Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5161 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Sep 15, 2008
1 parent 73f233b commit 25a62cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion defaults/yacy.init
Expand Up @@ -494,7 +494,7 @@ proxyIndexingLocalMedia=true
# Be careful with this number. Consider a branching factor of average 20;
# A prefetch-depth of 8 would index 25.600.000.000 pages, maybe the whole WWW.
crawlingDepth=3
crawlingIfOlder=525600
crawlingIfOlder=-1
crawlingDomFilterDepth=-1
crawlingDomMaxPages=-1
indexText=true
Expand Down
10 changes: 7 additions & 3 deletions source/de/anomic/kelondro/kelondroMScoreCluster.java
Expand Up @@ -54,24 +54,28 @@ public void clear() {
* shrink the cluster to a demanded size
* @param maxsize
*/
public void shrinkToMaxSize(int maxsize) {
public synchronized void shrinkToMaxSize(int maxsize) {
if (maxsize < 0) return;
Long key;
while (refkeyDB.size() > maxsize) {
// find and remove smallest objects until cluster has demanded size
refkeyDB.remove(keyrefDB.remove(keyrefDB.firstKey()));
key = keyrefDB.firstKey();
if (key == null) break;
refkeyDB.remove(keyrefDB.remove(key));
}
}

/**
* shrink the cluster in such a way that the smallest score is equal or greater than a given minScore
* @param minScore
*/
public void shrinkToMinScore(int minScore) {
public synchronized void shrinkToMinScore(int minScore) {
int score;
Long key;
while (true) {
// find and remove objects where their score is smaller than the demanded minimum score
key = keyrefDB.firstKey();
if (key == null) break;
score = (int) ((key.longValue() & 0xFFFFFFFF00000000L) >> 32);
if (score >= minScore) break;
refkeyDB.remove(keyrefDB.remove(key));
Expand Down

0 comments on commit 25a62cd

Please sign in to comment.