sashapolo commented on a change in pull request #468:
URL: https://github.com/apache/ignite-3/pull/468#discussion_r764767716



##########
File path: 
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/index/SortedIndexStorage.java
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.storage.index;
+
+import org.apache.ignite.internal.storage.SearchRow;
+import org.apache.ignite.internal.util.Cursor;
+
+/**
+ * Storage for a Sorted Index.
+ *
+ * <p>This storage serves as a sorted mapping from a subset of a table's 
columns (a.k.a. index columns) to a {@link SearchRow}
+ * from a {@link org.apache.ignite.internal.storage.PartitionStorage} from the 
same table.
+ *
+ * @see org.apache.ignite.schema.definition.index.SortedIndexDefinition
+ */
+public interface SortedIndexStorage extends AutoCloseable {
+    /**
+     * Returns a factory for creating index keys for this storage.
+     */
+    IndexKeyFactory indexKeyFactory();
+
+    /**
+     * Returns the Index Descriptor of this storage.
+     */
+    SortedIndexDescriptor indexDescriptor();
+
+    /**
+     * Adds the given index key and {@link SearchRow} to the index.
+     *
+     * <p>Putting a new value under the same key will overwrite the previous 
associated value.
+     */
+    void put(IndexKey key, SearchRow value);
+
+    /**
+     * Removes the given key from the index.
+     *
+     * <p>Removing a non-existent key is a no-op.
+     */
+    void remove(IndexKey key);
+
+    /**
+     * Returns a range of index values between the lower bound (inclusive) and 
the upper bound (inclusive).
+     */
+    // TODO: add options https://issues.apache.org/jira/browse/IGNITE-16059
+    Cursor<SearchRow> range(IndexKeyPrefix lowerBound, IndexKeyPrefix 
upperBound);

Review comment:
       > Returning 'boolean' may be useful. Does't it costs anything or easy to 
do?
   
   It is relatively easy to implement but it will cost a lookup: RocksDB does 
not return any booleans, so we will have to manually check. I don't think it is 
worth doing now....




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to