Package org.apache.hadoop.hbase.zookeeper.ZKTable

Examples of org.apache.hadoop.hbase.zookeeper.ZKTable.TableState


  public static Map<TableState, Set<String>> getEnabledOrEnablingTables(ZooKeeperWatcher zkw)
      throws KeeperException {
    Map<TableState, Set<String>> enabledTables = new HashMap<TableState, Set<String>>();
    List<String> children = ZKUtil.listChildrenNoWatch(zkw, zkw.clientTableZNode);
    for (String child : children) {
      TableState state = getTableState(zkw, child);
      if (state == TableState.ENABLED) {
        Set<String> tables = enabledTables.get(state);
        if (tables == null) {
          tables = new HashSet<String>();
          enabledTables.put(TableState.ENABLED, tables);
View Full Code Here


  }


  @Override
  public void setTableState(String tableName, String state) throws IOException {
    TableState tableState = TableState.valueOf(state);
    if (tableState == TableState.ENABLED) {
      List<HRegionInfo> tableRegions =
          MetaReader.getTableRegions(this.catalogTracker, Bytes.toBytes(tableName));
      List<HRegionInfo> onlineRegions =
          this.assignmentManager.getRegionsOfTable(Bytes.toBytes(tableName));
View Full Code Here

   * @throws KeeperException
   */
  public static boolean isDisabledTable(final ZooKeeperWatcher zkw,
      final String tableName)
  throws KeeperException {
    TableState state = getTableState(zkw, tableName);
    return isTableState(TableState.DISABLED, state);
  }
View Full Code Here

   * @return True if table is enabled.
   * @throws KeeperException
   */
  public static boolean isEnabledTable(final ZooKeeperWatcher zkw,
      final String tableName) throws KeeperException {
    TableState state = getTableState(zkw, tableName);
    return state == null || state == TableState.ENABLED;
  }
View Full Code Here

   * @return True if table is enabled.
   * @throws KeeperException
   */
  public static boolean isDisablingOrDisabledTable(final ZooKeeperWatcher zkw,
      final String tableName) throws KeeperException {
    TableState state = getTableState(zkw, tableName);
    return isTableState(TableState.DISABLING, state) ||
      isTableState(TableState.DISABLED, state);
  }
View Full Code Here

  throws KeeperException {
    Set<String> disabledTables = new HashSet<String>();
    List<String> children =
      ZKUtil.listChildrenNoWatch(zkw, zkw.clientTableZNode);
    for (String child: children) {
      TableState state = getTableState(zkw, child);
      if (state == TableState.DISABLED) disabledTables.add(child);
    }
    return disabledTables;
  }
View Full Code Here

  throws KeeperException {
    Set<String> disabledTables = new HashSet<String>();
    List<String> children =
      ZKUtil.listChildrenNoWatch(zkw, zkw.clientTableZNode);
    for (String child: children) {
      TableState state = getTableState(zkw, child);
      if (state == TableState.DISABLED || state == TableState.DISABLING)
        disabledTables.add(child);
    }
    return disabledTables;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.zookeeper.ZKTable.TableState

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.