more logging etc.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6589 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 007f8297de
commit f6731c6240

@ -60,8 +60,8 @@ public class DocumentIndex extends Segment {
static final ThreadGroup workerThreadGroup = new ThreadGroup("workerThreadGroup"); static final ThreadGroup workerThreadGroup = new ThreadGroup("workerThreadGroup");
public DocumentIndex(Log log, final File segmentPath, CallbackListener callback, int cachesize) throws IOException { public DocumentIndex(final File segmentPath, CallbackListener callback, int cachesize) throws IOException {
super(log, segmentPath, cachesize, targetFileSize * 4 - 1, false, false); super(new Log("DocumentIndex"), segmentPath, cachesize, targetFileSize * 4 - 1, false, false);
int cores = Runtime.getRuntime().availableProcessors() + 1; int cores = Runtime.getRuntime().availableProcessors() + 1;
this.callback = callback; this.callback = callback;
this.queue = new LinkedBlockingQueue<File>(cores * 300); this.queue = new LinkedBlockingQueue<File>(cores * 300);
@ -71,10 +71,6 @@ public class DocumentIndex extends Segment {
this.worker[i].start(); this.worker[i].start();
} }
} }
public DocumentIndex(final File segmentPath, CallbackListener callback, int cachesize) throws IOException {
this(new Log("DocumentIndex"), segmentPath, callback, cachesize);
}
class Worker extends Thread { class Worker extends Thread {
public Worker(int count) { public Worker(int count) {

@ -64,13 +64,6 @@ public final class MetadataRepository implements Iterable<byte[]> {
private Export exportthread; // will have a export thread assigned if exporter is running private Export exportthread; // will have a export thread assigned if exporter is running
private File location; private File location;
private ArrayList<hostStat> statsDump; private ArrayList<hostStat> statsDump;
public MetadataRepository(
final File path,
final boolean useTailCache,
final boolean exceed134217727) {
this(path, "urls", useTailCache, exceed134217727);
}
public MetadataRepository( public MetadataRepository(
final File path, final File path,
@ -126,7 +119,7 @@ public final class MetadataRepository implements Iterable<byte[]> {
// generates an plasmaLURLEntry using the url hash // generates an plasmaLURLEntry using the url hash
// if the url cannot be found, this returns null // if the url cannot be found, this returns null
if (urlHash == null) return null; if (urlHash == null) return null;
assert urlIndexFile != null; assert urlIndexFile != null : "urlHash = " + urlHash;
try { try {
final Row.Entry entry = urlIndexFile.get(urlHash.getBytes()); final Row.Entry entry = urlIndexFile.get(urlHash.getBytes());
if (entry == null) return null; if (entry == null) return null;

@ -1367,7 +1367,7 @@ public final class Switchboard extends serverSwitch {
entry selentry; entry selentry;
while (it.hasNext()) { while (it.hasNext()) {
selentry = it.next(); selentry = it.next();
assert selentry.handle() != null; assert selentry.handle() != null : "profile.name = " + selentry.name();
if (selentry.handle() == null) continue; if (selentry.handle() == null) continue;
if (selentry.name().equals(CrawlSwitchboard.CRAWL_PROFILE_PROXY)) if (selentry.name().equals(CrawlSwitchboard.CRAWL_PROFILE_PROXY))
crawler.profilesActiveCrawls.changeEntry(selentry, CrawlProfile.entry.RECRAWL_IF_OLDER, crawler.profilesActiveCrawls.changeEntry(selentry, CrawlProfile.entry.RECRAWL_IF_OLDER,

@ -96,8 +96,10 @@ public class bmpParser extends AbstractParser implements Idiom {
try { try {
image = ImageIO.read(sourceStream); image = ImageIO.read(sourceStream);
} catch (final EOFException e) { } catch (final EOFException e) {
Log.logException(e);
throw new ParserException(e.getMessage(), location); throw new ParserException(e.getMessage(), location);
} catch (final IOException e) { } catch (final IOException e) {
Log.logException(e);
throw new ParserException(e.getMessage(), location); throw new ParserException(e.getMessage(), location);
} }
if (image == null) throw new ParserException("ImageIO returned NULL", location); if (image == null) throw new ParserException("ImageIO returned NULL", location);

@ -41,6 +41,7 @@ import net.yacy.document.Idiom;
import net.yacy.document.ParserException; import net.yacy.document.ParserException;
import net.yacy.document.parser.html.ImageEntry; import net.yacy.document.parser.html.ImageEntry;
import net.yacy.kelondro.data.meta.DigestURI; import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.logging.Log;
public class genericImageParser extends AbstractParser implements Idiom { public class genericImageParser extends AbstractParser implements Idiom {
@ -75,8 +76,10 @@ public class genericImageParser extends AbstractParser implements Idiom {
try { try {
image = ImageIO.read(sourceStream); image = ImageIO.read(sourceStream);
} catch (final EOFException e) { } catch (final EOFException e) {
Log.logException(e);
throw new ParserException(e.getMessage(), location); throw new ParserException(e.getMessage(), location);
} catch (final IOException e) { } catch (final IOException e) {
Log.logException(e);
throw new ParserException(e.getMessage(), location); throw new ParserException(e.getMessage(), location);
} }
if (image == null) throw new ParserException("ImageIO returned NULL", location); if (image == null) throw new ParserException("ImageIO returned NULL", location);

@ -82,15 +82,14 @@ public class swfParser extends AbstractParser implements Idiom {
try { try {
contents = swf2html.convertSWFToHTML(source); contents = swf2html.convertSWFToHTML(source);
} catch (NegativeArraySizeException e) { } catch (NegativeArraySizeException e) {
// seen in log Log.logException(e);
return null; throw new ParserException(e.getMessage(), location);
} catch (IOException e) { } catch (IOException e) {
// seems to happen quite often Log.logException(e);
return null; throw new ParserException(e.getMessage(), location);
} catch (Exception e) { } catch (Exception e) {
// we have seen a lot of OOM errors in the parser...
Log.logException(e); Log.logException(e);
return null; throw new ParserException(e.getMessage(), location);
} }
String url = null; String url = null;
String urlnr = null; String urlnr = null;

@ -81,8 +81,9 @@ public final class Cache implements ObjectIndex, Iterable<Row.Entry> {
} }
private void init() { private void init() {
this.keyrow = new Row(new Column[]{index.row().column(0)}, index.row().objectOrder); Row row = index.row();
this.readHitCache = new RowSet(index.row()); this.keyrow = new Row(new Column[]{row.column(0)}, row.objectOrder);
this.readHitCache = new RowSet(row);
this.readMissCache = new RowSet(this.keyrow); this.readMissCache = new RowSet(this.keyrow);
this.readHit = 0; this.readHit = 0;
this.readMiss = 0; this.readMiss = 0;

@ -72,7 +72,7 @@ for option in $options;do
-l|--logging) -l|--logging)
LOGGING=1 LOGGING=1
# enable asserts # enable asserts
JAVA_ARGS="$JAVA_ARGS -ea -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" JAVA_ARGS="$JAVA_ARGS -ea"
if [ $DEBUG -eq 1 ];then if [ $DEBUG -eq 1 ];then
echo "can not combine -l and -d" echo "can not combine -l and -d"
exit 1; exit 1;
@ -81,7 +81,7 @@ for option in $options;do
-d|--debug) -d|--debug)
DEBUG=1 DEBUG=1
# enable asserts # enable asserts
JAVA_ARGS="$JAVA_ARGS -ea" JAVA_ARGS="$JAVA_ARGS -ea -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
if [ $LOGGING -eq 1 ];then if [ $LOGGING -eq 1 ];then
echo "can not combine -l and -d" echo "can not combine -l and -d"
exit 1; exit 1;
@ -95,7 +95,7 @@ for option in $options;do
;; ;;
esac #case option esac #case option
else #parameter else #parameter
if [ x$option = "--" ];then #option / parameter seperator if [ x$option = "--" ];then #option / parameter separator
isparameter=1; isparameter=1;
continue continue
else else

Loading…
Cancel
Save