added more logging for merge operation

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6095 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent a119860b82
commit 3c3e6499ae

@ -702,7 +702,10 @@ public class ArrayStack implements BLOB {
public File mergeMount(File f1, File f2, ReferenceFactory<? extends Reference> factory, Row payloadrow, File newFile, int writeBuffer) throws IOException { public File mergeMount(File f1, File f2, ReferenceFactory<? extends Reference> factory, Row payloadrow, File newFile, int writeBuffer) throws IOException {
Log.logInfo("BLOBArray", "merging " + f1.getName() + " with " + f2.getName()); Log.logInfo("BLOBArray", "merging " + f1.getName() + " with " + f2.getName());
File resultFile = mergeWorker(factory, this.keylength, this.ordering, f1, f2, payloadrow, newFile, writeBuffer); File resultFile = mergeWorker(factory, this.keylength, this.ordering, f1, f2, payloadrow, newFile, writeBuffer);
if (resultFile == null) return null; if (resultFile == null) {
Log.logWarning("BLOBArray", "merge of files " + f1 + ", " + f2 + " returned null. newFile = " + newFile);
return null;
}
mountBLOB(resultFile, false); mountBLOB(resultFile, false);
Log.logInfo("BLOBArray", "merged " + f1.getName() + " with " + f2.getName() + " into " + resultFile); Log.logInfo("BLOBArray", "merged " + f1.getName() + " with " + f2.getName() + " into " + resultFile);
return resultFile; return resultFile;
@ -740,6 +743,7 @@ public class ArrayStack implements BLOB {
FileUtils.deletedelete(f2); FileUtils.deletedelete(f2);
return newFile; return newFile;
} catch (IOException e) { } catch (IOException e) {
Log.logSevere("ArrayStack", "cannot close writing: " + e.getMessage(), e);
FileUtils.deletedelete(tmpFile); FileUtils.deletedelete(tmpFile);
FileUtils.deletedelete(newFile); FileUtils.deletedelete(newFile);
e.printStackTrace(); e.printStackTrace();

@ -105,7 +105,7 @@ public class IODispatcher extends Thread {
Log.logWarning("IODispatcher", "emergency merge of files " + f1.getName() + ", " + f2.getName() + " to " + newFile.getName()); Log.logWarning("IODispatcher", "emergency merge of files " + f1.getName() + ", " + f2.getName() + " to " + newFile.getName());
array.mergeMount(f1, f2, factory, payloadrow, newFile, (int) Math.min(MemoryControl.available() / 3, writeBufferSize)); array.mergeMount(f1, f2, factory, payloadrow, newFile, (int) Math.min(MemoryControl.available() / 3, writeBufferSize));
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); Log.logSevere("IODispatcher", "emergency merge failed: " + e.getMessage(), e);
} }
} else { } else {
MergeJob job = new MergeJob(f1, f2, factory, array, payloadrow, newFile); MergeJob job = new MergeJob(f1, f2, factory, array, payloadrow, newFile);
@ -114,11 +114,11 @@ public class IODispatcher extends Thread {
this.controlQueue.release(); this.controlQueue.release();
Log.logInfo("IODispatcher", "appended merge job of files " + f1.getName() + ", " + f2.getName() + " to " + newFile.getName()); Log.logInfo("IODispatcher", "appended merge job of files " + f1.getName() + ", " + f2.getName() + " to " + newFile.getName());
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); Log.logWarning("IODispatcher", "interrupted: " + e.getMessage(), e);
try { try {
array.mergeMount(f1, f2, factory, payloadrow, newFile, (int) Math.min(MemoryControl.available() / 3, writeBufferSize)); array.mergeMount(f1, f2, factory, payloadrow, newFile, (int) Math.min(MemoryControl.available() / 3, writeBufferSize));
} catch (IOException ee) { } catch (IOException ee) {
ee.printStackTrace(); Log.logSevere("IODispatcher", "IO failed: " + e.getMessage(), e);
} }
} }
} }
@ -245,7 +245,7 @@ public class IODispatcher extends Thread {
try { try {
return array.mergeMount(f1, f2, factory, payloadrow, newFile, (int) Math.min(MemoryControl.available() / 3, writeBufferSize)); return array.mergeMount(f1, f2, factory, payloadrow, newFile, (int) Math.min(MemoryControl.available() / 3, writeBufferSize));
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); Log.logSevere("IODispatcher", "mergeMount failed: " + e.getMessage(), e);
} }
return null; return null;
} }

Loading…
Cancel
Save