echauchot commented on code in PR #3:
URL:
https://github.com/apache/flink-connector-cassandra/pull/3#discussion_r1101570853
##########
flink-connector-cassandra/src/main/java/org/apache/flink/connector/cassandra/source/split/SplitsGenerator.java:
##########
@@ -41,139 +41,31 @@ public SplitsGenerator(CassandraPartitioner partitioner) {
}
/**
- * Given properly ordered list of Cassandra tokens, compute at least
{@code totalSplitCount}
- * splits. Each split can contain several token ranges in order to reduce
the overhead of
- * Cassandra vnodes. Currently, token range grouping is not smart and
doesn't check if they
- * share the same replicas.
+ * Split Cassandra tokens ring into {@link CassandraSplit}s containing
each a range of the ring.
*
- * @param totalSplitCount requested total amount of splits. This function
may generate more
- * splits.
- * @param ringTokens list of all start tokens in Cassandra cluster. They
have to be in ring
- * order.
- * @return list containing at least {@code totalSplitCount}
CassandraSplits.
+ * @param numSplits requested number of splits
+ * @return list containing {@code numSplits} CassandraSplits.
*/
- public List<CassandraSplit> generateSplits(long totalSplitCount,
List<BigInteger> ringTokens) {
- if (totalSplitCount == 1) {
- RingRange totalRingRange = RingRange.of(partitioner.min(),
partitioner.max());
+ public List<CassandraSplit> generateSplits(long numSplits) {
Review Comment:
for the current code yes but I'll add split size evaluation (see my proposal
in another comment) So I'd need some state and will keep SplitsGenerator
--
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]