use of org.apache.beam.runners.core.construction.ModelCoders.WindowedValueCoderComponents in project beam by apache.
the class ModelCodersTest method windowedValueCoderComponentsToConstructor.
@Test
public void windowedValueCoderComponentsToConstructor() throws IOException {
FullWindowedValueCoder<Iterable<KV<String, Integer>>> javaCoder = FullWindowedValueCoder.of(IterableCoder.of(KvCoder.of(StringUtf8Coder.of(), VarIntCoder.of())), IntervalWindowCoder.of());
MessageWithComponents coderAndComponents = CoderTranslation.toProto(javaCoder);
WindowedValueCoderComponents windowedValueCoderComponents = ModelCoders.getWindowedValueCoderComponents(coderAndComponents.getCoder());
Coder windowedCoder = ModelCoders.windowedValueCoder(windowedValueCoderComponents.elementCoderId(), windowedValueCoderComponents.windowCoderId());
assertThat(windowedCoder, equalTo(coderAndComponents.getCoder()));
}
Aggregations