com.sleepycat.je.utilint
Class Matchpoint

java.lang.Object
  extended by com.sleepycat.je.utilint.Matchpoint
All Implemented Interfaces:
Loggable

public class Matchpoint
extends Object
implements Loggable

This class writes out a log entry that can be used for replication syncup. It can be issued arbitrarily by the master at any point, in order to bound the syncup interval in much the way that a checkpoint bounds the recovery interval. The entry will a replicated one, which means that it will be tagged with a VLSN. Although this is a replication class, it resides in the utilint package because it is referenced in LogEntryType.java. TODO: This is currently not used. When it is used, it will be the first replicated log entry that does not have a real txn id. All replicated entries are expected to have negative ids, and the matchpoint should be exempt from Replay.updateSequences, or it should pass in a special reserved negative id, so as not to incur the assertion in Replay.updateSequences, that the txn id is <0.


Constructor Summary
Matchpoint()
          For constructing from the log.
Matchpoint(int repMasterNodeId)
           
 
Method Summary
 void dumpLog(StringBuilder sb, boolean verbose)
          Write the object into the string buffer for log dumping.
 int getLogSize()
           
 int getMasterNodeId()
           
 long getTransactionId()
           
 boolean logicalEquals(Loggable other)
           
 void readFromLog(ByteBuffer logBuffer, int entryVersion)
          Initialize this object from the data in itemBuf.
 void writeToLog(ByteBuffer logBuffer)
          Serialize this object into the buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Matchpoint

public Matchpoint(int repMasterNodeId)

Matchpoint

public Matchpoint()
For constructing from the log.

Method Detail

getMasterNodeId

public int getMasterNodeId()

getLogSize

public int getLogSize()
Specified by:
getLogSize in interface Loggable
Returns:
number of bytes used to store this object.
See Also:
Loggable.getLogSize()

writeToLog

public void writeToLog(ByteBuffer logBuffer)
Description copied from interface: Loggable
Serialize this object into the buffer.

Specified by:
writeToLog in interface Loggable
Parameters:
logBuffer - is the destination buffer
See Also:
Loggable.writeToLog(java.nio.ByteBuffer)

readFromLog

public void readFromLog(ByteBuffer logBuffer,
                        int entryVersion)
Description copied from interface: Loggable
Initialize this object from the data in itemBuf.

Specified by:
readFromLog in interface Loggable
See Also:
Loggable.readFromLog(java.nio.ByteBuffer, int)

dumpLog

public void dumpLog(StringBuilder sb,
                    boolean verbose)
Description copied from interface: Loggable
Write the object into the string buffer for log dumping. Each object should be dumped without indentation or new lines and should be valid XML.

Specified by:
dumpLog in interface Loggable
Parameters:
sb - destination string buffer
verbose - if true, dump the full, verbose version
See Also:
Loggable.dumpLog(java.lang.StringBuilder, boolean)

getTransactionId

public long getTransactionId()
Specified by:
getTransactionId in interface Loggable
Returns:
the transaction id embedded within this loggable object. Objects that have no transaction id should return 0.
See Also:
Loggable.getTransactionId()

logicalEquals

public boolean logicalEquals(Loggable other)
Specified by:
logicalEquals in interface Loggable
Returns:
true if these two loggable items are logically the same. Used for replication testing.


Copyright (c) 2004-2010 Oracle. All rights reserved.