Java 类org.apache.hadoop.hbase.regionserver.wal.HLogUtilsForTests 实例源码

项目:LCIndex-HBase-0.94.16    文件:TestAdmin.java   
@Test
public void testHLogRollWriting() throws Exception {
  setUpforLogRolling();
  String className = this.getClass().getName();
  StringBuilder v = new StringBuilder(className);
  while (v.length() < 1000) {
    v.append(className);
  }
  byte[] value = Bytes.toBytes(v.toString());
  HRegionServer regionServer = startAndWriteData("TestLogRolling", value);
  LOG.info("after writing there are "
      + HLogUtilsForTests.getNumLogFiles(regionServer.getWAL()) + " log files");

  // flush all regions

  List<HRegion> regions = new ArrayList<HRegion>(regionServer
      .getOnlineRegionsLocalContext());
  for (HRegion r : regions) {
    r.flushcache();
  }
  admin.rollHLogWriter(regionServer.getServerName().getServerName());
  int count = HLogUtilsForTests.getNumLogFiles(regionServer.getWAL());
  LOG.info("after flushing all regions and rolling logs there are " +
      count + " log files");
  assertTrue(("actual count: " + count), count <= 3);
}
项目:HIndex    文件:TestAdmin.java   
@Test (timeout=300000)
public void testHLogRollWriting() throws Exception {
  setUpforLogRolling();
  String className = this.getClass().getName();
  StringBuilder v = new StringBuilder(className);
  while (v.length() < 1000) {
    v.append(className);
  }
  byte[] value = Bytes.toBytes(v.toString());
  HRegionServer regionServer = startAndWriteData("TestLogRolling", value);
  LOG.info("after writing there are "
      + HLogUtilsForTests.getNumRolledLogFiles(regionServer.getWAL()) + " log files");

  // flush all regions

  List<HRegion> regions = new ArrayList<HRegion>(regionServer
      .getOnlineRegionsLocalContext());
  for (HRegion r : regions) {
    r.flushcache();
  }
  admin.rollHLogWriter(regionServer.getServerName().getServerName());
  int count = HLogUtilsForTests.getNumRolledLogFiles(regionServer.getWAL());
  LOG.info("after flushing all regions and rolling logs there are " +
      count + " log files");
  assertTrue(("actual count: " + count), count <= 2);
}
项目:IRIndex    文件:TestAdmin.java   
@Test
public void testHLogRollWriting() throws Exception {
  setUpforLogRolling();
  String className = this.getClass().getName();
  StringBuilder v = new StringBuilder(className);
  while (v.length() < 1000) {
    v.append(className);
  }
  byte[] value = Bytes.toBytes(v.toString());
  HRegionServer regionServer = startAndWriteData("TestLogRolling", value);
  LOG.info("after writing there are "
      + HLogUtilsForTests.getNumLogFiles(regionServer.getWAL()) + " log files");

  // flush all regions

  List<HRegion> regions = new ArrayList<HRegion>(regionServer
      .getOnlineRegionsLocalContext());
  for (HRegion r : regions) {
    r.flushcache();
  }
  admin.rollHLogWriter(regionServer.getServerName().getServerName());
  int count = HLogUtilsForTests.getNumLogFiles(regionServer.getWAL());
  LOG.info("after flushing all regions and rolling logs there are " +
      count + " log files");
  assertTrue(("actual count: " + count), count <= 3);
}
项目:PyroDB    文件:TestAdmin.java   
@Test (timeout=300000)
public void testHLogRollWriting() throws Exception {
  setUpforLogRolling();
  String className = this.getClass().getName();
  StringBuilder v = new StringBuilder(className);
  while (v.length() < 1000) {
    v.append(className);
  }
  byte[] value = Bytes.toBytes(v.toString());
  HRegionServer regionServer = startAndWriteData("TestLogRolling", value);
  LOG.info("after writing there are "
      + HLogUtilsForTests.getNumRolledLogFiles(regionServer.getWAL()) + " log files");

  // flush all regions

  List<HRegion> regions = new ArrayList<HRegion>(regionServer
      .getOnlineRegionsLocalContext());
  for (HRegion r : regions) {
    r.flushcache();
  }
  admin.rollHLogWriter(regionServer.getServerName().getServerName());
  int count = HLogUtilsForTests.getNumRolledLogFiles(regionServer.getWAL());
  LOG.info("after flushing all regions and rolling logs there are " +
      count + " log files");
  assertTrue(("actual count: " + count), count <= 2);
}
项目:c5    文件:TestAdmin.java   
@Test (timeout=300000)
public void testHLogRollWriting() throws Exception {
  setUpforLogRolling();
  String className = this.getClass().getName();
  StringBuilder v = new StringBuilder(className);
  while (v.length() < 1000) {
    v.append(className);
  }
  byte[] value = Bytes.toBytes(v.toString());
  HRegionServer regionServer = startAndWriteData("TestLogRolling", value);
  LOG.info("after writing there are "
      + HLogUtilsForTests.getNumLogFiles(regionServer.getWAL()) + " log files");

  // flush all regions

  List<HRegion> regions = new ArrayList<HRegion>(regionServer
      .getOnlineRegionsLocalContext());
  for (HRegion r : regions) {
    r.flushcache();
  }
  admin.rollHLogWriter(regionServer.getServerName().getServerName());
  int count = HLogUtilsForTests.getNumLogFiles(regionServer.getWAL());
  LOG.info("after flushing all regions and rolling logs there are " +
      count + " log files");
  assertTrue(("actual count: " + count), count <= 2);
}
项目:HBase-Research    文件:TestAdmin.java   
@Test
public void testHLogRollWriting() throws Exception {
  setUpforLogRolling();
  String className = this.getClass().getName();
  StringBuilder v = new StringBuilder(className);
  while (v.length() < 1000) {
    v.append(className);
  }
  byte[] value = Bytes.toBytes(v.toString());
  HRegionServer regionServer = startAndWriteData("TestLogRolling", value);
  LOG.info("after writing there are "
      + HLogUtilsForTests.getNumLogFiles(regionServer.getWAL()) + " log files");

  // flush all regions

  List<HRegion> regions = new ArrayList<HRegion>(regionServer
      .getOnlineRegionsLocalContext());
  for (HRegion r : regions) {
    r.flushcache();
  }
  admin.rollHLogWriter(regionServer.getServerName().getServerName());
  int count = HLogUtilsForTests.getNumLogFiles(regionServer.getWAL());
  LOG.info("after flushing all regions and rolling logs there are " +
      count + " log files");
  assertTrue(("actual count: " + count), count <= 2);
}
项目:hbase-0.94.8-qod    文件:TestAdmin.java   
@Test
public void testHLogRollWriting() throws Exception {
  setUpforLogRolling();
  String className = this.getClass().getName();
  StringBuilder v = new StringBuilder(className);
  while (v.length() < 1000) {
    v.append(className);
  }
  byte[] value = Bytes.toBytes(v.toString());
  HRegionServer regionServer = startAndWriteData("TestLogRolling", value);
  LOG.info("after writing there are "
      + HLogUtilsForTests.getNumLogFiles(regionServer.getWAL()) + " log files");

  // flush all regions

  List<HRegion> regions = new ArrayList<HRegion>(regionServer
      .getOnlineRegionsLocalContext());
  for (HRegion r : regions) {
    r.flushcache();
  }
  admin.rollHLogWriter(regionServer.getServerName().getServerName());
  int count = HLogUtilsForTests.getNumLogFiles(regionServer.getWAL());
  LOG.info("after flushing all regions and rolling logs there are " +
      count + " log files");
  assertTrue(("actual count: " + count), count <= 2);
}
项目:hbase-0.94.8-qod    文件:TestAdmin.java   
@Test
public void testHLogRollWriting() throws Exception {
  setUpforLogRolling();
  String className = this.getClass().getName();
  StringBuilder v = new StringBuilder(className);
  while (v.length() < 1000) {
    v.append(className);
  }
  byte[] value = Bytes.toBytes(v.toString());
  HRegionServer regionServer = startAndWriteData("TestLogRolling", value);
  LOG.info("after writing there are "
      + HLogUtilsForTests.getNumLogFiles(regionServer.getWAL()) + " log files");

  // flush all regions

  List<HRegion> regions = new ArrayList<HRegion>(regionServer
      .getOnlineRegionsLocalContext());
  for (HRegion r : regions) {
    r.flushcache();
  }
  admin.rollHLogWriter(regionServer.getServerName().getServerName());
  int count = HLogUtilsForTests.getNumLogFiles(regionServer.getWAL());
  LOG.info("after flushing all regions and rolling logs there are " +
      count + " log files");
  assertTrue(("actual count: " + count), count <= 2);
}
项目:DominoHBase    文件:TestAdmin.java   
@Test
public void testHLogRollWriting() throws Exception {
  setUpforLogRolling();
  String className = this.getClass().getName();
  StringBuilder v = new StringBuilder(className);
  while (v.length() < 1000) {
    v.append(className);
  }
  byte[] value = Bytes.toBytes(v.toString());
  HRegionServer regionServer = startAndWriteData("TestLogRolling", value);
  LOG.info("after writing there are "
      + HLogUtilsForTests.getNumLogFiles(regionServer.getWAL()) + " log files");

  // flush all regions

  List<HRegion> regions = new ArrayList<HRegion>(regionServer
      .getOnlineRegionsLocalContext());
  for (HRegion r : regions) {
    r.flushcache();
  }
  admin.rollHLogWriter(regionServer.getServerName().getServerName());
  int count = HLogUtilsForTests.getNumLogFiles(regionServer.getWAL());
  LOG.info("after flushing all regions and rolling logs there are " +
      count + " log files");
  assertTrue(("actual count: " + count), count <= 2);
}
项目:hindex    文件:TestAdmin.java   
@Test
public void testHLogRollWriting() throws Exception {
  setUpforLogRolling();
  String className = this.getClass().getName();
  StringBuilder v = new StringBuilder(className);
  while (v.length() < 1000) {
    v.append(className);
  }
  byte[] value = Bytes.toBytes(v.toString());
  HRegionServer regionServer = startAndWriteData("TestLogRolling", value);
  LOG.info("after writing there are "
      + HLogUtilsForTests.getNumLogFiles(regionServer.getWAL()) + " log files");

  // flush all regions

  List<HRegion> regions = new ArrayList<HRegion>(regionServer
      .getOnlineRegionsLocalContext());
  for (HRegion r : regions) {
    r.flushcache();
  }
  admin.rollHLogWriter(regionServer.getServerName().getServerName());
  int count = HLogUtilsForTests.getNumLogFiles(regionServer.getWAL());
  LOG.info("after flushing all regions and rolling logs there are " +
      count + " log files");
  assertTrue(("actual count: " + count), count <= 2);
}