com.sleepycat.je.txn
Class TxnPrepare

java.lang.Object
  extended by com.sleepycat.je.txn.TxnEnd
      extended by com.sleepycat.je.txn.TxnPrepare
All Implemented Interfaces:
LoggableObject, LogReadable, LogWritable

public class TxnPrepare
extends TxnEnd

This class writes out a transaction prepare record.


Field Summary
 
Fields inherited from class com.sleepycat.je.txn.TxnEnd
id, time
 
Constructor Summary
TxnPrepare()
          For constructing from the log.
TxnPrepare(long id, Xid xid)
           
 
Method Summary
 void dumpLog(StringBuffer sb, boolean verbose)
          Write the object into the string buffer for log dumping.
 int getLogSize()
           
 LogEntryType getLogType()
          All objects that are reponsible for a generating a type of log entry must implement this.
protected  String getTagName()
           
 Xid getXid()
           
 void readFromLog(ByteBuffer logBuffer, byte entryTypeVersion)
          Initialize this object from the data in itemBuf.
 void writeToLog(ByteBuffer logBuffer)
          Serialize this object into the buffer.
 
Methods inherited from class com.sleepycat.je.txn.TxnEnd
countAsObsoleteWhenLogged, getId, getLastLsn, getTransactionId, logEntryIsTransactional, marshallOutsideWriteLatch, postLogWork
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TxnPrepare

public TxnPrepare(long id,
                  Xid xid)

TxnPrepare

public TxnPrepare()
For constructing from the log.

Method Detail

getXid

public Xid getXid()

getLogType

public LogEntryType getLogType()
Description copied from interface: LoggableObject
All objects that are reponsible for a generating a type of log entry must implement this.

Specified by:
getLogType in interface LoggableObject
Specified by:
getLogType in class TxnEnd
Returns:
the type of log entry
See Also:
TxnEnd.getLogType()

getTagName

protected String getTagName()
Specified by:
getTagName in class TxnEnd

getLogSize

public int getLogSize()
Specified by:
getLogSize in interface LogWritable
Overrides:
getLogSize in class TxnEnd
Returns:
number of bytes used to store this object.
See Also:
LoggableObject#getLogSize

writeToLog

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

Specified by:
writeToLog in interface LogWritable
Overrides:
writeToLog in class TxnEnd
Parameters:
logBuffer - is the destination buffer
See Also:
LoggableObject#writeToLog

readFromLog

public void readFromLog(ByteBuffer logBuffer,
                        byte entryTypeVersion)
Description copied from interface: LogReadable
Initialize this object from the data in itemBuf.

Specified by:
readFromLog in interface LogReadable
Overrides:
readFromLog in class TxnEnd
See Also:
LogReadable#readFromLog

dumpLog

public void dumpLog(StringBuffer sb,
                    boolean verbose)
Description copied from interface: LogReadable
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 LogReadable
Overrides:
dumpLog in class TxnEnd
Parameters:
sb - destination string buffer
verbose - if true, dump the full, verbose version
See Also:
LogReadable#dumpLog


Copyright 2004-2005 Sleepycat, Inc. All Rights Reserved.