public interface Index
Modifier and Type | Interface and Description |
---|---|
static class |
Index.OperationSource
Identifies an original source of an index operation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canEvaluate(Class<? extends Predicate> predicateClass) |
void |
clear()
Clears out all entries from this index.
|
void |
destroy()
Releases all resources hold by this index, e.g.
|
Set<QueryableEntry> |
evaluate(Predicate predicate)
Evaluates the given predicate using this index.
|
String[] |
getComponents() |
TypeConverter |
getConverter() |
String |
getName() |
Set<QueryableEntry> |
getRecords(Comparable value)
Produces a result set containing entries whose attribute values are equal
to the given value.
|
Set<QueryableEntry> |
getRecords(Comparable[] values)
Produces a result set containing entries whose attribute values are equal
to at least one of the given values.
|
Set<QueryableEntry> |
getRecords(Comparable from,
boolean fromInclusive,
Comparable to,
boolean toInclusive)
Produces a result set by performing a range query on this index with the
range defined by the passed arguments.
|
Set<QueryableEntry> |
getRecords(Comparison comparison,
Comparable value)
Produces a result set containing entries whose attribute values are
satisfy the comparison of the given type with the given value.
|
String |
getUniqueKey() |
boolean |
isEvaluateOnly() |
boolean |
isOrdered()
Tells whether this index is ordered or not.
|
void |
putEntry(QueryableEntry entry,
Object oldValue,
Index.OperationSource operationSource)
Saves the given entry into this index.
|
void |
removeEntry(Data key,
Object value,
Index.OperationSource operationSource)
Removes the entry having the given key and the value from this index.
|
String getName()
PredicateUtils.canonicalizeAttribute(java.lang.String)
,
PredicateUtils.constructCanonicalCompositeIndexName(java.lang.String[])
String[] getComponents()
boolean isOrdered()
Ordered indexes support the fast evaluation of range queries. Unordered indexes are still capable to execute range queries, but the performance would be about the same as the full scan performance.
true
if this index is ordered, false
otherwise.getRecords(Comparison, Comparable)
,
getRecords(Comparable, boolean, Comparable, boolean)
String getUniqueKey()
null
if this
index is not a bitmap one.TypeConverter getConverter()
null
if the
converter is not known because there were no saves to this index and
the attribute type is not inferred yet.void putEntry(QueryableEntry entry, Object oldValue, Index.OperationSource operationSource)
entry
- the entry to save.oldValue
- the previous old value associated with the entry or
null
if the entry is new.operationSource
- the operation source.QueryException
- if there were errors while extracting the
attribute value from the entry.void removeEntry(Data key, Object value, Index.OperationSource operationSource)
key
- the key of the entry to remove.value
- the value of the entry to remove.operationSource
- the operation source.QueryException
- if there were errors while extracting the
attribute value from the entry.boolean isEvaluateOnly()
true
if this index supports querying only with evaluate(com.hazelcast.query.Predicate)
method, false
otherwise.boolean canEvaluate(Class<? extends Predicate> predicateClass)
true
if this index can evaluate a predicate of the given
predicate class, false
otherwise.Set<QueryableEntry> evaluate(Predicate predicate)
predicate
- the predicate to evaluate. The predicate is guaranteed
to be evaluable by this index (canEvaluate
returned true
for its class).Set<QueryableEntry> getRecords(Comparable value)
value
- the value to compare against.Set<QueryableEntry> getRecords(Comparable[] values)
values
- the values to compare against.Set<QueryableEntry> getRecords(Comparable from, boolean fromInclusive, Comparable to, boolean toInclusive)
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.Set<QueryableEntry> getRecords(Comparison comparison, Comparable value)
comparison
- the type of the comparison to perform.value
- the value to compare against.void clear()
void destroy()
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.