public class ReadOnlyServiceImpl extends Object implements ReadOnlyService, FSMCaller.LastAppliedLogIndexListener
| 构造器和说明 |
|---|
ReadOnlyServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addRequest(byte[] reqCtx,
ReadIndexClosure closure)
Adds a ReadIndex request.
|
boolean |
init(ReadOnlyServiceOptions opts)
Initialize the service.
|
void |
join()
Waits for service shutdown.
|
void |
onApplied(long appliedIndex)
Called when lastAppliedIndex updates.
|
void |
setError(RaftException error)
Called when the node is turned into error state.
|
void |
shutdown()
Dispose the resources for service.
|
public boolean init(ReadOnlyServiceOptions opts)
Lifecycleinit 在接口中 Lifecycle<ReadOnlyServiceOptions>public void setError(RaftException error)
ReadOnlyServicesetError 在接口中 ReadOnlyServiceerror - error with raft infopublic void shutdown()
Lifecycleshutdown 在接口中 Lifecycle<ReadOnlyServiceOptions>public void join()
throws InterruptedException
ReadOnlyServicejoin 在接口中 ReadOnlyServiceInterruptedException - if the current thread is interrupted
while waitingpublic void addRequest(byte[] reqCtx,
ReadIndexClosure closure)
ReadOnlyServiceaddRequest 在接口中 ReadOnlyServicereqCtx - request context of readIndexclosure - callbackpublic void onApplied(long appliedIndex)
onApplied 在接口中 FSMCaller.LastAppliedLogIndexListenerappliedIndex - applied indexCopyright © 2021. All rights reserved.