[ 
https://issues.apache.org/jira/browse/BEAM-3327?focusedWorklogId=94243&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-94243
 ]

ASF GitHub Bot logged work on BEAM-3327:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Apr/18 18:52
            Start Date: 23/Apr/18 18:52
    Worklog Time Spent: 10m 
      Work Description: axelmagn commented on a change in pull request #5152: 
[BEAM-3327] Harness Manager Interfaces
URL: https://github.com/apache/beam/pull/5152#discussion_r183501181
 
 

 ##########
 File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/manager/SdkHarnessManager.java
 ##########
 @@ -0,0 +1,70 @@
+/*
+ * 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.fnexecution.manager;
+
+import org.apache.beam.model.fnexecution.v1.ProvisionApi;
+import org.apache.beam.runners.core.construction.graph.ExecutableStage;
+import org.apache.beam.runners.fnexecution.artifact.ArtifactSource;
+import org.apache.beam.runners.fnexecution.control.RemoteBundle;
+import org.apache.beam.runners.fnexecution.state.StateRequestHandler;
+
+/**
+ * A manager of resources related to the SDK Harness, capable of providing 
RemoteBundles to runner
+ * operators.
+ *
+ * <p>In order to provide a simple interface to runner operators, the 
SdkHarnessManager is
+ * responsible for owning and managing the lifetimes of resources such as RPC 
servers and remote
+ * environments. It is responsible for both instantiation and cleanup of these 
resources.  Since all
+ * managed resources are owned by the SdkHarnessManager, it is responsible for 
cleaning them up when
+ * its close function is called.
+ */
+public interface SdkHarnessManager extends AutoCloseable {
+  /**
+   * Register a {@link ProvisionApi.ProvisionInfo} for a job.
+   */
+  void registerJobInfo(ProvisionApi.ProvisionInfo jobInfo);
+
+
+  /**
+   * Register an {@link ArtifactSource} as available for a job.
+   * @param jobId ID for the job the {@link ArtifactSource} belongs to.
+   * @param artifactSource The {@link ArtifactSource} to register.
+   * @return A closeable handle notifying the manager that the {@link 
ArtifactSource} is no longer
+   * available.
+   */
+  AutoCloseable registerArtifactSource(String jobId, ArtifactSource 
artifactSource);
 
 Review comment:
   The choice to do it this was was to anticipate runners for which 
ArtifactSources, ProvisioningInfo, and StateRequestHandlers had lifetimes that 
were not necessarily the same as the current flink runner.  This was largely in 
response to your previous point:
   
   > some runners will have persistent ArtifactSources and Provisioning 
information, at minimum, and should not need to respecify a server-shared one 
every time.
   
   We could easily pack it all back up as just an argument, but the question 
remains: do we want to anticipate runners that need to decouple ArtifactSource 
availability from the lifetime of an operation.
   
   ProvisioningInfo is a little different, since it is a data container, and 
does not facilitate communication with the worker in the same way that 
ArtifactSource or StateRequestHandlers do.

----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 94243)
    Time Spent: 18h 50m  (was: 18h 40m)

> Add abstractions to manage Environment Instance lifecycles.
> -----------------------------------------------------------
>
>                 Key: BEAM-3327
>                 URL: https://issues.apache.org/jira/browse/BEAM-3327
>             Project: Beam
>          Issue Type: New Feature
>          Components: runner-core
>            Reporter: Thomas Groh
>            Assignee: Ben Sidhom
>            Priority: Major
>              Labels: portability
>          Time Spent: 18h 50m
>  Remaining Estimate: 0h
>
> This permits remote stage execution for arbitrary environments



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to