pkolaczk commented on code in PR #2556:
URL: https://github.com/apache/cassandra/pull/2556#discussion_r1384692812
##########
src/java/org/apache/cassandra/index/sai/disk/v1/RowAwarePrimaryKeyMap.java:
##########
@@ -161,6 +161,11 @@ public long rowIdFromPrimaryKey(PrimaryKey key)
return
triePrefixSearcher.prefixSearch(key.asComparableBytes(ByteComparable.Version.OSS50));
}
+ public long count()
Review Comment:
fixed
##########
src/java/org/apache/cassandra/index/sai/iterators/KeyRangeAntiJoinIterator.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.cassandra.index.sai.iterators;
+
+import java.io.IOException;
+
+import org.apache.cassandra.index.sai.utils.PrimaryKey;
+import org.apache.cassandra.io.util.FileUtils;
+
+/**
+ * An iterator wrapper that wraps two iterators (left and right) and returns
the primary keys from the left iterator
+ * that do not match the primary keys from the right iterator. The keys
returned by the wrapped iterators must
+ * follow token-clustering order.
+ */
+public class KeyRangeAntiJoinIterator extends KeyRangeIterator
+{
+ final KeyRangeIterator left;
+ final KeyRangeIterator right;
+
+ private PrimaryKey nextKeyToSkip = null;
+
+ private KeyRangeAntiJoinIterator(KeyRangeIterator.Builder.Statistics
statistics, KeyRangeIterator left, KeyRangeIterator right)
+ {
+ super(statistics);
+ this.left = left;
+ this.right = right;
+ }
+
+ public static KeyRangeAntiJoinIterator create(KeyRangeIterator left,
KeyRangeIterator right)
+ {
+ AntiJoinStatistics statistics = new AntiJoinStatistics();
+ statistics.update(left);
+ return new KeyRangeAntiJoinIterator(statistics, left, right);
+ }
+
+ protected void performSkipTo(PrimaryKey nextKey)
+ {
+ left.performSkipTo(nextKey);
+ right.performSkipTo(nextKey);
+ }
+
+ public void close() throws IOException
Review Comment:
fixed
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]