public class IndexImpl extends Object implements InternalIndex
Modifier and Type | Class and Description |
---|---|
static class |
IndexImpl.NullObject |
Index.OperationSource
Modifier and Type | Field and Description |
---|---|
protected Extractors |
extractors |
protected IndexStore |
indexStore |
static IndexImpl.NullObject |
NULL |
protected InternalSerializationService |
ss |
Constructor and Description |
---|
IndexImpl(String attributeName,
boolean ordered,
InternalSerializationService ss,
Extractors extractors,
IndexCopyBehavior copyBehavior,
PerIndexStats stats) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears out all entries from this index.
|
protected IndexStore |
createIndexStore(boolean ordered,
PerIndexStats stats) |
void |
destroy()
Releases all resources hold by this index, e.g.
|
String |
getAttributeName() |
TypeConverter |
getConverter()
Provides comparable null object.
|
PerIndexStats |
getPerIndexStats()
Returns the index stats associated with this index.
|
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,
Index.OperationSource operationSource)
Removes the entry having the given key and the value from this index.
|
void |
saveEntryIndex(QueryableEntry entry,
Object oldRecordValue,
Index.OperationSource operationSource)
Saves the given entry into this index.
|
public static final IndexImpl.NullObject NULL
protected final InternalSerializationService ss
protected final Extractors extractors
protected final IndexStore indexStore
public IndexImpl(String attributeName, boolean ordered, InternalSerializationService ss, Extractors extractors, IndexCopyBehavior copyBehavior, PerIndexStats stats)
protected IndexStore createIndexStore(boolean ordered, PerIndexStats stats)
public void saveEntryIndex(QueryableEntry entry, Object oldRecordValue, Index.OperationSource operationSource)
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.operationSource
- the operation source.public void removeEntryIndex(Data key, Object value, Index.OperationSource operationSource)
Index
removeEntryIndex
in interface Index
key
- the key of the entry to remove.value
- the value of the entry to remove.operationSource
- the operation source.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)
public PerIndexStats getPerIndexStats()
InternalIndex
getPerIndexStats
in interface InternalIndex
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.