Skip to content

Commit

Permalink
flush the compressor cache when a cleanup is done
Browse files Browse the repository at this point in the history
  • Loading branch information
Orbiter committed Jun 7, 2012
1 parent a61f44f commit b0095c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions source/de/anomic/crawler/Cache.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ public void run() {
}
}

public static void commit() {
fileDB.flushAll();
}

/**
* clear the cache
*/
Expand Down
2 changes: 1 addition & 1 deletion source/net/yacy/kelondro/blob/Compressor.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ private boolean flushOne() {
}
}

private void flushAll() {
public void flushAll() {
while (!this.buffer.isEmpty()) {
if (!flushOne()) break;
}
Expand Down
5 changes: 4 additions & 1 deletion source/net/yacy/search/Switchboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ public indexingQueueEntry(
}

public int cleanupJobSize() {
int c = 0;
int c = 1; // "es gibt immer was zu tun"
if ( (this.crawlQueues.delegatedURL.stackSize() > 1000) ) {
c++;
}
Expand All @@ -1909,6 +1909,9 @@ public int cleanupJobSize() {

public boolean cleanupJob() {
try {
// flush the document compressor cache
Cache.commit();

// clear caches if necessary
if ( !MemoryControl.request(8000000L, false) ) {
for ( final Segment indexSegment : this.indexSegments ) {
Expand Down

0 comments on commit b0095c8

Please sign in to comment.