Class ProcedureTree
java.lang.Object
org.apache.hadoop.hbase.procedure2.store.ProcedureTree
Used to build the tree for procedures.
We will group the procedures with the root procedure, and then validate each group. For each
group of procedures(with the same root procedure), we will collect all the stack ids, if the max
stack id is n, then all the stack ids should be from 0 to n, non-repetition and non-omission. If
not, we will consider all the procedures in this group as corrupted. Please see the code in
checkReady(Entry, Map) method.
For the procedures not in any group, i.e, can not find the root procedure for these procedures,
we will also consider them as corrupted. Please see the code in checkOrphan(Map) method.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ProtoAndProcedure>private static final org.slf4j.Loggerprivate final List<ProtoAndProcedure> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddAllToCorruptedAndRemoveFromProcMap(ProcedureTree.Entry entry, Map<Long, ProcedureTree.Entry> remainingProcMap) private voidaddAllToValidAndRemoveFromProcMap(ProcedureTree.Entry entry, Map<Long, ProcedureTree.Entry> remainingProcMap) static ProcedureTreebuild(Collection<org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure> procedures) private List<ProcedureTree.Entry>buildTree(Map<Long, ProcedureTree.Entry> procMap) private voidcheckOrphan(Map<Long, ProcedureTree.Entry> procMap) private voidcheckReady(ProcedureTree.Entry rootEntry, Map<Long, ProcedureTree.Entry> remainingProcMap) private voidcollectStackId(ProcedureTree.Entry entry, Map<Integer, List<ProcedureTree.Entry>> stackId2Proc, org.apache.commons.lang3.mutable.MutableInt maxStackId)
-
Field Details
-
LOG
-
validProcs
-
corruptedProcs
-
-
Constructor Details
-
ProcedureTree
-
-
Method Details
-
buildTree
-
collectStackId
private void collectStackId(ProcedureTree.Entry entry, Map<Integer, List<ProcedureTree.Entry>> stackId2Proc, org.apache.commons.lang3.mutable.MutableInt maxStackId) -
addAllToCorruptedAndRemoveFromProcMap
private void addAllToCorruptedAndRemoveFromProcMap(ProcedureTree.Entry entry, Map<Long, ProcedureTree.Entry> remainingProcMap) -
addAllToValidAndRemoveFromProcMap
private void addAllToValidAndRemoveFromProcMap(ProcedureTree.Entry entry, Map<Long, ProcedureTree.Entry> remainingProcMap) -
checkReady
private void checkReady(ProcedureTree.Entry rootEntry, Map<Long, ProcedureTree.Entry> remainingProcMap) -
checkOrphan
-
getValidProcs
-
getCorruptedProcs
-
build
public static ProcedureTree build(Collection<org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure> procedures)
-