com.atomikos.persistence.dataserializable
Class FileLogStream
java.lang.Object
com.atomikos.persistence.imp.AbstractLogStream
com.atomikos.persistence.dataserializable.FileLogStream
- All Implemented Interfaces:
- LogStream
public class FileLogStream
- extends AbstractLogStream
- implements LogStream
A file implementation of a LogStream.
FileLogStream
public FileLogStream(String baseDir,
String baseName)
throws IOException
- Throws:
IOException
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.