use of org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor in project beam by apache.
the class SdkHarnessClientTest method testRegisterCachesBundleProcessors.
@Test
public void testRegisterCachesBundleProcessors() throws Exception {
ProcessBundleDescriptor descriptor1 = ProcessBundleDescriptor.newBuilder().setId("descriptor1").build();
ProcessBundleDescriptor descriptor2 = ProcessBundleDescriptor.newBuilder().setId("descriptor2").build();
List<RemoteInputDestination> remoteInputs = Collections.singletonList(RemoteInputDestination.of((FullWindowedValueCoder) FullWindowedValueCoder.of(VarIntCoder.of(), GlobalWindow.Coder.INSTANCE), SDK_GRPC_READ_TRANSFORM));
BundleProcessor processor1 = sdkHarnessClient.getProcessor(descriptor1, remoteInputs);
BundleProcessor processor2 = sdkHarnessClient.getProcessor(descriptor2, remoteInputs);
assertNotSame(processor1, processor2);
// Ensure that caching works.
assertSame(processor1, sdkHarnessClient.getProcessor(descriptor1, remoteInputs));
}
Aggregations