[GitHub] [hadoop] swamirishi commented on a change in pull request #2133: HADOOP-17122: Preserving Directory Attributes in DistCp with Atomic Copy

2020-08-10 Thread GitBox


swamirishi commented on a change in pull request #2133:
URL: https://github.com/apache/hadoop/pull/2133#discussion_r468036015



##
File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java
##
@@ -177,6 +177,44 @@ public void testPreserveStatus() throws IOException {
   conf.unset(DistCpConstants.CONF_LABEL_PRESERVE_STATUS);
 }
 
+  }
+  @Test
+  public void testPreserveStatusWithAtomicCommit() throws IOException {
+TaskAttemptContext taskAttemptContext = getTaskAttemptContext(config);
+JobContext jobContext = new 
JobContextImpl(taskAttemptContext.getConfiguration(),
+taskAttemptContext.getTaskAttemptID().getJobID());
+Configuration conf = jobContext.getConfiguration();
+String sourceBase;
+String workBase;
+String targetBase;
+FileSystem fs = null;
+try {
+  OutputCommitter committer = new CopyCommitter(null, taskAttemptContext);
+  fs = FileSystem.get(conf);
+  FsPermission sourcePerm = new FsPermission((short) 511);
+  FsPermission initialPerm = new FsPermission((short) 448);
+  sourceBase = TestDistCpUtils.createTestSetup(fs, sourcePerm);
+  workBase = TestDistCpUtils.createTestSetup(fs, initialPerm);
+  targetBase = "/tmp1/" + String.valueOf(rand.nextLong());
+  final DistCpOptions options = new DistCpOptions.Builder(
+  Collections.singletonList(new Path(sourceBase)), new 
Path("/out"))
+  .preserve(FileAttribute.PERMISSION).build();
+  options.appendToConf(conf);
+  final DistCpContext context = new DistCpContext(options);
+  context.setTargetPathExists(false);
+  CopyListing listing = new GlobbedCopyListing(conf, CREDENTIALS);
+  Path listingFile = new Path("/tmp1/" + String.valueOf(rand.nextLong()));
+  listing.buildListing(listingFile, context);
+  conf.set(DistCpConstants.CONF_LABEL_TARGET_FINAL_PATH, targetBase);

Review comment:
   Done





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] swamirishi commented on a change in pull request #2133: HADOOP-17122: Preserving Directory Attributes in DistCp with Atomic Copy

2020-08-10 Thread GitBox


swamirishi commented on a change in pull request #2133:
URL: https://github.com/apache/hadoop/pull/2133#discussion_r468035016



##
File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java
##
@@ -177,6 +177,44 @@ public void testPreserveStatus() throws IOException {
   conf.unset(DistCpConstants.CONF_LABEL_PRESERVE_STATUS);
 }
 
+  }
+  @Test

Review comment:
   Done





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] swamirishi commented on a change in pull request #2133: HADOOP-17122: Preserving Directory Attributes in DistCp with Atomic Copy

2020-08-10 Thread GitBox


swamirishi commented on a change in pull request #2133:
URL: https://github.com/apache/hadoop/pull/2133#discussion_r468034196



##
File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java
##
@@ -160,10 +160,10 @@ public void testPreserveStatus() throws IOException {
   context.setTargetPathExists(false);
 
   CopyListing listing = new GlobbedCopyListing(conf, CREDENTIALS);
-  Path listingFile = new Path("/tmp1/" + String.valueOf(rand.nextLong()));
+  Path listingFile = new Path("/tmp1/" + rand.nextLong());

Review comment:
   Done





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] swamirishi commented on a change in pull request #2133: HADOOP-17122: Preserving Directory Attributes in DistCp with Atomic Copy

2020-08-10 Thread GitBox


swamirishi commented on a change in pull request #2133:
URL: https://github.com/apache/hadoop/pull/2133#discussion_r464147738



##
File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java
##
@@ -177,6 +177,44 @@ public void testPreserveStatus() throws IOException {
   conf.unset(DistCpConstants.CONF_LABEL_PRESERVE_STATUS);
 }
 
+  }
+  @Test
+  public void testPreserveStatusWithAtomicCommit() throws IOException {
+TaskAttemptContext taskAttemptContext = getTaskAttemptContext(config);
+JobContext jobContext = new 
JobContextImpl(taskAttemptContext.getConfiguration(),
+taskAttemptContext.getTaskAttemptID().getJobID());
+Configuration conf = jobContext.getConfiguration();
+String sourceBase;
+String workBase;
+String targetBase;
+FileSystem fs = null;
+try {
+  OutputCommitter committer = new CopyCommitter(null, taskAttemptContext);
+  fs = FileSystem.get(conf);

Review comment:
   Can we get the code merged?

##
File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java
##
@@ -177,6 +177,44 @@ public void testPreserveStatus() throws IOException {
   conf.unset(DistCpConstants.CONF_LABEL_PRESERVE_STATUS);
 }
 
+  }
+  @Test
+  public void testPreserveStatusWithAtomicCommit() throws IOException {
+TaskAttemptContext taskAttemptContext = getTaskAttemptContext(config);
+JobContext jobContext = new 
JobContextImpl(taskAttemptContext.getConfiguration(),
+taskAttemptContext.getTaskAttemptID().getJobID());
+Configuration conf = jobContext.getConfiguration();
+String sourceBase;
+String workBase;
+String targetBase;
+FileSystem fs = null;
+try {
+  OutputCommitter committer = new CopyCommitter(null, taskAttemptContext);
+  fs = FileSystem.get(conf);

Review comment:
   @steveloughran Can you look at this PR. The test case seems sufficient 
for testing this use case.

##
File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java
##
@@ -177,6 +177,44 @@ public void testPreserveStatus() throws IOException {
   conf.unset(DistCpConstants.CONF_LABEL_PRESERVE_STATUS);
 }
 
+  }
+  @Test
+  public void testPreserveStatusWithAtomicCommit() throws IOException {
+TaskAttemptContext taskAttemptContext = getTaskAttemptContext(config);
+JobContext jobContext = new 
JobContextImpl(taskAttemptContext.getConfiguration(),
+taskAttemptContext.getTaskAttemptID().getJobID());
+Configuration conf = jobContext.getConfiguration();
+String sourceBase;
+String workBase;
+String targetBase;
+FileSystem fs = null;
+try {
+  OutputCommitter committer = new CopyCommitter(null, taskAttemptContext);
+  fs = FileSystem.get(conf);

Review comment:
   @steveloughran Can this code be merged?





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] swamirishi commented on a change in pull request #2133: HADOOP-17122: Preserving Directory Attributes in DistCp with Atomic Copy

2020-08-03 Thread GitBox


swamirishi commented on a change in pull request #2133:
URL: https://github.com/apache/hadoop/pull/2133#discussion_r464388213



##
File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java
##
@@ -160,10 +160,10 @@ public void testPreserveStatus() throws IOException {
   context.setTargetPathExists(false);
 
   CopyListing listing = new GlobbedCopyListing(conf, CREDENTIALS);
-  Path listingFile = new Path("/tmp1/" + String.valueOf(rand.nextLong()));
+  Path listingFile = new Path("/tmp1/" + rand.nextLong());
   listing.buildListing(listingFile, context);
 
-  conf.set(DistCpConstants.CONF_LABEL_TARGET_WORK_PATH, targetBase);
+  conf.set(DistCpConstants.CONF_LABEL_TARGET_FINAL_PATH, targetBase);

Review comment:
   @mukund-thakur  Can this code be merged? Or is there anything I have to 
do from my end.





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] swamirishi commented on a change in pull request #2133: HADOOP-17122: Preserving Directory Attributes in DistCp with Atomic Copy

2020-08-03 Thread GitBox


swamirishi commented on a change in pull request #2133:
URL: https://github.com/apache/hadoop/pull/2133#discussion_r464329525



##
File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java
##
@@ -160,10 +160,10 @@ public void testPreserveStatus() throws IOException {
   context.setTargetPathExists(false);
 
   CopyListing listing = new GlobbedCopyListing(conf, CREDENTIALS);
-  Path listingFile = new Path("/tmp1/" + String.valueOf(rand.nextLong()));
+  Path listingFile = new Path("/tmp1/" + rand.nextLong());
   listing.buildListing(listingFile, context);
 
-  conf.set(DistCpConstants.CONF_LABEL_TARGET_WORK_PATH, targetBase);
+  conf.set(DistCpConstants.CONF_LABEL_TARGET_FINAL_PATH, targetBase);

Review comment:
   This test case is not the case of Atomic Copy or non Atomic Copy. You 
are right about that, the value of final Path & work path would be same in case 
of non atomic copy . But as you see above we are setting the environment for 
testing the preserve status functionality & not doing a copy. It solely depends 
on the configuration value of the final Path & not the work path. This is the 
bug I raised & fixed the test case pertaining to this along with it.





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] swamirishi commented on a change in pull request #2133: HADOOP-17122: Preserving Directory Attributes in DistCp with Atomic Copy

2020-08-03 Thread GitBox


swamirishi commented on a change in pull request #2133:
URL: https://github.com/apache/hadoop/pull/2133#discussion_r464256899



##
File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java
##
@@ -177,6 +177,44 @@ public void testPreserveStatus() throws IOException {
   conf.unset(DistCpConstants.CONF_LABEL_PRESERVE_STATUS);
 }
 
+  }
+  @Test
+  public void testPreserveStatusWithAtomicCommit() throws IOException {
+TaskAttemptContext taskAttemptContext = getTaskAttemptContext(config);
+JobContext jobContext = new 
JobContextImpl(taskAttemptContext.getConfiguration(),
+taskAttemptContext.getTaskAttemptID().getJobID());
+Configuration conf = jobContext.getConfiguration();
+String sourceBase;
+String workBase;
+String targetBase;
+FileSystem fs = null;
+try {
+  OutputCommitter committer = new CopyCommitter(null, taskAttemptContext);
+  fs = FileSystem.get(conf);

Review comment:
   @steveloughran Can this code be merged?





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] swamirishi commented on a change in pull request #2133: HADOOP-17122: Preserving Directory Attributes in DistCp with Atomic Copy

2020-08-03 Thread GitBox


swamirishi commented on a change in pull request #2133:
URL: https://github.com/apache/hadoop/pull/2133#discussion_r464243407



##
File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java
##
@@ -177,6 +177,44 @@ public void testPreserveStatus() throws IOException {
   conf.unset(DistCpConstants.CONF_LABEL_PRESERVE_STATUS);
 }
 
+  }
+  @Test
+  public void testPreserveStatusWithAtomicCommit() throws IOException {
+TaskAttemptContext taskAttemptContext = getTaskAttemptContext(config);
+JobContext jobContext = new 
JobContextImpl(taskAttemptContext.getConfiguration(),
+taskAttemptContext.getTaskAttemptID().getJobID());
+Configuration conf = jobContext.getConfiguration();
+String sourceBase;
+String workBase;
+String targetBase;
+FileSystem fs = null;
+try {
+  OutputCommitter committer = new CopyCommitter(null, taskAttemptContext);
+  fs = FileSystem.get(conf);

Review comment:
   @steveloughran Can you look at this PR. The test case seems sufficient 
for testing this use case.





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] swamirishi commented on a change in pull request #2133: HADOOP-17122: Preserving Directory Attributes in DistCp with Atomic Copy

2020-08-02 Thread GitBox


swamirishi commented on a change in pull request #2133:
URL: https://github.com/apache/hadoop/pull/2133#discussion_r464147738



##
File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java
##
@@ -177,6 +177,44 @@ public void testPreserveStatus() throws IOException {
   conf.unset(DistCpConstants.CONF_LABEL_PRESERVE_STATUS);
 }
 
+  }
+  @Test
+  public void testPreserveStatusWithAtomicCommit() throws IOException {
+TaskAttemptContext taskAttemptContext = getTaskAttemptContext(config);
+JobContext jobContext = new 
JobContextImpl(taskAttemptContext.getConfiguration(),
+taskAttemptContext.getTaskAttemptID().getJobID());
+Configuration conf = jobContext.getConfiguration();
+String sourceBase;
+String workBase;
+String targetBase;
+FileSystem fs = null;
+try {
+  OutputCommitter committer = new CopyCommitter(null, taskAttemptContext);
+  fs = FileSystem.get(conf);

Review comment:
   Can we get the code merged?





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] swamirishi commented on a change in pull request #2133: HADOOP-17122: Preserving Directory Attributes in DistCp with Atomic Copy

2020-08-02 Thread GitBox


swamirishi commented on a change in pull request #2133:
URL: https://github.com/apache/hadoop/pull/2133#discussion_r464147008



##
File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java
##
@@ -177,6 +177,44 @@ public void testPreserveStatus() throws IOException {
   conf.unset(DistCpConstants.CONF_LABEL_PRESERVE_STATUS);
 }
 
+  }
+  @Test
+  public void testPreserveStatusWithAtomicCommit() throws IOException {
+TaskAttemptContext taskAttemptContext = getTaskAttemptContext(config);
+JobContext jobContext = new 
JobContextImpl(taskAttemptContext.getConfiguration(),
+taskAttemptContext.getTaskAttemptID().getJobID());
+Configuration conf = jobContext.getConfiguration();
+String sourceBase;
+String workBase;
+String targetBase;
+FileSystem fs = null;
+try {
+  OutputCommitter committer = new CopyCommitter(null, taskAttemptContext);
+  fs = FileSystem.get(conf);

Review comment:
   Yeah, we have registered a HDFS minicluster.





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org