org.apache.flink.api.common.typeutils.ComparatorTestBase Java Examples

The following examples show how to use org.apache.flink.api.common.typeutils.ComparatorTestBase. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CoderTypeSerializerTest.java    From beam with Apache License 2.0 5 votes vote down vote up
private void testWriteAndReadConfigSnapshot(Coder<String> coder) throws IOException {
  CoderTypeSerializer<String> serializer = new CoderTypeSerializer<>(coder);

  TypeSerializerSnapshot writtenSnapshot = serializer.snapshotConfiguration();
  ComparatorTestBase.TestOutputView outView = new ComparatorTestBase.TestOutputView();
  writtenSnapshot.writeSnapshot(outView);

  TypeSerializerSnapshot readSnapshot = new CoderTypeSerializer.LegacySnapshot();
  readSnapshot.readSnapshot(
      writtenSnapshot.getCurrentVersion(), outView.getInputView(), getClass().getClassLoader());

  assertThat(readSnapshot.restoreSerializer(), is(serializer));
}