public class Indexes extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Indexes.Builder
Builder which is used to create a new Indexes object.
|
Modifier and Type | Method and Description |
---|---|
InternalIndex |
addOrGetIndex(String name,
boolean ordered)
Obtains the existing index or creates a new one (if an index doesn't exist
yet) for the given name in this indexes instance.
|
void |
clearAll()
Clears contents of indexes managed by this instance.
|
void |
destroyIndexes()
Destroys and then removes all the indexes from this indexes instance.
|
InternalIndex[] |
getCompositeIndexes()
Returns all the composite indexes known to this indexes instance.
|
TypeConverter |
getConverter(String attribute) |
InternalIndex |
getIndex(String name) |
InternalIndex[] |
getIndexes()
Returns all the indexes known to this indexes instance.
|
IndexesStats |
getIndexesStats()
Returns the indexes stats of this indexes instance.
|
boolean |
haveAtLeastOneIndex()
Returns
true if this indexes instance contains at least one index,
false otherwise. |
boolean |
isGlobal() |
static void |
markPartitionAsIndexed(int partitionId,
InternalIndex[] indexes)
Marks the given partition as indexed by the given indexes.
|
static void |
markPartitionAsUnindexed(int partitionId,
InternalIndex[] indexes)
Marks the given partition as unindexed by the given indexes.
|
InternalIndex |
matchIndex(String pattern,
QueryContext.IndexMatchHint matchHint)
Matches an index for the given pattern and match hint.
|
static Indexes.Builder |
newBuilder(SerializationService ss,
IndexCopyBehavior indexCopyBehavior) |
void |
putEntry(QueryableEntry queryableEntry,
Object oldValue,
Index.OperationSource operationSource)
Inserts a new queryable entry into this indexes instance or updates the
existing one.
|
Set<QueryableEntry> |
query(Predicate predicate)
Performs a query on this indexes instance using the given predicate.
|
void |
removeEntry(Data key,
Object value,
Index.OperationSource operationSource)
Removes the entry from this indexes instance identified by the given key
and value.
|
public static void markPartitionAsIndexed(int partitionId, InternalIndex[] indexes)
partitionId
- the ID of the partition to mark as indexed.indexes
- the indexes by which the given partition is indexed.public static void markPartitionAsUnindexed(int partitionId, InternalIndex[] indexes)
partitionId
- the ID of the partition to mark as unindexed.indexes
- the indexes by which the given partition is unindexed.public static Indexes.Builder newBuilder(SerializationService ss, IndexCopyBehavior indexCopyBehavior)
ss
- the serializationServiceindexCopyBehavior
- the indexCopyBehaviorIndexCopyBehavior
public InternalIndex addOrGetIndex(String name, boolean ordered)
name
- the name of the index; the passed value might not
represent a canonical index name (as specified by
{@link Index#getName()), in this case the method
canonicalizes it.ordered
- true
if the new index should be ordered, false
otherwise.public InternalIndex[] getIndexes()
public InternalIndex[] getCompositeIndexes()
public void destroyIndexes()
public void clearAll()
public boolean haveAtLeastOneIndex()
true
if this indexes instance contains at least one index,
false
otherwise.public void putEntry(QueryableEntry queryableEntry, Object oldValue, Index.OperationSource operationSource)
queryableEntry
- the queryable entry to insert or update.oldValue
- the old entry value to update, null
if
inserting the new entry.operationSource
- the operation source.public void removeEntry(Data key, Object value, Index.OperationSource operationSource)
key
- the key if the entry to remove.value
- the value of the entry to remove.operationSource
- the operation source.public boolean isGlobal()
In case of a partitioned-index, each query has to query the index in each partition separately, which all-together may be around 3 times slower than querying a single global index.
public InternalIndex getIndex(String name)
null
if such index does
not exist. It's a caller's responsibility to canonicalize the passed
index name as specified by Index.getName()
.public Set<QueryableEntry> query(Predicate predicate)
predicate
- the predicate to evaluate.null
if the query can't be
performed using the indexes known to this indexes instance.public InternalIndex matchIndex(String pattern, QueryContext.IndexMatchHint matchHint)
pattern
- the pattern to match an index for. May be either an
attribute name or an exact index name.matchHint
- the match hint.null
if nothing matched.QueryContext.IndexMatchHint
,
matchIndex(java.lang.String, com.hazelcast.query.impl.QueryContext.IndexMatchHint)
public TypeConverter getConverter(String attribute)
null
if
a converter is not available. The later may happen if the attribute is
unknown to this indexes instance or there are no populated
indexes involving the given attribute.public IndexesStats getIndexesStats()
Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.