Search in sources :

Example 1 with OutboundObserverFactory

use of org.apache.beam.sdk.fn.stream.OutboundObserverFactory in project beam by apache.

the class FnHarness method main.

/**
 * Run a FnHarness with the given id and options that attaches to the specified logging and
 * control API service descriptors.
 *
 * @param id Harness ID
 * @param options The options for this pipeline
 * @param runnerCapabilites
 * @param loggingApiServiceDescriptor
 * @param controlApiServiceDescriptor
 * @param statusApiServiceDescriptor
 * @throws Exception
 */
public static void main(String id, PipelineOptions options, Set<String> runnerCapabilites, Endpoints.ApiServiceDescriptor loggingApiServiceDescriptor, Endpoints.ApiServiceDescriptor controlApiServiceDescriptor, @Nullable Endpoints.ApiServiceDescriptor statusApiServiceDescriptor) throws Exception {
    ManagedChannelFactory channelFactory;
    if (ExperimentalOptions.hasExperiment(options, "beam_fn_api_epoll")) {
        channelFactory = ManagedChannelFactory.createEpoll();
    } else {
        channelFactory = ManagedChannelFactory.createDefault();
    }
    OutboundObserverFactory outboundObserverFactory = HarnessStreamObserverFactories.fromOptions(options);
    main(id, options, runnerCapabilites, loggingApiServiceDescriptor, controlApiServiceDescriptor, statusApiServiceDescriptor, channelFactory, outboundObserverFactory, Caches.fromOptions(options));
}
Also used : ManagedChannelFactory(org.apache.beam.sdk.fn.channel.ManagedChannelFactory) OutboundObserverFactory(org.apache.beam.sdk.fn.stream.OutboundObserverFactory)

Aggregations

ManagedChannelFactory (org.apache.beam.sdk.fn.channel.ManagedChannelFactory)1 OutboundObserverFactory (org.apache.beam.sdk.fn.stream.OutboundObserverFactory)1