public void run() {
FetcherOutput fetcherOutput = new FetcherOutput();
Content content = new Content();
FetchListEntry fle = null;
String url = null;
while (true) {
if (LogFormatter.hasLoggedSevere()) // something bad happened
break; // exit
t0 = System.currentTimeMillis();
try {
// must be read in order! thus synchronize threads.
synchronized (ParseSegment.this) {
t1 = System.currentTimeMillis();
try {
if (fetcherNPReader.next(fetcherOutput) == null ||
contentReader.next(content) == null)
return;
} catch (EOFException eof) {
// only partial data available, stop this thread,
// other threads will be stopped also.
return;
}
entry++;
myEntry = entry;
if (LOG.isLoggable(Level.FINE))
LOG.fine("Read in entry "+entry);
// safe guard against mismatched files
//if (entry != fetcherNPReader.key() ||
// entry != contentReader.key()) {
// LOG.severe("Mismatched entries under "
// + FetcherOutput.DIR_NAME_NP + " and " + Content.DIR_NAME);
// continue;
//}
}
t2 = System.currentTimeMillis();
fle = fetcherOutput.getFetchListEntry();
url = fle.getPage().getURL().toString();
LOG.fine("parsing " + url); // parse the page
// safe guard against mismatched files
if (!url.equals(content.getUrl())) {