Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.TableStateManager


        LOG.warn("Nothing to split in log file " + logPath);
        return true;
      }
      if(csm != null) {
        try {
          TableStateManager tsm = csm.getTableStateManager();
          disablingOrDisabledTables = tsm.getTablesInStates(
            ZooKeeperProtos.Table.State.DISABLED, ZooKeeperProtos.Table.State.DISABLING);
        } catch (CoordinatedStateException e) {
          throw new IOException("Can't get disabling/disabled tables", e);
        }
      }
View Full Code Here


    List<HRegionInfo> regionsThatShouldBeOffline = new ArrayList<HRegionInfo>();

    log("Beginning to mock scenarios");

    // Disable the disabledTable in ZK
    TableStateManager zktable = new ZKTableStateManager(zkw);
    zktable.setTableState(disabledTable, ZooKeeperProtos.Table.State.DISABLED);

    /*
     *  ZK = OFFLINE
     */

 
View Full Code Here

    List<HRegionInfo> regionsThatShouldBeOffline = new ArrayList<HRegionInfo>();

    log("Beginning to mock scenarios");

    // Disable the disabledTable in ZK
    TableStateManager zktable = new ZKTableStateManager(zkw);
    zktable.setTableState(disabledTable, ZooKeeperProtos.Table.State.DISABLED);

    assertTrue(" The enabled table should be identified on master fail over.",
        zktable.isTableState(TableName.valueOf("enabledTable"),
          ZooKeeperProtos.Table.State.ENABLED));

    /*
     * ZK = CLOSING
     */
 
View Full Code Here

      }

    };
    ZooKeeperWatcher zkw = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(),
      name.getNameAsString(), abortable, true);
    TableStateManager zkt = new ZKTableStateManager(zkw);
    assertFalse(zkt.isTableState(name, Table.State.ENABLED));
    assertFalse(zkt.isTableState(name, Table.State.DISABLING));
    assertFalse(zkt.isTableState(name, Table.State.DISABLED));
    assertFalse(zkt.isTableState(name, Table.State.ENABLING));
    assertFalse(zkt.isTableState(name, Table.State.DISABLED, Table.State.DISABLING));
    assertFalse(zkt.isTableState(name, Table.State.DISABLED, Table.State.ENABLING));
    assertFalse(zkt.isTablePresent(name));
    zkt.setTableState(name, Table.State.DISABLING);
    assertTrue(zkt.isTableState(name, Table.State.DISABLING));
    assertTrue(zkt.isTableState(name, Table.State.DISABLED, Table.State.DISABLING));
    assertFalse(zkt.getTablesInStates(Table.State.DISABLED).contains(name));
    assertTrue(zkt.isTablePresent(name));
    zkt.setTableState(name, Table.State.DISABLED);
    assertTrue(zkt.isTableState(name, Table.State.DISABLED));
    assertTrue(zkt.isTableState(name, Table.State.DISABLED, Table.State.DISABLING));
    assertFalse(zkt.isTableState(name, Table.State.DISABLING));
    assertTrue(zkt.getTablesInStates(Table.State.DISABLED).contains(name));
    assertTrue(zkt.isTablePresent(name));
    zkt.setTableState(name, Table.State.ENABLING);
    assertTrue(zkt.isTableState(name, Table.State.ENABLING));
    assertTrue(zkt.isTableState(name, Table.State.DISABLED, Table.State.ENABLING));
    assertFalse(zkt.isTableState(name, Table.State.DISABLED));
    assertFalse(zkt.getTablesInStates(Table.State.DISABLED).contains(name));
    assertTrue(zkt.isTablePresent(name));
    zkt.setTableState(name, Table.State.ENABLED);
    assertTrue(zkt.isTableState(name, Table.State.ENABLED));
    assertFalse(zkt.isTableState(name, Table.State.ENABLING));
    assertTrue(zkt.isTablePresent(name));
    zkt.setDeletedTable(name);
    assertFalse(zkt.isTableState(name, Table.State.ENABLED));
    assertFalse(zkt.isTableState(name, Table.State.DISABLING));
    assertFalse(zkt.isTableState(name, Table.State.DISABLED));
    assertFalse(zkt.isTableState(name, Table.State.ENABLING));
    assertFalse(zkt.isTableState(name, Table.State.DISABLED, Table.State.DISABLING));
    assertFalse(zkt.isTableState(name, Table.State.DISABLED, Table.State.ENABLING));
    assertFalse(zkt.isTablePresent(name));
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.TableStateManager

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.