@Deprecated @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
Deprecated.
|
private static int |
BITS_PER_WORD
Deprecated.
|
private long[] |
deleted
Deprecated.
Keeps track of procedure ids which belong to this bitmap's range and have been deleted.
|
private static int |
MAX_NODE_SIZE
Deprecated.
|
private long[] |
modified
Deprecated.
Set of procedures which have been modified since last
resetModified() . |
private boolean |
partial
Deprecated.
Mimics
ProcedureStoreTracker.partial . |
private long |
start
Deprecated.
Offset of bitmap i.e.
|
private static long |
WORD_MASK
Deprecated.
|
Constructor and Description |
---|
BitSetNode(BitSetNode other,
boolean resetDelete)
Deprecated.
|
BitSetNode(long procId,
boolean partial)
Deprecated.
|
BitSetNode(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker.TrackerNode data)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
private static long |
alignDown(long x)
Deprecated.
Returns lower boundary (aligned to multiple of BITS_PER_WORD) of bitmap range x belongs to.
|
private static long |
alignUp(long x)
Deprecated.
Returns upper boundary (aligned to multiple of BITS_PER_WORD) of bitmap range x belongs to.
|
boolean |
canGrow(long procId)
Deprecated.
|
boolean |
canMerge(BitSetNode rightNode)
Deprecated.
|
boolean |
contains(long procId)
Deprecated.
|
org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureStoreTracker.TrackerNode |
convert()
Deprecated.
Convert to
org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureStoreTracker.TrackerNode
protobuf.
|
void |
delete(long procId)
Deprecated.
|
void |
dump()
Deprecated.
|
long |
getActiveMaxProcId()
Deprecated.
|
long |
getActiveMinProcId()
Deprecated.
|
long[] |
getActiveProcIds()
Deprecated.
Returns all the active procedure ids in this bit set.
|
private int |
getBitmapIndex(long procId)
Deprecated.
|
long |
getEnd()
Deprecated.
Inclusive.
|
long |
getStart()
Deprecated.
|
void |
grow(long procId)
Deprecated.
|
void |
insertOrUpdate(long procId)
Deprecated.
|
boolean |
isAllModified()
Deprecated.
Returns true, if all the procedures has been modified.
|
ProcedureStoreTracker.DeleteState |
isDeleted(long procId)
Deprecated.
|
boolean |
isEmpty()
Deprecated.
Returns true, if there are no active procedures in this BitSetNode, else false.
|
boolean |
isModified(long procId)
Deprecated.
|
void |
merge(BitSetNode rightNode)
Deprecated.
|
void |
resetModified()
Deprecated.
|
String |
toString()
Deprecated.
|
void |
unsetPartialFlag()
Deprecated.
|
(package private) void |
updateState(long procId,
boolean isDeleted)
Deprecated.
|
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.