yifan-c commented on code in PR #146:
URL:
https://github.com/apache/cassandra-analytics/pull/146#discussion_r2471252452
##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/bulkwriter/Tokenizer.java:
##########
@@ -39,13 +38,12 @@ interface SerializableFunction<T, R> extends Function<T,
R>, Serializable
private final TokenUtils tokenUtils;
private final SerializableFunction<Object[], Object[]> keyColumnProvider;
- public Tokenizer(BulkWriterContext writerContext)
+ public Tokenizer(BroadcastableTableSchema broadcastableTableSchema,
boolean isMurmur3Partitioner)
{
- TableSchema tableSchema = writerContext.schema().getTableSchema();
- this.tokenUtils = new TokenUtils(tableSchema.partitionKeyColumns,
- tableSchema.partitionKeyColumnTypes,
-
writerContext.cluster().getPartitioner() == Partitioner.Murmur3Partitioner);
- this.keyColumnProvider = tableSchema::getKeyColumns;
+ this.tokenUtils = new
TokenUtils(broadcastableTableSchema.getPartitionKeyColumns(),
+
broadcastableTableSchema.getPartitionKeyColumnTypes(),
+ isMurmur3Partitioner);
Review Comment:
Passing the boolean because that is wanted by `TokenUtils` constructor. I
would keep it as-is. The change would be unrelated to this refactor.
```java
public TokenUtils(List<String> partitionKeyColumns,
List<ColumnType<?>> partitionKeyColumnTypes,
boolean isMurmur3Partitioner)
```
--
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]