Skip to content

Commit 0b228d8

Browse files
Bouncheckdkropachev
authored andcommitted
Revert some core adjustments that were made for serverless
EndPoint fields are final again in Connection and Host classes.
1 parent fcd76eb commit 0b228d8

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

clirr-ignores.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@
6565
<justification>Serverless was dropped. This code has no use anymore.</justification>
6666
</difference>
6767

68+
<difference>
69+
<differenceType>7002</differenceType> <!-- method removed -->
70+
<className>com/datastax/driver/core/Host</className>
71+
<method>void setEndPoint(com.datastax.driver.core.EndPoint)</method>
72+
<justification>Originally endPoint field was made non-final to work around serverless limitations.
73+
We're making it final again for clarity. Driver always used to treat the EndPoint as something that
74+
does not change for given Host outside that specific case.
75+
</justification>
76+
</difference>
77+
6878
<difference>
6979
<differenceType>7004</differenceType> <!-- the number of arguments has changed -->
7080
<className>com/datastax/driver/core/Metadata</className>

driver-core/src/main/java/com/datastax/driver/core/Connection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ enum State {
127127

128128
volatile long maxIdleTime;
129129

130-
EndPoint endPoint;
130+
final EndPoint endPoint;
131131
private final String name;
132132
private volatile Integer shardId = null;
133133

driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -680,11 +680,6 @@ private static void updateInfo(
680680
}
681681
host.setHostId(row.getUUID("host_id"));
682682
host.setSchemaVersion(row.getUUID("schema_version"));
683-
684-
EndPoint endPoint = cluster.configuration.getPolicies().getEndPointFactory().create(row);
685-
if (endPoint != null) {
686-
host.setEndPoint(endPoint);
687-
}
688683
}
689684

690685
private static void updateLocationInfo(
@@ -816,8 +811,6 @@ private void refreshNodeListAndTokenMap(
816811
connection.endPoint);
817812
} else {
818813
updateInfo(controlHost, localRow, cluster, isInitialConnection);
819-
connection.endPoint = controlHost.getEndPoint();
820-
821814
if (metadataEnabled && factory != null) {
822815
Set<String> tokensStr = localRow.getSet("tokens", String.class);
823816
if (!tokensStr.isEmpty()) {

driver-core/src/main/java/com/datastax/driver/core/Host.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class Host {
4343
static final Logger statesLogger = LoggerFactory.getLogger(Host.class.getName() + ".STATES");
4444

4545
// The address we'll use to connect to the node
46-
private EndPoint endPoint;
46+
private final EndPoint endPoint;
4747

4848
// The broadcast RPC address, as reported in system tables.
4949
// Note that, unlike previous versions of the driver, this address is NOT TRANSLATED.
@@ -183,10 +183,6 @@ public EndPoint getEndPoint() {
183183
return endPoint;
184184
}
185185

186-
public void setEndPoint(EndPoint endPoint) {
187-
this.endPoint = endPoint;
188-
}
189-
190186
/**
191187
* Returns the address that the driver will use to connect to the node.
192188
*

0 commit comments

Comments
 (0)