| |
|
| java.lang.Object org.archive.crawler.io.CrawlerJournal
All known Subclasses: org.archive.crawler.frontier.RecoveryJournal,
CrawlerJournal | public class CrawlerJournal (Code) | | Utility class for a crawler journal/log that is compressed and
rotates by serial number at checkpoints.
author: gojomo |
GZIP_SUFFIX | final public static String GZIP_SUFFIX(Code) | | suffix to recognize gzipped files
|
LOG_ERROR | final public static String LOG_ERROR(Code) | | prefix for error lines
|
LOG_TIMESTAMP | final public static String LOG_TIMESTAMP(Code) | | prefix for timestamp lines
|
accumulatingBuffer | protected MutableString accumulatingBuffer(Code) | | Allocate a buffer for accumulating lines to write and reuse it.
|
gzipFile | protected File gzipFile(Code) | | File we're writing journal to.
Keep a reference in case we want to rotate it off.
|
lines | protected long lines(Code) | | line count
|
out | protected Writer out(Code) | | Stream on which we record frontier events.
|
timestamp_interval | protected int timestamp_interval(Code) | | number of lines between timestamps
|
CrawlerJournal | public CrawlerJournal(String path, String filename) throws IOException(Code) | | Create a new crawler journal at the given location
Parameters: path - Directory to make thejournal in. Parameters: filename - Name to use for journal file. throws: IOException - |
CrawlerJournal | public CrawlerJournal(File file) throws IOException(Code) | | Create a new crawler journal at the given location
Parameters: file - path at which to make journal throws: IOException - |
checkpoint | public synchronized void checkpoint(File checkpointDir) throws IOException(Code) | | Handle a checkpoint by rotating the current log to a checkpoint-named
file and starting a new log.
Parameters: checkpointDir - throws: IOException - |
close | public void close()(Code) | | Flush and close the underlying IO objects.
|
getBufferedReader | public static BufferedReader getBufferedReader(File source) throws IOException(Code) | | Get a BufferedReader on the crawler journal given
Parameters: source - File journal journal buffered reader. throws: IOException - |
seriousError | public void seriousError(String err)(Code) | | Note a serious error vioa a special log line
Parameters: err - |
writeLine | public synchronized void writeLine(String string)(Code) | | Write a line
Parameters: string - String |
writeLine | public synchronized void writeLine(String s1, String s2)(Code) | | Write a line of two strings
Parameters: s1 - String Parameters: s2 - String |
writeLine | public synchronized void writeLine(String s1, String s2, String s3)(Code) | | Write a line of three strings
Parameters: s1 - String Parameters: s2 - String Parameters: s3 - String |
writeLine | public synchronized void writeLine(MutableString mstring)(Code) | | Write a line.
Parameters: mstring - MutableString to write |
|
|
|