Skip to content

Commit

Permalink
release 2.1.1-14
Browse files Browse the repository at this point in the history
  • Loading branch information
vroyer committed Jul 1, 2016
1 parent 199f3ac commit d29e3e5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,11 @@ public ClusterState updateNumberOfShards(ClusterState currentState) {
String keyspace = indexMetaData.getSettings().get(IndexMetaData.SETTING_KEYSPACE,indexMetaData.getIndex());
if (Schema.instance != null && Schema.instance.getKeyspaceInstance(keyspace) != null) {
AbstractReplicationStrategy replicationStrategy = Schema.instance.getKeyspaceInstance(keyspace).getReplicationStrategy();
int rf = replicationStrategy.getReplicationFactor();
if (replicationStrategy instanceof IDistributedReplicationStrategy) {
indexMetaDataBuilder.numberOfReplicas( ((IDistributedReplicationStrategy)replicationStrategy).getReplicationFactor(DatabaseDescriptor.getLocalDataCenter()) - 1 );
} else {
indexMetaDataBuilder.numberOfReplicas( replicationStrategy.getReplicationFactor() - 1 );
}
rf = ((IDistributedReplicationStrategy)replicationStrategy).getReplicationFactor(DatabaseDescriptor.getLocalDataCenter());
}
indexMetaDataBuilder.numberOfReplicas( Math.max(0, rf -1) );
} else {
indexMetaDataBuilder.numberOfReplicas( 0 );
}
Expand Down

0 comments on commit d29e3e5

Please sign in to comment.