當前位置: 首頁>>代碼示例>>Java>>正文


Java TestRegionServerNoMaster類代碼示例

本文整理匯總了Java中org.apache.hadoop.hbase.regionserver.TestRegionServerNoMaster的典型用法代碼示例。如果您正苦於以下問題:Java TestRegionServerNoMaster類的具體用法?Java TestRegionServerNoMaster怎麽用?Java TestRegionServerNoMaster使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TestRegionServerNoMaster類屬於org.apache.hadoop.hbase.regionserver包,在下文中一共展示了TestRegionServerNoMaster類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: beforeClass

import org.apache.hadoop.hbase.regionserver.TestRegionServerNoMaster; //導入依賴的package包/類
@BeforeClass
public static void beforeClass() throws Exception {
  Configuration conf = HTU.getConfiguration();
  conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY, true);
  conf.setBoolean(ServerRegionReplicaUtil.REGION_REPLICA_REPLICATION_CONF_KEY, true);
  conf.setBoolean(ServerRegionReplicaUtil.REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH_CONF_KEY, false);

  // install WALObserver coprocessor for tests
  String walCoprocs = HTU.getConfiguration().get(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY);
  if (walCoprocs == null) {
    walCoprocs = WALEditCopro.class.getName();
  } else {
    walCoprocs += "," + WALEditCopro.class.getName();
  }
  HTU.getConfiguration().set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY,
    walCoprocs);
  HTU.startMiniCluster(NB_SERVERS);

  // Create table then get the single region for our new table.
  HTableDescriptor htd = HTU.createTableDescriptor(tableName.toString());
  table = HTU.createTable(htd, new byte[][]{f}, HTU.getConfiguration());

  hriPrimary = table.getRegionLocation(row, false).getRegionInfo();

  // mock a secondary region info to open
  hriSecondary = new HRegionInfo(hriPrimary.getTable(), hriPrimary.getStartKey(),
      hriPrimary.getEndKey(), hriPrimary.isSplit(), hriPrimary.getRegionId(), 1);

  // No master
  TestRegionServerNoMaster.stopMasterAndAssignMeta(HTU);
  rs0 = HTU.getMiniHBaseCluster().getRegionServer(0);
  rs1 = HTU.getMiniHBaseCluster().getRegionServer(1);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:34,代碼來源:TestRegionReplicaReplicationEndpointNoMaster.java

示例2: beforeClass

import org.apache.hadoop.hbase.regionserver.TestRegionServerNoMaster; //導入依賴的package包/類
@BeforeClass
public static void beforeClass() throws Exception {
  // enable store file refreshing
  HTU.getConfiguration().setInt(
      StorefileRefresherChore.REGIONSERVER_STOREFILE_REFRESH_PERIOD, REFRESH_PERIOD);
  HTU.getConfiguration().setBoolean("hbase.client.log.scanner.activity", true);
  ConnectionUtils.setupMasterlessConnection(HTU.getConfiguration());
  HTU.startMiniCluster(NB_SERVERS);

  // Create table then get the single region for our new table.
  HTableDescriptor hdt = HTU.createTableDescriptor(TestReplicasClient.class.getSimpleName());
  hdt.addCoprocessor(SlowMeCopro.class.getName());
  table = HTU.createTable(hdt, new byte[][]{f}, HTU.getConfiguration());

  hriPrimary = table.getRegionLocation(row, false).getRegionInfo();

  // mock a secondary region info to open
  hriSecondary = new HRegionInfo(hriPrimary.getTable(), hriPrimary.getStartKey(),
      hriPrimary.getEndKey(), hriPrimary.isSplit(), hriPrimary.getRegionId(), 1);

  // No master
  LOG.info("Master is going to be stopped");
  TestRegionServerNoMaster.stopMasterAndAssignMeta(HTU);
  Configuration c = new Configuration(HTU.getConfiguration());
  c.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1);
  LOG.info("Master has stopped");
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:28,代碼來源:TestReplicasClient.java

示例3: beforeClass

import org.apache.hadoop.hbase.regionserver.TestRegionServerNoMaster; //導入依賴的package包/類
@BeforeClass
public static void beforeClass() throws Exception {
  Configuration conf = HTU.getConfiguration();
  conf.setBoolean(ServerRegionReplicaUtil.REGION_REPLICA_REPLICATION_CONF_KEY, true);
  conf.setBoolean(ServerRegionReplicaUtil.REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH_CONF_KEY, false);

  // install WALObserver coprocessor for tests
  String walCoprocs = HTU.getConfiguration().get(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY);
  if (walCoprocs == null) {
    walCoprocs = WALEditCopro.class.getName();
  } else {
    walCoprocs += "," + WALEditCopro.class.getName();
  }
  HTU.getConfiguration().set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY,
    walCoprocs);
  HTU.startMiniCluster(NB_SERVERS);

  // Create table then get the single region for our new table.
  HTableDescriptor htd = HTU.createTableDescriptor(tableName.getNameAsString());
  table = HTU.createTable(htd, new byte[][]{f}, null);

  try (RegionLocator locator = HTU.getConnection().getRegionLocator(tableName)) {
    hriPrimary = locator.getRegionLocation(row, false).getRegionInfo();
  }

  // mock a secondary region info to open
  hriSecondary = new HRegionInfo(hriPrimary.getTable(), hriPrimary.getStartKey(),
      hriPrimary.getEndKey(), hriPrimary.isSplit(), hriPrimary.getRegionId(), 1);

  // No master
  TestRegionServerNoMaster.stopMasterAndAssignMeta(HTU);
  rs0 = HTU.getMiniHBaseCluster().getRegionServer(0);
  rs1 = HTU.getMiniHBaseCluster().getRegionServer(1);
}
 
開發者ID:apache,項目名稱:hbase,代碼行數:35,代碼來源:TestRegionReplicaReplicationEndpointNoMaster.java

示例4: beforeClass

import org.apache.hadoop.hbase.regionserver.TestRegionServerNoMaster; //導入依賴的package包/類
@BeforeClass
public static void beforeClass() throws Exception {
  // enable store file refreshing
  HTU.getConfiguration().setInt(
      StorefileRefresherChore.REGIONSERVER_STOREFILE_REFRESH_PERIOD, REFRESH_PERIOD);
  HTU.getConfiguration().setBoolean("hbase.client.log.scanner.activity", true);
  HTU.getConfiguration().setBoolean(MetricsConnection.CLIENT_SIDE_METRICS_ENABLED_KEY, true);
  ConnectionUtils.setupMasterlessConnection(HTU.getConfiguration());
  HTU.startMiniCluster(NB_SERVERS);

  // Create table then get the single region for our new table.
  HTableDescriptor hdt = HTU.createTableDescriptor(TestReplicasClient.class.getSimpleName());
  hdt.addCoprocessor(SlowMeCopro.class.getName());
  table = HTU.createTable(hdt, new byte[][]{f}, null);

  try (RegionLocator locator = HTU.getConnection().getRegionLocator(hdt.getTableName())) {
    hriPrimary = locator.getRegionLocation(row, false).getRegionInfo();
  }

  // mock a secondary region info to open
  hriSecondary = new HRegionInfo(hriPrimary.getTable(), hriPrimary.getStartKey(),
      hriPrimary.getEndKey(), hriPrimary.isSplit(), hriPrimary.getRegionId(), 1);

  // No master
  LOG.info("Master is going to be stopped");
  TestRegionServerNoMaster.stopMasterAndAssignMeta(HTU);
  Configuration c = new Configuration(HTU.getConfiguration());
  c.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1);
  LOG.info("Master has stopped");
}
 
開發者ID:apache,項目名稱:hbase,代碼行數:31,代碼來源:TestReplicasClient.java

示例5: flushRegion

import org.apache.hadoop.hbase.regionserver.TestRegionServerNoMaster; //導入依賴的package包/類
private void flushRegion(HRegionInfo regionInfo) throws IOException {
  TestRegionServerNoMaster.flushRegion(HTU, regionInfo);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:4,代碼來源:TestReplicasClient.java


注:本文中的org.apache.hadoop.hbase.regionserver.TestRegionServerNoMaster類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。