org.apache.mesos
Class Log.Reader

java.lang.Object
  extended by org.apache.mesos.Log.Reader
Enclosing class:
Log

public static class Log.Reader
extends Object

Provides read access to the Log. This class is safe for use from multiple threads and for the life of the log regardless of any exceptions thrown from its methods.


Constructor Summary
Log.Reader(Log log)
           
 
Method Summary
 Log.Position beginning()
          Returns the beginning position of the log (might be out of date with respect to another replica).
 Log.Position ending()
          Returns the ending position of the log (might be out of date with respect to another replica).
protected  void finalize()
           
protected  void initialize(Log log)
           
 List<Log.Entry> read(Log.Position from, Log.Position to, long timeout, TimeUnit unit)
          Attempts to read from the log between the specified positions (inclusive).
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log.Reader

public Log.Reader(Log log)
Method Detail

read

public List<Log.Entry> read(Log.Position from,
                            Log.Position to,
                            long timeout,
                            TimeUnit unit)
                     throws TimeoutException,
                            Log.OperationFailedException
Attempts to read from the log between the specified positions (inclusive). If either of the positions are invalid, an OperationFailedException will get thrown. Unfortunately, this will also get thrown in other circumstances (e.g., disk failure) and therefore it is currently impossible to tell these two cases apart.

Throws:
TimeoutException
Log.OperationFailedException

beginning

public Log.Position beginning()
Returns the beginning position of the log (might be out of date with respect to another replica).


ending

public Log.Position ending()
Returns the ending position of the log (might be out of date with respect to another replica).


initialize

protected void initialize(Log log)

finalize

protected void finalize()
Overrides:
finalize in class Object


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.