Class FnHarness


  • public class FnHarness
    extends java.lang.Object
    Main 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.ApiServiceDescriptor encoded as text representing the endpoint that is to be connected to for the Beam Fn Logging service.
    • CONTROL_API_SERVICE_DESCRIPTOR: A Endpoints.ApiServiceDescriptor encoded as text representing the endpoint that is to be connected to for the Beam Fn Control service.
    • PIPELINE_OPTIONS: A serialized form of PipelineOptions. See PipelineOptions for further details.
    • Constructor Summary

      Constructors 
      Constructor Description
      FnHarness()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)  
      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, 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 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)
      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 void main​(java.util.function.Function<java.lang.String,​java.lang.String> environmentVarGetter)  
      static java.lang.String removeNestedKey​(java.lang.String jsonString, java.lang.String keyToRemove)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FnHarness

        public FnHarness()
    • 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.Exception
        Run a FnHarness with the given id and options that attaches to the specified logging and control API service descriptors.
        Parameters:
        id - Harness ID
        options - The options for this pipeline
        runnerCapabilities -
        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.Exception
        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.
        Parameters:
        id - Harness ID
        options - The options for this pipeline
        runnerCapabilites -
        loggingApiServiceDescriptor -
        controlApiServiceDescriptor -
        statusApiServiceDescriptor -
        channelFactory -
        outboundObserverFactory -
        processWideCache -
        Throws:
        java.lang.Exception