zhijiangW commented on a change in pull request #8362: [FLINK-11391] Introduce 
shuffle master interface
URL: https://github.com/apache/flink/pull/8362#discussion_r289719687
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/deployment/ResultPartitionDeploymentDescriptorTest.java
 ##########
 @@ -40,26 +50,47 @@
        public void testSerialization() throws Exception {
                // Expected values
                IntermediateDataSetID resultId = new IntermediateDataSetID();
+
                IntermediateResultPartitionID partitionId = new 
IntermediateResultPartitionID();
+               ExecutionAttemptID producerExecutionId = new 
ExecutionAttemptID();
+
                ResultPartitionType partitionType = 
ResultPartitionType.PIPELINED;
                int numberOfSubpartitions = 24;
+               int connectionIndex = 10;
+
+               PartitionDescriptor partitionDescriptor = new 
PartitionDescriptor(
+                       resultId,
+                       partitionId,
+                       partitionType,
+                       numberOfSubpartitions,
+                       connectionIndex);
+
+               ResourceID producerLocation = new 
ResourceID("producerLocation");
+               InetSocketAddress address = new InetSocketAddress("localhost", 
10000);
+               ResultPartitionID resultPartitionID = new 
ResultPartitionID(partitionId, producerExecutionId);
+               ConnectionID connectionID = new ConnectionID(address, 
connectionIndex);
+               ShuffleDescriptor shuffleDescriptor = new 
NettyShuffleDescriptor(
+                       producerLocation,
+                       new 
NettyShuffleDescriptor.NetworkPartitionConnectionInfo(connectionID),
+                       resultPartitionID);
+
+               ResultPartitionDeploymentDescriptor orig = new 
ResultPartitionDeploymentDescriptor(
+                       partitionDescriptor,
+                       shuffleDescriptor,
+                       numberOfSubpartitions,
+                       true);
 
-               ResultPartitionDeploymentDescriptor orig =
-                               new ResultPartitionDeploymentDescriptor(
-                                               resultId,
-                                               partitionId,
-                                               partitionType,
-                                               numberOfSubpartitions,
-                                               numberOfSubpartitions,
-                                               true);
+               ResultPartitionDeploymentDescriptor copy = 
CommonTestUtils.createCopySerializable(orig);
 
-               ResultPartitionDeploymentDescriptor copy =
-                               CommonTestUtils.createCopySerializable(orig);
+               assertThat(copy.getShuffleDescriptor(), 
instanceOf(NettyShuffleDescriptor.class));
+               NettyShuffleDescriptor copySdd = (NettyShuffleDescriptor) 
copy.getShuffleDescriptor();
+               assertThat(copySdd.isLocalTo(producerLocation), is(true));
+               assertThat(copySdd.getConnectionId(), is(connectionID));
 
 Review comment:
   add verify `copySdd.getResultPartitionID`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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