|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.storage.InMemoryMultiQueue
public class InMemoryMultiQueue
Implements an in-memory queue store with multiple queues. This is used for testing other parallel queues where we need to simulate ability to apply in parallel across a bunch of threads and tell what happened on each.
| Constructor Summary | |
|---|---|
InMemoryMultiQueue()
|
|
| Method Summary | |
|---|---|
void |
configure(PluginContext context)
Complete plug-in configuration. |
ReplDBMSEvent |
get(int taskId)
Removes and returns next event from the queue, blocking if empty. |
ReplDBMSEvent |
get(int taskId,
long waitMillis)
Removes and returns next event from the queue, waiting up to specified number of milliseconds. |
ReplDBMSHeader |
getLastHeader(int taskId)
Returns the last header processed. |
int |
getMaxSize()
|
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. |
int |
getPartitions()
|
ReplDBMSEvent |
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 |
setMaxSize(int size)
|
void |
setName(java.lang.String name)
Sets the storage name. |
void |
setPartitions(int partitions)
|
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 InMemoryMultiQueue()
| Method Detail |
|---|
public java.lang.String getName()
getName in interface StoreStore.getName()public void setName(java.lang.String name)
setName in interface StoreStore.setName(java.lang.String)public int getMaxSize()
public void setMaxSize(int size)
public int getPartitions()
public void setPartitions(int partitions)
public void setLastHeader(int taskId,
ReplDBMSHeader header)
public ReplDBMSHeader getLastHeader(int taskId)
public 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 ReplDBMSEvent get(int taskId)
throws java.lang.InterruptedException
java.lang.InterruptedException
public ReplDBMSEvent get(int taskId,
long waitMillis)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic ReplDBMSEvent peek(int taskId)
public 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 TungstenProperties status()
status in interface StoreStore.status()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||