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

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

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

HBaseTestingUtility.startMiniZKCluster介绍

暂无

代码示例

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 TEST_UTIL.startMiniZKCluster();
}

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

@BeforeClass
public static void setupTest() throws Exception {
 UTIL.startMiniZKCluster();
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 TEST_UTIL.startMiniZKCluster();
}

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

@Before
public void before() throws Exception {
 UTIL.startMiniZKCluster();
}

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

@BeforeClass
public static void setupTest() throws Exception {
 UTIL.startMiniZKCluster();
}

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

/**
 * @throws Exception if starting the mini cluster or getting the filesystem fails
 */
@BeforeClass
public static void setUpBeforeClass() throws Exception {
 conf.setBoolean(BackupRestoreConstants.BACKUP_ENABLE_KEY, true);
 TEST_UTIL.startMiniZKCluster();
 TEST_UTIL.startMiniCluster(1);
 fs = FileSystem.get(conf);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 conf = HBaseConfiguration.create();
 conf.set("replication.replicationsource.implementation",
  ReplicationSourceDummy.class.getCanonicalName());
 conf.setLong("replication.sleep.before.failover", 2000);
 conf.setInt("replication.source.maxretriesmultiplier", 10);
 utility = new HBaseTestingUtility(conf);
 utility.startMiniZKCluster();
 setupZkAndReplication();
}

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

@BeforeClass
public static void beforeClass() throws Exception {
 // Set this down so tests run quicker
 UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 3);
 UTIL.startMiniZKCluster();
}

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

@BeforeClass
public static void setup() throws Exception {
 // Uncomment the following line if more verbosity is needed for
 // debugging (see HBASE-12285 for details).
 // Logger.getLogger("org.apache.hadoop.hbase").setLevel(Level.DEBUG);
 TEST_UTIL.startMiniZKCluster();
 TEST_UTIL.startMiniDFSCluster(3);
}

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

@BeforeClass
public static void setupBeforeClass() throws Exception {
 TEST_UTIL = new HBaseTestingUtility();
 TEST_UTIL.startMiniZKCluster();
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 // don't let hdfs client to choose a new replica when dn down
 TEST_UTIL.getConfiguration()
   .setBoolean("dfs.client.block.write.replace-datanode-on-failure.enable", false);
 TEST_UTIL.getConfiguration().setLong("hbase.regionserver.hlog.check.lowreplication.interval",
  CHECK_LOW_REPLICATION_INTERVAL);
 TEST_UTIL.startMiniDFSCluster(3);
 TEST_UTIL.startMiniZKCluster();
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 // Test we can first start the ZK cluster by itself
 Configuration conf = TEST_UTIL.getConfiguration();
 TEST_UTIL.startMiniDFSCluster(2);
 TEST_UTIL.startMiniZKCluster();
 conf.setInt(HConstants.ZK_SESSION_TIMEOUT, 1000);
 conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, MockLoadBalancer.class,
   LoadBalancer.class);
}

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

@Before
public void setUp() throws Exception {
 Configuration conf = testUtil.getConfiguration();
 conf.set(HConstants.MASTER_PORT, "0");
 conf.setInt(HConstants.ZK_SESSION_TIMEOUT, 2000);
 testUtil.startMiniZKCluster();
 ZKWatcher watcher = testUtil.getZooKeeperWatcher();
 ZKUtil.createWithParents(watcher, watcher.getZNodePaths().masterAddressZNode,
     Bytes.toBytes("fake:123"));
 master = new HMaster(conf);
 rpcClient = RpcClientFactory.createClient(conf, HConstants.CLUSTER_ID_DEFAULT);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 TEST_UTIL.startMiniZKCluster();
 TEST_UTIL.startMiniDFSCluster(1);
 CleanerChore.initChorePool(TEST_UTIL.getConfiguration());
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 TEST_UTIL.startMiniZKCluster();
 server = new DummyServer();
 conf.setBoolean(HConstants.REPLICATION_BULKLOAD_ENABLE_KEY, true);
 HMaster.decorateMasterConfiguration(conf);
 rp = ReplicationFactory.getReplicationPeers(server.getZooKeeper(), conf);
 rp.init();
 rq = ReplicationStorageFactory.getReplicationQueueStorage(server.getZooKeeper(), conf);
 fs = FileSystem.get(conf);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 Configuration c = TESTUTIL.getConfiguration();
 // We use local filesystem.  Set it so it writes into the testdir.
 FSUtils.setRootDir(c, TESTUTIL.getDataTestDir());
 DefaultMetricsSystem.setMiniClusterMode(true);
 // Startup a mini zk cluster.
 TESTUTIL.startMiniZKCluster();
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 utility = new HBaseTestingUtility();
 utility.startMiniZKCluster();
 conf = utility.getConfiguration();
 ZKWatcher zk = HBaseTestingUtility.getZooKeeperWatcher(utility);
 ZKUtil.createWithParents(zk, zk.getZNodePaths().rsZNode);
}

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

@Before
public void setUp() throws Exception {
 testUtil = new HBaseTestingUtility();
 testUtil.startMiniDFSCluster(1);
 testUtil.startMiniZKCluster(1);
 testUtil.createRootDir(); //manually setup hbase dir to point to minidfscluster
 cluster = new LocalHBaseCluster(testUtil.getConfiguration(), 0, 0);
}

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

@Before
public void setUp() throws Exception {
 testUtil = new HBaseTestingUtility();
 testUtil.startMiniDFSCluster(1);
 testUtil.startMiniZKCluster(1);
 testUtil.createRootDir();
 cluster = new LocalHBaseCluster(testUtil.getConfiguration(), 0, 0);
}

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

@Test
public void testMiniZooKeeperWithOneServer() throws Exception {
 HBaseTestingUtility hbt = new HBaseTestingUtility();
 MiniZooKeeperCluster cluster1 = hbt.startMiniZKCluster();
 try {
  assertEquals(0, cluster1.getBackupZooKeeperServerNum());
  assertTrue((cluster1.killCurrentActiveZooKeeperServer() == -1));
 } finally {
  hbt.shutdownMiniZKCluster();
 }
}

相关文章

HBaseTestingUtility类方法