@InterfaceAudience.Private class BitSetNode extends Object
BitSetNode
(if certain conditions are met).
Boundaries of bitmap are aligned to multiples of BITS_PER_WORD
. So the range
of a BitSetNode
is from [x * K, y * K) where x and y are integers, y > x and K is
BITS_PER_WORD.
We have two main bit sets to describe the state of procedures, the meanings are:
---------------------- | modified | deleted | meaning | 0 | 0 | proc exists, but hasn't been updated since last resetUpdates(). | 1 | 0 | proc was updated (but not deleted). | 1 | 1 | proc was deleted. | 0 | 1 | proc doesn't exist (maybe never created, maybe deleted in past). ----------------------The meaning of modified is that, we have modified the state of the procedure, no matter insert, update, or delete. And if it is an insert or update, we will set the deleted to 0, if not we will set the delete to 1. For a non-partial BitSetNode, the initial modified value is 0 and deleted value is 1. For the partial one, the initial modified value is 0 and the initial deleted value is also 0. In
unsetPartialFlag()
we will reset the deleted to 1 if it is not modified.Modifier and Type | Field and Description |
---|---|
private static int |
ADDRESS_BITS_PER_WORD |
private static int |
BITS_PER_WORD |
private long[] |
deleted
Keeps track of procedure ids which belong to this bitmap's range and have been deleted.
|
private static int |
MAX_NODE_SIZE |
private long[] |
modified
Set of procedures which have been modified since last
resetModified() . |
private boolean |
partial
Mimics
ProcedureStoreTracker.partial . |
private long |
start
Offset of bitmap i.e.
|
private static long |
WORD_MASK |
Constructor and Description |
---|
BitSetNode(BitSetNode other,
boolean resetDelete) |
BitSetNode(long procId,
boolean partial) |
BitSetNode(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker.TrackerNode data) |
Modifier and Type | Method and Description |
---|---|
private static long |
alignDown(long x) |
private static long |
alignUp(long x) |
boolean |
canGrow(long procId) |
boolean |
canMerge(BitSetNode rightNode) |
boolean |
contains(long procId) |
org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker.TrackerNode |
convert()
Convert to
org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureStoreTracker.TrackerNode
protobuf.
|
void |
delete(long procId) |
void |
dump() |
long |
getActiveMaxProcId() |
long |
getActiveMinProcId() |
long[] |
getActiveProcIds() |
private int |
getBitmapIndex(long procId) |
long |
getEnd()
Inclusive.
|
long |
getStart() |
void |
grow(long procId) |
void |
insertOrUpdate(long procId) |
boolean |
isAllModified() |
ProcedureStoreTracker.DeleteState |
isDeleted(long procId) |
boolean |
isEmpty() |
boolean |
isModified(long procId) |
void |
merge(BitSetNode rightNode) |
void |
resetModified() |
String |
toString() |
void |
unsetPartialFlag() |
(package private) void |
updateState(long procId,
boolean isDeleted) |
private static final long WORD_MASK
private static final int ADDRESS_BITS_PER_WORD
private static final int BITS_PER_WORD
private static final int MAX_NODE_SIZE
private boolean partial
ProcedureStoreTracker.partial
. It will effect how we fill the new deleted bits
when growing.private long[] modified
resetModified()
. Useful to track
procedures which have been modified since last WAL write.private long[] deleted
private long start
public BitSetNode(long procId, boolean partial)
public BitSetNode(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker.TrackerNode data)
public BitSetNode(BitSetNode other, boolean resetDelete)
public void dump()
public void insertOrUpdate(long procId)
public void delete(long procId)
public long getStart()
public long getEnd()
public boolean contains(long procId)
public ProcedureStoreTracker.DeleteState isDeleted(long procId)
public boolean isModified(long procId)
public boolean isAllModified()
public long[] getActiveProcIds()
public boolean isEmpty()
public void resetModified()
public void unsetPartialFlag()
public org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker.TrackerNode convert()
public boolean canGrow(long procId)
public boolean canMerge(BitSetNode rightNode)
public void grow(long procId)
public void merge(BitSetNode rightNode)
public long getActiveMinProcId()
public long getActiveMaxProcId()
private int getBitmapIndex(long procId)
void updateState(long procId, boolean isDeleted)
private static long alignUp(long x)
private static long alignDown(long x)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.