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

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

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

HBaseTestingUtility.startMiniDFSCluster介绍

[英]Start a minidfscluster.
[中]启动一个小型集群。

代码示例

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

/**
 * Start a minidfscluster.
 * @param servers How many DNs to start.
 * @throws Exception
 * @see #shutdownMiniDFSCluster()
 * @return The mini dfs cluster created.
 */
public MiniDFSCluster startMiniDFSCluster(int servers) throws Exception {
 return startMiniDFSCluster(servers, null);
}

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

/**
 * Makes this local HBase cluster use a mini-DFS cluster. Must be called before
 * {@link #startHBase()}.
 * @throws IOException
 */
public void startMiniDFS() throws Exception {
 if (testUtil == null) {
  testUtil = new HBaseTestingUtility(conf);
 }
 dfsCluster = testUtil.startMiniDFSCluster(numDataNodes);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 TEST_UTIL.startMiniDFSCluster(1);
 FS = TEST_UTIL.getDFSCluster().getFileSystem();
 Path rootDir = TEST_UTIL.createRootDir();
 oldLogDir = new Path(rootDir, HConstants.HREGION_OLDLOGDIR_NAME);
 if (FS.exists(oldLogDir)) FS.delete(oldLogDir, true);
 logDir = new Path(rootDir, HConstants.HREGION_LOGDIR_NAME);
 if (FS.exists(logDir)) FS.delete(logDir, true);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 TEST_UTIL = new HBaseTestingUtility();
 TEST_UTIL.startMiniDFSCluster(1);
}

代码示例来源: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 {
 // 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

private void setupDFS() throws Exception {
 Configuration conf = UTIL.getConfiguration();
 MiniDFSCluster dfs = UTIL.startMiniDFSCluster(3);
 CommonFSUtils.setWALRootDir(conf, new Path(conf.get("fs.defaultFS"), "/tmp/wal"));
 Path logDir = new Path(new Path(dfs.getFileSystem().getUri()), "/test-logs");
 store = ProcedureTestingUtility.createWalStore(conf, logDir);
 store.registerListener(stopProcedureListener);
 store.start(8);
 store.recoverLease();
}

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

@BeforeClass
public static void setupCluster() throws Exception {
 // have to use a minidfs cluster because the localfs doesn't modify file times correctly
 UTIL.startMiniDFSCluster(1);
 CleanerChore.initChorePool(UTIL.getConfiguration());
}

代码示例来源: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 {
 htu = new HBaseTestingUtility();
 htu.getConfiguration().setInt("dfs.blocksize", 1024);// For the test with multiple blocks
 htu.getConfiguration().setInt("dfs.replication", 3);
 htu.startMiniDFSCluster(3,
   new String[]{"/r1", "/r2", "/r3"}, new String[]{host1, host2, host3});
 conf = htu.getConfiguration();
 cluster = htu.getDFSCluster();
 dfs = (DistributedFileSystem) FileSystem.get(conf);
}

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

@Before
public void setUp() throws Exception {
 htu = new HBaseTestingUtility();
 htu.getConfiguration().setInt("dfs.blocksize", 1024);// For the test with multiple blocks
 htu.getConfiguration().setInt("dfs.replication", 3);
 htu.startMiniDFSCluster(3,
   new String[]{"/r1", "/r2", "/r3"}, new String[]{host1, host2, host3});
 conf = htu.getConfiguration();
 cluster = htu.getDFSCluster();
 dfs = (DistributedFileSystem) FileSystem.get(conf);
}

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

@BeforeClass
public static void setUp() throws Exception {
 UTIL.startMiniDFSCluster(3);
 FS = UTIL.getDFSCluster().getFileSystem();
}

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

@Test public void testSetupClusterTestBuildDir() throws Exception {
 HBaseTestingUtility hbt = new HBaseTestingUtility();
 Path testdir = hbt.getClusterTestDir();
 LOG.info("uuid-subdir=" + testdir);
 FileSystem fs = hbt.getTestFileSystem();
 assertFalse(fs.exists(testdir));
 hbt.startMiniDFSCluster(null);
 assertTrue(fs.exists(testdir));
 hbt.shutdownMiniCluster();
 assertFalse(fs.exists(testdir));
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 EVENT_LOOP_GROUP = new NioEventLoopGroup();
 CHANNEL_CLASS = NioSocketChannel.class;
 UTIL.startMiniDFSCluster(3);
 UTIL.getTestFileSystem().mkdirs(UTIL.getDataTestDirOnTestFS());
 WALS = new WALFactory(UTIL.getConfiguration(), TestCombinedAsyncWriter.class.getSimpleName());
}

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

@Test
public void testFilteredStatusDoesNotThrowOnNotFound() throws Exception {
 MiniDFSCluster cluster = htu.startMiniDFSCluster(1);
 try {
  assertNull(FSUtils.listStatusWithStatusFilter(cluster.getFileSystem(), new Path("definitely/doesn't/exist"), null));
 } finally {
  cluster.shutdown();
 }
}

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

@BeforeClass
public static void setUp() throws Exception {
 TEST_UTIL.getConfiguration().setInt(DFS_CLIENT_SOCKET_TIMEOUT_KEY, READ_TIMEOUT_MS);
 TEST_UTIL.startMiniDFSCluster(3);
 FS = TEST_UTIL.getDFSCluster().getFileSystem();
 EVENT_LOOP_GROUP = new NioEventLoopGroup();
 CHANNEL_CLASS = NioSocketChannel.class;
}

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

@BeforeClass
public static void setupCluster() throws Exception {
 Configuration conf = UTIL.getConfiguration();
 setupConf(UTIL.getConfiguration());
 UTIL.startMiniDFSCluster(3);
 CommonFSUtils.setWALRootDir(conf, new Path(conf.get("fs.defaultFS"), "/tmp/wal"));
 UTIL.startMiniCluster(2);
 UTIL.waitUntilNoRegionsInTransition();
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 UTIL.startMiniDFSCluster(3);
 FACTORY = new WALFactory(UTIL.getConfiguration(), "test");
 ((SyncReplicationWALProvider) FACTORY.getWALProvider()).setPeerInfoProvider(new InfoProvider());
 UTIL.getTestFileSystem().mkdirs(new Path(REMOTE_WAL_DIR, PEER_ID));
}

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

@Before
public void setup() throws Exception {
 testUtil = new HBaseTestingUtility();
 testUtil.startMiniDFSCluster(1);
 testDir = testUtil.getDataTestDirOnTestFS();
 FSUtils.setRootDir(testUtil.getConfiguration(), testDir);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 conf = TEST_UTIL.getConfiguration();
 TEST_UTIL.startMiniDFSCluster(1);
 rootDir = TEST_UTIL.createRootDir();
 walRootDir = TEST_UTIL.createWALRootDir();
 fs = FSUtils.getRootDirFileSystem(conf);
 walFs = FSUtils.getWALFileSystem(conf);
}

相关文章

HBaseTestingUtility类方法