Return-Path: X-Original-To: apmail-hive-commits-archive@www.apache.org Delivered-To: apmail-hive-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8A10C18D36 for ; Fri, 15 May 2015 04:31:29 +0000 (UTC) Received: (qmail 7254 invoked by uid 500); 15 May 2015 04:31:29 -0000 Delivered-To: apmail-hive-commits-archive@hive.apache.org Received: (qmail 7153 invoked by uid 500); 15 May 2015 04:31:29 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 6199 invoked by uid 99); 15 May 2015 04:31:28 -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; Fri, 15 May 2015 04:31:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8AF61E3CC3; Fri, 15 May 2015 04:31:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: xuefu@apache.org To: commits@hive.apache.org Date: Fri, 15 May 2015 04:31:40 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [13/50] [abbrv] hive git commit: HIVE-10539 : set default value of hive.repl.task.factory (Thejas Nair via Sushanth Sowmyan) HIVE-10539 : set default value of hive.repl.task.factory (Thejas Nair via Sushanth Sowmyan) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/a9d70a03 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/a9d70a03 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/a9d70a03 Branch: refs/heads/beeline-cli Commit: a9d70a03953aeedbe70b62fbc5820bc18754db8c Parents: 45307c1 Author: Sushanth Sowmyan Authored: Wed May 6 02:54:43 2015 -0700 Committer: Sushanth Sowmyan Committed: Wed May 6 02:55:35 2015 -0700 ---------------------------------------------------------------------- .../java/org/apache/hadoop/hive/conf/HiveConf.java | 3 ++- .../hive/hcatalog/api/repl/TestReplicationTask.java | 14 ++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/a9d70a03/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java ---------------------------------------------------------------------- diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 69fda45..db17f0f 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -1657,7 +1657,8 @@ public class HiveConf extends Configuration { "imported on to tables that are the target of replication. If this parameter is\n" + "set, regular imports will check if the destination table(if it exists) has a " + "'repl.last.id' set on it. If so, it will fail."), - HIVE_REPL_TASK_FACTORY("hive.repl.task.factory","", + HIVE_REPL_TASK_FACTORY("hive.repl.task.factory", + "org.apache.hive.hcatalog.api.repl.exim.EximReplicationTaskFactory", "Parameter that can be used to override which ReplicationTaskFactory will be\n" + "used to instantiate ReplicationTask events. Override for third party repl plugins"), HIVE_MAPPER_CANNOT_SPAN_MULTIPLE_PARTITIONS("hive.mapper.cannot.span.multiple.partitions", false, ""), http://git-wip-us.apache.org/repos/asf/hive/blob/a9d70a03/hcatalog/webhcat/java-client/src/test/java/org/apache/hive/hcatalog/api/repl/TestReplicationTask.java ---------------------------------------------------------------------- diff --git a/hcatalog/webhcat/java-client/src/test/java/org/apache/hive/hcatalog/api/repl/TestReplicationTask.java b/hcatalog/webhcat/java-client/src/test/java/org/apache/hive/hcatalog/api/repl/TestReplicationTask.java index ea7698e..9d62eaa 100644 --- a/hcatalog/webhcat/java-client/src/test/java/org/apache/hive/hcatalog/api/repl/TestReplicationTask.java +++ b/hcatalog/webhcat/java-client/src/test/java/org/apache/hive/hcatalog/api/repl/TestReplicationTask.java @@ -19,11 +19,14 @@ package org.apache.hive.hcatalog.api.repl; import junit.framework.TestCase; + import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.NotificationEvent; import org.apache.hadoop.hive.metastore.api.Table; import org.apache.hive.hcatalog.api.HCatClient; import org.apache.hive.hcatalog.api.HCatNotificationEvent; +import org.apache.hive.hcatalog.api.repl.exim.CreateTableReplicationTask; +import org.apache.hive.hcatalog.api.repl.exim.EximReplicationTaskFactory; import org.apache.hive.hcatalog.common.HCatConstants; import org.apache.hive.hcatalog.common.HCatException; import org.apache.hive.hcatalog.messaging.MessageFactory; @@ -75,17 +78,12 @@ public class TestReplicationTask extends TestCase{ event.setTableName(t.getTableName()); ReplicationTask.resetFactory(null); - Exception caught = null; - try { - ReplicationTask rtask = ReplicationTask.create(HCatClient.create(new HiveConf()),new HCatNotificationEvent(event)); - } catch (Exception e){ - caught = e; - } - assertNotNull("By default, without a ReplicationTaskFactory instantiated, replication tasks should fail.",caught); + ReplicationTask rtask = ReplicationTask.create(HCatClient.create(new HiveConf()),new HCatNotificationEvent(event)); + assertTrue("Provided factory instantiation should yield CreateTableReplicationTask", rtask instanceof CreateTableReplicationTask); ReplicationTask.resetFactory(NoopFactory.class); - ReplicationTask rtask = ReplicationTask.create(HCatClient.create(new HiveConf()),new HCatNotificationEvent(event)); + rtask = ReplicationTask.create(HCatClient.create(new HiveConf()),new HCatNotificationEvent(event)); assertTrue("Provided factory instantiation should yield NoopReplicationTask", rtask instanceof NoopReplicationTask); ReplicationTask.resetFactory(null);