com.atomikos.persistence.dataserializable
Class FileLogStream

java.lang.Object
  extended by com.atomikos.persistence.imp.AbstractLogStream
      extended by com.atomikos.persistence.dataserializable.FileLogStream
All Implemented Interfaces:
LogStream

public class FileLogStream
extends AbstractLogStream
implements LogStream

A file implementation of a LogStream.


Field Summary
 
Fields inherited from class com.atomikos.persistence.imp.AbstractLogStream
corrupt_, file_, LOGGER, output_, simulateCrash_
 
Constructor Summary
FileLogStream(String baseDir, String baseName)
           
 
Method Summary
 void flushObject(Object o, boolean shouldSync)
          Flush (force) an object to the stream.
 Vector<Recoverable> recover()
          Reads the log contents, and initializes the data structure.
 void writeCheckpoint(Enumeration elements)
          After intial recovery, it is good practice to write a checkpoint with only the most recent data.
 
Methods inherited from class com.atomikos.persistence.imp.AbstractLogStream
close, closeOutput, finalize, getSize, setCrashMode
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atomikos.persistence.LogStream
close, getSize
 

Constructor Detail

FileLogStream

public FileLogStream(String baseDir,
                     String baseName)
              throws IOException
Throws:
IOException
Method Detail

recover

public Vector<Recoverable> recover()
                            throws LogException
Description copied from interface: LogStream
Reads the log contents, and initializes the data structure. Should be called first.

Specified by:
recover in interface LogStream
Returns:
Vector The read objects from the log.
Throws:
LogException - On failure.

writeCheckpoint

public void writeCheckpoint(Enumeration elements)
                     throws LogException
Description copied from interface: LogStream
After intial recovery, it is good practice to write a checkpoint with only the most recent data. This method does that, and can also be called at random intervals during normal operation.

Specified by:
writeCheckpoint in interface LogStream
Parameters:
elements - The elements to keep in the log.
Throws:
LogException - On failure.

flushObject

public void flushObject(Object o,
                        boolean shouldSync)
                 throws LogException
Description copied from interface: LogStream
Flush (force) an object to the stream. If this method returns then the object is guaranteed to be persisted.

Specified by:
flushObject in interface LogStream
Throws:
LogException - On failure.


Copyright © 2014. All Rights Reserved.