You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by an...@apache.org on 2017/12/25 13:00:45 UTC
phoenix git commit: PHOENIX-4492 Fix MutableIndexReplicationIT
Repository: phoenix
Updated Branches:
refs/heads/5.x-HBase-2.0 bacf13775 -> 2af8aaf6b
PHOENIX-4492 Fix MutableIndexReplicationIT
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/2af8aaf6
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/2af8aaf6
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/2af8aaf6
Branch: refs/heads/5.x-HBase-2.0
Commit: 2af8aaf6be3048cd9e08e79ca7763654af189885
Parents: bacf137
Author: Ankit Singhal <an...@gmail.com>
Authored: Mon Dec 25 18:30:37 2017 +0530
Committer: Ankit Singhal <an...@gmail.com>
Committed: Mon Dec 25 18:30:37 2017 +0530
----------------------------------------------------------------------
.../end2end/index/MutableIndexReplicationIT.java | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/2af8aaf6/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexReplicationIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexReplicationIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexReplicationIT.java
index 1a380b8..5cc4e05 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexReplicationIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexReplicationIT.java
@@ -50,7 +50,6 @@ import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.client.TableDescriptor;
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
-import org.apache.hadoop.hbase.client.replication.ReplicationAdmin;
import org.apache.hadoop.hbase.replication.ReplicationPeerConfig;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster;
@@ -97,7 +96,7 @@ public class MutableIndexReplicationIT extends BaseTest {
protected static ZKWatcher zkw1;
protected static ZKWatcher zkw2;
- protected static ReplicationAdmin admin;
+ protected static Admin admin;
protected static HBaseTestingUtility utility1;
protected static HBaseTestingUtility utility2;
@@ -137,7 +136,7 @@ public class MutableIndexReplicationIT extends BaseTest {
// than default
conf1 = utility1.getConfiguration();
zkw1 = new ZKWatcher(conf1, "cluster1", null, true);
- admin = new ReplicationAdmin(conf1);
+ admin=ConnectionFactory.createConnection(conf1).getAdmin();
LOG.info("Setup first Zk");
// Base conf2 on conf1 so it gets the right zk cluster, and general cluster configs
@@ -151,12 +150,11 @@ public class MutableIndexReplicationIT extends BaseTest {
utility2.setZkCluster(miniZK);
zkw2 = new ZKWatcher(conf2, "cluster2", null, true);
- //replicate from cluster 1 -> cluster 2, but not back again
- admin.addPeer("1", new ReplicationPeerConfig().setClusterKey(utility2.getClusterKey()),null);
-
LOG.info("Setup second Zk");
utility1.startMiniCluster(2);
utility2.startMiniCluster(2);
+ //replicate from cluster 1 -> cluster 2, but not back again
+ admin.addReplicationPeer("1", new ReplicationPeerConfig().setClusterKey(utility2.getClusterKey()));
}
private static void setupDriver() throws Exception {
@@ -211,7 +209,7 @@ public class MutableIndexReplicationIT extends BaseTest {
assertEquals(1, cols.length);
// add the replication scope to the column
ColumnFamilyDescriptor col = ColumnFamilyDescriptorBuilder.newBuilder(cols[0].getName()).setScope(HConstants.REPLICATION_SCOPE_GLOBAL).build();
- desc=TableDescriptorBuilder.newBuilder(desc).addColumnFamily(col).build();
+ desc=TableDescriptorBuilder.newBuilder(desc).removeColumnFamily(cols[0].getName()).addColumnFamily(col).build();
//disable/modify/enable table so it has replication enabled
admin.disableTable(desc.getTableName());
admin.modifyTable(desc);