Class InMemoryProcedureIterator
java.lang.Object
org.apache.hadoop.hbase.procedure2.store.InMemoryProcedureIterator
- All Implemented Interfaces:
ProcedureStore.ProcedureIterator
@Private
public class InMemoryProcedureIterator
extends Object
implements ProcedureStore.ProcedureIterator
A procedure iterator which holds all the procedure protos in memory. For fast access.
-
Field Summary
Modifier and TypeFieldDescriptionprivate ProtoAndProcedure
private Iterator<ProtoAndProcedure>
private final List<ProtoAndProcedure>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
boolean
hasNext()
Returns true if the iterator has more elements.boolean
Calling this method does not need to convert the protobuf message to the Procedure class, so if it returns true we can callProcedureStore.ProcedureIterator.skipNext()
to skip the procedure without deserializing.private void
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
-
Field Details
-
procs
-
iter
-
current
-
-
Constructor Details
-
InMemoryProcedureIterator
-
-
Method Details
-
reset
Description copied from interface:ProcedureStore.ProcedureIterator
Reset the Iterator by seeking to the beginning of the list.- Specified by:
reset
in interfaceProcedureStore.ProcedureIterator
-
hasNext
Description copied from interface:ProcedureStore.ProcedureIterator
Returns true if the iterator has more elements. (In other words, returns true if next() would return a Procedure rather than throwing an exception.)- Specified by:
hasNext
in interfaceProcedureStore.ProcedureIterator
- Returns:
- true if the iterator has more procedures
-
checkNext
-
isNextFinished
Description copied from interface:ProcedureStore.ProcedureIterator
Calling this method does not need to convert the protobuf message to the Procedure class, so if it returns true we can callProcedureStore.ProcedureIterator.skipNext()
to skip the procedure without deserializing. This could increase the performance.- Specified by:
isNextFinished
in interfaceProcedureStore.ProcedureIterator
- Returns:
- true if the iterator next element is a completed procedure.
-
moveToNext
-
skipNext
Description copied from interface:ProcedureStore.ProcedureIterator
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.- Specified by:
skipNext
in interfaceProcedureStore.ProcedureIterator
-
next
Description copied from interface:ProcedureStore.ProcedureIterator
Returns the next procedure in the iteration.- Specified by:
next
in interfaceProcedureStore.ProcedureIterator
- Returns:
- the next procedure in the iteration.
- Throws:
IOException
- if there was an error fetching/deserializing the procedure
-