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

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

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

HBaseTestingUtility.createWALRootDir介绍

[英]Creates a hbase walDir in the user's home directory. Normally you won't make use of this method. Root hbaseWALDir is created for you as part of mini cluster startup. You'd only use this method if you were doing manual operation.
[中]在用户的主目录中创建hbase walDir。通常你不会使用这种方法。根hbaseWALDir是作为小型群集启动的一部分为您创建的。只有在进行手动操作时,才能使用此方法。

代码示例

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

@Before
public void setUp() throws Exception {
 FileStatus[] entries = FS.listStatus(new Path("/"));
 for (FileStatus dir : entries) {
  FS.delete(dir.getPath(), true);
 }
 final Path hbaseDir = TEST_UTIL.createRootDir();
 final Path hbaseWALDir = TEST_UTIL.createWALRootDir();
 DIR = new Path(hbaseWALDir, currentTest.getMethodName());
 assertNotEquals(hbaseDir, hbaseWALDir);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 conf = TEST_UTIL.getConfiguration();
 conf.setInt("hbase.regionserver.maxlogs", 5);
 rootDir = TEST_UTIL.createRootDir();
 walRootDir = TEST_UTIL.createWALRootDir();
 fs = FSUtils.getRootDirFileSystem(conf);
 logFs = FSUtils.getWALFileSystem(conf);
}

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

@Before
public void setUp() throws Exception {
 LOG.info("Cleaning up cluster for new test.");
 fs = TEST_UTIL.getDFSCluster().getFileSystem();
 HBASEDIR = TEST_UTIL.createRootDir();
 HBASELOGDIR = TEST_UTIL.createWALRootDir();
 OLDLOGDIR = new Path(HBASELOGDIR, HConstants.HREGION_OLDLOGDIR_NAME);
 CORRUPTDIR = new Path(HBASELOGDIR, HConstants.CORRUPT_DIR_NAME);
 TABLEDIR = FSUtils.getTableDir(HBASEDIR, TABLE_NAME);
 TMPDIRNAME = conf.get(HConstants.TEMPORARY_FS_DIRECTORY_KEY,
  HConstants.DEFAULT_TEMPORARY_HDFS_DIRECTORY);
 REGIONS.clear();
 Collections.addAll(REGIONS, "bbb", "ccc");
 InstrumentedLogWriter.activateFailure = false;
 wals = new WALFactory(conf, name.getMethodName());
 WALDIR = new Path(HBASELOGDIR,
   AbstractFSWALProvider.getWALDirectoryName(ServerName.valueOf(name.getMethodName(),
     16010, System.currentTimeMillis()).toString()));
 //fs.mkdirs(WALDIR);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 // Make block sizes small.
 conf = TEST_UTIL.getConfiguration();
 conf.setInt("dfs.blocksize", 1024 * 1024);
 conf.setInt("dfs.replication", 1);
 TEST_UTIL.startMiniDFSCluster(1);
 conf = TEST_UTIL.getConfiguration();
 fs = TEST_UTIL.getDFSCluster().getFileSystem();
 hbaseDir = TEST_UTIL.createRootDir();
 walRootDir = TEST_UTIL.createWALRootDir();
 walFs = FSUtils.getWALFileSystem(conf);
 logDir = new Path(walRootDir, HConstants.HREGION_LOGDIR_NAME);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 CommonFSUtils.setWALRootDir(TEST_UTIL.getConfiguration(), new Path("file:///tmp/wal"));
 // Make block sizes small.
 TEST_UTIL.getConfiguration().setInt("dfs.blocksize", 1024 * 1024);
 // needed for testAppendClose()
 // quicker heartbeat interval for faster DN death notification
 TEST_UTIL.getConfiguration().setInt("dfs.namenode.heartbeat.recheck-interval", 5000);
 TEST_UTIL.getConfiguration().setInt("dfs.heartbeat.interval", 1);
 TEST_UTIL.getConfiguration().setInt("dfs.client.socket-timeout", 5000);
 // faster failover with cluster.shutdown();fs.close() idiom
 TEST_UTIL.getConfiguration()
   .setInt("hbase.ipc.client.connect.max.retries", 1);
 TEST_UTIL.getConfiguration().setInt(
   "dfs.client.block.recovery.retries", 1);
 TEST_UTIL.getConfiguration().setInt(
  "hbase.ipc.client.connection.maxidletime", 500);
 TEST_UTIL.getConfiguration().setInt("hbase.lease.recovery.timeout", 10000);
 TEST_UTIL.getConfiguration().setInt("hbase.lease.recovery.dfs.timeout", 1000);
 TEST_UTIL.getConfiguration().set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY,
   SampleRegionWALCoprocessor.class.getName());
 TEST_UTIL.startMiniDFSCluster(3);
 conf = TEST_UTIL.getConfiguration();
 cluster = TEST_UTIL.getDFSCluster();
 hbaseDir = TEST_UTIL.createRootDir();
 hbaseWALDir = TEST_UTIL.createWALRootDir();
}

代码示例来源: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);
}

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

@BeforeClass
public static void beforeClass() throws Exception {
 conf= TEST_UTIL.getConfiguration();
 rootDir = TEST_UTIL.createRootDir();
 walRootDir = TEST_UTIL.createWALRootDir();
 fs = FSUtils.getRootDirFileSystem(conf);
 logFs = FSUtils.getWALFileSystem(conf);
 cluster = TEST_UTIL.startMiniCluster();
}

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

createWALRootDir();

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

@Before
public void setUp() throws Exception {
 FileStatus[] entries = FS.listStatus(new Path("/"));
 for (FileStatus dir : entries) {
  FS.delete(dir.getPath(), true);
 }
 final Path hbaseDir = TEST_UTIL.createRootDir();
 final Path hbaseWALDir = TEST_UTIL.createWALRootDir();
 DIR = new Path(hbaseWALDir, currentTest.getMethodName());
 assertNotEquals(hbaseDir, hbaseWALDir);
}

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

@Before
public void before() throws IOException {
 MasterFileSystem mfs = Mockito.mock(MasterFileSystem.class);
 Mockito.when(mfs.getWALFileSystem()).thenReturn(HTU.getTestFileSystem());
 Path walRootDir = HTU.createWALRootDir();
 Mockito.when(mfs.getWALRootDir()).thenReturn(walRootDir);
 this.masterServices = Mockito.mock(MasterServices.class);
 Mockito.when(this.masterServices.getConfiguration()).thenReturn(HTU.getConfiguration());
 Mockito.when(this.masterServices.getMasterFileSystem()).thenReturn(mfs);
 Mockito.when(this.masterServices.getServerName()).
   thenReturn(ServerName.parseServerName("master.example.org,0123,456"));
 this.mwm = new MasterWalManager(this.masterServices);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 conf = TEST_UTIL.getConfiguration();
 conf.setInt("hbase.regionserver.maxlogs", 5);
 rootDir = TEST_UTIL.createRootDir();
 walRootDir = TEST_UTIL.createWALRootDir();
 fs = FSUtils.getRootDirFileSystem(conf);
 logFs = FSUtils.getWALFileSystem(conf);
}

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

@Before
public void setUp() throws Exception {
 LOG.info("Cleaning up cluster for new test.");
 fs = TEST_UTIL.getDFSCluster().getFileSystem();
 HBASEDIR = TEST_UTIL.createRootDir();
 HBASELOGDIR = TEST_UTIL.createWALRootDir();
 OLDLOGDIR = new Path(HBASELOGDIR, HConstants.HREGION_OLDLOGDIR_NAME);
 CORRUPTDIR = new Path(HBASELOGDIR, HConstants.CORRUPT_DIR_NAME);
 TABLEDIR = FSUtils.getTableDir(HBASEDIR, TABLE_NAME);
 TMPDIRNAME = conf.get(HConstants.TEMPORARY_FS_DIRECTORY_KEY,
  HConstants.DEFAULT_TEMPORARY_HDFS_DIRECTORY);
 REGIONS.clear();
 Collections.addAll(REGIONS, "bbb", "ccc");
 InstrumentedLogWriter.activateFailure = false;
 wals = new WALFactory(conf, name.getMethodName());
 WALDIR = new Path(HBASELOGDIR,
   AbstractFSWALProvider.getWALDirectoryName(ServerName.valueOf(name.getMethodName(),
     16010, System.currentTimeMillis()).toString()));
 //fs.mkdirs(WALDIR);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 // Make block sizes small.
 conf = TEST_UTIL.getConfiguration();
 conf.setInt("dfs.blocksize", 1024 * 1024);
 conf.setInt("dfs.replication", 1);
 TEST_UTIL.startMiniDFSCluster(1);
 conf = TEST_UTIL.getConfiguration();
 fs = TEST_UTIL.getDFSCluster().getFileSystem();
 hbaseDir = TEST_UTIL.createRootDir();
 walRootDir = TEST_UTIL.createWALRootDir();
 walFs = FSUtils.getWALFileSystem(conf);
 logDir = new Path(walRootDir, HConstants.HREGION_LOGDIR_NAME);
}

代码示例来源:origin: com.aliyun.hbase/alihbase-mapreduce

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 // Make block sizes small.
 conf = TEST_UTIL.getConfiguration();
 conf.setInt("dfs.blocksize", 1024 * 1024);
 conf.setInt("dfs.replication", 1);
 TEST_UTIL.startMiniDFSCluster(1);
 conf = TEST_UTIL.getConfiguration();
 fs = TEST_UTIL.getDFSCluster().getFileSystem();
 hbaseDir = TEST_UTIL.createRootDir();
 walRootDir = TEST_UTIL.createWALRootDir();
 walFs = FSUtils.getWALFileSystem(conf);
 logDir = new Path(walRootDir, HConstants.HREGION_LOGDIR_NAME);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 CommonFSUtils.setWALRootDir(TEST_UTIL.getConfiguration(), new Path("file:///tmp/wal"));
 // Make block sizes small.
 TEST_UTIL.getConfiguration().setInt("dfs.blocksize", 1024 * 1024);
 // needed for testAppendClose()
 // quicker heartbeat interval for faster DN death notification
 TEST_UTIL.getConfiguration().setInt("dfs.namenode.heartbeat.recheck-interval", 5000);
 TEST_UTIL.getConfiguration().setInt("dfs.heartbeat.interval", 1);
 TEST_UTIL.getConfiguration().setInt("dfs.client.socket-timeout", 5000);
 // faster failover with cluster.shutdown();fs.close() idiom
 TEST_UTIL.getConfiguration()
   .setInt("hbase.ipc.client.connect.max.retries", 1);
 TEST_UTIL.getConfiguration().setInt(
   "dfs.client.block.recovery.retries", 1);
 TEST_UTIL.getConfiguration().setInt(
  "hbase.ipc.client.connection.maxidletime", 500);
 TEST_UTIL.getConfiguration().setInt("hbase.lease.recovery.timeout", 10000);
 TEST_UTIL.getConfiguration().setInt("hbase.lease.recovery.dfs.timeout", 1000);
 TEST_UTIL.getConfiguration().set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY,
   SampleRegionWALCoprocessor.class.getName());
 TEST_UTIL.startMiniDFSCluster(3);
 conf = TEST_UTIL.getConfiguration();
 cluster = TEST_UTIL.getDFSCluster();
 hbaseDir = TEST_UTIL.createRootDir();
 hbaseWALDir = TEST_UTIL.createWALRootDir();
}

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

@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);
}

代码示例来源:origin: com.aliyun.hbase/alihbase-mapreduce

@BeforeClass
public static void beforeClass() throws Exception {
 conf= TEST_UTIL.getConfiguration();
 rootDir = TEST_UTIL.createRootDir();
 walRootDir = TEST_UTIL.createWALRootDir();
 fs = FSUtils.getRootDirFileSystem(conf);
 logFs = FSUtils.getWALFileSystem(conf);
 cluster = TEST_UTIL.startMiniCluster();
}

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

@BeforeClass
public static void beforeClass() throws Exception {
 conf= TEST_UTIL.getConfiguration();
 rootDir = TEST_UTIL.createRootDir();
 walRootDir = TEST_UTIL.createWALRootDir();
 fs = FSUtils.getRootDirFileSystem(conf);
 logFs = FSUtils.getWALFileSystem(conf);
 cluster = TEST_UTIL.startMiniCluster();
}

代码示例来源:origin: com.aliyun.hbase/alihbase-mapreduce

@BeforeClass
public static void beforeClass() throws Exception {
 conf= TEST_UTIL.getConfiguration();
 rootDir = TEST_UTIL.createRootDir();
 walRootDir = TEST_UTIL.createWALRootDir();
 fs = FSUtils.getRootDirFileSystem(conf);
 logFs = FSUtils.getWALFileSystem(conf);
 cluster = TEST_UTIL.startMiniCluster();
}

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

@BeforeClass
public static void beforeClass() throws Exception {
 conf= TEST_UTIL.getConfiguration();
 rootDir = TEST_UTIL.createRootDir();
 walRootDir = TEST_UTIL.createWALRootDir();
 fs = FSUtils.getRootDirFileSystem(conf);
 logFs = FSUtils.getWALFileSystem(conf);
 cluster = TEST_UTIL.startMiniCluster();
}

相关文章

HBaseTestingUtility类方法