public interface Iterator extends Iterator<ByteBuffer>
StateMachine.onApply(Iterator)| 限定符和类型 | 方法和说明 |
|---|---|
Closure |
done()
If done() is non-NULL, you must call done()->Run() after applying this
task no matter this operation succeeds or fails, otherwise the
corresponding resources would leak.
|
ByteBuffer |
getData()
Return the data whose content is the same as what was passed to
Node#apply(Task) in the leader node.
|
long |
getIndex()
Return a unique and monotonically increasing identifier of the current task:
- Uniqueness guarantees that committed tasks in different peers with
the same index are always the same and kept unchanged
|
long |
getTerm()
Returns the term of the leader which to task was applied to.
|
void |
setErrorAndRollback(long ntail,
Status st)
Invoked when some critical error occurred.
|
forEachRemaining, hasNext, next, removeByteBuffer getData()
long getIndex()
long getTerm()
Closure done()
void setErrorAndRollback(long ntail,
Status st)
ntail - the number of tasks (starting from the last iterated one) considered as not to be applied.st - Status to describe the detail of the error.Copyright © 2021. All rights reserved.