com.neeve.rog.log
Class RogLogCompactionReader

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.rog.RogObject
          extended by com.neeve.rog.log.RogLogCompactionReader

public final class RogLogCompactionReader
extends RogObject

Specialized reader of a log that read, compacts and dispatches compacted entries to the caller.


Nested Class Summary
static interface RogLogCompactionReader.ReadHandler
          Interface through which compacted reads and dispatched to caller
static class RogLogCompactionReader.RunCompletionReason
          Enumerates the various reasons why a run(int, long) invocation completes
 
Method Summary
 void close()
          Close a compaction reader This method will initiate a stop of a compaction run if in progress
static RogLogCompactionReader create(RogLog log, RogLogCompactionReader.ReadHandler handler)
          Create a new log compaction reader.
 RogLog.Entry next()
          Get next entry in log file
 RogLogCompactionReader.RunCompletionReason run()
          Run the compaction reader This method runs the compaction reader until the last checkpoint in the file has been rolled over to a new log file
 RogLogCompactionReader.RunCompletionReason run(int logNumber, long maxFilePointer)
          Run the compaction reader
 
Methods inherited from class com.neeve.root.RootObject
getChecked, getThreaded, getTracer, setChecked, setTracer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static final RogLogCompactionReader create(RogLog log,
                                                  RogLogCompactionReader.ReadHandler handler)
                                           throws Exception
Create a new log compaction reader.

Parameters:
log - The transaction log to be read
handler - The handler to dispatch compacted read events to.
Throws:
Exception

run

public final RogLogCompactionReader.RunCompletionReason run(int logNumber,
                                                            long maxFilePointer)
                                                     throws Exception
Run the compaction reader

Parameters:
logNumber - The log number on which to run the compaction reader
maxFilePointer - The file pointer beyond which no entries should be read

This method runs the compaction reader until the supplied file pointer has been reached or the last checkpoint in the file has been rolled over to a new log file

Throws:
Exception

run

public final RogLogCompactionReader.RunCompletionReason run()
                                                     throws Exception
Run the compaction reader

This method runs the compaction reader until the last checkpoint in the file has been rolled over to a new log file

Throws:
Exception

next

public final RogLog.Entry next()
                        throws Exception
Get next entry in log file

Throws:
Exception

close

public final void close()
Close a compaction reader

This method will initiate a stop of a compaction run if in progress



Copyright © 2016 Neeve Research, LLC. All Rights Reserved.