public class HollowSparseIntegerSet extends java.lang.Object implements HollowTypeStateListener
Modifier and Type | Class and Description |
---|---|
static interface |
HollowSparseIntegerSet.IndexPredicate |
Modifier and Type | Field and Description |
---|---|
protected com.netflix.hollow.core.index.HollowSparseIntegerSet.SparseBitSet |
sparseBitSetVolatile |
Constructor and Description |
---|
HollowSparseIntegerSet(HollowReadStateEngine readStateEngine,
java.lang.String type,
java.lang.String fieldPath)
Create a index for integer values pointed by the given field path.
|
HollowSparseIntegerSet(HollowReadStateEngine readStateEngine,
java.lang.String type,
java.lang.String fieldPath,
HollowSparseIntegerSet.IndexPredicate predicate)
Create a index for integer values based on the given IndexPredicate.
|
Modifier and Type | Method and Description |
---|---|
void |
addedOrdinal(int ordinal)
Called once for each record which is added to the registered type.
|
void |
beginUpdate()
Called immediately before a delta update is applied to the state engine
|
protected void |
build() |
int |
cardinality() |
protected void |
compact() |
void |
detachFromDeltaUpdates()
Stop delta updates for this index.
|
void |
endUpdate()
Called immediately after a delta update is applied to the state engine.
|
boolean |
get(int i)
Check if the given value is contained in the set (or if the given value satisfies the predicate condition.)
|
protected void |
initSet(int maxValue) |
void |
listenForDeltaUpdates()
Use this method to keep the index updated with delta changes on the read state engine.
|
void |
removedOrdinal(int ordinal)
Called once for each record which is removed from the registered type.
|
protected void |
set(int ordinal) |
long |
size()
Estimate the total number of bits used to represent the integer set.
|
protected volatile com.netflix.hollow.core.index.HollowSparseIntegerSet.SparseBitSet sparseBitSetVolatile
public HollowSparseIntegerSet(HollowReadStateEngine readStateEngine, java.lang.String type, java.lang.String fieldPath)
readStateEngine
- the read statetype
- the type namefieldPath
- the field pathpublic HollowSparseIntegerSet(HollowReadStateEngine readStateEngine, java.lang.String type, java.lang.String fieldPath, HollowSparseIntegerSet.IndexPredicate predicate)
readStateEngine
- HollowReadStateEngine to read data set.type
- type which contains the path to integer values for indexing.fieldPath
- path to the integer valuespredicate
- implementation of IndexPredicate, indicating if the record passes the condition for indexing.protected void build()
protected void initSet(int maxValue)
protected void set(int ordinal)
protected void compact()
public boolean get(int i)
i
- the integer valuetrue
if the value is presentpublic long size()
public int cardinality()
public void listenForDeltaUpdates()
public void detachFromDeltaUpdates()
public void beginUpdate()
HollowTypeStateListener
beginUpdate
in interface HollowTypeStateListener
public void addedOrdinal(int ordinal)
HollowTypeStateListener
addedOrdinal
in interface HollowTypeStateListener
ordinal
- the ordinal of an object that was addedpublic void removedOrdinal(int ordinal)
HollowTypeStateListener
removedOrdinal
in interface HollowTypeStateListener
ordinal
- the ordinal of an object that was removedpublic void endUpdate()
HollowTypeStateListener
endUpdate
in interface HollowTypeStateListener