Package com.alibaba.wasp.master

Examples of com.alibaba.wasp.master.EntityGroupState


    }
    final Map<String, EntityGroupState> egit = new HashMap<String, EntityGroupState>();
    for (ClusterStatusProtos.EntityGroupInTransitionProtos entityGroup : proto
        .getEntityGroupsInTransitionList()) {
      String key = new String(entityGroup.getSpec().getValue().toByteArray());
      EntityGroupState value = EntityGroupState.convert(entityGroup
          .getEntityGroupState());
      egit.put(key, value);
    }

    return new ClusterStatus(
View Full Code Here


  @Override
  public void process() {
    // Code to defend against case where we get SPLIT before EntityGroup open
    // processing completes; temporary till we make SPLITs go via zk -- 0.92.
    EntityGroupState entityGroupState = this.assignmentManager
        .getEntityGroupStates().getEntityGroupTransitionState(
            entityGroupInfo.getEncodedName());
    boolean openedNodeDeleted = false;
    if (entityGroupState != null && entityGroupState.isOpened()) {
      openedNodeDeleted = deleteOpenedNode(expectedVersion);
      if (!openedNodeDeleted) {
        LOG.error("The znode of entityGroup "
            + entityGroupInfo.getEntityGroupNameAsString()
            + " could not be deleted.");
View Full Code Here

        EntityGroupStates entityGroupStates = assignmentManager
            .getEntityGroupStates();
        List<EntityGroupInfo> toAssignEntityGroups = new ArrayList<EntityGroupInfo>();
        for (Map.Entry<EntityGroupInfo, Result> e : egis.entrySet()) {
          EntityGroupInfo egi = e.getKey();
          EntityGroupState egit = entityGroupStates
              .getEntityGroupTransitionState(egi);
          if (processDeadEntityGroup(egi, e.getValue(), assignmentManager,
              server)) {
            ServerName addressFromAM = entityGroupStates
                .getFServerOfEntityGroup(egi);
            if (addressFromAM != null && !addressFromAM.equals(this.serverName)) {
              // If this entityGroup is in transition on the dead server, it
              // must be
              // opening or pending_open, which is covered by
              // AM#processServerShutdown
              LOG.debug("Skip assigning entityGroup "
                  + egi.getEntityGroupNameAsString()
                  + " because it has been opened in "
                  + addressFromAM.getServerName());
              continue;
            }
            if (egit != null) {
              if (!egit.isOnServer(serverName) || egit.isClosed()
                  || egit.isOpened() || egit.isSplit()) {
                // Skip entityGroups that are in transition on other server,
                // or in state closed/opened/split
                LOG.info("Skip assigning entityGroup " + egit);
                continue;
              }
              try {
                // clean zk node
                LOG.info("Reassigning entityGroup with eg = " + egit
                    + " and deleting zk node if exists");
                ZKAssign.deleteNodeFailSilent(server.getZooKeeper(), egi);
              } catch (KeeperException ke) {
                this.server.abort(
                    "Unexpected ZK exception deleting unassigned node " + egi,
                    ke);
                return;
              }
            }
            toAssignEntityGroups.add(egi);
          } else if (egit != null) {
            if (egit.isSplitting() || egit.isSplit()) {
              // This will happen when the FServer went down and the call back
              // for
              // the SPLIITING or SPLIT
              // has not yet happened for node Deleted event. In that case if
              // the EntityGroup was actually
              // split
              // but the FServer had gone down before completing the split
              // process
              // then will not try to
              // assign the parent EntityGroup again. In that case we should
              // make the
              // EntityGroup offline and
              // also delete the EntityGroup from EGIT.
              assignmentManager.entityGroupOffline(egi);
            } else if ((egit.isClosing() || egit.isPendingClose())
                && assignmentManager.getZKTable().isDisablingOrDisabledTable(
                    egi.getTableNameAsString())) {
              // If the table was partially disabled and the FServer went down,
              // we
              // should clear the EGIT
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.master.EntityGroupState

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.