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
FieldsModifier and TypeFieldDescriptionprivate ProtoAndProcedureprivate Iterator<ProtoAndProcedure>private final List<ProtoAndProcedure> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbooleanhasNext()Returns true if the iterator has more elements.booleanCalling 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 voidProcedure<?>next()Returns the next procedure in the iteration.voidreset()Reset the Iterator by seeking to the beginning of the list.voidskipNext()Skip the next procedure
-
Field Details
-
procs
-
iter
-
current
-
-
Constructor Details
-
InMemoryProcedureIterator
-
-
Method Details
-
reset
Description copied from interface:ProcedureStore.ProcedureIteratorReset the Iterator by seeking to the beginning of the list.- Specified by:
resetin interfaceProcedureStore.ProcedureIterator
-
hasNext
Description copied from interface:ProcedureStore.ProcedureIteratorReturns 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:
hasNextin interfaceProcedureStore.ProcedureIterator- Returns:
- true if the iterator has more procedures
-
checkNext
-
isNextFinished
Description copied from interface:ProcedureStore.ProcedureIteratorCalling 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:
isNextFinishedin interfaceProcedureStore.ProcedureIterator- Returns:
- true if the iterator next element is a completed procedure.
-
moveToNext
-
skipNext
Description copied from interface:ProcedureStore.ProcedureIteratorSkip 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:
skipNextin interfaceProcedureStore.ProcedureIterator
-
next
Description copied from interface:ProcedureStore.ProcedureIteratorReturns the next procedure in the iteration.- Specified by:
nextin interfaceProcedureStore.ProcedureIterator- Returns:
- the next procedure in the iteration.
- Throws:
IOException- if there was an error fetching/deserializing the procedure
-