git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3549 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent cdc7b77a62
commit 159bd0cab5

@ -572,7 +572,7 @@ public class kelondroCollectionIndex {
ArrayList actionList;
TreeMap actionMap;
boolean madegc = false;
System.out.println("DEBUG existingContainer: " + existingContainer.toString());
//System.out.println("DEBUG existingContainer: " + existingContainer.toString());
while (existingContainer.size() > 0) {
oldPartitionNumber1 = ((Integer) existingContainer.lastKey()).intValue();
containerMap = (TreeMap) existingContainer.remove(new Integer(oldPartitionNumber1));

@ -109,31 +109,12 @@ public class kelondroDyn {
buffer = new kelondroObjectBuffer(file.toString());
}
public static final kelondroDyn open(File file, boolean useNodeCache, boolean useObjectCache, long preloadTime, int key, int nodesize, char fillChar, boolean usetree, boolean writebuffer, boolean resetOnFail) {
return open(file, useNodeCache, useObjectCache, preloadTime, key, nodesize, fillChar, new kelondroNaturalOrder(true), usetree, writebuffer, resetOnFail);
}
public static final kelondroDyn open(File file, boolean useNodeCache, boolean useObjectCache, long preloadTime, int key,
int nodesize, char fillChar, kelondroOrder objectOrder, boolean usetree, boolean writebuffer, boolean resetOnFail) {
return new kelondroDyn(file, useNodeCache, useObjectCache, preloadTime, key, nodesize, fillChar, objectOrder, usetree, writebuffer, resetOnFail);
}
public void reset() throws IOException {
String name = this.index.filename();
this.index.reset();
this.buffer = new kelondroObjectBuffer(name);
}
/*
private void writeSegmentCount() {
try {
setText(0, kelondroBase64Order.enhancedCoder.encodeLong(segmentCount, 8).getBytes());
} catch (Exception e) {
}
}
*/
public kelondroRow row() {
return this.rowdef;
}

@ -151,7 +151,9 @@ public class kelondroFlexTable extends kelondroFlexWidthArray implements kelondr
}
private kelondroIndex initializeRamIndex() {
kelondroRowSet ri = new kelondroRowSet(new kelondroRow(new kelondroColumn[]{super.row().column(0), new kelondroColumn("int c-4 {b256}")}, super.rowdef.objectOrder, super.rowdef.primaryKey), super.col[0].size() + 1);
int space = super.col[0].size() + 1;
if (space < 0) throw new kelondroException("wrong space: " + space);
kelondroRowSet ri = new kelondroRowSet(new kelondroRow(new kelondroColumn[]{super.row().column(0), new kelondroColumn("int c-4 {b256}")}, super.rowdef.objectOrder, super.rowdef.primaryKey), space);
Iterator content = super.col[0].contentNodes(-1);
kelondroRecords.Node node;
kelondroRow.Entry indexentry;

@ -2801,13 +2801,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
//snippet = null;
result.setSnippet(null);
}
/*
if ((snippet != null) && (snippet.getSource() == plasmaSnippetCache.ERROR_NO_MATCH)) {
// suppress line: there is no match in that resource
} else {*/
i++;
results.appendResult(result);
//}
i++;
results.appendResult(result);
}
}
log.logFine("SEARCH TIME AFTER RESULT PREPARATION: " + ((System.currentTimeMillis() - timestamp) / 1000) + " seconds");

@ -139,7 +139,7 @@ public final class plasmaWordIndex implements indexRI {
public void dhtOutFlushControl() {
// check for forced flush
synchronized (this) {
synchronized (dhtOutCache) {
if ((dhtOutCache.getMaxWordCount() > wCacheMaxChunk ) ||
(dhtOutCache.size() > dhtOutCache.getMaxWordCount()) ||
(serverMemory.available() < collections.minMem())) {
@ -149,7 +149,7 @@ public final class plasmaWordIndex implements indexRI {
}
public void dhtInFlushControl() {
// check for forced flush
synchronized (this) {
synchronized (dhtInCache) {
if ((dhtInCache.getMaxWordCount() > wCacheMaxChunk ) ||
(dhtInCache.size() > dhtInCache.getMaxWordCount())||
(serverMemory.available() < collections.minMem())) {
@ -173,10 +173,10 @@ public final class plasmaWordIndex implements indexRI {
if ((!dhtInCase) && (yacyDHTAction.shallBeOwnWord(wordHash))) dhtInCase = true;
// add the entry
if (dhtInCase) {
if (dhtInCase) synchronized (dhtInCache) {
dhtInCache.addEntry(wordHash, entry, updateTime, true);
dhtInFlushControl();
} else {
} else synchronized (dhtOutCache) {
dhtOutCache.addEntry(wordHash, entry, updateTime, false);
dhtOutFlushControl();
}
@ -189,10 +189,10 @@ public final class plasmaWordIndex implements indexRI {
if ((!dhtInCase) && (yacyDHTAction.shallBeOwnWord(entries.getWordHash()))) dhtInCase = true;
// add the entry
if (dhtInCase) {
if (dhtInCase) synchronized (dhtInCache) {
dhtInCache.addEntries(entries, updateTime, true);
dhtInFlushControl();
} else {
} else synchronized (dhtOutCache) {
dhtOutCache.addEntries(entries, updateTime, false);
dhtOutFlushControl();
}
@ -329,13 +329,18 @@ public final class plasmaWordIndex implements indexRI {
public indexContainer getContainer(String wordHash, Set urlselection, long maxTime) {
// get from cache
indexContainer container = dhtOutCache.getContainer(wordHash, urlselection, -1);
if (container == null) {
container = dhtInCache.getContainer(wordHash, urlselection, -1);
} else {
container.addAllUnique(dhtInCache.getContainer(wordHash, urlselection, -1));
indexContainer container;
synchronized (dhtOutCache) {
container = dhtOutCache.getContainer(wordHash, urlselection, -1);
}
synchronized (dhtInCache) {
if (container == null) {
container = dhtInCache.getContainer(wordHash, urlselection, -1);
} else {
container.addAllUnique(dhtInCache.getContainer(wordHash, urlselection, -1));
}
}
// get from collection index
if (container == null) {
container = collections.getContainer(wordHash, urlselection, (maxTime < 0) ? -1 : maxTime);

@ -192,11 +192,11 @@ public final class yacySeedDB {
initializeHandlerMethod = null;
}
try {
return new kelondroMapObjects(kelondroDyn.open(seedDBFile, true, true, preloadTime / 3, commonHashLength, 480, '#', false, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this);
return new kelondroMapObjects(new kelondroDyn(seedDBFile, true, true, preloadTime / 3, commonHashLength, 480, '#', false, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this);
} catch (Exception e) {
seedDBFile.delete();
// try again
return new kelondroMapObjects(kelondroDyn.open(seedDBFile, true, true, preloadTime / 3, commonHashLength, 480, '#', false, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this);
return new kelondroMapObjects(new kelondroDyn(seedDBFile, true, true, preloadTime / 3, commonHashLength, 480, '#', false, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this);
}
}

Loading…
Cancel
Save