[
https://issues.apache.org/jira/browse/BEAM-2597?focusedWorklogId=99302&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-99302
]
ASF GitHub Bot logged work on BEAM-2597:
----------------------------------------
Author: ASF GitHub Bot
Created on: 08/May/18 00:35
Start Date: 08/May/18 00:35
Worklog Time Spent: 10m
Work Description: bsidhom commented on a change in pull request #5285:
[BEAM-2597] Flink batch ExecutableStage operator
URL: https://github.com/apache/beam/pull/5285#discussion_r186584295
##########
File path:
runners/flink/src/main/java/org/apache/beam/runners/flink/DistributedCachePool.java
##########
@@ -0,0 +1,71 @@
+/*
+ * 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.flink;
+
+import io.grpc.stub.StreamObserver;
+import java.io.IOException;
+import java.io.Serializable;
+import javax.annotation.concurrent.ThreadSafe;
+import org.apache.beam.model.jobmanagement.v1.ArtifactApi.ArtifactChunk;
+import org.apache.beam.model.jobmanagement.v1.ArtifactApi.Manifest;
+import org.apache.beam.runners.fnexecution.artifact.ArtifactSource;
+import org.apache.flink.api.common.cache.DistributedCache;
+
+/**
+ * A pool of {@link DistributedCache DistributedCaches} to use as artifact
sources. A cache must be
+ * registered before artifacts are requested from it.
+ */
+@ThreadSafe
+public class DistributedCachePool implements ArtifactSource {
+
+ /**
+ * Factory for creating {@link DistributedCachePool cache pools}. Must be
serializable for
+ * distribution to TaskManagers.
+ */
+ public interface Factory extends Serializable {
+ /** Gets or creates a cache pool for the given job id. */
+ DistributedCachePool forJob(String jobId);
+ }
+
+ /** Retrieves the default distributed cache pool factory. */
+ public static Factory defaultFactory() {
+ return (jobId) -> {
+ throw new UnsupportedOperationException();
+ };
+ }
+
+ private DistributedCachePool() {}
+
+ /**
+ * Adds a new cache to the pool. When the returned {@link AutoCloseable} is
closed, the given
+ * cache will be removed from the pool.
+ */
+ public AutoCloseable addCacheToPool(DistributedCache distributedCache) {
Review comment:
Indeed. In that case, we'll need another layer to wrap the
`DistributedCache` in an `ArtifactSource`. I wanted to minimize "interface"
changes here to make it easier to understand exactly what's happening in
`FlinkExecutableStageFunction`.
----------------------------------------------------------------
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: 99302)
Time Spent: 2h (was: 1h 50m)
> FlinkRunner ExecutableStage batch operator
> ------------------------------------------
>
> Key: BEAM-2597
> URL: https://issues.apache.org/jira/browse/BEAM-2597
> Project: Beam
> Issue Type: Sub-task
> Components: runner-flink
> Reporter: Kenneth Knowles
> Assignee: Ben Sidhom
> Priority: Major
> Labels: portability
> Time Spent: 2h
> Remaining Estimate: 0h
>
> This operator will execute user code in the context of an SDK harness by
> constructing a ProcessBundleDescriptor from an ExecutableStage (physical
> stage plan) and sending instructions/elements over the control and data
> planes.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)