@@ -63,7 +63,7 @@ public class OperationRouting {
63
63
64
64
public OperationRouting (Settings settings , ClusterSettings clusterSettings ) {
65
65
// whether to ignore awareness attributes when routing requests
66
- final boolean ignoreAwarenessAttr = parseBoolean (System .getProperty (IGNORE_AWARENESS_ATTRIBUTES_PROPERTY ), false );
66
+ boolean ignoreAwarenessAttr = parseBoolean (System .getProperty (IGNORE_AWARENESS_ATTRIBUTES_PROPERTY ), false );
67
67
if (ignoreAwarenessAttr == false ) {
68
68
awarenessAttributes = AwarenessAllocationDecider .CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING .get (settings );
69
69
if (awarenessAttributes .isEmpty () == false ) {
@@ -88,10 +88,13 @@ List<String> getAwarenessAttributes() {
88
88
}
89
89
90
90
private void setAwarenessAttributes (List <String > awarenessAttributes ) {
91
- if (this .awarenessAttributes .isEmpty () && awarenessAttributes .isEmpty () == false ) {
92
- deprecationLogger .deprecated (IGNORE_AWARENESS_ATTRIBUTES_DEPRECATION_MESSAGE );
91
+ boolean ignoreAwarenessAttr = parseBoolean (System .getProperty (IGNORE_AWARENESS_ATTRIBUTES_PROPERTY ), false );
92
+ if (ignoreAwarenessAttr == false ) {
93
+ if (this .awarenessAttributes .isEmpty () && awarenessAttributes .isEmpty () == false ) {
94
+ deprecationLogger .deprecated (IGNORE_AWARENESS_ATTRIBUTES_DEPRECATION_MESSAGE );
95
+ }
96
+ this .awarenessAttributes = awarenessAttributes ;
93
97
}
94
- this .awarenessAttributes = awarenessAttributes ;
95
98
}
96
99
97
100
public ShardIterator indexShards (ClusterState clusterState , String index , String id , @ Nullable String routing ) {
0 commit comments