orbiter 18 years ago
parent 711641f167
commit 143fa40d77

@ -392,6 +392,7 @@ public final class indexRAMRI implements indexRI {
} }
public synchronized indexContainer getContainer(String wordHash, Set urlselection) { public synchronized indexContainer getContainer(String wordHash, Set urlselection) {
if (wordHash == null) return null;
// retrieve container // retrieve container
indexContainer container = (indexContainer) cache.get(wordHash); indexContainer container = (indexContainer) cache.get(wordHash);

@ -192,13 +192,12 @@ public final class plasmaWordIndex implements indexRI {
} }
private void flushCache(indexRAMRI ram, int count) { private void flushCache(indexRAMRI ram, int count) {
if (ram.size() <= count) count = ram.size();
if (count <= 0) return;
if (count > 5000) count = 5000;
busyCacheFlush = true; busyCacheFlush = true;
String wordHash; String wordHash;
ArrayList containerList = new ArrayList(); ArrayList containerList = new ArrayList();
synchronized (ram) { synchronized (ram) {
count = Math.min(5000, Math.min(count, ram.size()));
if (count <= 0) return;
boolean collectMax = true; boolean collectMax = true;
indexContainer c; indexContainer c;
while (collectMax) { while (collectMax) {

Loading…
Cancel
Save