Search in sources :

Example 1 with BeamFnDataReadRunner

use of org.apache.beam.fn.harness.BeamFnDataReadRunner in project beam by apache.

the class ProcessBundleHandler method trySplit.

/**
 * Splits an active bundle.
 */
public BeamFnApi.InstructionResponse.Builder trySplit(BeamFnApi.InstructionRequest request) {
    BundleProcessor bundleProcessor = bundleProcessorCache.find(request.getProcessBundleSplit().getInstructionId());
    BeamFnApi.ProcessBundleSplitResponse.Builder response = BeamFnApi.ProcessBundleSplitResponse.newBuilder();
    if (bundleProcessor == null) {
        // failing so that the runner does not fail/timeout.
        return BeamFnApi.InstructionResponse.newBuilder().setProcessBundleSplit(BeamFnApi.ProcessBundleSplitResponse.getDefaultInstance());
    }
    for (BeamFnDataReadRunner channelRoot : bundleProcessor.getChannelRoots()) {
        channelRoot.trySplit(request.getProcessBundleSplit(), response);
    }
    return BeamFnApi.InstructionResponse.newBuilder().setProcessBundleSplit(response);
}
Also used : BeamFnDataReadRunner(org.apache.beam.fn.harness.BeamFnDataReadRunner)

Aggregations

BeamFnDataReadRunner (org.apache.beam.fn.harness.BeamFnDataReadRunner)1