Package org.apache.hadoop.hbase.util

Examples of org.apache.hadoop.hbase.util.HBaseFsck$TableInfo$HDFSIntegrityFixer


    TEST_UTIL.shutdownMiniHBaseCluster();
    TEST_UTIL.shutdownMiniZKCluster();
    HConnectionManager.deleteConnection(conf);

    // rebuild meta table from scratch
    HBaseFsck fsck = new HBaseFsck(conf);
    assertTrue(fsck.rebuildMeta(false));

    // bring up the minicluster
    TEST_UTIL.startMiniZKCluster(); // tables seem enabled by default
    TEST_UTIL.restartHBaseCluster(3);
   
View Full Code Here


    Configuration conf = HBaseConfiguration.create();
    // Cover both bases, the old way of setting default fs and the new.
    // We're supposed to run on 0.20 and 0.21 anyways.
    conf.set("fs.defaultFS", conf.get(HConstants.HBASE_DIR));
    conf.set("fs.default.name", conf.get(HConstants.HBASE_DIR));
    HBaseFsck fsck = new HBaseFsck(conf);
    boolean fixHoles = false;

    // Process command-line args.
    for (int i = 0; i < args.length; i++) {
      String cmd = args[i];
      if (cmd.equals("-details")) {
        fsck.setDisplayFullReport();
      } else if (cmd.equals("-base")) {
        // update hbase root dir to user-specified base
        i++;
        String path = args[i];
        conf.set(HConstants.HBASE_DIR, path);
        conf.set("fs.defaultFS", conf.get(HConstants.HBASE_DIR));
        conf.set("fs.default.name", conf.get(HConstants.HBASE_DIR));
      } else if (cmd.equals("-fixHoles")) {
        fixHoles = true;
      } else if (cmd.equals("-fix")) {
        // make all fix options true
        fixHoles = true;
      } else {
        String str = "Unknown command line option : " + cmd;
        LOG.info(str);
        System.out.println(str);
        printUsageAndExit();
      }
    }

    // Fsck doesn't shutdown and and doesn't provide a way to shutdown its
    // threads cleanly, so we do a System.exit.
    boolean success = false;
    try {
      success = fsck.rebuildMeta(fixHoles);
    } catch (MultipleIOException mioes) {
      for (IOException ioe : mioes.getExceptions()) {
        LOG.error("Bailed out due to:", ioe);
      }
    } catch (Exception e) {
View Full Code Here

  }

  public static HBaseFsck doFsck(Configuration conf, boolean fixAssignments,
      boolean fixMeta, boolean fixHdfsHoles, boolean fixHdfsOverlaps,
      boolean fixHdfsOrphans, boolean fixVersionFile) throws Exception {
    HBaseFsck fsck = new HBaseFsck(conf);
    fsck.connect();
    fsck.setDisplayFullReport(); // i.e. -details
    fsck.setTimeLag(0);
    fsck.setFixAssignments(fixAssignments);
    fsck.setFixMeta(fixMeta);
    fsck.setFixHdfsHoles(fixHdfsHoles);
    fsck.setFixHdfsOverlaps(fixHdfsOverlaps);
    fsck.setFixHdfsOrphans(fixHdfsOrphans);
    fsck.setFixVersionFile(fixVersionFile);
    fsck.onlineHbck();
    return fsck;
  }
View Full Code Here

    // shutdown the minicluster
    TEST_UTIL.shutdownMiniHBaseCluster();
    TEST_UTIL.shutdownMiniZKCluster();

    // attempt to rebuild meta table from scratch
    HBaseFsck fsck = new HBaseFsck(conf);
    assertFalse(fsck.rebuildMeta(false));

    Multimap<byte[], HbckInfo> problems = fsck.getOverlapGroups(table);
    assertEquals(1, problems.keySet().size());
    assertEquals(3, problems.size());

    // bring up the minicluster
    TEST_UTIL.startMiniZKCluster(); // tables seem enabled by default
View Full Code Here

    // shutdown the minicluster
    TEST_UTIL.shutdownMiniHBaseCluster();
    TEST_UTIL.shutdownMiniZKCluster();

    // attempt to rebuild meta table from scratch
    HBaseFsck fsck = new HBaseFsck(conf);
    assertFalse(fsck.rebuildMeta(false));

    // bring up the minicluster
    TEST_UTIL.startMiniZKCluster(); // tables seem enabled by default
    TEST_UTIL.restartHBaseCluster(3);
View Full Code Here

    TEST_UTIL.shutdownMiniHBaseCluster();
    TEST_UTIL.shutdownMiniZKCluster();
    HConnectionManager.deleteConnection(conf);

    // rebuild meta table from scratch
    HBaseFsck fsck = new HBaseFsck(conf);
    assertTrue(fsck.rebuildMeta(false));

    // bring up the minicluster
    TEST_UTIL.startMiniZKCluster();
    TEST_UTIL.restartHBaseCluster(3);
    TEST_UTIL.getHBaseAdmin().enableTable(table);
View Full Code Here

    // shutdown the minicluster
    TEST_UTIL.shutdownMiniHBaseCluster();
    TEST_UTIL.shutdownMiniZKCluster();

    // attempt to rebuild meta table from scratch
    HBaseFsck fsck = new HBaseFsck(conf);
    assertFalse(fsck.rebuildMeta(false));

    Multimap<byte[], HbckInfo> problems = fsck.getOverlapGroups(table);
    assertEquals(1, problems.keySet().size());
    assertEquals(3, problems.size());

    // bring up the minicluster
    TEST_UTIL.startMiniZKCluster(); // tables seem enabled by default
View Full Code Here

    // shutdown the minicluster
    TEST_UTIL.shutdownMiniHBaseCluster();
    TEST_UTIL.shutdownMiniZKCluster();

    // attempt to rebuild meta table from scratch
    HBaseFsck fsck = new HBaseFsck(conf);
    assertFalse(fsck.rebuildMeta(false));

    // bring up the minicluster
    TEST_UTIL.startMiniZKCluster(); // tables seem enabled by default
    TEST_UTIL.restartHBaseCluster(3);
View Full Code Here

  public static HBaseFsck doFsck(Configuration conf, boolean fixAssignments,
      boolean fixMeta, boolean fixHdfsHoles, boolean fixHdfsOverlaps,
      boolean fixHdfsOrphans, boolean fixTableOrphans, boolean fixVersionFile,
      String table) throws Exception {
    HBaseFsck fsck = new HBaseFsck(conf);
    fsck.connect();
    fsck.setDisplayFullReport(); // i.e. -details
    fsck.setTimeLag(0);
    fsck.setFixAssignments(fixAssignments);
    fsck.setFixMeta(fixMeta);
    fsck.setFixHdfsHoles(fixHdfsHoles);
    fsck.setFixHdfsOverlaps(fixHdfsOverlaps);
    fsck.setFixHdfsOrphans(fixHdfsOrphans);
    fsck.setFixTableOrphans(fixTableOrphans);
    fsck.setFixVersionFile(fixVersionFile);
    if (table != null) {
      fsck.includeTable(table);
    }
    fsck.onlineHbck();
    return fsck;
  }
View Full Code Here

   * @throws Exception
   */
  public static HBaseFsck doHFileQuarantine(Configuration conf, String table) throws Exception {
    String[] args = {"-sidelineCorruptHFiles", "-ignorePreCheckPermission", table};
    ExecutorService exec = new ScheduledThreadPoolExecutor(10);
    HBaseFsck hbck = new HBaseFsck(conf, exec);
    hbck.exec(exec, args);
    return hbck;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.util.HBaseFsck$TableInfo$HDFSIntegrityFixer

Copyright © 2018 www.massapicom. 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.