Package org.apache.beam.fn.harness
Class FnHarness
- java.lang.Object
-
- org.apache.beam.fn.harness.FnHarness
-
public class FnHarness extends java.lang.ObjectMain entry point into the Beam SDK Fn Harness for Java.This entry point expects the following environment variables:
- HARNESS_ID: A String representing the ID of this FnHarness. This will be added to the headers of calls to the Beam Control Service
- LOGGING_API_SERVICE_DESCRIPTOR: A
Endpoints.ApiServiceDescriptorencoded as text representing the endpoint that is to be connected to for the Beam Fn Logging service. - CONTROL_API_SERVICE_DESCRIPTOR: A
Endpoints.ApiServiceDescriptorencoded as text representing the endpoint that is to be connected to for the Beam Fn Control service. - PIPELINE_OPTIONS: A serialized form of
PipelineOptions. SeePipelineOptionsfor further details.
-
-
Constructor Summary
Constructors Constructor Description FnHarness()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)static voidmain(java.lang.String id, org.apache.beam.sdk.options.PipelineOptions options, java.util.Set<java.lang.String> runnerCapabilities, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor loggingApiServiceDescriptor, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor controlApiServiceDescriptor, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor statusApiServiceDescriptor)Run a FnHarness with the given id and options that attaches to the specified logging and control API service descriptors.static voidmain(java.lang.String id, org.apache.beam.sdk.options.PipelineOptions options, java.util.Set<java.lang.String> runnerCapabilites, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor loggingApiServiceDescriptor, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor controlApiServiceDescriptor, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor statusApiServiceDescriptor, org.apache.beam.sdk.fn.channel.ManagedChannelFactory channelFactory, org.apache.beam.sdk.fn.stream.OutboundObserverFactory outboundObserverFactory, Cache<java.lang.Object,java.lang.Object> processWideCache)Run a FnHarness with the given id and options that attaches to the specified logging and control API service descriptors using the given channel factory and outbound observer factory.static voidmain(java.util.function.Function<java.lang.String,java.lang.String> environmentVarGetter)static java.lang.StringremoveNestedKey(java.lang.String jsonString, java.lang.String keyToRemove)
-
-
-
Method Detail
-
removeNestedKey
public static java.lang.String removeNestedKey(java.lang.String jsonString, java.lang.String keyToRemove) throws java.lang.Exception- Throws:
java.lang.Exception
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
main
public static void main(java.util.function.Function<java.lang.String,java.lang.String> environmentVarGetter) throws java.lang.Exception- Throws:
java.lang.Exception
-
main
public static void main(java.lang.String id, org.apache.beam.sdk.options.PipelineOptions options, java.util.Set<java.lang.String> runnerCapabilities, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor loggingApiServiceDescriptor, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor controlApiServiceDescriptor, @Nullable org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor statusApiServiceDescriptor) throws java.lang.ExceptionRun a FnHarness with the given id and options that attaches to the specified logging and control API service descriptors.- Parameters:
id- Harness IDoptions- The options for this pipelinerunnerCapabilities-loggingApiServiceDescriptor-controlApiServiceDescriptor-statusApiServiceDescriptor-- Throws:
java.lang.Exception
-
main
public static void main(java.lang.String id, org.apache.beam.sdk.options.PipelineOptions options, java.util.Set<java.lang.String> runnerCapabilites, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor loggingApiServiceDescriptor, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor controlApiServiceDescriptor, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor statusApiServiceDescriptor, org.apache.beam.sdk.fn.channel.ManagedChannelFactory channelFactory, org.apache.beam.sdk.fn.stream.OutboundObserverFactory outboundObserverFactory, Cache<java.lang.Object,java.lang.Object> processWideCache) throws java.lang.ExceptionRun a FnHarness with the given id and options that attaches to the specified logging and control API service descriptors using the given channel factory and outbound observer factory.- Parameters:
id- Harness IDoptions- The options for this pipelinerunnerCapabilites-loggingApiServiceDescriptor-controlApiServiceDescriptor-statusApiServiceDescriptor-channelFactory-outboundObserverFactory-processWideCache-- Throws:
java.lang.Exception
-
-