当前位置: 首页>>代码示例>>Java>>正文


Java SampleRegionWALObserver类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver的典型用法代码示例。如果您正苦于以下问题:Java SampleRegionWALObserver类的具体用法?Java SampleRegionWALObserver怎么用?Java SampleRegionWALObserver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SampleRegionWALObserver类属于org.apache.hadoop.hbase.coprocessor包,在下文中一共展示了SampleRegionWALObserver类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUpBeforeClass

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  // Make block sizes small.
  TEST_UTIL.getConfiguration().setInt("dfs.blocksize", 1024 * 1024);
  // 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().set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY,
      SampleRegionWALObserver.class.getName());
  TEST_UTIL.startMiniDFSCluster(3);

  conf = TEST_UTIL.getConfiguration();
  fs = TEST_UTIL.getDFSCluster().getFileSystem();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:24,代码来源:TestFSHLog.java

示例2: testWALCoprocessorLoaded

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
/**
 * A loaded WAL coprocessor won't break existing WAL test cases.
 */
@Test
public void testWALCoprocessorLoaded() throws Exception {
  // test to see whether the coprocessor is loaded or not.
  FSHLog log = null;
  try {
    log = new FSHLog(fs, FSUtils.getRootDir(conf), dir.toString(),
        HConstants.HREGION_OLDLOGDIR_NAME, conf, null, true, null, null);
    WALCoprocessorHost host = log.getCoprocessorHost();
    Coprocessor c = host.findCoprocessor(SampleRegionWALObserver.class.getName());
    assertNotNull(c);
  } finally {
    if (log != null) {
      log.close();
    }
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:20,代码来源:TestFSHLog.java

示例3: setUpBeforeClass

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  // Make block sizes small.
  TEST_UTIL.getConfiguration().setInt("dfs.blocksize", 1024 * 1024);
  // needed for testAppendClose()
  TEST_UTIL.getConfiguration().setBoolean("dfs.support.broken.append", true);
  TEST_UTIL.getConfiguration().setBoolean("dfs.support.append", true);
  // 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().set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY,
      SampleRegionWALObserver.class.getName());
  TEST_UTIL.startMiniDFSCluster(3);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:24,代码来源:TestProtobufLog.java

示例4: setUpBeforeClass

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  // Make block sizes small.
  TEST_UTIL.getConfiguration().setInt("dfs.blocksize", 1024 * 1024);
  // needed for testAppendClose()
  TEST_UTIL.getConfiguration().setBoolean("dfs.support.broken.append", true);
  TEST_UTIL.getConfiguration().setBoolean("dfs.support.append", true);
  // 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().set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY,
      SampleRegionWALObserver.class.getName());
  TEST_UTIL.startMiniDFSCluster(3);

  conf = TEST_UTIL.getConfiguration();
  cluster = TEST_UTIL.getDFSCluster();

  hbaseDir = TEST_UTIL.createRootDir();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:29,代码来源:TestWALFactory.java

示例5: testWALCoprocessorLoaded

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
/**
 * A loaded WAL coprocessor won't break existing WAL test cases.
 */
@Test
public void testWALCoprocessorLoaded() throws Exception {
  // test to see whether the coprocessor is loaded or not.
  WALCoprocessorHost host = wals.getWAL(UNSPECIFIED_REGION).getCoprocessorHost();
  Coprocessor c = host.findCoprocessor(SampleRegionWALObserver.class.getName());
  assertNotNull(c);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:TestWALFactory.java

示例6: testSetListRemoveCP

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
/**
 * Test cps in the table description
 * @throws Exception
 */
@Test
public void testSetListRemoveCP() throws Exception {
  HTableDescriptor desc = new HTableDescriptor("testGetSetRemoveCP");
  // simple CP
  String className1 = BaseRegionObserver.class.getName();
  String className2 = SampleRegionWALObserver.class.getName();
  // Check that any coprocessor is present.
  assertTrue(desc.getCoprocessors().size() == 0);

  // Add the 1 coprocessor and check if present.
  desc.addCoprocessor(className1);
  assertTrue(desc.getCoprocessors().size() == 1);
  assertTrue(desc.getCoprocessors().contains(className1));

  // Add the 2nd coprocessor and check if present.
  // remove it and check that it is gone
  desc.addCoprocessor(className2);
  assertTrue(desc.getCoprocessors().size() == 2);
  assertTrue(desc.getCoprocessors().contains(className2));

  // Remove one and check
  desc.removeCoprocessor(className1);
  assertTrue(desc.getCoprocessors().size() == 1);
  assertFalse(desc.getCoprocessors().contains(className1));
  assertTrue(desc.getCoprocessors().contains(className2));

  // Remove the last and check
  desc.removeCoprocessor(className2);
  assertTrue(desc.getCoprocessors().size() == 0);
  assertFalse(desc.getCoprocessors().contains(className1));
  assertFalse(desc.getCoprocessors().contains(className2));
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:37,代码来源:TestHTableDescriptor.java

示例7: setUpBeforeClass

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  // Make block sizes small.
  TEST_UTIL.getConfiguration().setInt("dfs.blocksize", 1024 * 1024);
  // needed for testAppendClose()
  TEST_UTIL.getConfiguration().setBoolean("dfs.support.broken.append", true);
  TEST_UTIL.getConfiguration().setBoolean("dfs.support.append", true);
  // quicker heartbeat interval for faster DN death notification
  TEST_UTIL.getConfiguration().setInt("heartbeat.recheck.interval", 5000);
  TEST_UTIL.getConfiguration().setInt("dfs.heartbeat.interval", 1);
  TEST_UTIL.getConfiguration().setInt("dfs.socket.timeout", 5000);
  // faster failover with cluster.shutdown();fs.close() idiom
  TEST_UTIL.getConfiguration()
      .setInt("ipc.client.connect.max.retries", 1);
  TEST_UTIL.getConfiguration().setInt(
      "dfs.client.block.recovery.retries", 1);
  TEST_UTIL.getConfiguration().setInt(
    "ipc.client.connection.maxidletime", 500);
  TEST_UTIL.getConfiguration().set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY,
      SampleRegionWALObserver.class.getName());
  TEST_UTIL.startMiniDFSCluster(3);

  conf = TEST_UTIL.getConfiguration();
  cluster = TEST_UTIL.getDFSCluster();
  fs = cluster.getFileSystem();

  hbaseDir = TEST_UTIL.createRootDir();
  oldLogDir = new Path(hbaseDir, ".oldlogs");
  dir = new Path(hbaseDir, getName());
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:31,代码来源:TestHLog.java

示例8: testWALCoprocessorLoaded

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
/**
 * A loaded WAL coprocessor won't break existing HLog test cases.
 */
@Test
public void testWALCoprocessorLoaded() throws Exception {
  // test to see whether the coprocessor is loaded or not.
  HLog log = new HLog(fs, dir, oldLogDir, conf);
  try {
    WALCoprocessorHost host = log.getCoprocessorHost();
    Coprocessor c = host.findCoprocessor(SampleRegionWALObserver.class.getName());
    assertNotNull(c);
  } finally {
    if (log != null) log.closeAndDelete();
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:16,代码来源:TestHLog.java

示例9: testSetListRemoveCP

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
/**
 * Test cps in the table description
 * @throws Exception
 */
@Test
public void testSetListRemoveCP() throws Exception {
  HTableDescriptor desc = new HTableDescriptor(TableName.valueOf("testGetSetRemoveCP"));
  // simple CP
  String className1 = BaseRegionObserver.class.getName();
  String className2 = SampleRegionWALObserver.class.getName();
  // Check that any coprocessor is present.
  assertTrue(desc.getCoprocessors().size() == 0);

  // Add the 1 coprocessor and check if present.
  desc.addCoprocessor(className1);
  assertTrue(desc.getCoprocessors().size() == 1);
  assertTrue(desc.getCoprocessors().contains(className1));

  // Add the 2nd coprocessor and check if present.
  // remove it and check that it is gone
  desc.addCoprocessor(className2);
  assertTrue(desc.getCoprocessors().size() == 2);
  assertTrue(desc.getCoprocessors().contains(className2));

  // Remove one and check
  desc.removeCoprocessor(className1);
  assertTrue(desc.getCoprocessors().size() == 1);
  assertFalse(desc.getCoprocessors().contains(className1));
  assertTrue(desc.getCoprocessors().contains(className2));

  // Remove the last and check
  desc.removeCoprocessor(className2);
  assertTrue(desc.getCoprocessors().size() == 0);
  assertFalse(desc.getCoprocessors().contains(className1));
  assertFalse(desc.getCoprocessors().contains(className2));
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:37,代码来源:TestHTableDescriptor.java

示例10: setUpBeforeClass

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  // Make block sizes small.
  TEST_UTIL.getConfiguration().setInt("dfs.blocksize", 1024 * 1024);
  // needed for testAppendClose()
  TEST_UTIL.getConfiguration().setBoolean("dfs.support.broken.append", true);
  TEST_UTIL.getConfiguration().setBoolean("dfs.support.append", true);
  // quicker heartbeat interval for faster DN death notification
  TEST_UTIL.getConfiguration().setInt("heartbeat.recheck.interval", 5000);
  TEST_UTIL.getConfiguration().setInt("dfs.heartbeat.interval", 1);
  TEST_UTIL.getConfiguration().setInt("dfs.socket.timeout", 5000);
  // faster failover with cluster.shutdown();fs.close() idiom
  TEST_UTIL.getConfiguration()
      .setInt("ipc.client.connect.max.retries", 1);
  TEST_UTIL.getConfiguration().setInt(
      "dfs.client.block.recovery.retries", 1);
  TEST_UTIL.getConfiguration().setInt(
    "ipc.client.connection.maxidletime", 500);
  TEST_UTIL.getConfiguration().set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY,
      SampleRegionWALObserver.class.getName());
  TEST_UTIL.startMiniDFSCluster(3);

  conf = TEST_UTIL.getConfiguration();
  cluster = TEST_UTIL.getDFSCluster();
  fs = cluster.getFileSystem();

  hbaseDir = TEST_UTIL.createRootDir();
  oldLogDir = new Path(hbaseDir, HConstants.HREGION_OLDLOGDIR_NAME);
  dir = new Path(hbaseDir, getName());
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:31,代码来源:TestHLog.java

示例11: testWALCoprocessorLoaded

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
/**
 * A loaded WAL coprocessor won't break existing HLog test cases.
 */
@Test
public void testWALCoprocessorLoaded() throws Exception {
  // test to see whether the coprocessor is loaded or not.
  HLog log = HLogFactory.createHLog(fs, hbaseDir,
      getName(), conf);
  try {
    WALCoprocessorHost host = log.getCoprocessorHost();
    Coprocessor c = host.findCoprocessor(SampleRegionWALObserver.class.getName());
    assertNotNull(c);
  } finally {
    if (log != null) log.closeAndDelete();
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:17,代码来源:TestHLog.java

示例12: setUpBeforeClass

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  // Make block sizes small.
  TEST_UTIL.getConfiguration().setInt("dfs.blocksize", 1024 * 1024);
  // needed for testAppendClose()
  TEST_UTIL.getConfiguration().setBoolean("dfs.support.broken.append", true);
  TEST_UTIL.getConfiguration().setBoolean("dfs.support.append", true);
  // 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("ipc.client.connect.max.retries", 1);
  TEST_UTIL.getConfiguration().setInt(
      "dfs.client.block.recovery.retries", 1);
  TEST_UTIL.getConfiguration().setInt(
    "ipc.client.connection.maxidletime", 500);
  TEST_UTIL.getConfiguration().set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY,
      SampleRegionWALObserver.class.getName());
  TEST_UTIL.startMiniDFSCluster(3);

  conf = TEST_UTIL.getConfiguration();
  cluster = TEST_UTIL.getDFSCluster();
  fs = cluster.getFileSystem();

  hbaseDir = TEST_UTIL.createRootDir();
  oldLogDir = new Path(hbaseDir, HConstants.HREGION_OLDLOGDIR_NAME);
  dir = new Path(hbaseDir, getName());
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:32,代码来源:TestHLog.java

示例13: setUpBeforeClass

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  // Make block sizes small.
  TEST_UTIL.getConfiguration().setInt("dfs.blocksize", 1024 * 1024);
  // needed for testAppendClose()
  TEST_UTIL.getConfiguration().setBoolean("dfs.support.append", true);
  // quicker heartbeat interval for faster DN death notification
  TEST_UTIL.getConfiguration().setInt("heartbeat.recheck.interval", 5000);
  TEST_UTIL.getConfiguration().setInt("dfs.heartbeat.interval", 1);
  TEST_UTIL.getConfiguration().setInt("dfs.socket.timeout", 5000);
  // faster failover with cluster.shutdown();fs.close() idiom
  TEST_UTIL.getConfiguration()
      .setInt("ipc.client.connect.max.retries", 1);
  TEST_UTIL.getConfiguration().setInt(
      "dfs.client.block.recovery.retries", 1);
  TEST_UTIL.getConfiguration().setInt(
    "ipc.client.connection.maxidletime", 500);
  TEST_UTIL.getConfiguration().set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY,
      SampleRegionWALObserver.class.getName());
  TEST_UTIL.startMiniDFSCluster(3);

  conf = TEST_UTIL.getConfiguration();
  cluster = TEST_UTIL.getDFSCluster();
  fs = cluster.getFileSystem();

  hbaseDir = TEST_UTIL.createRootDir();
  oldLogDir = new Path(hbaseDir, ".oldlogs");
  dir = new Path(hbaseDir, getName());
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:30,代码来源:TestHLog.java

示例14: testWALCoprocessorLoaded

import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; //导入依赖的package包/类
/**
 * A loaded WAL coprocessor won't break existing HLog test cases.
 */
@Test
public void testWALCoprocessorLoaded() throws Exception {
  // test to see whether the coprocessor is loaded or not.
  HLog log = HLogFactory.createHLog(fs, hbaseDir, 
      getName(), conf);
  try {
    WALCoprocessorHost host = log.getCoprocessorHost();
    Coprocessor c = host.findCoprocessor(SampleRegionWALObserver.class.getName());
    assertNotNull(c);
  } finally {
    if (log != null) log.closeAndDelete();
  }
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:17,代码来源:TestHLog.java


注:本文中的org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。