pnowojski commented on a change in pull request #6705: [FLINK-10356][network] 
add sanity checks to SpillingAdaptiveSpanningRecordDeserializer
URL: https://github.com/apache/flink/pull/6705#discussion_r250622218
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/util/DeserializationUtils.java
 ##########
 @@ -36,18 +40,25 @@
         *
         * @param records records to be deserialized
         * @param deserializer the record deserializer
+        * @param mustBeFullRecords if set, fails if the deserialized records 
contain partial records
         * @return the number of full deserialized records
         */
        public static int deserializeRecords(
                        ArrayDeque<SerializationTestType> records,
-                       RecordDeserializer<SerializationTestType> deserializer) 
throws Exception {
+                       RecordDeserializer<SerializationTestType> deserializer,
+                       boolean mustBeFullRecords) throws Exception {
                int deserializedRecords = 0;
 
                while (!records.isEmpty()) {
                        SerializationTestType expected = records.poll();
                        SerializationTestType actual = 
expected.getClass().newInstance();
 
-                       if (deserializer.getNextRecord(actual).isFullRecord()) {
+                       RecordDeserializer.DeserializationResult 
deserializationResult =
+                               deserializer.getNextRecord(actual);
+                       if (mustBeFullRecords) {
+                               assertThat(deserializationResult, 
hasProperty("fullRecord", equalTo(true)));
 
 Review comment:
   why not `assertTrue(deserializationResult.isFullRecord())`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to