Skip to content

Commit ea70ff8

Browse files
committed
Remove es.transport.cname_in_publish_address sysprop warning
This propery has been a deprecated no-op since elastic#45662 (8.0.0). This commit removes it entirely in 9.0.0.
1 parent 1f4262e commit ea70ff8

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

server/src/main/java/org/elasticsearch/transport/TransportInfo.java

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,25 @@
1111

1212
import org.elasticsearch.common.io.stream.StreamInput;
1313
import org.elasticsearch.common.io.stream.StreamOutput;
14-
import org.elasticsearch.common.logging.DeprecationCategory;
15-
import org.elasticsearch.common.logging.DeprecationLogger;
1614
import org.elasticsearch.common.network.InetAddresses;
1715
import org.elasticsearch.common.transport.BoundTransportAddress;
1816
import org.elasticsearch.common.transport.TransportAddress;
1917
import org.elasticsearch.common.util.Maps;
2018
import org.elasticsearch.core.Nullable;
21-
import org.elasticsearch.core.UpdateForV9;
2219
import org.elasticsearch.node.ReportingService;
2320
import org.elasticsearch.xcontent.XContentBuilder;
2421

2522
import java.io.IOException;
2623
import java.util.Map;
2724

28-
import static org.elasticsearch.core.Booleans.parseBoolean;
29-
3025
public class TransportInfo implements ReportingService.Info {
3126

32-
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(TransportInfo.class);
33-
34-
/** Whether to add hostname to publish host field when serializing. */
35-
@UpdateForV9 // Remove es.transport.cname_in_publish_address property from TransportInfo in 9.0.0
36-
private static final boolean CNAME_IN_PUBLISH_ADDRESS = parseBoolean(
37-
System.getProperty("es.transport.cname_in_publish_address"),
38-
false
39-
);
40-
4127
private final BoundTransportAddress address;
4228
private Map<String, BoundTransportAddress> profileAddresses;
43-
private final boolean cnameInPublishAddressProperty;
4429

4530
public TransportInfo(BoundTransportAddress address, @Nullable Map<String, BoundTransportAddress> profileAddresses) {
46-
this(address, profileAddresses, CNAME_IN_PUBLISH_ADDRESS);
47-
}
48-
49-
public TransportInfo(
50-
BoundTransportAddress address,
51-
@Nullable Map<String, BoundTransportAddress> profileAddresses,
52-
boolean cnameInPublishAddressProperty
53-
) {
5431
this.address = address;
5532
this.profileAddresses = profileAddresses;
56-
this.cnameInPublishAddressProperty = cnameInPublishAddressProperty;
5733
}
5834

5935
public TransportInfo(StreamInput in) throws IOException {
@@ -67,7 +43,6 @@ public TransportInfo(StreamInput in) throws IOException {
6743
profileAddresses.put(key, value);
6844
}
6945
}
70-
this.cnameInPublishAddressProperty = CNAME_IN_PUBLISH_ADDRESS;
7146
}
7247

7348
@Override
@@ -97,16 +72,7 @@ private String formatPublishAddressString(String propertyName, TransportAddress
9772
String publishAddressString = publishAddress.toString();
9873
String hostString = publishAddress.address().getHostString();
9974
if (InetAddresses.isInetAddress(hostString) == false) {
100-
publishAddressString = hostString + '/' + publishAddress.toString();
101-
if (cnameInPublishAddressProperty) {
102-
deprecationLogger.warn(
103-
DeprecationCategory.SETTINGS,
104-
"cname_in_publish_address",
105-
"es.transport.cname_in_publish_address system property is deprecated and no longer affects "
106-
+ propertyName
107-
+ " formatting. Remove this property to get rid of this deprecation warning."
108-
);
109-
}
75+
publishAddressString = hostString + '/' + publishAddress;
11076
}
11177
return publishAddressString;
11278
}

0 commit comments

Comments
 (0)