mirror of https://github.com/apache/cassandra
Follow up to rebuild fix
This commit is contained in:
parent
46c85980fc
commit
9cb5d0cef7
|
|
@ -233,10 +233,9 @@ public class Rebuild
|
|||
private static MovementMap movementMap(ClusterMetadata metadata, String keyspace, String tokens)
|
||||
{
|
||||
MovementMap.Builder movementMapBuilder = MovementMap.builder();
|
||||
DataPlacements placements = metadata.placements();
|
||||
if (keyspace == null)
|
||||
{
|
||||
placements.forEach((params, placement) -> movementMapBuilder.put(params, addMovementsForParams(placement, null)));
|
||||
metadata.placements().forEach((params, placement) -> movementMapBuilder.put(params, addMovementsForParams(placement, null)));
|
||||
// Special case to include the system metadata keyspace
|
||||
ReplicationParams metaParams = Keyspace.open(METADATA_KEYSPACE_NAME).getMetadata().params.replication;
|
||||
movementMapBuilder.put(metaParams, addMovementsForParams(metadata.placement(metaParams), null));
|
||||
|
|
@ -244,13 +243,13 @@ public class Rebuild
|
|||
else if (tokens == null)
|
||||
{
|
||||
ReplicationParams params = Keyspace.open(keyspace).getMetadata().params.replication;
|
||||
movementMapBuilder.put(params, addMovementsForParams(placements.get(params), null));
|
||||
movementMapBuilder.put(params, addMovementsForParams(metadata.placement(params), null));
|
||||
}
|
||||
else
|
||||
{
|
||||
ReplicationParams params = Keyspace.open(keyspace).getMetadata().params.replication;
|
||||
RangesAtEndpoint ranges = rangesForRebuildWithTokens(tokens, keyspace);
|
||||
movementMapBuilder.put(params, addMovementsForParams(placements.get(params), ranges));
|
||||
movementMapBuilder.put(params, addMovementsForParams(metadata.placement(params), ranges));
|
||||
}
|
||||
return movementMapBuilder.build();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue