Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fixed a bug that was recently inserted which caused that no idx and gap files were written.
orbiter3029ef6eb301
diff --git a/source/de/anomic/kelondro/blob/BLOBHeapModifier.java b/source/de/anomic/kelondro/blob/BLOBHeapModifier.javaindex d21e147ae..ad89a810d 100644--- a/source/de/anomic/kelondro/blob/BLOBHeapModifier.java+++ b/source/de/anomic/kelondro/blob/BLOBHeapModifier.java@@ -106,36 +106,6 @@ public class BLOBHeapModifier extends HeapReader implements BLOB {public synchronized void close(boolean writeIDX) {shrinkWithGapsAtEnd();super.close(writeIDX);-- if (writeIDX && index != null && free != null && (index.size() > 3 || free.size() > 3)) {- // now we can create a dump of the index and the gap information- // to speed up the next start- try {- long start = System.currentTimeMillis();- String fingerprint = HeapWriter.fingerprintFileHash(this.heapFile);- if (fingerprint == null) {- Log.logSevere("kelondroBLOBHeap", "cannot write a dump for " + heapFile.getName()+ ": fingerprint is null");- } else {- free.dump(HeapWriter.fingerprintGapFile(this.heapFile, fingerprint));- }- free.clear();- free = null;- if (fingerprint != null) {- index.dump(HeapWriter.fingerprintIndexFile(this.heapFile, fingerprint));- Log.logInfo("kelondroBLOBHeap", "wrote a dump for the " + this.index.size() + " index entries of " + heapFile.getName()+ " in " + (System.currentTimeMillis() - start) + " milliseconds.");- }- index.close();- index = null;- } catch (IOException e) {- e.printStackTrace();- }- } else {- // this is small.. just free resources, do not write index- if (free != null) free.clear();- free = null;- if (index != null) index.close();- index = null;- }}/**diff --git a/source/de/anomic/kelondro/blob/HeapReader.java b/source/de/anomic/kelondro/blob/HeapReader.javaindex 86a9bb4c1..007e2857a 100644--- a/source/de/anomic/kelondro/blob/HeapReader.java+++ b/source/de/anomic/kelondro/blob/HeapReader.java@@ -293,11 +293,35 @@ public class HeapReader {public synchronized void close(boolean writeIDX) {if (file != null) file.close();file = null;- heapFile = null;- free.clear();- free = null;- index.close();- index = null;+ if (writeIDX && index != null && free != null && (index.size() > 3 || free.size() > 3)) {+ // now we can create a dump of the index and the gap information+ // to speed up the next start+ try {+ long start = System.currentTimeMillis();+ String fingerprint = HeapWriter.fingerprintFileHash(this.heapFile);+ if (fingerprint == null) {+ Log.logSevere("kelondroBLOBHeap", "cannot write a dump for " + heapFile.getName()+ ": fingerprint is null");+ } else {+ free.dump(HeapWriter.fingerprintGapFile(this.heapFile, fingerprint));+ }+ free.clear();+ free = null;+ if (fingerprint != null) {+ index.dump(HeapWriter.fingerprintIndexFile(this.heapFile, fingerprint));+ Log.logInfo("kelondroBLOBHeap", "wrote a dump for the " + this.index.size() + " index entries of " + heapFile.getName()+ " in " + (System.currentTimeMillis() - start) + " milliseconds.");+ }+ index.close();+ index = null;+ } catch (IOException e) {+ e.printStackTrace();+ }+ } else {+ // this is small.. just free resources, do not write index+ if (free != null) free.clear();+ free = null;+ if (index != null) index.close();+ index = null;+ }}/**