Examples of SerializationTestType


Examples of org.apache.flink.runtime.io.network.serialization.types.SerializationTestType

    } catch (IOException e) {
      e.printStackTrace();
    }

    try {
      SerializationTestType emptyRecord = new SerializationTestType() {
        @Override
        public SerializationTestType getRandom(Random rnd) {
          throw new UnsupportedOperationException();
        }
View Full Code Here

Examples of org.apache.flink.runtime.io.network.serialization.types.SerializationTestType

      if (serializer.addRecord(record).isFullBuffer()) {
        // buffer is full => start deserializing
        deserializer.setNextMemorySegment(serializer.getCurrentBuffer().getMemorySegment(), segmentSize);

        while (!serializedRecords.isEmpty()) {
          SerializationTestType expected = serializedRecords.poll();
          SerializationTestType actual = expected.getClass().newInstance();

          if (deserializer.getNextRecord(actual).isFullRecord()) {
            Assert.assertEquals(expected, actual);
            numRecords--;
          } else {
            serializedRecords.addFirst(expected);
            break;
          }
        }

        while (serializer.setNextBuffer(buffer).isFullBuffer()) {
          deserializer.setNextMemorySegment(serializer.getCurrentBuffer().getMemorySegment(), segmentSize);
        }



      }
    }

    // deserialize left over records
    deserializer.setNextMemorySegment(serializer.getCurrentBuffer().getMemorySegment(), (numBytes % segmentSize));

    serializer.clear();

    while (!serializedRecords.isEmpty()) {
      SerializationTestType expected = serializedRecords.poll();

      SerializationTestType actual = expected.getClass().newInstance();
      DeserializationResult result = deserializer.getNextRecord(actual);

      Assert.assertTrue(result.isFullRecord());
      Assert.assertEquals(expected, actual);
      numRecords--;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.