From 2f860a256499f079ef4ece3e93fe8f579ba3dbf1 Mon Sep 17 00:00:00 2001 From: f1ori Date: Sat, 18 Apr 2009 14:35:18 +0000 Subject: [PATCH] * convert byte[] hashes to string for log output git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5830 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .../de/anomic/kelondro/text/BufferedIndexCollection.java | 2 +- source/de/anomic/kelondro/text/ReferenceContainer.java | 4 ++++ source/de/anomic/plasma/plasmaRankingCRProcess.java | 2 +- source/de/anomic/plasma/plasmaWordIndex.java | 2 +- source/de/anomic/yacy/dht/Dispatcher.java | 2 +- source/de/anomic/yacy/dht/Transmission.java | 2 +- source/yacy.java | 8 ++++---- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/source/de/anomic/kelondro/text/BufferedIndexCollection.java b/source/de/anomic/kelondro/text/BufferedIndexCollection.java index 4cd1cde13..4ed8b796f 100644 --- a/source/de/anomic/kelondro/text/BufferedIndexCollection.java +++ b/source/de/anomic/kelondro/text/BufferedIndexCollection.java @@ -167,7 +167,7 @@ public final class BufferedIndexCollection exte container.addUnique(elm.toKelondroEntry()); } } - if (container.size() < beforeDouble) System.out.println("*** DEBUG DOUBLECHECK - removed " + (beforeDouble - container.size()) + " index entries from word container " + container.getTermHash()); + if (container.size() < beforeDouble) System.out.println("*** DEBUG DOUBLECHECK - removed " + (beforeDouble - container.size()) + " index entries from word container " + container.getTermHashAsString()); return container; } diff --git a/source/de/anomic/kelondro/text/ReferenceContainer.java b/source/de/anomic/kelondro/text/ReferenceContainer.java index c6246e278..f27e489c0 100644 --- a/source/de/anomic/kelondro/text/ReferenceContainer.java +++ b/source/de/anomic/kelondro/text/ReferenceContainer.java @@ -87,6 +87,10 @@ public class ReferenceContainer extends RowSet return termHash; } + public String getTermHashAsString() { + return new String(termHash); + } + public void add(final Reference entry) { // add without double-occurrence test assert entry.toKelondroEntry().objectsize() == super.rowdef.objectsize; diff --git a/source/de/anomic/plasma/plasmaRankingCRProcess.java b/source/de/anomic/plasma/plasmaRankingCRProcess.java index 68989de0a..4b81ac122 100644 --- a/source/de/anomic/plasma/plasmaRankingCRProcess.java +++ b/source/de/anomic/plasma/plasmaRankingCRProcess.java @@ -389,7 +389,7 @@ public class plasmaRankingCRProcess { CloneableIterator cr_entry; while (i.hasNext()) { keycollection = i.next(); - referee = new String(keycollection.getTermHash()); + referee = keycollection.getTermHashAsString(); if (referee.length() == 6) refereeDom = referee; else refereeDom = referee.substring(6); cr_entry = keycollection.rows(); diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java index 3e838679a..967900de1 100644 --- a/source/de/anomic/plasma/plasmaWordIndex.java +++ b/source/de/anomic/plasma/plasmaWordIndex.java @@ -703,7 +703,7 @@ public final class plasmaWordIndex { } if (urlHashs.size() > 0) try { final int removed = index.remove(container.getTermHash(), urlHashs); - Log.logFine("INDEXCLEANER", container.getTermHash() + ": " + removed + " of " + container.size() + " URL-entries deleted"); + Log.logFine("INDEXCLEANER", container.getTermHashAsString() + ": " + removed + " of " + container.size() + " URL-entries deleted"); lastWordHash = container.getTermHash(); lastDeletionCounter = urlHashs.size(); urlHashs.clear(); diff --git a/source/de/anomic/yacy/dht/Dispatcher.java b/source/de/anomic/yacy/dht/Dispatcher.java index 64a58a5d3..e46d4bfbe 100755 --- a/source/de/anomic/yacy/dht/Dispatcher.java +++ b/source/de/anomic/yacy/dht/Dispatcher.java @@ -199,7 +199,7 @@ public class Dispatcher { while (it.hasNext()) { urlHashes.add(it.next().metadataHash()); } - if (this.log.isFine()) this.log.logFine("selected " + urlHashes.size() + " urls for word '" + c.getTermHash() + "'"); + if (this.log.isFine()) this.log.logFine("selected " + urlHashes.size() + " urls for word '" + c.getTermHashAsString() + "'"); if (urlHashes.size() > 0) this.backend.remove(c.getTermHash(), urlHashes); } diff --git a/source/de/anomic/yacy/dht/Transmission.java b/source/de/anomic/yacy/dht/Transmission.java index d490ed2c5..83eb9160b 100644 --- a/source/de/anomic/yacy/dht/Transmission.java +++ b/source/de/anomic/yacy/dht/Transmission.java @@ -204,7 +204,7 @@ public class Transmission { Iterator> i = this.containers.iterator(); ReferenceContainer firstContainer = (i == null) ? null : i.next(); log.logInfo("Index transfer of " + this.containers.size() + - " words [" + ((firstContainer == null) ? null : firstContainer.getTermHash()) + " .. " + new String(this.primaryTarget) + "]" + + " words [" + ((firstContainer == null) ? null : firstContainer.getTermHashAsString()) + " .. " + new String(this.primaryTarget) + "]" + " and " + this.references.size() + " URLs" + " to peer " + target.getName() + ":" + target.hash + " in " + (transferTime / 1000) + diff --git a/source/yacy.java b/source/yacy.java index e53a704de..83e1362eb 100644 --- a/source/yacy.java +++ b/source/yacy.java @@ -705,7 +705,7 @@ public final class yacy { } if (wordCounter%500 == 0) { - wordChunkEndHash = new String(wordIdxContainer.getTermHash()); + wordChunkEndHash = wordIdxContainer.getTermHashAsString(); wordChunkEnd = System.currentTimeMillis(); final long duration = wordChunkEnd - wordChunkStart; log.logInfo(wordCounter + " words scanned " + @@ -884,7 +884,7 @@ public final class yacy { bos.write(container.getTermHash()); bos.write(serverCore.CRLF); if (counter % 500 == 0) { - log.logInfo("Found " + counter + " Hashs until now. Last found Hash: " + container.getTermHash()); + log.logInfo("Found " + counter + " Hashs until now. Last found Hash: " + container.getTermHashAsString()); } } } @@ -901,14 +901,14 @@ public final class yacy { bos.write(container.getTermHash()); bos.write(serverCore.CRLF); if (counter % 500 == 0) { - log.logInfo("Found " + counter + " Hashs until now. Last found Hash: " + container.getTermHash()); + log.logInfo("Found " + counter + " Hashs until now. Last found Hash: " + container.getTermHashAsString()); } } } bos.flush(); bos.close(); } - log.logInfo("Total number of Hashs: " + counter + ". Last found Hash: " + (container == null ? "null" : container.getTermHash())); + log.logInfo("Total number of Hashs: " + counter + ". Last found Hash: " + (container == null ? "null" : container.getTermHashAsString())); } catch (final IOException e) { log.logSevere("IOException", e); }