Class IndexRowComparatorImpl
- java.lang.Object
-
- org.apache.ignite.internal.cache.query.index.sorted.IndexRowComparatorImpl
-
- All Implemented Interfaces:
IndexRowComparator
public class IndexRowComparatorImpl extends Object implements IndexRowComparator
Provide default logic of rows comparison. Consider: 1. NULL is the least value. 2. Comparison of different types is not supported.
-
-
Field Summary
Fields Modifier and Type Field Description protected IndexKeyTypeSettingskeyTypeSettingsKey type settings for this index.
-
Constructor Summary
Constructors Constructor Description IndexRowComparatorImpl(IndexKeyTypeSettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareKey(long pageAddr, int off, int maxSize, IndexKey key, InlineIndexKeyType type)Compare inlined index key with specified key.intcompareKey(IndexKey left, IndexKey right)Compare index keys.intcompareRow(IndexRow left, IndexRow right, int idx)Compare index rows by key specified withidx.
-
-
-
Field Detail
-
keyTypeSettings
protected final IndexKeyTypeSettings keyTypeSettings
Key type settings for this index.
-
-
Constructor Detail
-
IndexRowComparatorImpl
public IndexRowComparatorImpl(IndexKeyTypeSettings settings)
-
-
Method Detail
-
compareKey
public int compareKey(long pageAddr, int off, int maxSize, IndexKey key, InlineIndexKeyType type)Compare inlined index key with specified key. If it is impossible to compare inlined key, it returns special vals:COMPARE_UNSUPPORTEDandCANT_BE_COMPARE, seeNullableInlineIndexKeyType.- Specified by:
compareKeyin interfaceIndexRowComparator- Parameters:
pageAddr- address of an index row.off- offset of an index key.maxSize- max size to read.key- key to compare with.type- inline type of index key.
-
compareRow
public int compareRow(IndexRow left, IndexRow right, int idx) throws IgniteCheckedException
Compare index rows by key specified withidx.- Specified by:
compareRowin interfaceIndexRowComparator- Parameters:
left- index row.right- index row.idx- offset of index key.- Throws:
IgniteCheckedException
-
compareKey
public int compareKey(IndexKey left, IndexKey right) throws IgniteCheckedException
Compare index keys.- Specified by:
compareKeyin interfaceIndexRowComparator- Parameters:
left- index key.right- index key.- Throws:
IgniteCheckedException
-
-