|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.storage.InMemoryQueueStore
public class InMemoryQueueStore
Implements an in-memory event store. This queue has no memory beyond its current contents.
| Field Summary | |
|---|---|
protected ReplDBMSHeader |
lastHeader
|
protected int |
maxSize
|
protected java.lang.String |
name
|
protected int |
partitions
|
protected java.util.concurrent.LinkedBlockingQueue<ReplDBMSEvent> |
queue
|
protected long |
transactionCount
|
| Constructor Summary | |
|---|---|
InMemoryQueueStore()
|
|
| Method Summary | |
|---|---|
void |
configure(PluginContext context)
Complete plug-in configuration. |
ReplDBMSEvent |
get()
Removes and returns next event from the queue, blocking if empty. |
ReplDBMSHeader |
getLastHeader()
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. |
ReplDBMSEvent |
peek()
Returns but does not remove next event from the queue if it exists or returns null if queue is empty. |
ReplDBMSEvent |
poll()
Removes and returns next event from the queue, returning null if empty. |
void |
prepare(PluginContext context)
Allocate an in-memory queue. |
void |
put(ReplDBMSEvent event)
Puts an event in the queue, blocking if it is full. |
void |
release(PluginContext context)
Release queue. |
void |
setLastHeader(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)
|
void |
setName(java.lang.String name)
Sets the storage name. |
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, i.e., channels. |
void |
setSyncInterval(int syncInterval)
Sets the number of events to process before generating an automatic control event if sync is enabled. |
int |
size()
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 |
| Field Detail |
|---|
protected java.lang.String name
protected java.util.concurrent.LinkedBlockingQueue<ReplDBMSEvent> queue
protected int maxSize
protected ReplDBMSHeader lastHeader
protected long transactionCount
protected int partitions
| Constructor Detail |
|---|
public InMemoryQueueStore()
| 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)
public void setLastHeader(ReplDBMSHeader header)
public ReplDBMSHeader getLastHeader()
public long getMaxStoredSeqno()
getMaxStoredSeqno in interface StoreStore.getMaxStoredSeqno()public long getMinStoredSeqno()
getMinStoredSeqno in interface StoreStore.getMinStoredSeqno()public void setPartitions(int partitions)
public void setPartitionerClass(java.lang.String partitionerClass)
public void setSyncInterval(int syncInterval)
public void setMaxOfflineInterval(int maxOfflineInterval)
public void put(ReplDBMSEvent event)
throws java.lang.InterruptedException,
ReplicatorException
ReplicatorException
java.lang.InterruptedException
public ReplDBMSEvent get()
throws java.lang.InterruptedException
java.lang.InterruptedException
public ReplDBMSEvent poll()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic ReplDBMSEvent peek()
public int size()
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()
Store
status in interface Store
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||