Modifier and Type | Class and Description |
---|---|
static class |
IndexImpl.NullObject |
Modifier and Type | Field and Description |
---|---|
protected IndexStore |
indexStore |
static IndexImpl.NullObject |
NULL |
protected InternalSerializationService |
ss |
Constructor and Description |
---|
IndexImpl(String attributeName,
boolean ordered,
InternalSerializationService ss,
Extractors extractors,
IndexCopyBehavior copyQueryResultOn) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears out all entries from this index.
|
IndexStore |
createIndexStore(boolean ordered) |
void |
destroy()
Releases all resources hold by this index, e.g.
|
String |
getAttributeName() |
TypeConverter |
getConverter()
Provides comparable null object.
|
Set<QueryableEntry> |
getRecords(Comparable attributeValue)
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> |
getSubRecords(ComparisonType comparisonType,
Comparable searchedAttributeValue)
Produces a result set containing entries whose attribute values are
satisfy the comparison of the given type with the given value.
|
Set<QueryableEntry> |
getSubRecordsBetween(Comparable fromAttributeValue,
Comparable toAttributeValue)
Produces a result set by performing a range query on this index.
|
boolean |
isOrdered()
Tells whether this index is ordered or not.
|
void |
removeEntryIndex(Data key,
Object value)
Removes the entry having the given key and the value from this index.
|
void |
saveEntryIndex(QueryableEntry entry,
Object oldRecordValue)
Saves the given entry into this index.
|
public static final IndexImpl.NullObject NULL
protected final InternalSerializationService ss
protected final IndexStore indexStore
public IndexImpl(String attributeName, boolean ordered, InternalSerializationService ss, Extractors extractors, IndexCopyBehavior copyQueryResultOn)
public IndexStore createIndexStore(boolean ordered)
public void saveEntryIndex(QueryableEntry entry, Object oldRecordValue) throws QueryException
Index
saveEntryIndex
in interface Index
entry
- the entry to save.oldRecordValue
- the previous old value associated with the entry or
null
if the entry is new.QueryException
- if there were errors while extracting the
attribute value from the entry.public void removeEntryIndex(Data key, Object value)
Index
removeEntryIndex
in interface Index
key
- the key of the entry to remove.value
- the value of the entry to remove.public Set<QueryableEntry> getRecords(Comparable[] values)
Index
getRecords
in interface Index
values
- the values to compare against.public Set<QueryableEntry> getRecords(Comparable attributeValue)
Index
getRecords
in interface Index
attributeValue
- the value to compare against.public Set<QueryableEntry> getSubRecords(ComparisonType comparisonType, Comparable searchedAttributeValue)
Index
getSubRecords
in interface Index
comparisonType
- the type of the comparison to perform.searchedAttributeValue
- the value to compare against.public Set<QueryableEntry> getSubRecordsBetween(Comparable fromAttributeValue, Comparable toAttributeValue)
Index
More precisely, this method produces a result set containing entries
whose attribute values are greater than or equal to the given
from
value and less than or equal to the given to
value.
getSubRecordsBetween
in interface Index
fromAttributeValue
- the beginning of the range (inclusive).toAttributeValue
- the end of the range (inclusive).public TypeConverter getConverter()
getConverter
in interface Index
null
if the
converter is not known because there were no saves to this index and
the attribute type is not inferred yet.public void clear()
Index
public void destroy()
Index
public String getAttributeName()
getAttributeName
in interface Index
public boolean isOrdered()
Index
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.
isOrdered
in interface Index
true
if this index is ordered, false
otherwise.Index.getSubRecords(com.hazelcast.query.impl.ComparisonType, java.lang.Comparable)
,
Index.getSubRecordsBetween(java.lang.Comparable, java.lang.Comparable)
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.