wangyang0918 commented on a change in pull request #8303: [FLINK-12343] 
[flink-yarn] add file replication config for yarn configuration
URL: https://github.com/apache/flink/pull/8303#discussion_r300947201
 
 

 ##########
 File path: flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNITCase.java
 ##########
 @@ -113,6 +120,30 @@ public void testPerJobMode() throws Exception {
 
                                        assertThat(jobResult, 
is(notNullValue()));
                                        
assertThat(jobResult.getSerializedThrowable().isPresent(), is(false));
+
+                                       final FileSystem fs = 
FileSystem.get(getYarnConfiguration());
+                                       String suffix = ".flink/" + 
applicationId.toString() + "/" + flinkUberjar.getName();
+
+                                       Path uberJarHDFSPath = new 
Path(fs.getHomeDirectory(), suffix);
+                                       FileStatus fsStatus = 
fs.getFileStatus(uberJarHDFSPath);
+                                       Assert.assertEquals(5, 
fsStatus.getReplication());
+
+                                       Path appPath = 
uberJarHDFSPath.getParent();
+                                       FileStatus[] fileStatuses = 
fs.listStatus(appPath, new PathFilter() {
+                                               @Override
+                                               public boolean accept(Path 
path) {
+                                                       return 
path.getName().endsWith("taskmanager-conf.yaml");
+                                               }
+                                       });
+
+                                       final int replication = 
getYarnConfiguration().getInt(DFSConfigKeys.DFS_REPLICATION_KEY,
+                                               
DFSConfigKeys.DFS_REPLICATION_DEFAULT);
+
+                                       // All of the task manager confs are 
used by single TM, the replica number should be DFS_REPLICATION_DEFAULT.
+                                       for (FileStatus fileStatus : 
fileStatuses) {
+                                               
Assert.assertEquals(replication, fsStatus.getReplication());
 
 Review comment:
   Is it a typo? It should be `fileStatus.getReplication()`.

----------------------------------------------------------------
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