Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.HBaseAdmin.compact()


      // should have a second StoreFile now
      assertEquals(2, fs.listStatus(storePath).length);

      // minor compactions shouldn't get rid of the file
      admin.compact(TABLE_NAME.getName());
      try {
        quickPoll(new Callable<Boolean>() {
          public Boolean call() throws Exception {
            return fs.listStatus(storePath).length == 1;
          }
View Full Code Here


      // should have a second StoreFile now
      assertEquals(2, fs.listStatus(storePath).length);

      // minor compactions shouldn't get rid of the file
      admin.compact(TABLE_NAME);
      try {
        quickPoll(new Callable<Boolean>() {
          public Boolean call() throws Exception {
            return fs.listStatus(storePath).length == 1;
          }
View Full Code Here

      // should have a second StoreFile now
      assertEquals(2, fs.listStatus(storePath).length);

      // minor compactions shouldn't get rid of the file
      admin.compact(TABLE_NAME);
      try {
        quickPoll(new Callable<Boolean>() {
          public Boolean call() throws Exception {
            return fs.listStatus(storePath).length == 1;
          }
View Full Code Here

    LOG.info("Performing action: Compact table " + tableName + ", major=" + major);
    try {
      if (major) {
        admin.majorCompact(tableNameBytes);
      } else {
        admin.compact(tableNameBytes);
      }
    } catch (Exception ex) {
      LOG.warn("Compaction failed, might be caused by other chaos: " + ex.getMessage());
    }
    if (sleepTime > 0) {
View Full Code Here

      if (major) {
        LOG.debug("Major compacting region " + region.getRegionNameAsString());
        admin.majorCompact(region.getRegionName());
      } else {
        LOG.debug("Compacting region " + region.getRegionNameAsString());
        admin.compact(region.getRegionName());
      }
    } catch (Exception ex) {
      LOG.warn("Compaction failed, might be caused by other chaos: " + ex.getMessage());
    }
    if (sleepTime > 0) {
View Full Code Here

        while (!(store.getStorefilesCount() > 2)) {
          Thread.sleep(10);
        }
      }
      result(fam, row, qual, row2, table, value, value2, row1, value1);
      admin.compact(tableName.getName());
      while (admin.getCompactionState(tableName.getName()) != CompactionState.NONE) {
        Thread.sleep(10);
      }
      result(fam, row, qual, row2, table, value, value2, row1, value1);
    } finally {
View Full Code Here

        }
      } finally {
        if (scanner != null)
          scanner.close();
      }
      admin.compact(tableName.getName());
      while (admin.getCompactionState(tableName.getName()) != CompactionState.NONE) {
        Thread.sleep(10);
      }
      s = new Scan(row);
      scanner = table.getScanner(s);
View Full Code Here

      List<HRegion> regions = rs.getOnlineRegions(table);
      int countBefore = countStoreFiles(regions, family);
      assertTrue(countBefore > 0); // there should be some data files
      HBaseAdmin admin = new HBaseAdmin(TEST_UTIL.getConfiguration());
      if (expectedState == CompactionState.MINOR) {
        admin.compact(tableName);
      } else {
        admin.majorCompact(table);
      }
      long curt = System.currentTimeMillis();
      long waitTime = 5000;
View Full Code Here

    LOG.debug("Verifying all 'batches', both HFile v1 and encoded HFile v2");
    verifyBatches(numBatches);

    LOG.debug("Doing a manual compaction");
    admin.compact(TABLE);
    Thread.sleep(TimeUnit.SECONDS.toMillis(10));

    LOG.debug("Verify all the data again");
    verifyBatches(numBatches);
  }
View Full Code Here

      // should have a second StoreFile now
      assertEquals(2, fs.listStatus(storePath).length);

      // minor compactions shouldn't get rid of the file
      admin.compact(TABLE_NAME);
      try {
        quickPoll(new Callable<Boolean>() {
          public Boolean call() throws Exception {
            return fs.listStatus(storePath).length == 1;
          }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.