Return-Path: X-Original-To: apmail-falcon-commits-archive@minotaur.apache.org Delivered-To: apmail-falcon-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EABA618674 for ; Thu, 3 Mar 2016 10:30:16 +0000 (UTC) Received: (qmail 73331 invoked by uid 500); 3 Mar 2016 10:30:16 -0000 Delivered-To: apmail-falcon-commits-archive@falcon.apache.org Received: (qmail 73297 invoked by uid 500); 3 Mar 2016 10:30:16 -0000 Mailing-List: contact commits-help@falcon.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@falcon.apache.org Delivered-To: mailing list commits@falcon.apache.org Received: (qmail 73288 invoked by uid 99); 3 Mar 2016 10:30:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2016 10:30:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 52F88E0D58; Thu, 3 Mar 2016 10:30:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pallavi@apache.org To: commits@falcon.apache.org Message-Id: <376c9ce3b4fe4bee8f7cc2acd207f53d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: falcon git commit: FALCON-1844 Replication to delete files removed in source by default Date: Thu, 3 Mar 2016 10:30:16 +0000 (UTC) Repository: falcon Updated Branches: refs/heads/master 8f2c0fc7f -> 7e554e791 FALCON-1844 Replication to delete files removed in source by default Author: Pallavi Rao Reviewers: Pavan Kolamuri , Sandeep Samudrala, Peeyush Bishnoi Closes #60 from pallavi-rao/1844 Project: http://git-wip-us.apache.org/repos/asf/falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/7e554e79 Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/7e554e79 Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/7e554e79 Branch: refs/heads/master Commit: 7e554e7913a8b411f462c333cc67cdd307c6ff87 Parents: 8f2c0fc Author: Pallavi Rao Authored: Thu Mar 3 16:00:07 2016 +0530 Committer: Pallavi Rao Committed: Thu Mar 3 16:00:07 2016 +0530 ---------------------------------------------------------------------- .../java/org/apache/falcon/replication/FeedReplicator.java | 8 ++++---- .../org/apache/falcon/replication/FeedReplicatorTest.java | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/falcon/blob/7e554e79/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java ---------------------------------------------------------------------- diff --git a/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java b/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java index bbf7321..a8da51d 100644 --- a/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java +++ b/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java @@ -211,11 +211,11 @@ public class FeedReplicator extends Configured implements Tool { distcpOptions.setSkipCRC(Boolean.parseBoolean(skipChecksum)); } + // Removing deleted files by default - FALCON-1844 String removeDeletedFiles = cmd.getOptionValue( - ReplicationDistCpOption.DISTCP_OPTION_REMOVE_DELETED_FILES.getName()); - if (StringUtils.isNotEmpty(removeDeletedFiles)) { - distcpOptions.setDeleteMissing(Boolean.parseBoolean(removeDeletedFiles)); - } + ReplicationDistCpOption.DISTCP_OPTION_REMOVE_DELETED_FILES.getName(), "true"); + distcpOptions.setDeleteMissing(Boolean.parseBoolean(removeDeletedFiles)); + String preserveBlockSize = cmd.getOptionValue( ReplicationDistCpOption.DISTCP_OPTION_PRESERVE_BLOCK_SIZE.getName()); http://git-wip-us.apache.org/repos/asf/falcon/blob/7e554e79/replication/src/test/java/org/apache/falcon/replication/FeedReplicatorTest.java ---------------------------------------------------------------------- diff --git a/replication/src/test/java/org/apache/falcon/replication/FeedReplicatorTest.java b/replication/src/test/java/org/apache/falcon/replication/FeedReplicatorTest.java index 9cfeb30..e7e177e 100644 --- a/replication/src/test/java/org/apache/falcon/replication/FeedReplicatorTest.java +++ b/replication/src/test/java/org/apache/falcon/replication/FeedReplicatorTest.java @@ -58,6 +58,7 @@ public class FeedReplicatorTest { List srcPaths = new ArrayList(); srcPaths.add(new Path("hdfs://localhost:8020/tmp/")); validateMandatoryArguments(options, srcPaths, true); + Assert.assertTrue(options.shouldDeleteMissing()); } @Test @@ -87,7 +88,7 @@ public class FeedReplicatorTest { "-overwrite", "true", "-ignoreErrors", "false", "-skipChecksum", "false", - "-removeDeletedFiles", "true", + "-removeDeletedFiles", "false", "-preserveBlockSize", "false", "-preserveReplicationNumber", "true", "-preservePermission", "false", @@ -115,7 +116,7 @@ public class FeedReplicatorTest { Assert.assertTrue(options.shouldOverwrite()); Assert.assertFalse(options.shouldIgnoreFailures()); Assert.assertFalse(options.shouldSkipCRC()); - Assert.assertTrue(options.shouldDeleteMissing()); + Assert.assertFalse(options.shouldDeleteMissing()); Assert.assertFalse(options.shouldPreserve(DistCpOptions.FileAttribute.BLOCKSIZE)); Assert.assertTrue(options.shouldPreserve(DistCpOptions.FileAttribute.REPLICATION)); Assert.assertFalse(options.shouldPreserve(DistCpOptions.FileAttribute.PERMISSION));