public interface QuorumPipeline<S extends HAPipelineGlue>
Quorum
defining
methods to replicating writes.Modifier and Type | Method and Description |
---|---|
long |
getLastCommitCounter()
Return the lastCommitCounter for this service (based on its current root
block).
|
long |
getLastCommitTime()
Return the lastCommitTime for this service (based on its current root
block).
|
UUID |
getStoreUUID()
The
UUID of the backing store. |
void |
logRootBlock(IRootBlockView rootBlock)
Log the root block for the commit point that closes the current write set
onto the
HALogWriter . |
void |
logWriteCacheBlock(IHAWriteMessage msg,
ByteBuffer data)
Log the
IHAWriteMessage and the associated data (if necessary). |
void |
purgeHALogs(long token)
Purge the local HA log files.
|
Future<Void> |
receiveAndReplicate(IHASyncRequest req,
IHASendState snd,
IHAWriteMessage msg)
Return a
Future for a task which will replicate an NIO buffer
along the write pipeline. |
Future<Void> |
replicate(IHASyncRequest req,
IHAWriteMessage msg,
ByteBuffer b)
Return a
Future for a task which will replicate an NIO buffer
along the write pipeline. |
Future<IHAPipelineResetResponse> |
resetPipeline(IHAPipelineResetRequest req)
Reset the pipeline (blocking).
|
Future<Void> replicate(IHASyncRequest req, IHAWriteMessage msg, ByteBuffer b) throws IOException
Future
for a task which will replicate an NIO buffer
along the write pipeline. This method is only invoked by the quorum
leader. The payload is replicated to the first follower in the write
pipeline. That follower will accept the payload (and replicate it if
necessary) using #receiveAndReplicate(IHAWriteMessage)
.
Note: The implementation of this method should be robust to changes in
the write pipeline. Specifically, if a follower leaves the write
pipeline, it should attempt to retransmit the message and the payload
while allowing time for the write pipeline to be reconfigured in response
to the related QuorumMember
events.
req
- A synchronization request (optional). This is only non-null
when historical WriteCache
blocks are being replayed
down the write pipeline in order to synchronize a service.msg
- The RMI metadata about the payload.b
- The payload. The bytes from the position to the limit will be
transmitted (note that the #of bytes remaining in the buffer
MUST agree with IHAWriteMessageBase.getSize()
).IOException
Future<Void> receiveAndReplicate(IHASyncRequest req, IHASendState snd, IHAWriteMessage msg) throws IOException
Future
for a task which will replicate an NIO buffer
along the write pipeline. This method is invoked for any node except the
master, including the last node in the failover chain.req
- A synchronization request (optional). This is only non-null
when historical WriteCache
blocks are being replayed
down the write pipeline in order to synchronize a service.snd
- Metadata about the state of the sender and potentially the
routing of the payload along the write replication pipeline.msg
- The RMI metadata about the payload.IOException
Future<IHAPipelineResetResponse> resetPipeline(IHAPipelineResetRequest req) throws IOException
HAReceiveService
(including the inner HASendService
). The
next message and payload relayed from the leader will cause new socket
connections to be established.msg
- The request.Future
for the operation on the local service.IOException
long getLastCommitTime()
IHAWriteMessage
which requires this
information as part of the metadata about replicated WriteCache
blocks.long getLastCommitCounter()
IHAWriteMessage
which requires this
information as part of the metadata about replicated WriteCache
blocks.void logWriteCacheBlock(IHAWriteMessage msg, ByteBuffer data) throws IOException
IHAWriteMessage
and the associated data (if necessary).
The log file for the current write set will be deleted if the quorum is
fully met at the next 2-phase commit.msg
- The IHAWriteMessage
.data
- The WriteCache
block.IOException
void logRootBlock(IRootBlockView rootBlock) throws IOException
HALogWriter
.
Note: This method is ONLY invoked as part of the 2-phase commit protocol. Therefore, this method ONLY applies to the live HALog file. A service is atomically either joined with the met quorum at a 2-phase commit point or not joined. The PREPARE and COMMIT messages are ONLY generated for services that were joined with the met quorum as of that atomic decision point in the commit protocol. Therefore, this method is never called for a service that was not joined as of that atomic decision point.
rootBlock
- The root block for the commit point that was just achieved.IOException
void purgeHALogs(long token)
Note: The open HALog file is NOT removed by this method.
token
- The quorum token. The quorum must remain fully met for this
token across this operation. If that invariant is violated
then the operation will terminate once this violation is
noticed.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.