Package org.apache.helix

Examples of org.apache.helix.HelixException


    //separately validate each portion
    ExpressionParser.validateExpression(exp);
   
    //validate comparator
    if (!comparatorMap.containsKey(cmp.toUpperCase())) {
      throw new HelixException("Unknown comparator type "+cmp);
    }
    String actionValue = null;
    try
    {
      actionValue = AlertParser.getComponent(AlertParser.ACTION_NAME, alert);
View Full Code Here


      String validActions = "";
      for (ActionOnError action : ActionOnError.values())
      {
        validActions = validActions + action + " ";
      }
      throw new HelixException("Unknown cmd type " + actionValue + ", valid types : " + validActions);
    }
  }
View Full Code Here

    double mergedVal;
    double mergedTime;
   
    if (currValTup == null || newValTup == null || currTimeTup == null ||
        newTimeTup == null) {
      throw new HelixException("Tuples cannot be null");
    }
   
    //old tuples may be empty, indicating no value/time exist
    if (currValTup.size() > 0 && currTimeTup.size() > 0) {
      currVal = Double.parseDouble(currValTup.iterator().next());
View Full Code Here

  {
    if (!_handlerFactoryMap.containsKey(type))
    {
      if (!type.equalsIgnoreCase(factory.getMessageType()))
      {
        throw new HelixException("Message factory type mismatch. Type: " + type
            + " factory : " + factory.getMessageType());

      }
      _handlerFactoryMap.put(type, factory);
      _threadpoolMap.put(type, Executors.newFixedThreadPool(threadpoolSize));
View Full Code Here

  {
    String type = message.getMsgType();

    if(!type.equals(getMessageType()))
    {
      throw new HelixException("Unexpected msg type for message "+message.getMsgId()
          +" type:" + message.getMsgType());
    }

    return new DefaultParticipantErrorMessageHandler(message, context, _manager);
  }
View Full Code Here

  {
    String type = message.getMsgType();
   
    if(!type.equals(getMessageType()))
    {
      throw new HelixException("Unexpected msg type for message "+message.getMsgId()
          +" type:" + message.getMsgType());
    }
   
    return new DefaultControllerMessageHandler(message, context);
  }
View Full Code Here

    {
      String type = _message.getMsgType();
      HelixTaskResult result = new HelixTaskResult();
      if(!type.equals(MessageType.CONTROLLER_MSG.toString()))
      {
        throw new HelixException("Unexpected msg type for message "+_message.getMsgId()
            +" type:" + _message.getMsgType());
      }
      result.getTaskResultMap().put("ControllerResult", "msg "+ _message.getMsgId() + " from "+_message.getMsgSrc() + " processed");
      result.setSuccess(true);
      return result;
View Full Code Here

    {
      String errorMsg = "Unexpected msg type for message " + message.getMsgId()
          + " type:" + message.getMsgType() + " Expected : "
          + MessageType.TASK_REPLY;
      _logger.error(errorMsg);
      throw new HelixException(errorMsg);
    }
    String correlationId = message.getCorrelationId();
    if (correlationId == null)
    {
      String errorMsg = "Message " + message.getMsgId()
          + " does not have correlation id";
      _logger.error(errorMsg);
      throw new HelixException(errorMsg);
    }

    if (!_callbackMap.containsKey(correlationId))
    {
      String errorMsg = "Message "
          + message.getMsgId()
          + " does not have correponding callback. Probably timed out already. Correlation id: "
          + correlationId;
      _logger.error(errorMsg);
      throw new HelixException(errorMsg);
    }
    _logger.info("Verified reply message " + message.getMsgId()
        + " correlation:" + correlationId);
  }
View Full Code Here

  {
    String type = message.getMsgType();

    if (!type.equals(getMessageType()))
    {
      throw new HelixException("Unexpected msg type for message "
          + message.getMsgId() + " type:" + message.getMsgType());
    }

    return new DefaultSchedulerMessageHandler(message, context, _manager);
  }
View Full Code Here

        NotificationContext context)
    {
      // TODO Auto-generated method stub
      if(message.getMsgSubType()!= null && message.getMsgSubType().equals("EXCEPTION"))
      {
        throw new HelixException("Test Message handler exception, can ignore");
      }
      _handlersCreated++;
      return new TestMessageHandler(message, context);
    }
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.