kw2542 commented on a change in pull request #14554:
URL: https://github.com/apache/beam/pull/14554#discussion_r616893054
##########
File path:
runners/samza/src/main/java/org/apache/beam/runners/samza/SamzaExecutionContext.java
##########
@@ -81,93 +50,11 @@ void setMetricsContainer(SamzaMetricsContainer
metricsContainer) {
this.metricsContainer = metricsContainer;
}
- public JobBundleFactory getJobBundleFactory() {
- return this.jobBundleFactory;
- }
-
- void setJobBundleFactory(JobBundleFactory jobBundleFactory) {
- this.jobBundleFactory = jobBundleFactory;
- }
-
@Override
- public void start() {
- checkState(getJobBundleFactory() == null, "jobBundleFactory has been
created!");
-
- if (SamzaRunnerOverrideConfigs.isPortableMode(options)) {
- try {
- controlClientPool = MapControlClientPool.create();
- dataExecutor = Executors.newCachedThreadPool();
-
- fnControlServer =
- GrpcFnServer.allocatePortAndCreateFor(
- FnApiControlClientPoolService.offeringClientsToPool(
- controlClientPool.getSink(), () -> SAMZA_WORKER_ID),
- ServerFactory.createWithPortSupplier(
- () ->
SamzaRunnerOverrideConfigs.getFnControlPort(options)));
- LOG.info("Started control server on port {}",
fnControlServer.getServer().getPort());
-
- fnDataServer =
- GrpcFnServer.allocatePortAndCreateFor(
- GrpcDataService.create(
- options, dataExecutor,
OutboundObserverFactory.serverDirect()),
- ServerFactory.createDefault());
- LOG.info("Started data server on port {}",
fnDataServer.getServer().getPort());
-
- fnStateServer =
- GrpcFnServer.allocatePortAndCreateFor(
- GrpcStateService.create(), ServerFactory.createDefault());
- LOG.info("Started state server on port {}",
fnStateServer.getServer().getPort());
-
- final long waitTimeoutMs =
- SamzaRunnerOverrideConfigs.getControlClientWaitTimeoutMs(options);
- LOG.info("Control client wait timeout config: " + waitTimeoutMs);
-
- final InstructionRequestHandler instructionHandler =
- controlClientPool.getSource().take(SAMZA_WORKER_ID,
Duration.ofMillis(waitTimeoutMs));
- final EnvironmentFactory environmentFactory =
- (environment, workerId) ->
- RemoteEnvironment.forHandler(environment, instructionHandler);
- // TODO: use JobBundleFactoryBase.WrappedSdkHarnessClient.wrapping
- jobBundleFactory =
- SingleEnvironmentInstanceJobBundleFactory.create(
- environmentFactory, fnDataServer, fnStateServer, idGenerator);
- LOG.info("Started job bundle factory");
- } catch (Exception e) {
- throw new RuntimeException(
- "Running samza in Beam portable mode but failed to create job
bundle factory", e);
- }
-
- setJobBundleFactory(jobBundleFactory);
- }
- }
+ public void start() {}
Review comment:
Good point, we could eliminate it as well but that requires some more
refactor on SamzaExecutionContext as well as SamzaExecutionContext$Factory
I would prefer to separate the refactor in another PR to avoid too many
changes in one PR. What do you think.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]