[
https://issues.apache.org/jira/browse/BEAM-14317?focusedWorklogId=757870&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-757870
]
ASF GitHub Bot logged work on BEAM-14317:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 18/Apr/22 12:47
Start Date: 18/Apr/22 12:47
Worklog Time Spent: 10m
Work Description: kennknowles commented on code in PR #17381:
URL: https://github.com/apache/beam/pull/17381#discussion_r852094329
##########
examples/java/src/main/java/org/apache/beam/examples/common/ExampleJVMInitializer.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.examples.common;
+
+import org.apache.beam.sdk.harness.JvmInitializer;
+import org.apache.beam.sdk.options.PipelineOptions;
+
+// Currently, JvmInitializers are only supported in portable pipelines or when
using Google Cloud
+// Dataflow.
+public class ExampleJVMInitializer implements JvmInitializer {
Review Comment:
Can you use `@AutoService` to register this?
##########
examples/java/src/main/resources/META-INF/services/org.apache.beam.sdk.harness.JvmInitializer:
##########
@@ -0,0 +1 @@
+org.apache.beam.examples.common.ExampleJVMInitializer
Review Comment:
You don't need to do this manually, I think.
Issue Time Tracking
-------------------
Worklog Id: (was: 757870)
Time Spent: 1h (was: 50m)
> Add an example JvmInitializer
> -----------------------------
>
> Key: BEAM-14317
> URL: https://issues.apache.org/jira/browse/BEAM-14317
> Project: Beam
> Issue Type: Improvement
> Components: examples-java
> Reporter: Arun Pandian
> Assignee: Arun Pandian
> Priority: P2
> Time Spent: 1h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)