public class IteratorWrapper extends Object implements Iterator
| 构造器和说明 |
|---|
IteratorWrapper(IteratorImpl iterImpl) |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
boolean |
hasNext() |
ByteBuffer |
next() |
void |
setErrorAndRollback(long ntail,
Status st)
Invoked when some critical error occurred.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, removepublic IteratorWrapper(IteratorImpl iterImpl)
public boolean hasNext()
hasNext 在接口中 Iterator<ByteBuffer>public ByteBuffer next()
next 在接口中 Iterator<ByteBuffer>public ByteBuffer getData()
Iteratorpublic long getIndex()
Iteratorpublic long getTerm()
Iteratorpublic Closure done()
Iteratorpublic void setErrorAndRollback(long ntail,
Status st)
Iteratorntail - 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.