public interface RaftIntegration
Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable task)
Executes the task on underlying task execution mechanism.
|
Object |
getAppendedEntryOnLeaderElection()
Returns the entry to be appended if the no-op entry append on leader
election feature is enabled.
|
ILogger |
getLogger(String name)
Returns an
ILogger instance for given name. |
boolean |
isReachable(Endpoint endpoint)
Returns true if the endpoint is reachable by the time this method
is called, false otherwise.
|
boolean |
isReady()
Returns true if underlying platform is ready to operate,
false otherwise.
|
SimpleCompletableFuture |
newCompletableFuture()
Creates a new instance of
SimpleCompletableFuture . |
void |
onNodeStatusChange(RaftNodeStatus status)
Called when RaftNode status changes.
|
void |
restoreSnapshot(Object operation,
long commitIndex)
Restores the snapshot with the given operation for the given commit
index
|
Object |
runOperation(Object operation,
long commitIndex)
Executes the operation on underlying operation execution mechanism
and returns its return value.
|
void |
schedule(Runnable task,
long delay,
TimeUnit timeUnit)
Schedules the task on underlying scheduling mechanism.
|
boolean |
send(AppendFailureResponse response,
Endpoint target)
Sends the
AppendFailureResponse to target endpoint to be handled
by its RaftNode.handleAppendResponse(AppendFailureResponse) . |
boolean |
send(AppendRequest request,
Endpoint target)
Sends the
AppendRequest to target endpoint to be handled by
its RaftNode.handleAppendRequest(AppendRequest) . |
boolean |
send(AppendSuccessResponse response,
Endpoint target)
Sends the
AppendSuccessResponse to target endpoint to be handled
by its RaftNode.handleAppendResponse(AppendSuccessResponse) . |
boolean |
send(InstallSnapshot request,
Endpoint target)
Sends the
InstallSnapshot to target endpoint to be handled by
its RaftNode.handleInstallSnapshot(InstallSnapshot) . |
boolean |
send(PreVoteRequest request,
Endpoint target)
Sends the
PreVoteRequest to target endpoint to be handled by
its RaftNode.handlePreVoteRequest(PreVoteRequest) . |
boolean |
send(PreVoteResponse response,
Endpoint target)
Sends the
PreVoteResponse to target endpoint to be handled by
its RaftNode.handlePreVoteResponse(PreVoteResponse) . |
boolean |
send(VoteRequest request,
Endpoint target)
Sends the
VoteRequest to target endpoint to be handled by
its RaftNode.handleVoteRequest(VoteRequest) . |
boolean |
send(VoteResponse response,
Endpoint target)
Sends the
VoteResponse to target endpoint to be handled by
its RaftNode.handleVoteResponse(VoteResponse) . |
Object |
takeSnapshot(long commitIndex)
Take a snapshot for the given commit index which is the current commit
index
|
ILogger getLogger(String name)
ILogger
instance for given name.name
- logger nameboolean isReady()
boolean isReachable(Endpoint endpoint)
endpoint
- endpointboolean send(PreVoteRequest request, Endpoint target)
PreVoteRequest
to target endpoint to be handled by
its RaftNode.handlePreVoteRequest(PreVoteRequest)
.boolean send(PreVoteResponse response, Endpoint target)
PreVoteResponse
to target endpoint to be handled by
its RaftNode.handlePreVoteResponse(PreVoteResponse)
.boolean send(VoteRequest request, Endpoint target)
VoteRequest
to target endpoint to be handled by
its RaftNode.handleVoteRequest(VoteRequest)
.boolean send(VoteResponse response, Endpoint target)
VoteResponse
to target endpoint to be handled by
its RaftNode.handleVoteResponse(VoteResponse)
.boolean send(AppendRequest request, Endpoint target)
AppendRequest
to target endpoint to be handled by
its RaftNode.handleAppendRequest(AppendRequest)
.boolean send(AppendSuccessResponse response, Endpoint target)
AppendSuccessResponse
to target endpoint to be handled
by its RaftNode.handleAppendResponse(AppendSuccessResponse)
.boolean send(AppendFailureResponse response, Endpoint target)
AppendFailureResponse
to target endpoint to be handled
by its RaftNode.handleAppendResponse(AppendFailureResponse)
.boolean send(InstallSnapshot request, Endpoint target)
InstallSnapshot
to target endpoint to be handled by
its RaftNode.handleInstallSnapshot(InstallSnapshot)
.Object runOperation(Object operation, long commitIndex)
operation
- raft operationcommitIndex
- commit indexObject takeSnapshot(long commitIndex)
commitIndex
- commit indexSnapshotEntry
void restoreSnapshot(Object operation, long commitIndex)
operation
- snapshot operation provided by takeSnapshot(long)
commitIndex
- commit index of the snapshotvoid execute(Runnable task)
task
- the taskvoid schedule(Runnable task, long delay, TimeUnit timeUnit)
task
- the taskdelay
- the time from now to delay executiontimeUnit
- the time unit of the delaySimpleCompletableFuture newCompletableFuture()
SimpleCompletableFuture
.Object getAppendedEntryOnLeaderElection()
See Bug in single-server membership changes post by Diego Ongaro for more info.
void onNodeStatusChange(RaftNodeStatus status)
status
- new statusCopyright © 2021 Hazelcast, Inc.. All Rights Reserved.