com.continuent.tungsten.replicator.thl.log
Class LogEventReplReader

java.lang.Object
  extended by com.continuent.tungsten.replicator.thl.log.LogEventReplReader

public class LogEventReplReader
extends java.lang.Object

This class encapsulates operations to read a log record header and serialized THLEvent for an event. It automatically reads the header but does not deserialize the event until asked to. You should call done() after use to free resources.

Author:
Robert Hodges

Constructor Summary
LogEventReplReader(LogRecord logRecord, Serializer serializer, boolean checkCRC)
          Instantiate the reader and load header information.
 
Method Summary
 THLEvent deserializeEvent()
          Deserialize and return the event.
 void done()
          Release the log record.
 long getEpochNumber()
           
 java.lang.String getEventId()
           
 short getFragno()
           
 LogRecord getLogRecord()
           
 byte getRecordType()
           
 long getSeqno()
           
 java.lang.String getShardId()
           
 java.lang.String getSourceId()
           
 java.lang.Long getSourceTStamp()
           
 boolean isLastFrag()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogEventReplReader

public LogEventReplReader(LogRecord logRecord,
                          Serializer serializer,
                          boolean checkCRC)
                   throws ReplicatorException
Instantiate the reader and load header information.

Throws:
ReplicatorException
Method Detail

getLogRecord

public LogRecord getLogRecord()

getRecordType

public byte getRecordType()

getSeqno

public long getSeqno()

getFragno

public short getFragno()

isLastFrag

public boolean isLastFrag()

getEpochNumber

public long getEpochNumber()

getSourceId

public java.lang.String getSourceId()

getEventId

public java.lang.String getEventId()

getShardId

public java.lang.String getShardId()

getSourceTStamp

public java.lang.Long getSourceTStamp()

deserializeEvent

public THLEvent deserializeEvent()
                          throws ReplicatorException
Deserialize and return the event.

Throws:
ReplicatorException

done

public void done()
Release the log record.