Examples of TableState


Examples of org.apache.accumulo.core.master.state.tables.TableState

   
    try {
      ZooReaderWriter.getRetryingInstance().mutate(statePath, (byte[]) newState.name().getBytes(), ZooUtil.PUBLIC, new Mutator() {
        @Override
        public byte[] mutate(byte[] oldData) throws Exception {
          TableState oldState = TableState.UNKNOWN;
          if (oldData != null)
            oldState = TableState.valueOf(new String(oldData));
          boolean transition = true;
          // +--------+
          // v |
View Full Code Here

Examples of org.apache.accumulo.core.master.state.tables.TableState

    }
  }
 
  public TableState updateTableStateCache(String tableId) {
    synchronized (tableStateCache) {
      TableState tState = TableState.UNKNOWN;
      byte[] data = zooStateCache.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE);
      if (data != null) {
        String sState = new String(data);
        try {
          tState = TableState.valueOf(sState);
View Full Code Here

Examples of org.apache.accumulo.core.master.state.tables.TableState

          }
          break;
        case NodeCreated:
        case NodeDataChanged:
          // state transition
          TableState tState = updateTableStateCache(tableId);
          log.debug("State transition to " + tState + " @ " + event);
          synchronized (observers) {
            for (TableObserver to : observers)
              to.stateChanged(tableId, tState);
          }
View Full Code Here

Examples of org.apache.accumulo.core.master.state.tables.TableState

  }
 
  @Override
  public Repo<Master> call(long tid, Master env) throws Exception {
   
    TableState ts = TableState.ONLINE;
    if (top == TableOperation.OFFLINE)
      ts = TableState.OFFLINE;
   
    TableManager.getInstance().transitionTableState(tableId, ts);
    Utils.unreserveTable(tableId, tid, true);
View Full Code Here

Examples of org.apache.accumulo.core.master.state.tables.TableState

    Constructor<? extends TabletBalancer> constructor = clazz.getConstructor(String.class);
    return constructor.newInstance(table);
  }

  protected String getLoadBalancerClassNameForTable(String table) {
    TableState tableState = TableManager.getInstance().getTableState(table);
    if (tableState == null)
      return null;
    if (tableState.equals(TableState.ONLINE))
      return configuration.getTableConfiguration(table).get(Property.TABLE_LOAD_BALANCER);
    return null;
  }
View Full Code Here

Examples of org.apache.accumulo.core.master.state.tables.TableState

     * check for offline tables and remove their migrations.
     */
    private void cleanupOfflineMigrations() {
      TableManager manager = TableManager.getInstance();
      for (String tableId : Tables.getIdToNameMap(instance).keySet()) {
        TableState state = manager.getTableState(tableId);
        if (TableState.OFFLINE == state) {
          clearMigrations(tableId);
        }
      }
    }
View Full Code Here

Examples of org.apache.accumulo.core.master.state.tables.TableState

                String parts[] = delete.split("/");
                if (parts.length > 2) {
                  String tableId = parts[parts.length - 3];
                  String tabletDir = parts[parts.length - 2];
                  TableManager.getInstance().updateTableStateCache(tableId);
                  TableState tableState = TableManager.getInstance().getTableState(tableId);
                  if (tableState != null && tableState != TableState.DELETING) {
                    // clone directories don't always exist
                    if (!tabletDir.startsWith("c-"))
                      log.debug("File doesn't exist: " + fullPath);
                  }
View Full Code Here

Examples of org.apache.accumulo.core.master.state.tables.TableState

        for (TabletGroupWatcher watcher : watchers) {
          TableManager manager = TableManager.getInstance();
          for (Entry<Text,TableCounts> entry : watcher.getStats().entrySet()) {
            Text tableId = entry.getKey();
            TableCounts counts = entry.getValue();
            TableState tableState = manager.getTableState(tableId.toString());
            if (tableState != null && tableState.equals(TableState.ONLINE)) {
              result += counts.unassigned() + counts.assignedToDeadServers() + counts.assigned();
            }
          }
        }
        break;
View Full Code Here

Examples of org.apache.accumulo.core.master.state.tables.TableState

        throw new IllegalStateException("Unknown Master State");
    }
  }

  TabletGoalState getTableGoalState(KeyExtent extent) {
    TableState tableState = TableManager.getInstance().getTableState(extent.getTableId().toString());
    if (tableState == null)
      return TabletGoalState.DELETED;
    switch (tableState) {
      case DELETING:
        return TabletGoalState.DELETED;
View Full Code Here

Examples of org.apache.accumulo.core.master.state.tables.TableState

      return result;
    }
    TableManager manager = TableManager.getInstance();

    for (String tableId : Tables.getIdToNameMap(instance).keySet()) {
      TableState state = manager.getTableState(tableId);
      if (state != null) {
        if (state == TableState.ONLINE)
          result.add(tableId);
      }
    }
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.