@Deprecated @InterfaceAudience.Private class ProcedureStoreTracker extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ProcedureStoreTracker.DeleteState
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
keepDeletes
Deprecated.
If true, do not remove bits corresponding to deleted procedures.
|
private static org.slf4j.Logger |
LOG
Deprecated.
|
private TreeMap<Long,BitSetNode> |
map
Deprecated.
|
private long |
maxModifiedProcId
Deprecated.
|
private long |
minModifiedProcId
Deprecated.
|
(package private) boolean |
partial
Deprecated.
If true, it means tracker has incomplete information about the active/deleted procedures.
|
Constructor and Description |
---|
ProcedureStoreTracker()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
private BitSetNode |
delete(BitSetNode node,
long procId)
Deprecated.
|
void |
delete(long procId)
Deprecated.
|
void |
delete(long[] procIds)
Deprecated.
|
void |
dump()
Deprecated.
|
long |
getActiveMinProcId()
Deprecated.
|
long[] |
getAllActiveProcIds()
Deprecated.
Will be used when there are too many proc wal files.
|
long |
getModifiedMaxProcId()
Deprecated.
|
long |
getModifiedMinProcId()
Deprecated.
|
private BitSetNode |
getOrCreateNode(long procId)
Deprecated.
|
private BitSetNode |
growNode(BitSetNode node,
long procId)
Deprecated.
Grows
node to contain procId and updates the map. |
private BitSetNode |
insert(BitSetNode node,
long procId)
Deprecated.
|
void |
insert(long procId)
Deprecated.
|
void |
insert(long[] procIds)
Deprecated.
|
void |
insert(long procId,
long[] subProcIds)
Deprecated.
|
boolean |
isAllModified()
Deprecated.
|
ProcedureStoreTracker.DeleteState |
isDeleted(long procId)
Deprecated.
If
partial is false, returns state from the bitmap. |
boolean |
isEmpty()
Deprecated.
Returns true, if no procedure is active, else false.
|
boolean |
isModified(long procId)
Deprecated.
|
boolean |
isPartial()
Deprecated.
|
private BitSetNode |
lookupClosestNode(BitSetNode node,
long procId)
Deprecated.
lookup the node containing the specified procId.
|
private BitSetNode |
mergeNodes(BitSetNode leftNode,
BitSetNode rightNode)
Deprecated.
Merges
leftNode & rightNode and updates the map. |
void |
reset()
Deprecated.
|
void |
resetModified()
Deprecated.
Clears the list of updated procedure ids.
|
void |
resetTo(ProcedureStoreTracker tracker)
Deprecated.
Resets internal state to same as given
tracker . |
void |
resetTo(ProcedureStoreTracker tracker,
boolean resetDelete)
Deprecated.
Resets internal state to same as given
tracker , and change the deleted flag according
to the modified flag if resetDelete is true. |
void |
resetToProto(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker trackerProtoBuf)
Deprecated.
|
void |
setDeleted(long procId,
boolean isDeleted)
Deprecated.
This method is used when restarting where we need to rebuild the ProcedureStoreTracker.
|
void |
setDeletedIfDeletedByThem(ProcedureStoreTracker tracker)
Deprecated.
For the global tracker, we will use this method to build the holdingCleanupTracker, as the
modified flags will be cleared after rolling so we only need to test the deleted flags.
|
void |
setDeletedIfModified(long... procId)
Deprecated.
Set the given bit for the procId to delete if it was modified before.
|
void |
setDeletedIfModifiedInBoth(ProcedureStoreTracker tracker)
Deprecated.
|
private void |
setDeleteIf(ProcedureStoreTracker tracker,
BiFunction<BitSetNode,Long,Boolean> func)
Deprecated.
|
void |
setKeepDeletes(boolean keepDeletes)
Deprecated.
|
void |
setMinMaxModifiedProcIds(long min,
long max)
Deprecated.
Will be called when restarting where we need to rebuild the ProcedureStoreTracker.
|
void |
setPartialFlag(boolean isPartial)
Deprecated.
|
org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker |
toProto()
Deprecated.
Builds org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureStoreTracker
protocol buffer from current state.
|
private void |
trackProcIds(long procId)
Deprecated.
|
private BitSetNode |
update(BitSetNode node,
long procId)
Deprecated.
|
void |
update(long procId)
Deprecated.
|
private static final org.slf4j.Logger LOG
private final TreeMap<Long,BitSetNode> map
private boolean keepDeletes
boolean partial
isDeleted(long)
docs to understand
it's real use.private long minModifiedProcId
private long maxModifiedProcId
ProcedureStoreTracker()
public void resetToProto(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker trackerProtoBuf)
public void resetTo(ProcedureStoreTracker tracker)
tracker
. Does deep copy of the bitmap.public void resetTo(ProcedureStoreTracker tracker, boolean resetDelete)
tracker
, and change the deleted flag according
to the modified flag if resetDelete
is true. Does deep copy of the bitmap.
The resetDelete
will be set to true when building cleanup tracker, please see the
comments in BitSetNode(BitSetNode, boolean)
to learn how we change the
deleted flag if resetDelete
is true.public void insert(long procId)
public void insert(long[] procIds)
public void insert(long procId, long[] subProcIds)
private BitSetNode insert(BitSetNode node, long procId)
public void update(long procId)
private BitSetNode update(BitSetNode node, long procId)
public void delete(long procId)
public void delete(long[] procIds)
private BitSetNode delete(BitSetNode node, long procId)
public void setMinMaxModifiedProcIds(long min, long max)
public void setDeleted(long procId, boolean isDeleted)
delete(long)
method above assume that the BitSetNode
exists, but when restart
this is not true, as we will read the wal files in reverse order so a delete may come first.public void setDeletedIfModified(long... procId)
private void setDeleteIf(ProcedureStoreTracker tracker, BiFunction<BitSetNode,Long,Boolean> func)
public void setDeletedIfDeletedByThem(ProcedureStoreTracker tracker)
public void setDeletedIfModifiedInBoth(ProcedureStoreTracker tracker)
setDeletedIfModified(long...)
, but here the procId
are given by
the tracker
. If a procedure is modified by us, and also by the given tracker
,
then we mark it as deleted.setDeletedIfModified(long...)
private BitSetNode lookupClosestNode(BitSetNode node, long procId)
node
- cached node to check before doing a lookupprocId
- the procId to lookupprivate void trackProcIds(long procId)
public long getModifiedMinProcId()
public long getModifiedMaxProcId()
public void reset()
public boolean isModified(long procId)
public ProcedureStoreTracker.DeleteState isDeleted(long procId)
partial
is false, returns state from the bitmap. If no state is found for
procId
, returns YES. If partial is true, tracker doesn't have complete view of system
state, so it returns MAYBE if there is no update for the procedure or if it doesn't have a
state in bitmap. Otherwise, returns state from the bitmap.public long getActiveMinProcId()
public void setKeepDeletes(boolean keepDeletes)
public boolean isPartial()
public void setPartialFlag(boolean isPartial)
public boolean isEmpty()
public boolean isAllModified()
resetModified()
.public long[] getAllActiveProcIds()
public void resetModified()
private BitSetNode getOrCreateNode(long procId)
private BitSetNode growNode(BitSetNode node, long procId)
node
to contain procId
and updates the map.BitSetNode
instance which contains procId
.private BitSetNode mergeNodes(BitSetNode leftNode, BitSetNode rightNode)
leftNode
& rightNode
and updates the map.public void dump()
public org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker toProto() throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.