Java 类org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver 实例源码

项目:ditb    文件:TestFSHLog.java   
@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();
}
项目:ditb    文件:TestFSHLog.java   
/**
 * 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();
    }
  }
}
项目:ditb    文件:TestProtobufLog.java   
@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);
}
项目:pbase    文件:TestFSHLog.java   
@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();
}
项目:pbase    文件:TestFSHLog.java   
/**
 * 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();
    }
  }
}
项目:pbase    文件:TestProtobufLog.java   
@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);
}
项目:ditb    文件:TestWALFactory.java   
@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();
}
项目:ditb    文件:TestWALFactory.java   
/**
 * 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);
}
项目:LCIndex-HBase-0.94.16    文件:TestHTableDescriptor.java   
/**
 * 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));
}
项目:LCIndex-HBase-0.94.16    文件:TestHLog.java   
@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());
}
项目:LCIndex-HBase-0.94.16    文件:TestHLog.java   
/**
 * 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();
  }
}
项目:pbase    文件:TestWALFactory.java   
@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();
}
项目:pbase    文件:TestWALFactory.java   
/**
 * 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);
}
项目:HIndex    文件:TestHTableDescriptor.java   
/**
 * 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));
}
项目:HIndex    文件:TestHLog.java   
@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());
}
项目:HIndex    文件:TestHLog.java   
/**
 * 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();
  }
}
项目:IRIndex    文件:TestHTableDescriptor.java   
/**
 * 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));
}
项目:IRIndex    文件:TestHLog.java   
@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());
}
项目:IRIndex    文件:TestHLog.java   
/**
 * 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();
  }
}
项目:PyroDB    文件:TestHTableDescriptor.java   
/**
 * 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));
}
项目:PyroDB    文件:TestHLog.java   
@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());
}
项目:PyroDB    文件:TestHLog.java   
/**
 * 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();
  }
}
项目:c5    文件:TestHTableDescriptor.java   
/**
 * 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));
}
项目:c5    文件:TestHLog.java   
@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());
}
项目:c5    文件:TestHLog.java   
/**
 * 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();
  }
}
项目:HBase-Research    文件:TestHTableDescriptor.java   
/**
 * 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));
}
项目:HBase-Research    文件:TestHLog.java   
@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());
}
项目:HBase-Research    文件:TestHLog.java   
/**
 * 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();
  }
}
项目:hbase-0.94.8-qod    文件:TestHTableDescriptor.java   
/**
 * 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));
}
项目:hbase-0.94.8-qod    文件:TestHLog.java   
@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());
}
项目:hbase-0.94.8-qod    文件:TestHLog.java   
/**
 * 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();
  }
}
项目:hbase-0.94.8-qod    文件:TestHTableDescriptor.java   
/**
 * 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));
}
项目:hbase-0.94.8-qod    文件:TestHLog.java   
@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());
}
项目:hbase-0.94.8-qod    文件:TestHLog.java   
/**
 * 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();
  }
}
项目:DominoHBase    文件:TestHLog.java   
@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());
}
项目:DominoHBase    文件:TestHLog.java   
/**
 * 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();
  }
}
项目:hindex    文件:TestHTableDescriptor.java   
/**
 * 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));
}
项目:hindex    文件:TestHLog.java   
@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());
}
项目:hindex    文件:TestHLog.java   
/**
 * 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();
  }
}