com.continuent.tungsten.replicator.event
Class ReplDBMSFilteredEvent

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

public class ReplDBMSFilteredEvent
extends ReplDBMSEvent

Implements a filtered event, which represents a gap in the transaction sequence. Missing sequence numbers can result in ambiguities in processing the log--for example, are we missing a seqno because the log is corrupt or because it was filtered out. This class holds a record of the missing transactions in order to remove such ambiguity.

Generally speaking this class marks position using the first event in the beginning of the range. We also store the end seqno and fragno to show the extent of the range. Both beginning and end seqno/frago are inclusive.

For now filtering less-than-whole transactions is not support and may cause unpredictable replicator behavior.

Version:
1.0
Author:
Stephane Giron
See Also:
Serialized Form

Constructor Summary
ReplDBMSFilteredEvent(java.lang.Long firstFilteredSeqno, java.lang.Short firstFilteredFragno, java.lang.Long lastFilteredSeqno, java.lang.Short lastFilteredFragno, boolean lastFrag, java.lang.String eventId, java.lang.String sourceId, java.sql.Timestamp timestamp, long epochNumber)
          Method to instantiate a filtered event from header data of the first event in the sequence plus the end seqno and fragno of the last event.
ReplDBMSFilteredEvent(ReplDBMSHeader firstFilteredEvent, ReplDBMSHeader lastFilteredEvent)
          Standard way to instantiate a filtered event using the headers from the first and last event.
ReplDBMSFilteredEvent(java.lang.String lastFilteredId, java.lang.Long firstFilteredSeqno, java.lang.Long lastFilteredSeqno, java.lang.Short lastFragno)
          Simple method to instantiate.
 
Method Summary
 short getFragnoEnd()
          Returns the fragnoEnd value.
 long getSeqnoEnd()
          Returns the seqnoEnd value.
 void updateCommitSeqno()
           
 
Methods inherited from class com.continuent.tungsten.replicator.event.ReplDBMSEvent
getAppliedLatency, getData, getDBMSEvent, getEpochNumber, getEventId, getExtractedTstamp, getFragno, getLastFrag, getSeqno, getShardId, getSourceId, setShardId
 
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

ReplDBMSFilteredEvent

public ReplDBMSFilteredEvent(java.lang.String lastFilteredId,
                             java.lang.Long firstFilteredSeqno,
                             java.lang.Long lastFilteredSeqno,
                             java.lang.Short lastFragno)
Simple method to instantiate. This should only be used for testing as well as cases where we do not have full restart information as it will lead to restart problems if stored in the log or in the applier table (usually trep_commit_seqno) used to restart replication.


ReplDBMSFilteredEvent

public ReplDBMSFilteredEvent(java.lang.Long firstFilteredSeqno,
                             java.lang.Short firstFilteredFragno,
                             java.lang.Long lastFilteredSeqno,
                             java.lang.Short lastFilteredFragno,
                             boolean lastFrag,
                             java.lang.String eventId,
                             java.lang.String sourceId,
                             java.sql.Timestamp timestamp,
                             long epochNumber)
Method to instantiate a filtered event from header data of the first event in the sequence plus the end seqno and fragno of the last event.

Parameters:
firstFilteredSeqno - First filtered seqno
firstFilteredFragno - First filtered fragno
lastFilteredSeqno - Last seqno that is filtered
lastFilteredFragno - Last fragno on that event
lastFrag - Whether this is the last fragment or not -- does not seem to mean much for filtered transactions
eventId - Restart point in log
sourceId - Source of the first transaction
timestamp - Commit timestamp
epochNumber - Epoch number of the first event

ReplDBMSFilteredEvent

public ReplDBMSFilteredEvent(ReplDBMSHeader firstFilteredEvent,
                             ReplDBMSHeader lastFilteredEvent)
Standard way to instantiate a filtered event using the headers from the first and last event.

Parameters:
firstFilteredEvent - First filtered event in stream
lastFilteredEvent - Last filtered event in stream
Method Detail

getSeqnoEnd

public long getSeqnoEnd()
Returns the seqnoEnd value.

Returns:
Returns the seqnoEnd.

updateCommitSeqno

public void updateCommitSeqno()

getFragnoEnd

public short getFragnoEnd()
Returns the fragnoEnd value.

Returns:
Returns the fragnoEnd.