Details
-
Task
-
Status: Resolved
-
Major
-
Resolution: Resolved
-
None
-
None
Description
API
- Add SortedIndexStorage interface:
public interface SortedIndexStorage extends AutoCloseable { /** Index key factory */ IndexKeyFactory indexKeyFactory(); /** Index descriptor */ SortedIndexDescriptor indexDescriptor(); /** Adds a value */ void put(IndexKey key, SearchRow value); /** Removes a value */ void remove(IndexKey key); /** Range scan */ Cursor<SearchRow> range(IndexKeyPrefix lowerBound, IndexKeyPrefix upperBound); /** Removes all values */ void destroy(); }
- IndexKeyPrefix can contain a smaller number of columns, than the IndexKey, needed for the prefix search.
public interface IndexKey { byte[] asBytes(); } public interface IndexKeyPrefix { Object[] prefixColumnValues(); }
- SearchRow is a class from the storage-api that represents a key from the partition storage.
Implementation details
For the initial implementation it is suggested to use BinaryRow serialization mechanism (it is proposed to implement the IndexKey on top of it, simply ignoring the value bytes) to store it in RocksDB. First implementation will also use a naive comparator, that will convert each BinaryRow into a Row and compare individual deserialized columns.
It is also proposed to store partition storage keys as values in the index storage.
Attachments
Issue Links
- is blocked by
-
IGNITE-14928 Create Index entities
- Resolved
- is part of
-
IGNITE-14925 Sorted indexes engine
- Resolved
- links to