Klose6 commented on code in PR #187:
URL:
https://github.com/apache/cassandra-analytics/pull/187#discussion_r3025975046
##########
cassandra-analytics-cdc-sidecar/src/main/java/org/apache/cassandra/cdc/sidecar/SidecarCdcBuilder.java:
##########
@@ -85,17 +89,38 @@ public class SidecarCdcBuilder extends CdcBuilder
EventConsumer eventConsumer,
SchemaSupplier schemaSupplier,
TokenRangeSupplier tokenRangeSupplier,
+ @NotNull Function<String, Integer> portResolver,
SidecarCdcClient.ClientConfig clientConfig,
SidecarClient sidecarClient,
ICdcStats cdcStats)
{
super(jobId, partitionId, eventConsumer, schemaSupplier);
this.clusterConfigProvider = clusterConfigProvider;
- this.sidecarCdcClient = new SidecarCdcClient(clientConfig,
sidecarClient, cdcStats);
+ this.portResolver = portResolver;
+ this.sidecarCdcClient = new SidecarCdcClient(clientConfig,
sidecarClient, cdcStats, portResolver);
withCdcOptions(cdcOptions);
withTokenRangeSupplier(tokenRangeSupplier);
}
+ /**
+ * Builds a port resolver function from the {@link
CdcSidecarInstancesProvider}. The resolver looks up
+ * the port for a given hostname from the provider, falling back to the
configured effective port.
+ */
+ static Function<String, Integer> buildPortResolver(@NotNull
CdcSidecarInstancesProvider provider,
Review Comment:
In this latest
[commit](https://github.com/apache/cassandra-analytics/commit/dfface1be7a0d70e745b6e0732e681bde237508c#diff-1e824b92860d2a734894ee972f24297f4f30cf450359333224a947b48c49c7ae)
it accepts the sidecarCdcClient in the SidecarCdc.java so I removed this and
in cassandra-sidecar we can inject the sidecar port mapping into the
sidecarCdcClient with its added withPortResolver() when calls the
SidecarCdc.builder().
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]