com.sun.jini.outrigger.snaplogstore
Class LogInputFile

java.lang.Object
  extended by com.sun.jini.outrigger.snaplogstore.LogFile
      extended by com.sun.jini.outrigger.snaplogstore.LogInputFile

 class LogInputFile
extends LogFile

A class to help you read log files created by LogOutputFile.

Author:
Sun Microsystems, Inc.
See Also:
LogOutputFile

Nested Class Summary
private static class LogInputFile.LogInputFileIterator
          The implementation of Iterator returned by LogInputStream.logs.
 
Field Summary
private  File file
           
private static long intBytes
           
private static Logger logger
          Logger for logging persistent store related information
 
Fields inherited from class com.sun.jini.outrigger.snaplogstore.LogFile
ABORT_OP, baseDir, baseFile, BATCH_TAKE_OP, BATCH_WRITE_OP, BOOT_OP, CANCEL_OP, COMMIT_OP, JOINSTATE_OP, LOG_TYPE, LOG_VERSION, NOTIFIED_OP, PREPARE_OP, REGISTER_OP, RENEW_OP, TAKE_OP, UUID_OP, WRITE_OP
 
Constructor Summary
private LogInputFile(LogFile desc, File path)
          Create a new LogInputFile.
 
Method Summary
(package private)  void consume(BackEnd opOn)
          Consume the input file, invoking the appropriate operations on the given object.
private  void failure(String message)
          Report a failure consuming the log file and throw an InternalSpaceException containing message.
private  void failure(String message, Exception e)
          Report a exception while consuming the log file and throw an InternalSpaceException containing message.
(package private)  void finished()
          This log has been successfully drained, and committed -- it can be removed.
(package private) static Iterator logs(String basePath, boolean returnAll)
          Return an Iterator that will loop through all the logs that match the given basePath pattern, interpreted as described in the matching LogStream constructor.
 String toString()
           
 
Methods inherited from class com.sun.jini.outrigger.snaplogstore.LogFile
destroy, existingLogs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

file

private File file

intBytes

private static final long intBytes
See Also:
Constant Field Values

logger

private static final Logger logger
Logger for logging persistent store related information

Constructor Detail

LogInputFile

private LogInputFile(LogFile desc,
                     File path)
              throws IOException
Create a new LogInputFile.

Note: Don't invoke this. This is needed by the enumeration returned by logs, which is how you should be getting LogInputFile objects. When nested classes arrive, this constructor can be properly protected.

Throws:
IOException
Method Detail

logs

static Iterator logs(String basePath,
                     boolean returnAll)
              throws IOException
Return an Iterator that will loop through all the logs that match the given basePath pattern, interpreted as described in the matching LogStream constructor. If returnAll is false, the most recent file will be left off the list. This would be the proper value for an ongoing poll looking for completed log files. You would specify true during recovery, when all existing logs should be committed because no new ones are currently being created

Throws:
IOException
See Also:
Iterator

consume

void consume(BackEnd opOn)
Consume the input file, invoking the appropriate operations on the given object.


failure

private void failure(String message)
Report a failure consuming the log file and throw an InternalSpaceException containing message.


failure

private void failure(String message,
                     Exception e)
Report a exception while consuming the log file and throw an InternalSpaceException containing message.


finished

void finished()
This log has been successfully drained, and committed -- it can be removed.


toString

public String toString()
Overrides:
toString in class Object


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.