phet commented on a change in pull request #3427:
URL: https://github.com/apache/gobblin/pull/3427#discussion_r750785564
##########
File path:
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/HelixRetriggeringJobCallable.java
##########
@@ -263,7 +275,7 @@ private void runJobExecutionLauncher() throws JobException {
jobLock.lock();
try {
- if (planningJobIdFromStore.isPresent() &&
!canRun(planningJobIdFromStore.get(), planningJobManager)) {
+ if (planningJobIdFromStore.isPresent() &&
!canRun(planningJobIdFromStore.get(), planningJobHelixManager)) {
Review comment:
not pressing, but equivalent:
```
if (planningJobIdFromStore.map(id -> !canRun(id,
planningJobHelixManager)).getOrElse(false)) {
```
##########
File path:
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/HelixRetriggeringJobCallable.java
##########
@@ -249,8 +260,9 @@ private void runJobExecutionLauncher() throws JobException {
String newPlanningId;
Closer closer = Closer.create();
try {
- HelixManager planningJobManager =
this.taskDriverHelixManager.isPresent()?
+ HelixManager planningJobHelixManager =
this.taskDriverHelixManager.isPresent()?
this.taskDriverHelixManager.get() : this.jobHelixManager;
Review comment:
`getOrElse`?
...actually thought I earlier saw a similar replacement above...
##########
File path:
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/HelixRetriggeringJobCallable.java
##########
@@ -126,8 +126,17 @@ public HelixRetriggeringJobCallable(
this.planningJobLauncherMetrics = planningJobLauncherMetrics;
this.helixMetrics = helixMetrics;
this.appWorkDir = appWorkDir;
- this.jobHelixManager = jobHelixManager;
- this.taskDriverHelixManager = taskDriverHelixManager;
+
+ // make a copy of helix managers, so that each job can keep using it
without worrying about disconnect from the GobblinClusterManager where they are
created
+ this.jobHelixManager =
GobblinHelixMultiManager.buildHelixManager(ConfigUtils.propertiesToConfig(sysProps),
+
sysProps.getProperty(GobblinClusterConfigurationKeys.ZK_CONNECTION_STRING_KEY),
+ GobblinClusterConfigurationKeys.HELIX_CLUSTER_NAME_KEY,
jobHelixManager.getInstanceType());
+
+ this.taskDriverHelixManager = taskDriverHelixManager.map(
+ helixManager ->
GobblinHelixMultiManager.buildHelixManager(ConfigUtils.propertiesToConfig(sysProps),
+
sysProps.getProperty(GobblinClusterConfigurationKeys.ZK_CONNECTION_STRING_KEY),
+ GobblinClusterConfigurationKeys.TASK_DRIVER_CLUSTER_NAME_KEY,
helixManager.getInstanceType()));
+
Review comment:
yeah, I suppose `GobblinHelixMultiManager.buildHelixManager` is already
a utility, probably excessive to abstract too much beyond. what I noticed is
that (before calling) you're pulling a property out of the same `Config` you
provide to the call. usage shows `ZK_CONNECTION_STRING_KEY` to be pretty
widely referenced... what about a 3-param overload:
```
protected static HelixManager buildHelixManager(Config config, String
clusterName, InstanceType type) {
return buildHelixManager(config,
config.getProperty(GobblinClusterConfigurationKeys.ZK_CONNECTION_STRING_KEY),
clusterName, type);
}
```
?
is
--
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]