Package org.apache.helix

Examples of org.apache.helix.HelixException


    {
      String errorMsg =
          "Fail to create live instance node after waiting, so quit. instance:"
              + _instanceName;
      logger.warn(errorMsg);
      throw new HelixException(errorMsg);

    }
    String currentStatePathParent =
        PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
                                   _clusterName,
View Full Code Here


                                                EventType[] eventTypes,
                                                ChangeType changeType)
  {
    if (listener == null)
    {
      throw new HelixException("Listener cannot be null");
    }
    return new CallbackHandler(this, _zkClient, path, listener, eventTypes, changeType);
  }
View Full Code Here

    logger.info(zkConnection.getZookeeper());

    if (!ZKUtil.isClusterSetup(_clusterName, _zkClient))
    {
      throw new HelixException("Initial cluster structure is not set up for cluster:"
          + _clusterName);
    }
    if (!isInstanceSetup())
    {
      throw new HelixException("Initial cluster structure is not set up for instance:"
          + _instanceName + " instanceType:" + _instanceType);
    }

    if (_instanceType == InstanceType.PARTICIPANT
        || _instanceType == InstanceType.CONTROLLER_PARTICIPANT)
View Full Code Here

      {
        String errorMessage =
            "instance " + _instanceName + " already has a liveinstance in cluster "
                + _clusterName;
        logger.error(errorMessage);
        throw new HelixException(errorMessage);
      }
    }
    // Invoke the PreConnectCallbacks
    for (PreConnectCallback callback : _preConnectCallbacks)
    {
View Full Code Here

  private void checkConnected()
  {
    if (!isConnected())
    {
      throw new HelixException("ClusterManager not connected. Call clusterManager.connect()");
    }
  }
View Full Code Here

    // We need to find out the "FROM" target, and replace it with liveInstances
    // / partitions etc
    int fromIndex = sql.indexOf("FROM");
    if (fromIndex == -1)
    {
      throw new HelixException("Query must contain FROM target. Query: " + sql);
    }
    // Per JoSql, select FROM <target> the target must be a object class that
    // corresponds to a "table row"
    // In out case, the row is always a ZNRecord

    int nextSpace = sql.indexOf(" ", fromIndex);
    while (sql.charAt(nextSpace) == ' ')
    {
      nextSpace++;
    }
    int nextnextSpace = sql.indexOf(" ", nextSpace);
    if (nextnextSpace == -1)
    {
      nextnextSpace = sql.length();
    }
    String fromTarget = sql.substring(nextSpace, nextnextSpace).trim();

    if (fromTarget.length() == 0)
    {
      throw new HelixException("FROM target in the query cannot be empty. Query: " + sql);
    }
    return fromTarget;
  }
View Full Code Here

    {
      fromTarget = josqlQuery.getVariable(PropertyType.IDEALSTATES.toString() + FLATTABLE);
    }
    else
    {
      throw new HelixException(
          "Unknown query target "
              + fromTargetString
              + ". Target should be PARTITIONS, LIVEINSTANCES, CONFIGS, STATEMODELDEFS, IDEALSTATES, EXTERNALVIEW, and corresponding flat Tables");
    }
View Full Code Here

      JsonParameters jsonParameters = new JsonParameters(entity);
      String command = jsonParameters.getCommand();

      if (command == null)
      {
        throw new HelixException("Could NOT find 'command' in parameterMap: " + jsonParameters._parameterMap);
      }
      else if (command.equalsIgnoreCase(ClusterSetup.addCluster))
      {
        jsonParameters.verifyCommand(ClusterSetup.addCluster);

        ZkClient zkClient =
            (ZkClient) getContext().getAttributes().get(RestAdminApplication.ZKCLIENT);
        ClusterSetup setupTool = new ClusterSetup(zkClient);
        setupTool.addCluster(jsonParameters.getParameter(JsonParameters.CLUSTER_NAME),
                             false);
      }
      else
      {
        throw new HelixException("Unsupported command: " + command
            + ". Should be one of [" + ClusterSetup.addCluster + "]");
      }

      getResponse().setEntity(getClustersRepresentation());
      getResponse().setStatus(Status.SUCCESS_OK);
View Full Code Here

      _statusUpdateUtil.logError(message,
                                 HelixStateTransitionHandler.class,
                                 errorMessage,
                                 manager.getHelixDataAccessor());
      logger.error(errorMessage);
      throw new HelixException(errorMessage);
    }
    // DataAccessor accessor = manager.getDataAccessor();
    HelixDataAccessor accessor = manager.getHelixDataAccessor();

    String partitionName = message.getPartitionName();
View Full Code Here

        accessor.setProperty(accessor.keyBuilder().stateModelDef(newStateModel.getId()), new StateModelDefinition(newStateModel) );
        getResponse().setEntity(getStateModelsRepresentation());
      }
      else
      {
          throw new HelixException("Unsupported command: " + command
                                   + ". Should be one of [" + ClusterSetup.addStateModelDef + "]");
      }
     
      getResponse().setStatus(Status.SUCCESS_OK);
    }
View Full Code Here

TOP

Related Classes of org.apache.helix.HelixException

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.