blambov commented on code in PR #2064:
URL: https://github.com/apache/cassandra/pull/2064#discussion_r1095556618


##########
src/java/org/apache/cassandra/io/sstable/BloomFilterMetrics.java:
##########
@@ -89,7 +89,7 @@ protected R map(SSTableReader r)
     /**
      * False positive ratio of bloom filter from last read
      */
-    public final GaugeProvider<Double> recentBloomFilterFalseRatio = 
newGaugeProvider("BloomFilterFalseRatio", readers -> {
+    public final GaugeProvider<Double> recentBloomFilterFalseRatio = 
newGaugeProvider("RecentBloomFilterFalseRatio", readers -> {
         long falsePositiveCount = 0L;
         long truePositiveCount = 0L;
         long trueNegativeCount = 0L;

Review Comment:
   The calls below (`getFalsePositiveCount` etc) should be changed to their 
recent versions.



##########
src/java/org/apache/cassandra/io/sstable/keycache/KeyCacheSupport.java:
##########
@@ -0,0 +1,120 @@
+/*
+ * 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.io.sstable.keycache;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.apache.cassandra.cache.KeyCacheKey;
+import org.apache.cassandra.db.ClusteringPrefix;
+import org.apache.cassandra.db.DecoratedKey;
+import org.apache.cassandra.db.filter.ClusteringIndexFilter;
+import org.apache.cassandra.io.sstable.format.AbstractRowIndexEntry;
+import org.apache.cassandra.io.sstable.format.SSTableReader;
+import org.apache.cassandra.io.util.DataInputPlus;
+
+public interface KeyCacheSupport<T extends SSTableReader & KeyCacheSupport<T>>
+{
+    @Nullable
+    KeyCache getKeyCache();
+
+    /**
+     * Should quickly get a lower bound prefix from cache only if everything 
is already availabe in memory and does not
+     * need to be loaded from disk.
+     */
+    @Nullable
+    ClusteringPrefix<?> getLowerBoundPrefixFromCache(DecoratedKey 
partitionKey, ClusteringIndexFilter filter);
+
+    /**
+     * @return Number of key cache hit
+     */
+    default long getKeyCacheHit()
+    {
+        KeyCache keyCache = getKeyCache();
+        return keyCache != null ? keyCache.getHits() : 0;
+    }
+
+    /**
+     * @return Number of key cache request
+     */
+    default long getKeyCacheRequest()

Review Comment:
   Nit: Request -> Requests



##########
src/java/org/apache/cassandra/io/sstable/format/SortedTableReader.java:
##########
@@ -0,0 +1,120 @@
+/*
+ * 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.io.sstable.format;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+import com.google.common.collect.Lists;
+
+import org.apache.cassandra.db.DecoratedKey;
+import org.apache.cassandra.io.sstable.BloomFilterTracker;
+import org.apache.cassandra.utils.IFilter;
+
+import static 
org.apache.cassandra.utils.concurrent.SharedCloseable.sharedCopyOrNull;
+
+public abstract class SortedTableReader extends SSTableReader

Review Comment:
   Nit: Because the only thing this provides is bloom filter support, doesn't 
it make better sense to call it `SSTableReaderWithFilter`?



-- 
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]

Reply via email to