org.apache.hadoop.hdfs.server.datanode.fsdataset
Interface RollingLogs


public interface RollingLogs

Rolling logs consist of a current log and a set of previous logs. The implementation should support a single appender and multiple readers.


Nested Class Summary
static interface RollingLogs.Appender
          To append text to the logs.
static interface RollingLogs.LineIterator
          To iterate the lines of the logs.
 
Method Summary
 RollingLogs.Appender appender()
           
 RollingLogs.LineIterator iterator(boolean skipPrevious)
          Create an iterator to iterate the lines in the logs.
 boolean roll()
          Roll current to previous.
 

Method Detail

iterator

RollingLogs.LineIterator iterator(boolean skipPrevious)
                                  throws IOException
Create an iterator to iterate the lines in the logs.

Parameters:
skipPrevious - Should it skip reading the previous log?
Returns:
a new iterator.
Throws:
IOException

appender

RollingLogs.Appender appender()
Returns:
the only appender to append text to the logs. The same object is returned if it is invoked multiple times.

roll

boolean roll()
             throws IOException
Roll current to previous.

Returns:
true if the rolling succeeded. When it returns false, it is not equivalent to an error. It means that the rolling cannot be performed at the moment, e.g. the logs are being read.
Throws:
IOException


Copyright © 2014 Apache Software Foundation. All Rights Reserved.