refined assortment

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@159 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 20 years ago
parent 0e1d9e9722
commit 76dc892017

@ -83,9 +83,9 @@ Changes take effect immediately</td>
</tr>
#{assortmentCluster}#
<tr valign="top" class="TableCellDark">
<td class=small>Assortment #[assortmentSlot]# Cache Size:</td>
<td class=small>Assortment #[assortmentSlot]#:</td>
<td class=small>#[assortmentSize]#</td>
<td class=small></td>
<td class=small>Buffer for words appearing exactly on #[assortmentSlot]# different pages.</td>
</tr>
#{/assortmentCluster}#
<tr valign="top" class="TableCellDark">

@ -56,7 +56,7 @@ public final class plasmaWordIndexCache implements plasmaWordIndexInterface {
private static final String oldSingletonFileName = "indexSingletons0.db";
private static final String newSingletonFileName = "indexAssortment001.db";
private static final String indexAssortmentClusterPath = "ACLUSTER";
private static final int assortmentLimit = 3;
private static final int assortmentLimit = 6;
// class variables
@ -378,11 +378,16 @@ public final class plasmaWordIndexCache implements plasmaWordIndexInterface {
if (count > 2000) return count;
}
// stop flushing if cache is shrinked enough
// avoid as possible to flush high-scores
if (cache.size() < this.maxWords) return count;
// flush high-scores
for (int cluster = clusterCandidate.length; cluster > 0; cluster--) {
candidateCounter = 0;
i = clusterCandidate[cluster - 1].entrySet().iterator();
while (i.hasNext()) {
if (cache.size() < this.maxWords) return count;
entry = (Map.Entry) i.next();
key = (String) entry.getValue();
createTime = (Long) entry.getKey();
@ -391,7 +396,6 @@ public final class plasmaWordIndexCache implements plasmaWordIndexInterface {
candidateCounter += cluster + 1;
log.logDebug("flushed high-cluster #" + (cluster + 1) + ", key=" + key + ", count=" + count + ", cachesize=" + cache.size());
}
if (count > 2000) return count;
}
}

Loading…
Cancel
Save