public class NTWriteManager extends java.lang.Object implements NTThread.NTRunnable
IncomingEntryReceiver that buffers transactions and then and then
dispatches them to a flushable transaction receiver that is periodically offered all queued
transaction and then flushed| Modifier and Type | Field and Description |
|---|---|
private NTEntryStore |
m_entryStore |
private java.util.Queue<NTTableEntry> |
m_incomingAssignmentQueue |
private java.util.Queue<NTTableEntry> |
m_incomingUpdateQueue |
private long |
m_keepAliveDelay |
private long |
m_lastWrite |
private java.util.Queue<NTTableEntry> |
m_outgoingAssignmentQueue |
private java.util.Queue<NTTableEntry> |
m_outgoingUpdateQueue |
private NTConnectionList |
m_receiver |
private NTThread |
m_thread |
private java.lang.Object |
m_transactionsLock |
private int |
QUEUE_SIZE |
private int |
SLEEP_TIME |
| Constructor and Description |
|---|
NTWriteManager(NTConnectionList receiver,
NTEntryStore entryStore,
long keepAliveDelay)
Create a new Write manager
|
| Modifier and Type | Method and Description |
|---|---|
void |
offerOutgoingAssignment(NTTableEntry entry) |
void |
offerOutgoingUpdate(NTTableEntry entry) |
void |
run()
the periodic method that sends all buffered transactions
|
void |
start()
start the write thread
|
void |
stop()
stop the write thread
|
private final int SLEEP_TIME
private final int QUEUE_SIZE
private java.lang.Object m_transactionsLock
private NTThread m_thread
private final NTEntryStore m_entryStore
private volatile java.util.Queue<NTTableEntry> m_incomingAssignmentQueue
private volatile java.util.Queue<NTTableEntry> m_incomingUpdateQueue
private volatile java.util.Queue<NTTableEntry> m_outgoingAssignmentQueue
private volatile java.util.Queue<NTTableEntry> m_outgoingUpdateQueue
private NTConnectionList m_receiver
private long m_lastWrite
private final long m_keepAliveDelay
public NTWriteManager(NTConnectionList receiver, NTEntryStore entryStore, long keepAliveDelay)
receiver - threadManager - transactionPool - entryStore - public void start()
public void stop()
public void offerOutgoingAssignment(NTTableEntry entry)
public void offerOutgoingUpdate(NTTableEntry entry)
public void run()
throws java.lang.InterruptedException
run in interface NTThread.NTRunnablejava.lang.InterruptedException