Revert "Don'y use `INDEX_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE_SETTING` directly as it triggers (many) deprecation logging"

This reverts commit e976aa09bb.
This commit is contained in:
Boaz Leskes 2017-01-16 16:15:32 +01:00
parent e976aa09bb
commit b887681550
2 changed files with 3 additions and 5 deletions

View File

@ -1218,7 +1218,7 @@ public class IndexMetaData implements Diffable<IndexMetaData>, ToXContent {
* {@link #isIndexUsingShadowReplicas(org.elasticsearch.common.settings.Settings)}.
*/
public static boolean isOnSharedFilesystem(Settings settings) {
// don't use the settings directly, not to trigger manny deprecation logging
// don't use the settings directly, not to trigger manny deprecation
return settings.getAsBoolean(SETTING_SHARED_FILESYSTEM, isIndexUsingShadowReplicas(settings));
}
@ -1228,7 +1228,7 @@ public class IndexMetaData implements Diffable<IndexMetaData>, ToXContent {
* setting for this is <code>false</code>.
*/
public static boolean isIndexUsingShadowReplicas(Settings settings) {
// don't use the settings directly, not to trigger manny deprecation logging
// don't use the settings directly, not to trigger manny deprecation
return settings.getAsBoolean(SETTING_SHADOW_REPLICAS, false);
}

View File

@ -476,10 +476,8 @@ public abstract class PrimaryShardAllocator extends BaseGatewayShardAllocator {
* recovered on any node
*/
private boolean recoverOnAnyNode(IndexMetaData metaData) {
// don't use the settings directly, not to trigger manny deprecation logging
return (IndexMetaData.isOnSharedFilesystem(metaData.getSettings()) || IndexMetaData.isOnSharedFilesystem(this.settings))
&& (metaData.getSettings().getAsBoolean(IndexMetaData.SETTING_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE, false) ||
this.settings.getAsBoolean(IndexMetaData.SETTING_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE, false));
&& IndexMetaData.INDEX_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE_SETTING.get(metaData.getSettings(), this.settings);
}
protected abstract FetchResult<NodeGatewayStartedShards> fetchData(ShardRouting shard, RoutingAllocation allocation);