public void stop() { if(!isRunning()) { return; } // XXX happens at finish; move to teardown? log.close(); log = null; }
/** * Note a serious error vioa a special log line * * @param err */ public synchronized void seriousError(String err) { writeLine(LOG_ERROR+ArchiveUtils.getLog14Date()+" "+err+"\n"); }
public void start() { if (isRunning()) { return; } try { File logFile = getLogFile().getFile(); log = new CrawlerJournal(logFile); } catch (IOException e) { // TODO Auto-generated catch block throw new RuntimeException(e); } }
return; close(); this.out = initialize(this.gzipFile); } catch (IOException ioe) { LOGGER.log(Level.SEVERE,"Problem rotating recovery journal", ioe);
/** * Create a new crawler journal at the given location * * @param file path at which to make journal * @throws IOException */ public CrawlerJournal(File file) throws IOException { this.gzipFile = file; this.out = initialize(gzipFile); }
/** * Write a line * @param strs */ public synchronized void writeLine(String... strs) { try { for(String s : strs) { this.out.write(s); } this.out.write("\n"); noteLine(); } catch (IOException e) { LOGGER.log( Level.SEVERE, "problem writing journal line: "+StringUtils.join(strs), e); } }
/** * Count and note a line * * @throws IOException */ protected void noteLine() throws IOException { lines++; considerTimestamp(); }
public void doCheckpoint(Checkpoint checkpointInProgress) throws IOException { // rotate log log.rotateForCheckpoint(checkpointInProgress); }
return; close(); this.out = initialize(this.gzipFile); } catch (IOException ioe) { LOGGER.log(Level.SEVERE,"Problem rotating recovery journal", ioe);
/** * Create a new crawler journal at the given location * * @param path Directory to make thejournal in. * @param filename Name to use for journal file. * @throws IOException */ public CrawlerJournal(String path, String filename) throws IOException { this.gzipFile = new File(path, filename); this.out = initialize(gzipFile); }
/** * Write a line. * * @param mstring MutableString to write */ public synchronized void writeLine(MutableString mstring) { if (this.out == null) { return; } try { mstring.write(out); this.out.write("\n"); noteLine(); } catch (IOException e) { LOGGER.log(Level.SEVERE,"problem writing journal line: "+mstring, e); } }
/** * Count and note a line * * @throws IOException */ protected void noteLine() throws IOException { lines++; considerTimestamp(); }
public void doCheckpoint(Checkpoint checkpointInProgress) throws IOException { // rotate log log.rotateForCheckpoint(checkpointInProgress); }
@Override protected void innerProcess(CrawlURI curi) { log.writeLine(persistKeyFor(curi), " ", new String(Base64.encodeBase64( SerializationUtils.serialize((Serializable)curi.getPersistentDataMap())))); }
public void stop() { if(!isRunning()) { return; } // XXX happens at finish; move to teardown? log.close(); log = null; }
/** * Create a new crawler journal at the given location * * @param file path at which to make journal * @throws IOException */ public CrawlerJournal(File file) throws IOException { this.gzipFile = file; this.out = initialize(gzipFile); }
/** * Write a line * @param strs */ public synchronized void writeLine(String... strs) { try { for(String s : strs) { this.out.write(s); } this.out.write("\n"); noteLine(); } catch (IOException e) { LOGGER.log( Level.SEVERE, "problem writing journal line: "+StringUtils.join(strs), e); } }
public void start() { if (isRunning()) { return; } try { File logFile = getLogFile().getFile(); log = new CrawlerJournal(logFile); } catch (IOException e) { // TODO Auto-generated catch block throw new RuntimeException(e); } }
/** * Note a serious error vioa a special log line * * @param err */ public synchronized void seriousError(String err) { writeLine(LOG_ERROR+ArchiveUtils.getLog14Date()+" "+err+"\n"); }
/** * Create a new crawler journal at the given location * * @param path Directory to make thejournal in. * @param filename Name to use for journal file. * @throws IOException */ public CrawlerJournal(String path, String filename) throws IOException { this.gzipFile = new File(path, filename); this.out = initialize(gzipFile); }