org.apache.hadoop.hbase.HBaseTestingUtility.setZkCluster()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中org.apache.hadoop.hbase.HBaseTestingUtility.setZkCluster()方法的一些代码示例,展示了HBaseTestingUtility.setZkCluster()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HBaseTestingUtility.setZkCluster()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.HBaseTestingUtility
类名称:HBaseTestingUtility
方法名:setZkCluster

HBaseTestingUtility.setZkCluster介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

protected static void initTestingUtility(HBaseTestingUtility util, String zkParent) {
 util.setZkCluster(ZK_UTIL.getZkCluster());
 Configuration conf = util.getConfiguration();
 conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, zkParent);
 conf.setInt("replication.source.size.capacity", 102400);
 conf.setLong("replication.source.sleepforretries", 100);
 conf.setInt("hbase.regionserver.maxlogs", 10);
 conf.setLong("hbase.master.logcleaner.ttl", 10);
 conf.setInt("zookeeper.recovery.retry", 1);
 conf.setInt("zookeeper.recovery.retry.intervalmill", 10);
 conf.setLong(HConstants.THREAD_WAKE_FREQUENCY, 100);
 conf.setInt("replication.stats.thread.period.seconds", 5);
 conf.setBoolean("hbase.tests.use.shortcircuit.reads", false);
 conf.setLong("replication.sleep.before.failover", 2000);
 conf.setInt("replication.source.maxretriesmultiplier", 10);
 conf.setFloat("replication.source.ratio", 1.0f);
 conf.setBoolean("replication.source.eof.autorecovery", true);
}

代码示例来源:origin: apache/hbase

utility1.startMiniZKCluster();
MiniZooKeeperCluster miniZK = utility1.getZkCluster();
utility1.setZkCluster(miniZK);
new ZKWatcher(conf1, "cluster1", null, true);
utility2.setZkCluster(miniZK);
new ZKWatcher(conf2, "cluster2", null, true);
utility3.setZkCluster(miniZK);
new ZKWatcher(conf3, "cluster3", null, true);

代码示例来源:origin: apache/hbase

@SuppressWarnings("resource")
private void startMiniClusters(int numClusters) throws Exception {
 Random random = new Random();
 utilities = new HBaseTestingUtility[numClusters];
 configurations = new Configuration[numClusters];
 for (int i = 0; i < numClusters; i++) {
  Configuration conf = new Configuration(baseConfiguration);
  conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/" + i + random.nextInt());
  HBaseTestingUtility utility = new HBaseTestingUtility(conf);
  if (i == 0) {
   utility.startMiniZKCluster();
   miniZK = utility.getZkCluster();
  } else {
   utility.setZkCluster(miniZK);
  }
  utility.startMiniCluster();
  utilities[i] = utility;
  configurations[i] = conf;
  new ZKWatcher(conf, "cluster" + i, null, true);
 }
}

代码示例来源:origin: apache/hbase

utility2.setZkCluster(miniZK);
new ZKWatcher(conf2, "cluster3", null, true);
utility3.setZkCluster(miniZK);
new ZKWatcher(conf3, "cluster3", null, true);

代码示例来源:origin: apache/hbase

utility2.setZkCluster(miniZK);

代码示例来源:origin: apache/hbase

conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2");
TEST_UTIL2 = new HBaseTestingUtility(conf2);
TEST_UTIL2.setZkCluster(TEST_UTIL.getZkCluster());
TEST_UTIL2.startMiniDFSCluster(3);
String root2 = TEST_UTIL2.getConfiguration().get("fs.defaultFS");

代码示例来源:origin: apache/hbase

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 conf1 = HBaseConfiguration.create();
 conf1.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/1");
 conf1.setLong("replication.source.sleepforretries", 100);
 // Each WAL is about 120 bytes
 conf1.setInt(HConstants.REPLICATION_SOURCE_TOTAL_BUFFER_KEY, REPLICATION_SOURCE_QUOTA);
 conf1.setLong("replication.source.per.peer.node.bandwidth", 100L);
 utility1 = new HBaseTestingUtility(conf1);
 utility1.startMiniZKCluster();
 MiniZooKeeperCluster miniZK = utility1.getZkCluster();
 new ZKWatcher(conf1, "cluster1", null, true);
 conf2 = new Configuration(conf1);
 conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2");
 utility2 = new HBaseTestingUtility(conf2);
 utility2.setZkCluster(miniZK);
 new ZKWatcher(conf2, "cluster2", null, true);
 ReplicationAdmin admin1 = new ReplicationAdmin(conf1);
 ReplicationPeerConfig rpc = new ReplicationPeerConfig();
 rpc.setClusterKey(utility2.getClusterKey());
 utility1.startMiniCluster();
 utility2.startMiniCluster();
 admin1.addPeer("peer1", rpc, null);
 admin1.addPeer("peer2", rpc, null);
 admin1.addPeer("peer3", rpc, null);
 numOfPeer = admin1.getPeersCount();
}

代码示例来源:origin: apache/hbase

TEST_UTIL1.setZkCluster(miniZK);
zkw2 = new ZKWatcher(conf1, "cluster2", null, true);

代码示例来源:origin: apache/hbase

setVisibilityLabelServiceImpl(conf1, ExpAsStringVisibilityLabelServiceImpl.class);
TEST_UTIL1 = new HBaseTestingUtility(conf1);
TEST_UTIL1.setZkCluster(miniZK);
zkw2 = new ZKWatcher(conf1, "cluster2", null, true);

代码示例来源:origin: apache/hbase

utility2.setZkCluster(miniZK);
zkw2 = new ZKWatcher(conf2, "cluster2", null, true);
LOG.info("Setup second Zk");

代码示例来源:origin: apache/hbase

htu2.getConfiguration().set(HConstants.ZOOKEEPER_CLIENT_PORT,
 htu1.getConfiguration().get(HConstants.ZOOKEEPER_CLIENT_PORT, "-1"));
htu2.setZkCluster(htu1.getZkCluster());
htu3.getConfiguration().set(HConstants.ZOOKEEPER_CLIENT_PORT,
 htu1.getConfiguration().get(HConstants.ZOOKEEPER_CLIENT_PORT, "-1"));
htu3.setZkCluster(htu1.getZkCluster());

代码示例来源:origin: apache/hbase

HTU2.setZkCluster(miniZK);
HTU2.startMiniCluster(NB_SERVERS);
LOG.info("Setup second Zk");

代码示例来源:origin: Impetus/Kundera

utility.setZkCluster(zkCluster);
utility.startMiniCluster();
utility.getHBaseCluster().startMaster();

代码示例来源:origin: apache/phoenix

utility2.setZkCluster(miniZK);
zkw2 = new ZKWatcher(conf2, "cluster2", null, true);

代码示例来源:origin: org.apache.hbase/hbase-server

utility1.startMiniZKCluster();
MiniZooKeeperCluster miniZK = utility1.getZkCluster();
utility1.setZkCluster(miniZK);
new ZKWatcher(conf1, "cluster1", null, true);
utility2.setZkCluster(miniZK);
new ZKWatcher(conf2, "cluster2", null, true);
utility3.setZkCluster(miniZK);
new ZKWatcher(conf3, "cluster3", null, true);

代码示例来源:origin: org.apache.hbase/hbase-server

@SuppressWarnings("resource")
private void startMiniClusters(int numClusters) throws Exception {
 Random random = new Random();
 utilities = new HBaseTestingUtility[numClusters];
 configurations = new Configuration[numClusters];
 for (int i = 0; i < numClusters; i++) {
  Configuration conf = new Configuration(baseConfiguration);
  conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/" + i + random.nextInt());
  HBaseTestingUtility utility = new HBaseTestingUtility(conf);
  if (i == 0) {
   utility.startMiniZKCluster();
   miniZK = utility.getZkCluster();
  } else {
   utility.setZkCluster(miniZK);
  }
  utility.startMiniCluster();
  utilities[i] = utility;
  configurations[i] = conf;
  new ZKWatcher(conf, "cluster" + i, null, true);
 }
}

代码示例来源:origin: org.apache.hbase/hbase-server

utility2.setZkCluster(miniZK);
new ZKWatcher(conf2, "cluster3", null, true);
utility3.setZkCluster(miniZK);
new ZKWatcher(conf3, "cluster3", null, true);

代码示例来源:origin: org.apache.hbase/hbase-server

utility2.setZkCluster(miniZK);

代码示例来源:origin: org.apache.hbase/hbase-server

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 conf1 = HBaseConfiguration.create();
 conf1.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/1");
 conf1.setLong("replication.source.sleepforretries", 100);
 // Each WAL is about 120 bytes
 conf1.setInt(HConstants.REPLICATION_SOURCE_TOTAL_BUFFER_KEY, REPLICATION_SOURCE_QUOTA);
 conf1.setLong("replication.source.per.peer.node.bandwidth", 100L);
 utility1 = new HBaseTestingUtility(conf1);
 utility1.startMiniZKCluster();
 MiniZooKeeperCluster miniZK = utility1.getZkCluster();
 new ZKWatcher(conf1, "cluster1", null, true);
 conf2 = new Configuration(conf1);
 conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2");
 utility2 = new HBaseTestingUtility(conf2);
 utility2.setZkCluster(miniZK);
 new ZKWatcher(conf2, "cluster2", null, true);
 ReplicationAdmin admin1 = new ReplicationAdmin(conf1);
 ReplicationPeerConfig rpc = new ReplicationPeerConfig();
 rpc.setClusterKey(utility2.getClusterKey());
 utility1.startMiniCluster(1, 1);
 utility2.startMiniCluster(1, 1);
 admin1.addPeer("peer1", rpc, null);
 admin1.addPeer("peer2", rpc, null);
 admin1.addPeer("peer3", rpc, null);
 numOfPeer = admin1.getPeersCount();
}

代码示例来源:origin: org.apache.hbase/hbase-server

htu2.getConfiguration().set(HConstants.ZOOKEEPER_CLIENT_PORT,
 htu1.getConfiguration().get(HConstants.ZOOKEEPER_CLIENT_PORT, "-1"));
htu2.setZkCluster(htu1.getZkCluster());
htu3.getConfiguration().set(HConstants.ZOOKEEPER_CLIENT_PORT,
 htu1.getConfiguration().get(HConstants.ZOOKEEPER_CLIENT_PORT, "-1"));
htu3.setZkCluster(htu1.getZkCluster());

相关文章

HBaseTestingUtility类方法