private static final class WALProcedureTree.Iter extends Object implements ProcedureStore.ProcedureIterator
Modifier and Type | Field and Description |
---|---|
private WALProcedureTree.ProtoAndProc |
current |
private Iterator<WALProcedureTree.ProtoAndProc> |
iter |
private List<WALProcedureTree.ProtoAndProc> |
procs |
Constructor and Description |
---|
Iter(List<WALProcedureTree.ProtoAndProc> procs) |
Modifier and Type | Method and Description |
---|---|
private void |
checkNext() |
boolean |
hasNext()
Returns true if the iterator has more elements.
|
boolean |
isNextFinished()
Calling this method does not need to convert the protobuf message to the Procedure class, so
if it returns true we can call
ProcedureStore.ProcedureIterator.skipNext() to skip the procedure without
deserializing. |
private void |
moveToNext() |
Procedure<?> |
next()
Returns the next procedure in the iteration.
|
void |
reset()
Reset the Iterator by seeking to the beginning of the list.
|
void |
skipNext()
Skip the next procedure
This method is used to skip the deserializing of the procedure to increase performance, as
when calling next we need to convert the protobuf message to the Procedure class.
|
private final List<WALProcedureTree.ProtoAndProc> procs
private Iterator<WALProcedureTree.ProtoAndProc> iter
private WALProcedureTree.ProtoAndProc current
public Iter(List<WALProcedureTree.ProtoAndProc> procs)
public void reset()
ProcedureStore.ProcedureIterator
reset
in interface ProcedureStore.ProcedureIterator
public boolean hasNext()
ProcedureStore.ProcedureIterator
hasNext
in interface ProcedureStore.ProcedureIterator
private void checkNext()
public boolean isNextFinished()
ProcedureStore.ProcedureIterator
ProcedureStore.ProcedureIterator.skipNext()
to skip the procedure without
deserializing. This could increase the performance.isNextFinished
in interface ProcedureStore.ProcedureIterator
private void moveToNext()
public void skipNext()
ProcedureStore.ProcedureIterator
skipNext
in interface ProcedureStore.ProcedureIterator
public Procedure<?> next() throws IOException
ProcedureStore.ProcedureIterator
next
in interface ProcedureStore.ProcedureIterator
IOException
- if there was an error fetching/deserializing the procedureCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.