jberragan commented on code in PR #98:
URL: 
https://github.com/apache/cassandra-analytics/pull/98#discussion_r1945222554


##########
cassandra-bridge/src/main/java/org/apache/cassandra/bridge/CassandraBridge.java:
##########
@@ -443,6 +445,198 @@ public ByteBuffer uncompress(ByteBuffer input) throws 
IOException
 
     public abstract CompressionUtil compressionUtil();
 
+    // additional SSTable utils methods
+
+    /**
+     * @param keyspace keyspace name
+     * @param table    table name
+     * @param ssTable  SSTable instance
+     * @return last repair time for a given SSTable by reading the 
Statistics.db file.
+     * @throws IOException
+     */
+    public abstract long lastRepairTime(String keyspace, String table, SSTable 
ssTable) throws IOException;
+
+    /**
+     * @param ssTable          SSTable instance
+     * @param partitioner      Cassandra partitioner
+     * @param minIndexInterval minIndexInterval configured in the TableMetaData
+     * @param maxIndexInterval maxIndexInterval configured in the TableMetadata
+     * @return the first and last token by attempting to read from the 
Summary.db file first then failing back to the Index.db.
+     * @throws IOException
+     */
+    public abstract Pair<BigInteger, BigInteger> firstLastToken(SSTable 
ssTable,
+                                                                Partitioner 
partitioner,
+                                                                int 
minIndexInterval,
+                                                                int 
maxIndexInterval) throws IOException;
+
+    /**
+     * @param ssTable          SSTable instance
+     * @param minIndexInterval minIndexInterval configured in the TableMetaData
+     * @param partitioner      Cassandra partitioner
+     * @param maxIndexInterval maxIndexInterval configured in the TableMetadata
+     * @param ranges           a list of token ranges
+     * @return a list boolean value if corresponding token range in `ranges` 
list parameter overlaps with the SSTable.
+     * The SSTable may or may not contain data for the range.
+     */
+    public abstract List<Boolean> overlaps(SSTable ssTable,
+                                           Partitioner partitioner,
+                                           int minIndexInterval,
+                                           int maxIndexInterval,
+                                           List<TokenRange> ranges) throws 
IOException;
+
+    /**
+     * @param partitioner     Cassandra partitioner
+     * @param keyspace        Cassandra keyspace
+     * @param createTableStmt CQL table create statement
+     * @param partitionKeys   list of
+     * @return list of tokens corresponding to each input `partitionKeys`
+     */
+    public List<BigInteger> toTokens(Partitioner partitioner, String keyspace, 
String createTableStmt, List<List<String>> partitionKeys)
+    {
+        return toTokens(partitioner, encodePartitionKeys(partitioner, 
keyspace, createTableStmt, partitionKeys));
+    }
+
+    /**
+     * @param partitioner   Cassandra partitioner
+     * @param partitionKeys list of encoded partition keys
+     * @return list of tokens corresponding to each input `partitionKeys`
+     */
+    public abstract List<BigInteger> toTokens(Partitioner partitioner, 
@NotNull List<ByteBuffer> partitionKeys);
+
+    /**
+     * @param partitioner     Cassandra partitioner
+     * @param keyspace        keyspace name
+     * @param createTableStmt CQL create table statement
+     * @param partitionKey    partition key
+     * @return encoded ByteBuffer for the input `partitionKey`
+     */
+    public ByteBuffer encodePartitionKey(Partitioner partitioner, String 
keyspace, String createTableStmt, List<String> partitionKey)
+    {
+        return encodePartitionKeys(partitioner, keyspace, createTableStmt, 
Collections.singletonList(partitionKey)).get(0);
+    }
+
+    /**
+     * @param partitioner     Cassandra partitioner
+     * @param keyspace        keyspace name
+     * @param createTableStmt CQL create table statement
+     * @param partitionKeys   list of partition keys
+     * @return a list encoded ByteBuffers corresponding to the partition keys 
input in `partitionKeys`
+     */
+    public abstract List<ByteBuffer> encodePartitionKeys(Partitioner 
partitioner, String keyspace, String createTableStmt, List<List<String>> 
partitionKeys);
+
+    /**
+     * @param partitioner   Cassandra partitioner
+     * @param keyspace      keyspace name
+     * @param table         table name
+     * @param ssTable       SSTable instance
+     * @param partitionKeys list of partition keys
+     * @return list of booleans returning true if an SSTable might contain a 
partition key
+     * (might return false-positives but never false-negatives),
+     * corresponding to the partition keys input in `partitionKeys`.
+     * @throws IOException
+     */
+    public abstract List<Boolean> maybeContains(Partitioner partitioner,

Review Comment:
   What is confusing? I can add a comment regarding performance 
characteristics. What benefit is there by having another `BloomFilter` class?



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