[ https://issues.apache.org/jira/browse/BEAM-6271?focusedWorklogId=186664&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-186664 ]
ASF GitHub Bot logged work on BEAM-6271: ---------------------------------------- Author: ASF GitHub Bot Created on: 18/Jan/19 02:08 Start Date: 18/Jan/19 02:08 Worklog Time Spent: 10m Work Description: lhaiesp commented on pull request #7321: [BEAM-6271] SamzaRunner: initial support for portable api in samza runner URL: https://github.com/apache/beam/pull/7321#discussion_r248907238 ########## File path: runners/samza/src/main/java/org/apache/beam/runners/samza/SamzaJobServerDriver.java ########## @@ -0,0 +1,125 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.beam.runners.samza; + +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Nullable; +import org.apache.beam.model.pipeline.v1.RunnerApi; +import org.apache.beam.runners.core.construction.PipelineOptionsTranslation; +import org.apache.beam.runners.fnexecution.GrpcFnServer; +import org.apache.beam.runners.fnexecution.ServerFactory; +import org.apache.beam.runners.fnexecution.artifact.BeamFileSystemArtifactStagingService; +import org.apache.beam.runners.fnexecution.jobsubmission.InMemoryJobService; +import org.apache.beam.runners.fnexecution.jobsubmission.JobInvocation; +import org.apache.beam.runners.fnexecution.jobsubmission.JobInvoker; +import org.apache.beam.vendor.protobuf.v3.com.google.protobuf.Struct; +import org.kohsuke.args4j.CmdLineException; +import org.kohsuke.args4j.CmdLineParser; +import org.kohsuke.args4j.Option; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** Driver program that starts a job server. */ +public class SamzaJobServerDriver { + private static final Logger LOG = LoggerFactory.getLogger(SamzaJobServerDriver.class); + + private final ServerConfiguration config; + + /** Configuration for the jobServer. */ + private static class ServerConfiguration { + @Option(name = "--job-port", usage = "The job service port. (Default: 11440)") + private int jobPort = 11440; + + @Option(name = "--control-port", usage = "The FnControl port. (Default: 11441)") + private int controlPort = 11441; + } + + private SamzaJobServerDriver(ServerConfiguration config) { + this.config = config; + } + + public static void main(String[] args) throws Exception { + ServerConfiguration configuration = new ServerConfiguration(); + CmdLineParser parser = new CmdLineParser(configuration); + try { + parser.parseArgument(args); + fromConfig(configuration).run(); + } catch (CmdLineException e) { + LOG.error("Unable to parse command line arguments {}", Arrays.asList(args), e); + throw new IllegalArgumentException("Unable to parse command line arguments.", e); + } catch (Exception e) { + LOG.error("Hit exception with SamzaJobServer. Exiting...", e); + throw e; + } + } + + public static SamzaJobServerDriver fromConfig(ServerConfiguration config) { + return new SamzaJobServerDriver(config); + } + + private InMemoryJobService createJobService() throws IOException { Review comment: sure. need to move the config to be a parameter. either way doesn't make too much difference ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 186664) Time Spent: 3h 40m (was: 3.5h) > initial support for portable api in samza runner > ------------------------------------------------ > > Key: BEAM-6271 > URL: https://issues.apache.org/jira/browse/BEAM-6271 > Project: Beam > Issue Type: Task > Components: runner-samza > Reporter: Hai Lu > Assignee: Hai Lu > Priority: Major > Time Spent: 3h 40m > Remaining Estimate: 0h > > Support portable api in Samza runner. > This ticket tracks the initial effort to support portable api in Samza > runner, including job server inside samza runner, config translation for > portable pipeline, transform translation for portable pipeline, refactor of > existing codes to merge logic of portable api and java api as much as > possible, etc. -- This message was sent by Atlassian JIRA (v7.6.3#76005)