better logging

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6361 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 2275f885a8
commit e1fba41cad

@ -544,7 +544,7 @@ public class ArrayStack implements BLOB {
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
} catch (final ExecutionException e) {
e.printStackTrace();
Log.logSevere("ArrayStack", "", e);
throw new RuntimeException(e.getCause());
}
//System.out.println("*DEBUG SplitTable fail.time = " + (System.currentTimeMillis() - start) + " ms");
@ -610,7 +610,7 @@ public class ArrayStack implements BLOB {
this.next = b.get(key);
if (this.next != null) return;
} catch (IOException e) {
e.printStackTrace();
Log.logSevere("ArrayStack", "", e);
this.next = null;
return;
}
@ -768,7 +768,6 @@ public class ArrayStack implements BLOB {
Log.logSevere("ArrayStack", "cannot close writing: " + e.getMessage(), e);
FileUtils.deletedelete(tmpFile);
FileUtils.deletedelete(newFile);
e.printStackTrace();
return null;
}
}

@ -40,6 +40,7 @@ import java.util.zip.GZIPOutputStream;
import de.anomic.kelondro.order.ByteOrder;
import de.anomic.kelondro.order.CloneableIterator;
import de.anomic.kelondro.util.ByteArray;
import de.anomic.yacy.logging.Log;
public class Compressor implements BLOB {
@ -82,7 +83,7 @@ public class Compressor implements BLOB {
try {
flushAll();
} catch (IOException e) {
e.printStackTrace();
Log.logSevere("Compressor", "", e);
}
this.backend.close(writeIDX);
}
@ -108,7 +109,7 @@ public class Compressor implements BLOB {
baos.close();
return baos.toByteArray();
} catch (IOException e) {
e.printStackTrace();
Log.logSevere("Compressor", "", e);
return null;
}
}

@ -418,7 +418,7 @@ public final class Row {
try {
setCol(column, (cell == null) ? null : cell.getBytes(encoding));
} catch (final UnsupportedEncodingException e) {
e.printStackTrace();
Log.logSevere("Row", "", e);
}
}
@ -429,7 +429,7 @@ public final class Row {
try {
setCol(nick, cell.getBytes(encoding));
} catch (final UnsupportedEncodingException e) {
e.printStackTrace();
Log.logSevere("Row", "", e);
}
}

@ -554,9 +554,9 @@ public class RowCollection implements Iterable<Row.Entry> {
sort2.get();
sort3.get();
} catch (final InterruptedException e) {
e.printStackTrace();
Log.logSevere("RowCollection", "", e);
} catch (final ExecutionException e) {
e.printStackTrace();
Log.logSevere("RowCollection", "", e);
}
} else {
qsort(0, p, 0, swapspace);
@ -589,9 +589,9 @@ public class RowCollection implements Iterable<Row.Entry> {
try {
part.get();
} catch (final InterruptedException e) {
e.printStackTrace();
Log.logSevere("RowCollection", "", e);
} catch (final ExecutionException e) {
e.printStackTrace();
Log.logSevere("RowCollection", "", e);
}
} else {
qsort(0, p, 0, swapspace);

@ -405,15 +405,13 @@ public class RowSet extends RowCollection implements ObjectIndex, Iterable<Row.E
try {
c0.sort();
} catch (Exception e) {
Log.logSevere("RowSet", "collection corrupted. cleaned. " + e.getMessage());
e.printStackTrace();
Log.logSevere("RowSet", "collection corrupted. cleaned. " + e.getMessage(), e);
c0.clear();
}
try {
c1.sort();
} catch (Exception e) {
Log.logSevere("RowSet", "collection corrupted. cleaned. " + e.getMessage());
e.printStackTrace();
Log.logSevere("RowSet", "collection corrupted. cleaned. " + e.getMessage(), e);
c1.clear();
}
int c0i = 0, c1i = 0;

@ -156,7 +156,7 @@ public class SplitTable implements ObjectIndex {
try {
d = DateFormatter.parseShortMilliSecond(tablefile[i].substring(prefix.length() + 1, prefix.length() + 18));
} catch (ParseException e) {
e.printStackTrace();
Log.logSevere("SplitTable", "", e);
continue;
}
time = d.getTime();
@ -296,7 +296,7 @@ public class SplitTable implements ObjectIndex {
try {
d = DateFormatter.parseShortMilliSecond(name.substring(prefix.length() + 1, prefix.length() + 18)).getTime();
} catch (ParseException e) {
e.printStackTrace();
Log.logSevere("SplitTable", "", e);
d = 0;
}
if (d + this.fileAgeLimit < System.currentTimeMillis() || new File(this.path, name).length() >= this.fileSizeLimit) {
@ -397,7 +397,7 @@ public class SplitTable implements ObjectIndex {
try {
order = orderQueue.take();
} catch (InterruptedException e) {
e.printStackTrace();
Log.logSevere("SplitTable", "", e);
continue;
}
if (order == poisonDiscoverOrder) break;
@ -409,7 +409,7 @@ public class SplitTable implements ObjectIndex {
order.challenge.commitNoDiscovery();
}
} catch (Exception e) {
e.printStackTrace();
Log.logSevere("SplitTable", "", e);
order.challenge.commitNoDiscovery();
}
}
@ -428,7 +428,7 @@ public class SplitTable implements ObjectIndex {
try {
this.orderQueue.put(new DiscoverOrder(challenge, i.next()));
} catch (InterruptedException e) {
e.printStackTrace();
Log.logSevere("SplitTable", "", e);
}
}
}
@ -502,7 +502,7 @@ public class SplitTable implements ObjectIndex {
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
} catch (final ExecutionException e) {
e.printStackTrace();
Log.logSevere("SplitTable", "", e);
throw new RuntimeException(e.getCause());
}
return null;
@ -582,7 +582,7 @@ public class SplitTable implements ObjectIndex {
try {
this.orderQueue.put(poisonDiscoverOrder);
} catch (InterruptedException e) {
e.printStackTrace();
Log.logSevere("SplitTable", "", e);
}
}

@ -108,7 +108,7 @@ public class Table implements ObjectIndex {
fos = new FileOutputStream(tablefile);
} catch (final FileNotFoundException e) {
// should not happen
e.printStackTrace();
Log.logSevere("Table", "", e);
}
if (fos != null) try { fos.close(); } catch (final IOException e) {}
}
@ -227,10 +227,10 @@ public class Table implements ObjectIndex {
}
} catch (final FileNotFoundException e) {
// should never happen
e.printStackTrace();
Log.logSevere("Table", "", e);
throw new kelondroException(e.getMessage());
} catch (final IOException e) {
e.printStackTrace();
Log.logSevere("Table", "", e);
throw new kelondroException(e.getMessage());
}
@ -390,8 +390,7 @@ public class Table implements ObjectIndex {
try {
assert file.size() == index.size() : "file.size() = " + file.size() + ", index.size() = " + index.size();
} catch (final IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.logSevere("Table", "", e);
}
assert table == null || table.size() == index.size() : "table.size() = " + table.size() + ", index.size() = " + index.size();
return index.has(key);
@ -603,7 +602,7 @@ public class Table implements ObjectIndex {
fos = new FileOutputStream(f);
} catch (final FileNotFoundException e) {
// should not happen
e.printStackTrace();
Log.logSevere("Table", "", e);
}
if (fos != null) try { fos.close(); } catch (final IOException e) {}
@ -613,7 +612,7 @@ public class Table implements ObjectIndex {
this.file = new BufferedRecords(new Records(f, rowdef.objectsize), this.buffersize);
} catch (final FileNotFoundException e) {
// should never happen
e.printStackTrace();
Log.logSevere("Table", "", e);
}
// initialize index and copy table
@ -644,7 +643,7 @@ public class Table implements ObjectIndex {
try {
return new rowIteratorNoOrder();
} catch (IOException e) {
e.printStackTrace();
Log.logSevere("Table", "", e);
return null;
}
}
@ -701,7 +700,7 @@ public class Table implements ObjectIndex {
try {
file.get(this.c, b, 0);
} catch (final IOException e) {
e.printStackTrace();
Log.logSevere("Table", "", e);
return null;
}
} else {

Loading…
Cancel
Save