com.sleepycat.je.rep.stream
Class OutputWireRecord

java.lang.Object
  extended by com.sleepycat.je.rep.stream.WireRecord
      extended by com.sleepycat.je.rep.stream.OutputWireRecord

public class OutputWireRecord
extends WireRecord

Format for log entries sent across the wire for replication. In most cases, the bytes are read directly from the log and never need to be serialized into the backing object. Note that the ByteBuffer held within the OutputWireRecord has a limited lifetime. Often it's just sliced, rather than copied from the underlying buffer.


Field Summary
protected  ByteBuffer entryBuffer
           
 
Fields inherited from class com.sleepycat.je.rep.stream.WireRecord
header
 
Constructor Summary
OutputWireRecord(InputWireRecord input)
           
OutputWireRecord(LogEntryHeader header, ByteBuffer readerBuffer)
          Make a OutputWireRecord from FileReader output for sending out.
OutputWireRecord(LogItem logItem)
          Creates an OutputWireRecord from a log item.
 
Method Summary
 String dump()
          Dump the contents.
 long getCommitTxnId()
           
 byte getEntryType()
           
 long getTimeStamp()
           
 VLSN getVLSN()
           
(package private)  int getWireSize()
          Support for reading and writing FeedRecords to network.
 boolean match(InputWireRecord input)
          Used at syncup, when comparing records received from the feeder against local records.
 boolean match(OutputWireRecord otherRecord)
          For unit tests.
 String toString()
           
 boolean verifyNegativeSequences(String debugTag)
           
(package private)  void writeToWire(ByteBuffer messageBuffer)
           
 
Methods inherited from class com.sleepycat.je.rep.stream.WireRecord
instantiateEntry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

entryBuffer

protected final ByteBuffer entryBuffer
Constructor Detail

OutputWireRecord

OutputWireRecord(LogEntryHeader header,
                 ByteBuffer readerBuffer)
Make a OutputWireRecord from FileReader output for sending out.


OutputWireRecord

OutputWireRecord(LogItem logItem)
Creates an OutputWireRecord from a log item. This constructor is used when a Feeder can bypass access to the log because the log item is available in the log item cache associated with the VLSNIndex.


OutputWireRecord

OutputWireRecord(InputWireRecord input)
Method Detail

getEntryType

public byte getEntryType()
Returns:
the log entry type for this record.

match

public boolean match(InputWireRecord input)
              throws DatabaseException
Used at syncup, when comparing records received from the feeder against local records.

Returns:
true if this OutputWireRecord has the same logical contents as the InputWireRecord. The comparison will disregard portions of the logEntry that may be different, such at timestamps on a Commit entry. Must be called before the entryBuffer that backs this OutputWireRecord is reused.
Throws:
DatabaseException

match

public boolean match(OutputWireRecord otherRecord)
              throws DatabaseException
For unit tests.

Returns:
true if this OutputWireRecord has the same logical contents as "other".
Throws:
DatabaseException

getVLSN

public VLSN getVLSN()

dump

public String dump()
            throws DatabaseException
Dump the contents.

Throws:
DatabaseException

toString

public String toString()
Overrides:
toString in class Object

getWireSize

int getWireSize()
Support for reading and writing FeedRecords to network.


writeToWire

void writeToWire(ByteBuffer messageBuffer)

getCommitTxnId

public long getCommitTxnId()
                    throws DatabaseException
Throws:
DatabaseException

getTimeStamp

public long getTimeStamp()
                  throws DatabaseException
Throws:
DatabaseException

verifyNegativeSequences

public boolean verifyNegativeSequences(String debugTag)


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