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

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

                Author: ASF GitHub Bot
            Created on: 18/Apr/18 18:08
            Start Date: 18/Apr/18 18:08
    Worklog Time Spent: 10m 
      Work Description: bsidhom commented on a change in pull request #5150:  
[BEAM-4071] Add Portable Runner Job API shim
URL: https://github.com/apache/beam/pull/5150#discussion_r182506978
 
 

 ##########
 File path: 
runners/reference/java/src/main/java/org/apache/beam/runners/reference/CloseableResource.java
 ##########
 @@ -0,0 +1,81 @@
+/*
+ * 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.reference;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkState;
+
+/**
+ * An {@link AutoCloseable} that wraps a resource that needs to be cleaned up 
but does not implement
+ * {@link AutoCloseable} itself. Recipients of a {@link CloseableResource} are 
in general
+ * responsible for cleanup. Not thread-safe.
+ */
+public class CloseableResource<T> implements AutoCloseable {
 
 Review comment:
   While protecting against double closes is generally a good idea, I don't 
think we should attempt to do that here. 
   
   First, we do not have insight into exactly what operations a given `Closer` 
is performing. It _may_ be reasonable for two separate `Closer`s to be created 
for the same underlying resource and to have separate `CloseableResources` 
representing the different aspects that require cleanup (e.g., if those have 
different lifecycles).
   
   Second, as Eugene pointed out, `AutoCloseables` should _usually_ be 
idempotent, so guarding from double-closes here is overstepping our bounds.

----------------------------------------------------------------
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: 92198)
    Time Spent: 9h 10m  (was: 9h)

> Portable Runner Job API shim
> ----------------------------
>
>                 Key: BEAM-4071
>                 URL: https://issues.apache.org/jira/browse/BEAM-4071
>             Project: Beam
>          Issue Type: New Feature
>          Components: runner-core
>            Reporter: Ben Sidhom
>            Assignee: Ben Sidhom
>            Priority: Minor
>          Time Spent: 9h 10m
>  Remaining Estimate: 0h
>
> There needs to be a way to execute Java-SDK pipelines against a portable job 
> server. The job server itself is expected to be started up out-of-band. The 
> "PortableRunner" should take an option indicating the Job API endpoint and 
> defer other runner configurations to the backend itself.



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

Reply via email to