@InterfaceAudience.Private public class ProcedureStoreTracker extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ProcedureStoreTracker.DeleteState |
| Constructor and Description |
|---|
ProcedureStoreTracker() |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(long procId) |
void |
delete(long[] procIds) |
void |
dump() |
long |
getActiveMinProcId() |
long[] |
getAllActiveProcIds()
Will be used when there are too many proc wal files.
|
long |
getModifiedMaxProcId() |
long |
getModifiedMinProcId() |
void |
insert(long procId) |
void |
insert(long[] procIds) |
void |
insert(long procId,
long[] subProcIds) |
boolean |
isAllModified() |
ProcedureStoreTracker.DeleteState |
isDeleted(long procId)
If
partial is false, returns state from the bitmap. |
boolean |
isEmpty() |
boolean |
isModified(long procId) |
boolean |
isPartial() |
void |
reset() |
void |
resetModified()
Clears the list of updated procedure ids.
|
void |
resetTo(ProcedureStoreTracker tracker)
Resets internal state to same as given
tracker. |
void |
resetTo(ProcedureStoreTracker tracker,
boolean resetDelete)
Resets internal state to same as given
tracker, and change the deleted flag according
to the modified flag if resetDelete is true. |
void |
resetToProto(ProcedureProtos.ProcedureStoreTracker trackerProtoBuf) |
void |
setDeleted(long procId,
boolean isDeleted)
This method is used when restarting where we need to rebuild the ProcedureStoreTracker.
|
void |
setDeletedIfDeletedByThem(ProcedureStoreTracker tracker)
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)
Set the given bit for the procId to delete if it was modified before.
|
void |
setDeletedIfModifiedInBoth(ProcedureStoreTracker tracker)
|
void |
setKeepDeletes(boolean keepDeletes) |
void |
setMinMaxModifiedProcIds(long min,
long max)
Will be called when restarting where we need to rebuild the ProcedureStoreTracker.
|
void |
setPartialFlag(boolean isPartial) |
ProcedureProtos.ProcedureStoreTracker |
toProto()
Builds
org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureStoreTracker
protocol buffer from current state.
|
void |
update(long procId) |
public void resetToProto(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(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)
public void update(long procId)
public void delete(long procId)
public void delete(long[] procIds)
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)
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...)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()
public void dump()
public ProcedureProtos.ProcedureStoreTracker toProto() throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.