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

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

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

HBaseTestingUtility.startMiniCluster介绍

[英]Start up a minicluster of hbase, dfs and zookeeper all using default options. Option default value can be found in StartMiniClusterOption.Builder.
[中]使用默认选项启动hbase、dfs和zookeeper的小型集群。选项默认值可在StartMiniClusterOption中找到。建设者

代码示例

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

@BeforeClass
public static void setUp() throws Exception {
 final Configuration conf = TEST_UTIL.getConfiguration();
 conf.setBoolean(CoprocessorHost.COPROCESSORS_ENABLED_CONF_KEY, true);
 TEST_UTIL.startMiniCluster(5);
}

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

@Before
public void setUp() throws Exception {
 TEST_UTIL.getConfiguration().set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,
  MasterSyncObserver.class.getName());
 TEST_UTIL.startMiniCluster(1);
}

代码示例来源: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 before() throws Exception {
 Configuration conf = UTIL.getConfiguration();
 conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, CustomObserver.class.getName());
 conf.setStrings(
  CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,
  MasterSyncObserver.class.getName(), CPMasterObserver.class.getName());
 conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 5);
 conf.setBoolean(QuotaUtil.QUOTA_CONF_KEY, true);
 conf.setClass("hbase.coprocessor.regionserver.classes", CPRegionServerObserver.class,
  RegionServerObserver.class);
 UTIL.startMiniCluster();
 waitForQuotaInitialize(UTIL);
 ADMIN = UTIL.getAdmin();
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 Configuration conf = HBaseConfiguration.create();
 conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, TestWALObserver.class.getName());
 util = new HBaseTestingUtility(conf);
 util.startMiniCluster();
}

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

@BeforeClass
public static void beforeClass() throws Exception {
 // Default in ZookeeperMiniCluster is 1000, setting artificially low to trigger exhaustion.
 // need min of 7 to properly start the default mini HBase cluster
 UTIL.getConfiguration().setInt(HConstants.ZOOKEEPER_MAX_CLIENT_CNXNS, 10);
 UTIL.startMiniCluster();
}

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

@BeforeClass
public static void setUp() throws Exception {
 conf.setBoolean(BackupRestoreConstants.BACKUP_ENABLE_KEY, true);
 BackupManager.decorateMasterConfiguration(conf);
 BackupManager.decorateRegionServerConfiguration(conf);
 cluster = UTIL.startMiniCluster();
 conn = UTIL.getConnection();
}

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

@Before
public void before() throws Exception {
 UTIL.getConfiguration().set("hbase.master.loadbalancer.class", this.balancerName);
 // set minCostNeedBalance to 0, make sure balancer run
 UTIL.startMiniCluster(1);
 this.desc = new HTableDescriptor(TableName.valueOf("test"));
 this.desc.addFamily(new HColumnDescriptor(FAMILY_NAME));
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 // disable the retry
 TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 0);
 TEST_UTIL.startMiniCluster(1);
}

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

@Before
public void setUp() throws Exception {
 TEST_UTIL.getConfiguration().set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,
  MasterSyncObserver.class.getName());
 TEST_UTIL.startMiniCluster(1);
}

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

/**
 * @throws java.lang.Exception
 */
@BeforeClass
public static void setUpBeforeClass() throws Exception {
 TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD,
  leaseTimeout);
 TEST_UTIL.startMiniCluster();
}

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

@Test
public void testMiniClusterBindToWildcard() throws Exception {
 HBaseTestingUtility hbt = new HBaseTestingUtility();
 hbt.getConfiguration().set("hbase.regionserver.ipc.address", "0.0.0.0");
 MiniHBaseCluster cluster = hbt.startMiniCluster();
 try {
  assertEquals(1, cluster.getLiveRegionServerThreads().size());
 } finally {
  hbt.shutdownMiniCluster();
 }
}

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

/**
 * @throws java.lang.Exception
 */
@BeforeClass
public static void setUpBeforeClass() throws Exception {
 // Turn off codec use
 TEST_UTIL.getConfiguration().set("hbase.client.default.rpc.codec", "");
 TEST_UTIL.startMiniCluster(1);
}

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

@BeforeClass
public static void setupBeforeClass() throws Exception {
 Configuration conf = util.getConfiguration();
 conf.setInt("hbase.hfile.compaction.discharger.interval",
  Integer.MAX_VALUE);
 util.startMiniCluster(3);
}

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

@BeforeClass
public static void setupBeforeClass() throws Exception {
 Configuration conf = UTIL.getConfiguration();
 conf.set(CoprocessorHost.REGIONSERVER_COPROCESSOR_CONF_KEY,
  JMXListener.class.getName());
 conf.setInt("regionserver.rmi.registry.port", connectorPort);
 UTIL.startMiniCluster();
}

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

@BeforeClass
public static void setupBeforeClass() throws Exception {
 Configuration conf = UTIL.getConfiguration();
 conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,
   BuggyMasterObserver.class.getName());
 conf.setBoolean(CoprocessorHost.ABORT_ON_ERROR_KEY, true);
 conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 2);  // Fail fast
 UTIL.startMiniCluster();
}

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

@BeforeClass
public static void setupBeforeClass() throws Exception {
 Configuration conf = TEST_UTIL.getConfiguration();
 conf.set(RSRpcServices.MASTER_RPC_SCHEDULER_FACTORY_CLASS,
  "org.apache.hadoop.hbase.regionserver.MasterFifoRpcSchedulerFactory");
 conf.setInt(HConstants.REGION_SERVER_HANDLER_COUNT, 5);
 conf.setInt(MasterFifoRpcScheduler.MASTER_SERVER_REPORT_HANDLER_COUNT, 2);
 TEST_UTIL.startMiniCluster();
}

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

@BeforeClass
public static void setUp() throws Exception {
 UTIL.getConfiguration().setBoolean("hbase.write.hbck1.lock.file", false);
 UTIL.startMiniCluster(1);
}

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

@BeforeClass
public static void provisionCluster() throws Exception {
 conf = util.getConfiguration();
 // We don't check persistence in HFiles in this test, but if we ever do we will
 // need this where the default hfile version is not 3 (i.e. 0.98)
 conf.setInt("hfile.format.version", 3);
 conf.set("hbase.coprocessor.region.classes", TTLCheckingObserver.class.getName());
 util.startMiniCluster();
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 Configuration conf = TEST_UTIL.getConfiguration();
 // Need HFileV3
 conf.setInt(HFile.FORMAT_VERSION_KEY, HFile.MIN_FORMAT_VERSION_WITH_TAGS);
 // effectively limit max result size to one entry if it has tags
 conf.setLong(HConstants.HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE_KEY, SCANNER_DATA_LIMIT);
 conf.setBoolean(ScannerCallable.LOG_SCANNER_ACTIVITY, true);
 TEST_UTIL.startMiniCluster(1);
}

相关文章

HBaseTestingUtility类方法