|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.pipeline.Pipeline
public class Pipeline
Stores the information related to a replication pipeline, which is a set of independent processing stages.
The pipeline life cycle requires that pipelines do not release underlying stages or progress trackers within stages. This is necessary to avoid race conditions for monitoring and status calls, which may call pipelines at various stages of preparation and also following release. To release pipeline resources, clients must drop references to the pipeline itself.
| Constructor Summary | |
|---|---|
Pipeline()
|
|
| Method Summary | |
|---|---|
void |
addService(java.lang.String name,
PipelineService service)
|
void |
addStage(Stage stage)
|
void |
addStore(java.lang.String name,
Store store)
|
void |
configure(PluginContext context)
Configures pipeline data structures including stages and stores. |
java.util.concurrent.Future<ReplDBMSHeader> |
flush()
Find the current native event ID in the DBMS and wait until it reaches the log. |
double |
getApplyLatency()
Returns the latency of applying the last committed event in seconds. |
int |
getChannels()
Returns the number of parallel apply channels in final stage. |
PluginContext |
getContext()
|
Stage |
getFirstStage()
|
Extractor |
getHeadExtractor()
Returns extractor at head of pipeline. |
ReplDBMSHeader |
getLastAppliedEvent()
Returns the last event applied in the last stage. |
long |
getLastAppliedSeqno()
Returns the last sequence number applied in the last stage. |
long |
getLastExtractedSeqno()
Returns the last value processed in the first stage. |
Stage |
getLastStage()
|
long |
getMaxCommittedSeqno()
getMaxCommittedSeqno returns the max committed sequence number from all the stores. |
long |
getMaxStoredSeqno()
Returns the current maximum stored sequence number. |
long |
getMinStoredSeqno()
Returns the current minimum stored sequence number. |
java.lang.String |
getName()
Sets the name of this pipeline, which must be unique across all defined pipelines. |
java.lang.String |
getOfflineRequests()
Returns a formatted list of current offline requests. |
java.lang.String |
getPipelineSource()
Returns the source of the current pipeline, if known. |
PipelineService |
getService(java.lang.String name)
|
java.util.List<java.lang.String> |
getServiceNames()
|
java.util.List<ShardProgress> |
getShardProgress()
Returns shard progress instances ordered by shard ID. |
Stage |
getStage(java.lang.String name)
|
java.util.List<Stage> |
getStages()
|
Store |
getStore(java.lang.String name)
|
java.util.List<java.lang.String> |
getStoreNames()
|
Applier |
getTailApplier()
Returns applier at tail of pipeline. |
java.util.List<TaskProgress> |
getTaskProgress()
Returns task progress instances ordered by task ID. |
java.util.List<Watch<?>> |
getWatches(boolean committed)
Returns the currently scheduled watches. |
boolean |
isAutoSync()
|
boolean |
isShutdown()
Returns true if the pipeline has stopped. |
void |
prepare(PluginContext context)
Prepare plug-in for use. |
void |
release(PluginContext context)
Release all resources used by plug-in. |
void |
setApplySkipCount(long skipCount)
Sets the number of apply transactions to skip, which allows the pipeline to skip over errors. |
void |
setApplySkipEvents(java.util.SortedSet<java.lang.Long> seqnos)
|
void |
setAutoSync(boolean autoSync)
|
void |
setInitialEventId(java.lang.String eventId)
Sets the native event ID from which to start extracting. |
void |
setName(java.lang.String name)
|
void |
setSyncTHLWithExtractor(boolean syncTHLWithExtractor)
|
void |
shutdown(boolean immediate)
Stop pipeline operation. |
java.util.concurrent.Future<Pipeline> |
shutdownAfterEventId(java.lang.String eventId)
Shuts down after a particular event ID is applied. |
java.util.concurrent.Future<Pipeline> |
shutdownAfterHeartbeat(java.lang.String name)
Shuts down after a heartbeat event is seen. |
java.util.concurrent.Future<Pipeline> |
shutdownAfterSequenceNumber(long seqno)
Shuts down after a particular sequence number is applied. |
java.util.concurrent.Future<Pipeline> |
shutdownAfterTimestamp(java.sql.Timestamp timestamp)
Shuts down after the replication event timestamp meets or exceeds the argument. |
void |
start(com.continuent.tungsten.fsm.event.EventDispatcher eventDispatcher)
Start pipeline operation. |
boolean |
syncTHLWithExtractor()
|
java.util.concurrent.Future<ReplDBMSHeader> |
watchForCommittedSequenceNumber(long seqno,
boolean terminate)
Sets a watch for a particular sequence number to be safely committed on all channels at the end of the pipeline. |
java.util.concurrent.Future<ReplDBMSHeader> |
watchForExtractedEventId(java.lang.String eventId)
Sets a watch for a particular event ID to be extracted. |
java.util.concurrent.Future<ReplDBMSHeader> |
watchForExtractedSequenceNumber(long seqno)
Sets a watch for a particular sequence number to be extracted. |
java.util.concurrent.Future<ReplDBMSHeader> |
watchForProcessedEventId(java.lang.String eventId)
Sets a watch for a particular event ID to be processed. |
java.util.concurrent.Future<ReplDBMSHeader> |
watchForProcessedSequenceNumber(long seqno)
Sets a watch for a particular sequence number to be processed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Pipeline()
| Method Detail |
|---|
public java.lang.String getName()
public void setName(java.lang.String name)
public boolean isAutoSync()
public void setAutoSync(boolean autoSync)
public void addStage(Stage stage)
public void addStore(java.lang.String name,
Store store)
public void addService(java.lang.String name,
PipelineService service)
public Stage getStage(java.lang.String name)
public java.util.List<Stage> getStages()
public Stage getFirstStage()
public Stage getLastStage()
public PluginContext getContext()
public Extractor getHeadExtractor()
public Applier getTailApplier()
public Store getStore(java.lang.String name)
public java.util.List<java.lang.String> getStoreNames()
public PipelineService getService(java.lang.String name)
public java.util.List<java.lang.String> getServiceNames()
public java.lang.String getPipelineSource()
public int getChannels()
public void configure(PluginContext context)
throws ReplicatorException,
java.lang.InterruptedException
configure in interface ReplicatorPluginReplicatorException - Thrown if configuration is incomplete or
fails
java.lang.InterruptedExceptionReplicatorPlugin.configure(com.continuent.tungsten.replicator.plugin.PluginContext)
public void prepare(PluginContext context)
throws ReplicatorException,
java.lang.InterruptedException
prepare in interface ReplicatorPluginReplicatorException - Thrown if resource allocation fails
java.lang.InterruptedExceptionReplicatorPlugin.prepare(com.continuent.tungsten.replicator.plugin.PluginContext)public void release(PluginContext context)
release in interface ReplicatorPluginReplicatorPlugin.release(com.continuent.tungsten.replicator.plugin.PluginContext)
public void start(com.continuent.tungsten.fsm.event.EventDispatcher eventDispatcher)
throws ReplicatorException
ReplicatorExceptionpublic void shutdown(boolean immediate)
public java.util.concurrent.Future<Pipeline> shutdownAfterSequenceNumber(long seqno)
throws java.lang.InterruptedException,
ReplicatorException
seqno - Sequence number to watch for
java.lang.InterruptedException
ReplicatorException
public java.util.concurrent.Future<Pipeline> shutdownAfterEventId(java.lang.String eventId)
throws java.lang.InterruptedException,
ReplicatorException
eventId - Event ID to watch for
java.lang.InterruptedException
ReplicatorException
public java.util.concurrent.Future<Pipeline> shutdownAfterHeartbeat(java.lang.String name)
throws java.lang.InterruptedException,
ReplicatorException
java.lang.InterruptedException
ReplicatorException
public java.util.concurrent.Future<Pipeline> shutdownAfterTimestamp(java.sql.Timestamp timestamp)
throws java.lang.InterruptedException,
ReplicatorException
timestamp - Timestamp value to wait for
java.lang.InterruptedException
ReplicatorExceptionpublic boolean isShutdown()
public long getLastExtractedSeqno()
public long getLastAppliedSeqno()
public ReplDBMSHeader getLastAppliedEvent()
public double getApplyLatency()
public long getMinStoredSeqno()
public long getMaxStoredSeqno()
public java.lang.String getOfflineRequests()
public java.util.List<TaskProgress> getTaskProgress()
public java.util.List<ShardProgress> getShardProgress()
public void setInitialEventId(java.lang.String eventId)
eventId - Event ID from which to start replicationpublic void setApplySkipCount(long skipCount)
public java.util.concurrent.Future<ReplDBMSHeader> watchForExtractedSequenceNumber(long seqno)
throws java.lang.InterruptedException
seqno - Sequence number to watch for
java.lang.InterruptedException - if cancelled
public java.util.concurrent.Future<ReplDBMSHeader> watchForExtractedEventId(java.lang.String eventId)
throws java.lang.InterruptedException
eventId - Native event ID to watch for
java.lang.InterruptedException - if cancelled
public java.util.concurrent.Future<ReplDBMSHeader> watchForCommittedSequenceNumber(long seqno,
boolean terminate)
throws java.lang.InterruptedException
seqno - Sequence number to watch forterminate - If true, terminate task when watch is successful
java.lang.InterruptedException
public java.util.concurrent.Future<ReplDBMSHeader> watchForProcessedSequenceNumber(long seqno)
throws java.lang.InterruptedException
seqno - Sequence number to watch for
java.lang.InterruptedException - if cancelled
public java.util.concurrent.Future<ReplDBMSHeader> watchForProcessedEventId(java.lang.String eventId)
throws java.lang.InterruptedException
eventId - Native event ID to watch for
java.lang.InterruptedException - if canceledpublic java.util.List<Watch<?>> getWatches(boolean committed)
public java.util.concurrent.Future<ReplDBMSHeader> flush()
throws java.lang.InterruptedException,
ReplicatorException
java.lang.InterruptedException
ReplicatorExceptionpublic void setSyncTHLWithExtractor(boolean syncTHLWithExtractor)
public boolean syncTHLWithExtractor()
public void setApplySkipEvents(java.util.SortedSet<java.lang.Long> seqnos)
public long getMaxCommittedSeqno()
throws ReplicatorException
ReplicatorException - in case an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||