com.continuent.tungsten.replicator.event
Class ReplDBMSEvent

java.lang.Object
  extended by com.continuent.tungsten.replicator.event.ReplEvent
      extended by com.continuent.tungsten.replicator.event.ReplDBMSEvent
All Implemented Interfaces:
ReplDBMSHeader, java.io.Serializable
Direct Known Subclasses:
ReplDBMSFilteredEvent

public class ReplDBMSEvent
extends ReplEvent
implements ReplDBMSHeader

Storage class for replication events implementing full event management metadata such as timestamp, source ID, epoch number, and event fragment protocol.

Version:
1.0
Author:
Teemu Ollakka
See Also:
Serialized Form

Constructor Summary
ReplDBMSEvent(long seqno, DBMSEvent event)
          Short constructor.
ReplDBMSEvent(long seqno, short fragno, boolean lastFrag, java.lang.String sourceId, long epochNumber, java.sql.Timestamp extractedTstamp, DBMSEvent event)
          Construct a new replication event.
 
Method Summary
 long getAppliedLatency()
           
 java.util.ArrayList<DBMSData> getData()
          Gets the event data for this replicated event.
 DBMSEvent getDBMSEvent()
          Returns the raw DBMS event containing SQL data.
 long getEpochNumber()
          Returns the epoch number, a number that identifies a continuous sequence of events from the time a master goes online until it goes offline.
 java.lang.String getEventId()
          Returns the native event ID corresponding to this log sequence number.
 java.sql.Timestamp getExtractedTstamp()
          Returns the extractedTstamp value.
 short getFragno()
          Returns the event fragment number, a monotonically increasing whole number starting at 0.
 boolean getLastFrag()
          Returns true if this fragment is the last one.
 long getSeqno()
          Returns the sequence number of this event.
 java.lang.String getShardId()
          Returns the shard ID for this transaction.
 java.lang.String getSourceId()
          Returns the ID of the data source from which this event was originally extracted.
 void setShardId(java.lang.String shardId)
          Sets the shard ID.
 
Methods inherited from class com.continuent.tungsten.replicator.event.ReplEvent
getEstimatedSize, setEstimatedSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplDBMSEvent

public ReplDBMSEvent(long seqno,
                     short fragno,
                     boolean lastFrag,
                     java.lang.String sourceId,
                     long epochNumber,
                     java.sql.Timestamp extractedTstamp,
                     DBMSEvent event)
Construct a new replication event.

Parameters:
seqno - Log sequence number
fragno - Fragment number
lastFrag - True if this is the last fragment
sourceId - Originating source of data
epochNumber - Epoch number on data
extractedTstamp - Time of extraction
event - Raw event data, which must always be supplied.

ReplDBMSEvent

public ReplDBMSEvent(long seqno,
                     DBMSEvent event)
Short constructor.

Method Detail

getSeqno

public long getSeqno()
Returns the sequence number of this event.

Specified by:
getSeqno in interface ReplDBMSHeader
Specified by:
getSeqno in class ReplEvent
See Also:
ReplDBMSHeader.getSeqno()

getFragno

public short getFragno()
Returns the event fragment number, a monotonically increasing whole number starting at 0.

Specified by:
getFragno in interface ReplDBMSHeader
See Also:
ReplDBMSHeader.getFragno()

getLastFrag

public boolean getLastFrag()
Returns true if this fragment is the last one.

Specified by:
getLastFrag in interface ReplDBMSHeader
See Also:
ReplDBMSHeader.getLastFrag()

getData

public java.util.ArrayList<DBMSData> getData()
Gets the event data for this replicated event.


getSourceId

public java.lang.String getSourceId()
Returns the ID of the data source from which this event was originally extracted.

Specified by:
getSourceId in interface ReplDBMSHeader
See Also:
ReplDBMSHeader.getSourceId()

getEpochNumber

public long getEpochNumber()
Returns the epoch number, a number that identifies a continuous sequence of events from the time a master goes online until it goes offline.

Specified by:
getEpochNumber in interface ReplDBMSHeader
See Also:
ReplDBMSHeader.getEpochNumber()

getExtractedTstamp

public java.sql.Timestamp getExtractedTstamp()
Returns the extractedTstamp value.

Specified by:
getExtractedTstamp in interface ReplDBMSHeader
Returns:
Returns the extractedTstamp.

getEventId

public java.lang.String getEventId()
Returns the native event ID corresponding to this log sequence number.

Specified by:
getEventId in interface ReplDBMSHeader
See Also:
ReplDBMSHeader.getEventId()

getShardId

public java.lang.String getShardId()
Returns the shard ID for this transaction.

Specified by:
getShardId in interface ReplDBMSHeader
See Also:
ReplDBMSHeader.getShardId()

setShardId

public void setShardId(java.lang.String shardId)
Sets the shard ID. This can be assigned after the event is created.


getDBMSEvent

public DBMSEvent getDBMSEvent()
Returns the raw DBMS event containing SQL data.


getAppliedLatency

public long getAppliedLatency()
Specified by:
getAppliedLatency in interface ReplDBMSHeader