forked from apache/beam
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
29 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...java/core/src/main/java/org/apache/beam/sdk/options/InitializePipelineOptionsFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.apache.beam.sdk.options; | ||
|
||
import java.util.Iterator; | ||
import java.util.ServiceLoader; | ||
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterators; | ||
import org.checkerframework.checker.initialization.qual.Initialized; | ||
import org.checkerframework.checker.nullness.qual.Nullable; | ||
|
||
|
||
@SuppressWarnings("rawtypes") | ||
/** | ||
* Interface to support offspring wire-in for Li: if input class meets some requirements, | ||
* the customized pipelineOptions will be initialized. | ||
* | ||
*/ | ||
public interface InitializePipelineOptionsFactory<T> { | ||
T initializePipelineOptions(T pipelineOptions, Class<T> clazz); | ||
|
||
interface Registrar { | ||
InitializePipelineOptionsFactory create(); | ||
} | ||
|
||
|
||
static @Initialized @Nullable InitializePipelineOptionsFactory getFactory() { | ||
final Iterator<InitializePipelineOptionsFactory.Registrar> | ||
factories = ServiceLoader.load(InitializePipelineOptionsFactory.Registrar.class).iterator(); | ||
return factories.hasNext() ? Iterators.getOnlyElement(factories).create() : null; | ||
} | ||
} |
27 changes: 0 additions & 27 deletions
27
sdks/java/core/src/main/java/org/apache/beam/sdk/options/InvokePipelineOptionsFactory.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters