venkata91 commented on code in PR #2596:
URL: https://github.com/apache/celeborn/pull/2596#discussion_r1662936066
##########
client-flink/common/src/main/java/org/apache/celeborn/plugin/flink/readclient/FlinkShuffleClientImpl.java:
##########
@@ -133,15 +136,33 @@ public FlinkShuffleClientImpl(
String module = TransportModuleConstants.DATA_MODULE;
TransportConf dataTransportConf =
Utils.fromCelebornConf(conf, module, conf.getInt("celeborn." + module
+ ".io.threads", 8));
- TransportContext context =
+ this.context =
new TransportContext(
dataTransportConf, readClientHandler,
conf.clientCloseIdleConnections());
- this.flinkTransportClientFactory =
- new FlinkTransportClientFactory(context,
conf.clientFetchMaxRetriesForEachReplica());
this.setupLifecycleManagerRef(driverHost, port);
this.driverTimestamp = driverTimestamp;
}
+ private void initializeFlinkTransportClientFactory() {
Review Comment:
Do you think it would make sense to combine both
`initializeFlinkTransportClientFactory` and
`initializeTransportClientFactoryIfRequired` into
`initializeTransportClientFactoryIfRequired` and just use that everywhere?
##########
client-flink/common/src/main/java/org/apache/celeborn/plugin/flink/readclient/FlinkShuffleClientImpl.java:
##########
@@ -565,6 +587,15 @@ public void setDataClientFactory(TransportClientFactory
dataClientFactory) {
@Override
@VisibleForTesting
public TransportClientFactory getDataClientFactory() {
+ initializeTransportClientFactoryIfRequired();
Review Comment:
nit: `initTransportClientFactoryIfRequired`?
##########
client-flink/common/src/main/java/org/apache/celeborn/plugin/flink/readclient/FlinkShuffleClientImpl.java:
##########
@@ -565,6 +587,15 @@ public void setDataClientFactory(TransportClientFactory
dataClientFactory) {
@Override
@VisibleForTesting
public TransportClientFactory getDataClientFactory() {
+ initializeTransportClientFactoryIfRequired();
return flinkTransportClientFactory;
}
+
+ private void initializeTransportClientFactoryIfRequired() {
+ if (null == flinkTransportClientFactory) {
+ logger.info(
+ "FlinkTransportClientFactory has not been initialized, " +
"initializing with default");
Review Comment:
nit: remove the concat operator?
```suggestion
logger.info(
"FlinkTransportClientFactory has not been initialized,
initializing with default");
```
##########
client-flink/common/src/main/java/org/apache/celeborn/plugin/flink/network/FlinkTransportClientFactory.java:
##########
@@ -63,7 +66,13 @@ public TransportClient createClientWithRetry(String
remoteHost, int remotePort)
remotePort,
e);
if (retryCount == 0) {
- throw e;
+ if (e instanceof InterruptedException) {
+ throw (InterruptedException) e;
+ } else if (e instanceof IOException) {
+ throw (IOException) e;
+ } else {
+ Utils.rethrowAsRuntimeException(e);
+ }
Review Comment:
nit: How about this?
```suggestion
if (e instanceof InterruptedException || e instanceof IOException)
{
throw e;
} else {
Utils.rethrowAsRuntimeException(e);
}
```
##########
client-flink/common/src/main/java/org/apache/celeborn/plugin/flink/readclient/FlinkShuffleClientImpl.java:
##########
@@ -133,15 +136,33 @@ public FlinkShuffleClientImpl(
String module = TransportModuleConstants.DATA_MODULE;
TransportConf dataTransportConf =
Utils.fromCelebornConf(conf, module, conf.getInt("celeborn." + module
+ ".io.threads", 8));
- TransportContext context =
+ this.context =
new TransportContext(
dataTransportConf, readClientHandler,
conf.clientCloseIdleConnections());
- this.flinkTransportClientFactory =
- new FlinkTransportClientFactory(context,
conf.clientFetchMaxRetriesForEachReplica());
this.setupLifecycleManagerRef(driverHost, port);
this.driverTimestamp = driverTimestamp;
}
+ private void initializeFlinkTransportClientFactory() {
Review Comment:
Basically similar to `initDataClientFactoryIfNeeded`?
--
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]