|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.storage.parallel.ParallelQueueStore
public class ParallelQueueStore
Implements an parallel event store. This queue has no memory beyond its current contents.
| Nested Class Summary | |
|---|---|
class |
ParallelQueueStore.QueueMetadataImpl
|
| Constructor Summary | |
|---|---|
ParallelQueueStore()
|
|
| Method Summary | |
|---|---|
void |
configure(PluginContext context)
Complete plug-in configuration. |
ReplEvent |
get(int taskId)
Removes and returns next event from the queue, blocking if empty. |
ReplDBMSHeader |
getLastHeader(int taskId)
Returns the last header processed. |
int |
getMaxOfflineInterval()
Returns the maximum number of seconds to do a clean shutdown. |
int |
getMaxSize()
Maximum size of individual queues. |
long |
getMaxStoredSeqno()
Returns the maximum persistently stored sequence number. |
long |
getMinStoredSeqno()
Returns the minimum persistently stored sequence number. |
java.lang.String |
getName()
Gets the storage name. |
Partitioner |
getPartitioner()
|
java.lang.String |
getPartitionerClass()
Returns the class used for partitioning transactions across queues. |
int |
getPartitions()
Returns the number of partitions for events. |
long |
getStoreSize()
Returns the current number of events across all queues of store. |
int |
getSyncInterval()
Returns the number of events between sync intervals. |
void |
insertStopEvent()
Inserts stop control event after next complete transaction. |
void |
insertWatchSyncEvent(WatchPredicate<ReplDBMSHeader> predicate)
Inserts watch synchronization event after next complete transaction that matches the provided predicate. |
boolean |
isSyncEnabled()
Returns true if automatic control events for synchronization are enabled. |
ReplEvent |
peek(int taskId)
Returns but does not remove next event from the queue if it exists or returns null if queue is empty. |
void |
prepare(PluginContext context)
Allocate an in-memory queue. |
void |
put(int taskId,
ReplDBMSEvent event)
Puts an event in the queue, blocking if it is full. |
void |
release(PluginContext context)
Release queue. |
void |
setLastHeader(int taskId,
ReplDBMSHeader header)
Sets the last header processed. |
void |
setMaxOfflineInterval(int maxOfflineInterval)
Sets the maximum number of seconds for a clean shutdown. |
void |
setMaxSize(int size)
Returns the maximum size of individual queues. |
void |
setName(java.lang.String name)
Sets the storage name. |
void |
setPartitioner(Partitioner partitioner)
|
void |
setPartitionerClass(java.lang.String partitionerClass)
Sets the class used for partitioning transactions across queues. |
void |
setPartitions(int partitions)
Sets the number of queue partitions. |
void |
setSyncEnabled(boolean syncEnabled)
Enables/disables automatic generation of control events to ensure queue consumers have up-to-date positions in the log. |
void |
setSyncInterval(int syncInterval)
Sets the number of events to process before generating an automatic control event if sync is enabled. |
int |
size(int taskId)
Returns the current queue size. |
TungstenProperties |
status()
Returns status information as a set of named properties. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ParallelQueueStore()
| Method Detail |
|---|
public java.lang.String getName()
Store
getName in interface Storepublic void setName(java.lang.String name)
Store
setName in interface Storepublic int getMaxSize()
public void setMaxSize(int size)
ParallelStore
setMaxSize in interface ParallelStorepublic void setPartitions(int partitions)
setPartitions in interface ParallelStorepublic int getPartitions()
getPartitions in interface ParallelStorepublic Partitioner getPartitioner()
public void setPartitioner(Partitioner partitioner)
public java.lang.String getPartitionerClass()
ParallelStore
getPartitionerClass in interface ParallelStorepublic void setPartitionerClass(java.lang.String partitionerClass)
ParallelStore
setPartitionerClass in interface ParallelStorepublic int getSyncInterval()
getSyncInterval in interface ParallelStorepublic void setSyncInterval(int syncInterval)
setSyncInterval in interface ParallelStorepublic boolean isSyncEnabled()
public void setSyncEnabled(boolean syncEnabled)
syncEnabled - If true sync control events are generatedpublic void setMaxOfflineInterval(int maxOfflineInterval)
setMaxOfflineInterval in interface ParallelStoreParallelStore.setMaxOfflineInterval(int)public int getMaxOfflineInterval()
getMaxOfflineInterval in interface ParallelStoreParallelStore.getMaxOfflineInterval()public long getStoreSize()
public void setLastHeader(int taskId,
ReplDBMSHeader header)
throws ReplicatorException
ReplicatorException
public ReplDBMSHeader getLastHeader(int taskId)
throws ReplicatorException
ReplicatorExceptionpublic long getMaxStoredSeqno()
getMaxStoredSeqno in interface StoreStore.getMaxStoredSeqno()public long getMinStoredSeqno()
getMinStoredSeqno in interface StoreStore.getMinStoredSeqno()
public void put(int taskId,
ReplDBMSEvent event)
throws java.lang.InterruptedException,
ReplicatorException
java.lang.InterruptedException
ReplicatorException
public ReplEvent get(int taskId)
throws java.lang.InterruptedException,
ReplicatorException
java.lang.InterruptedException
ReplicatorException
public ReplEvent peek(int taskId)
throws ReplicatorException,
java.lang.InterruptedException
ReplicatorException
java.lang.InterruptedExceptionpublic int size(int taskId)
public void configure(PluginContext context)
throws ReplicatorException
configure in interface ReplicatorPluginReplicatorException - Thrown if configuration is incomplete or
failsReplicatorPlugin.configure(com.continuent.tungsten.replicator.plugin.PluginContext)
public void prepare(PluginContext context)
throws ReplicatorException
prepare in interface ReplicatorPluginReplicatorException - Thrown if resource allocation failsReplicatorPlugin.prepare(com.continuent.tungsten.replicator.plugin.PluginContext)
public void release(PluginContext context)
throws ReplicatorException
release in interface ReplicatorPluginReplicatorException - Thrown if resource deallocation failsReplicatorPlugin.release(com.continuent.tungsten.replicator.plugin.PluginContext)
public void insertStopEvent()
throws java.lang.InterruptedException
insertStopEvent in interface ParallelStorejava.lang.InterruptedExceptionParallelStore.insertStopEvent()
public void insertWatchSyncEvent(WatchPredicate<ReplDBMSHeader> predicate)
throws java.lang.InterruptedException
insertWatchSyncEvent in interface ParallelStorejava.lang.InterruptedExceptionParallelStore.insertWatchSyncEvent(com.continuent.tungsten.replicator.util.WatchPredicate)public TungstenProperties status()
status in interface StoreStore.status()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||