Skip to content

Commit 2cb7834

Browse files
committed
address review
1 parent 937e132 commit 2cb7834

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

server/src/main/java/org/elasticsearch/cluster/routing/OperationRouting.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class OperationRouting {
6363

6464
public OperationRouting(Settings settings, ClusterSettings clusterSettings) {
6565
// 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);
6767
if (ignoreAwarenessAttr == false) {
6868
awarenessAttributes = AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING.get(settings);
6969
if (awarenessAttributes.isEmpty() == false) {
@@ -88,10 +88,13 @@ List<String> getAwarenessAttributes() {
8888
}
8989

9090
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;
9397
}
94-
this.awarenessAttributes = awarenessAttributes;
9598
}
9699

97100
public ShardIterator indexShards(ClusterState clusterState, String index, String id, @Nullable String routing) {

0 commit comments

Comments
 (0)