public final class BitmapIndexStore extends BaseIndexStore
Internally, manages a Bitmap
instance along with key remapping
structures used to establish the correspondence between long bitmap keys and
actual user-provided keys.
Constructor and Description |
---|
BitmapIndexStore(IndexDefinition definition,
InternalSerializationService serializationService,
Extractors extractors) |
Modifier and Type | Method and Description |
---|---|
boolean |
canEvaluate(Class<? extends Predicate> predicateClass) |
Comparable |
canonicalizeQueryArgumentScalar(Comparable value)
Canonicalizes the given value for the purpose of a hash-based lookup.
|
void |
clear()
Clears the contents of this index by purging all its entries.
|
Set<QueryableEntry> |
evaluate(Predicate predicate,
TypeConverter converter)
Evaluates the given predicate using this index store.
|
Set<QueryableEntry> |
getRecords(Comparable value)
Obtains entries that have indexed attribute value equal to the given
value.
|
Set<QueryableEntry> |
getRecords(Comparable from,
boolean fromInclusive,
Comparable to,
boolean toInclusive)
Obtains entries that have indexed attribute value belonging to the given
range.
|
Set<QueryableEntry> |
getRecords(Comparison comparison,
Comparable value)
Obtains entries that have indexed attribute value satisfying the given
comparison with the given value.
|
Set<QueryableEntry> |
getRecords(Set<Comparable> values)
Obtains entries that have indexed attribute value equal to one of the
given set of values.
|
void |
insert(Object value,
QueryableEntry entry,
IndexOperationStats operationStats)
Inserts the given entry into this index store under the given value
acting as an index key.
|
boolean |
isEvaluateOnly() |
void |
remove(Object value,
Data entryKey,
Object entryValue,
IndexOperationStats operationStats)
Removes the existing entry mapping in this index.
|
void |
update(Object oldValue,
Object newValue,
QueryableEntry entry,
IndexOperationStats operationStats)
Updates the existing entry mapping in this index by remapping it from the
given old value to the new given value.
|
destroy
public BitmapIndexStore(IndexDefinition definition, InternalSerializationService serializationService, Extractors extractors)
public Comparable canonicalizeQueryArgumentScalar(Comparable value)
IndexStore
The method is used while performing InPredicate queries to canonicalize the set of values in question, so additional duplicate-eliminating post-processing step can be avoided.
The main difference comparing to BaseIndexStore.canonicalizeScalarForStorage(java.lang.Comparable)
is that this method is specifically designed to support the
canonicalization of transient non-persistent values (think of query
arguments), so a more efficient representation may chosen.
value
- the value to canonicalize.public void insert(Object value, QueryableEntry entry, IndexOperationStats operationStats)
IndexStore
value
- the value to insert the entry under.entry
- the entry to insert.operationStats
- the operation stats to update while performing the
operation.Index.putEntry(com.hazelcast.query.impl.QueryableEntry, java.lang.Object, com.hazelcast.query.impl.Index.OperationSource)
,
IndexOperationStats.onEntryAdded(java.lang.Object, java.lang.Object)
public void update(Object oldValue, Object newValue, QueryableEntry entry, IndexOperationStats operationStats)
IndexStore
The update operation is logically equivalent to removing the old mapping and inserting the new one.
oldValue
- the value to remap the entry from.newValue
- the new value to remap the entry to.entry
- the entry to remap.operationStats
- the operation stats to update while performing the
operation.IndexStore.remove(java.lang.Object, com.hazelcast.nio.serialization.Data, java.lang.Object, com.hazelcast.monitor.impl.IndexOperationStats)
,
IndexStore.insert(java.lang.Object, com.hazelcast.query.impl.QueryableEntry, com.hazelcast.monitor.impl.IndexOperationStats)
,
Index.putEntry(com.hazelcast.query.impl.QueryableEntry, java.lang.Object, com.hazelcast.query.impl.Index.OperationSource)
,
IndexOperationStats.onEntryRemoved(java.lang.Object)
,
IndexOperationStats.onEntryAdded(java.lang.Object, java.lang.Object)
public void remove(Object value, Data entryKey, Object entryValue, IndexOperationStats operationStats)
IndexStore
value
- the value to remove the mapping from.entryKey
- the entry key to remove the mapping to.entryValue
- the entry value to remove the mapping to.operationStats
- the operation stats to update while performing the
operation.Index.removeEntry(com.hazelcast.nio.serialization.Data, java.lang.Object, com.hazelcast.query.impl.Index.OperationSource)
,
IndexOperationStats.onEntryRemoved(java.lang.Object)
public void clear()
IndexStore
public boolean isEvaluateOnly()
true
if this index store supports querying only with
IndexStore.evaluate(com.hazelcast.query.Predicate, com.hazelcast.core.TypeConverter)
method, false
otherwise.public boolean canEvaluate(Class<? extends Predicate> predicateClass)
true
if this index store can evaluate a predicate of the
given predicate class, false
otherwise.public Set<QueryableEntry> evaluate(Predicate predicate, TypeConverter converter)
IndexStore
predicate
- the predicate to evaluate. The predicate is guaranteed
to be evaluable by this index store (canEvaluate
returned true
for its class).public Set<QueryableEntry> getRecords(Comparable value)
IndexStore
value
- the value to obtains the entries for.Index.getRecords(Comparable)
public Set<QueryableEntry> getRecords(Set<Comparable> values)
IndexStore
values
- the values to obtains the entries for.Index.getRecords(Comparable[])
public Set<QueryableEntry> getRecords(Comparison comparison, Comparable value)
IndexStore
comparison
- the comparison to perform.value
- the value to perform the comparison with.Index.getRecords(Comparison, Comparable)
public Set<QueryableEntry> getRecords(Comparable from, boolean fromInclusive, Comparable to, boolean toInclusive)
IndexStore
from
- the beginning of the range.fromInclusive
- true
if the beginning of the range is
inclusive, false
otherwise.to
- the end of the range.toInclusive
- true
if the end of the range is inclusive,
false
otherwise.Index.getRecords(Comparable, boolean, Comparable, boolean)
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.