more logging etc.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6589 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2010-01-17 00:41:50 +00:00
parent 007f8297de
commit f6731c6240
8 changed files with 22 additions and 28 deletions

View File

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

View File

@ -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 File location;
private ArrayList<hostStat> statsDump;
public MetadataRepository(
final File path,
final boolean useTailCache,
final boolean exceed134217727) {
this(path, "urls", useTailCache, exceed134217727);
}
public MetadataRepository(
final File path,
@ -126,7 +119,7 @@ public final class MetadataRepository implements Iterable<byte[]> {
// generates an plasmaLURLEntry using the url hash
// if the url cannot be found, this returns null
if (urlHash == null) return null;
assert urlIndexFile != null;
assert urlIndexFile != null : "urlHash = " + urlHash;
try {
final Row.Entry entry = urlIndexFile.get(urlHash.getBytes());
if (entry == null) return null;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -72,7 +72,7 @@ for option in $options;do
-l|--logging)
LOGGING=1
# 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
echo "can not combine -l and -d"
exit 1;
@ -81,7 +81,7 @@ for option in $options;do
-d|--debug)
DEBUG=1
# 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
echo "can not combine -l and -d"
exit 1;
@ -95,7 +95,7 @@ for option in $options;do
;;
esac #case option
else #parameter
if [ x$option = "--" ];then #option / parameter seperator
if [ x$option = "--" ];then #option / parameter separator
isparameter=1;
continue
else