public class ReplicatorOutboundRequest
- extends Object
This is for the Manager to request the Replicator to send outbound replication request(s).
The manager *synchronously* waits for the Replicator to do its stuff.
The first part of the processing here (in run()) is to increase the TxSeqNum for transactions going to the SSD
and write the packets to the SSD. With the SSD implementation, it is important that the
increase in the txSeqNum is tied to the packets going onto the write queue.
The physical write can overlap with further processing, but the ReplicatorOutboundRequest has to wait
for at least one of the writes to the SSD to complete. This coordination is done via the semaphore
What the run() method does is to put the packets onto sendPacketQueue. The reason for having a queue here is:
- we're going to have to fork off at some point anyway, because the manager is waiting for this
- so we don't really want to go all the way to the linkProvider with all the packets
in case there is back pressure from the link. If we did this, the whole thing would be single-threaded.
So we'll start with 2 DCConnectionSendThreads.
We link with this via the dccSendQueue, which actually contains the whole ReplicatorOutboundRequest because it has
- the packet
- the result
- the semaphore we need
The ROR's are sent via MgrReplicatorOutboundThread.
public ReplicatorPacket packets
public transient NamedSemaphore finishOutboundRequestSem
public transient ByteArrayWriteBuffer bawb
public transient BufferOutput bufferOutput
public transient int fileNumber
public transient byte dataAsByteArr
public transient long firstTxSeqNum
public transient AtomicInteger writeCount
public ReplicatorOutboundRequest(ReplicatorPacket packets)
packets - must be non-null
public void finishOutboundRequest()
public Object getResult()
public void init(InvocationService arg0)
public void run()
- This is the method that is called to do the invocable bit! It's not a Thread.run()!
This method is run on the isolator/primary replicator.
We want to get the message stored before returning...
so 'sendReplicatorPackets' does the store on our behalf.
public byte getByteArray()
public void writeExternal(PofWriter writer)
public void readExternal(PofReader reader)
public String toString()
toString in class