Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,8 @@ default Set<Node> getReplicas(@NonNull String keyspaceName, @NonNull TokenRange
/** The name of the partitioner class in use, as reported by the Cassandra nodes. */
@NonNull
String getPartitionerName();

/** The partitioner class in use, as reported by the Cassandra nodes. */
@NonNull
Partitioner getPartitioner();
}
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ protected Set<Node> getReplicas(@Nullable Request request, @Nullable Session ses
}

partitioner = request.getPartitioner();
if (partitioner == null && maybeTokenMap.isPresent()) {
partitioner = maybeTokenMap.get().getPartitioner();
}
} catch (Exception e) {
// Protect against poorly-implemented Request instances
LOG.error("Unexpected error while trying to compute query plan", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ public String getPartitionerName() {
return tokenFactory.getPartitionerName();
}

@NonNull
@Override
public Partitioner getPartitioner() {
return tokenFactory;
}

private KeyspaceTokenMap getKeyspaceMap(CqlIdentifier keyspace) {
Map<String, String> config = replicationConfigs.get(keyspace);
return (config == null) ? null : keyspaceMaps.get(config);
Expand Down
Loading