Package com.alibaba.wasp

Examples of com.alibaba.wasp.EntityGroupInfo


      EntityGroupStates entityGroupStates = assignmentManager
          .getEntityGroupStates();
      for (EntityGroupInfo entityGroup : entityGroups) {
        if (entityGroupStates.isEntityGroupInTransition(entityGroup))
          continue;
        final EntityGroupInfo egi = entityGroup;
        pool.execute(Trace.wrap(new Runnable() {
          public void run() {
            assignmentManager.unassign(egi);
          }
        }));
View Full Code Here


      if (egis != null) {
        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
              // and remove the node for the EntityGroup.
              // The egit that we use may be stale in case the table was in
View Full Code Here

    return tableDesc.getTableName();
  }

  @Override
  public String getEntityGroupName() {
    EntityGroupInfo entiyGroupInfo = this.entiyGroup.getEntityGroupInfo();
    if (entiyGroupInfo == null) {
      return "";
    }
    return entiyGroupInfo.getEncodedName();
  }
View Full Code Here

   * @throws java.io.IOException
   */
  private boolean transitionToOpened(final EntityGroup entityGroup)
      throws IOException {
    boolean result = false;
    EntityGroupInfo egi = entityGroup.getEntityGroupInfo();
    final String name = egi.getEntityGroupNameAsString();
    // Finally, Transition ZK node to OPENED
    try {
      if (ZKAssign.transitionNodeOpened(this.server.getZooKeeper(), egi,
          this.server.getServerName(), this.version) == -1) {
        LOG.warn("Completed the OPEN of entityGroup "
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.EntityGroupInfo

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.