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

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

                Author: ASF GitHub Bot
            Created on: 27/Mar/19 22:22
            Start Date: 27/Mar/19 22:22
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on pull request #8104: [BEAM-6872] 
Add hook for user-defined JVM initialization in workers
URL: https://github.com/apache/beam/pull/8104#discussion_r269791386
 
 

 ##########
 File path: 
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowWorkerInitializer.java
 ##########
 @@ -0,0 +1,33 @@
+/*
+ * 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.dataflow;
+
+import java.util.ServiceLoader;
+import org.apache.beam.sdk.annotations.Experimental;
+
+/**
+ * A service interface for defining one-time initialization for Dataflow 
workers.
+ *
+ * <p>Dataflow workers will use {@link ServiceLoader} to run every setup() 
implementation as soon as
+ * possible after start up. In general this should occur immediately after 
logging is setup and
+ * configured, but before the worker begins processing elements.
+ */
+@Experimental
+public interface DataflowWorkerInitializer {
+  void setup();
 
 Review comment:
   add two methods:
   * onStartup(): This is called as soon as we enter main().
   * beforeProcessing(PipelineOptions options): This is called before we start 
processing.
   
   make them have default no-op methods.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 219663)
    Time Spent: 0.5h  (was: 20m)

> Add hook for user-defined JVM initialization in workers
> -------------------------------------------------------
>
>                 Key: BEAM-6872
>                 URL: https://issues.apache.org/jira/browse/BEAM-6872
>             Project: Beam
>          Issue Type: New Feature
>          Components: runner-dataflow
>            Reporter: Brian Hulette
>            Assignee: Brian Hulette
>            Priority: Minor
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Expose an interface for users to run some one-time initialization code when a 
> worker starts up.
> This can be useful for things like overriding the Default ZoneRulesProvider, 
> or setting up custom SSL providers.



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

Reply via email to