Package com.linkedin.helix

Examples of com.linkedin.helix.HelixException


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


      }
    }

    if (nextIters.size() != 1)
    {
      throw new HelixException("operator pipeline produced " + nextIters.size()
          + " tuple sets instead of exactly 1");
    }

    return nextIters.get(0);
  }
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

    {
      aggComponent = matcher.group();
      aggComponent = aggComponent.substring(1, aggComponent.length() - 1);
      if (aggComponent.contains(")") || aggComponent.contains("("))
      {
        throw new HelixException(expression
            + " has invalid aggregate component");
      }
    }
    else
    {
      throw new HelixException(expression + " has invalid aggregate component");
    }
    if (matcher.find())
    {
      statComponent = matcher.group();
      statComponent = statComponent.substring(1, statComponent.length() - 1);
      // statComponent must have at least 1 arg between paren
      if (statComponent.contains(")") || statComponent.contains("(")
          || statComponent.length() == 0)
      {
        throw new HelixException(expression + " has invalid stat component");
      }
      lastMatchEnd = matcher.end();
    }
    else
    {
      throw new HelixException(expression + " has invalid stat component");
    }
    if (matcher.find())
    {
      throw new HelixException(expression
          + " has too many parenthesis components");
    }

    if (expression.length() >= lastMatchEnd + 1)
    { // lastMatchEnd is pos 1 past the pattern. check if there are paren there
      if (expression.substring(lastMatchEnd).contains("(")
          || expression.substring(lastMatchEnd).contains(")"))
      {
        throw new HelixException(expression + " has extra parenthesis");
      }
    }

    // check wildcard locations. each part can have at most 1 wildcard, and must
    // be at end
    // String expStatNamePart = expression.substring(expression.)
    StringTokenizer fieldTok = new StringTokenizer(statComponent,
        statFieldDelim);
    while (fieldTok.hasMoreTokens())
    {
      String currTok = fieldTok.nextToken();
      if (currTok.contains(wildcardChar))
      {
        if (currTok.indexOf(wildcardChar) != currTok.length() - 1
            || currTok.lastIndexOf(wildcardChar) != currTok.length() - 1)
        {
          throw new HelixException(currTok
              + " is illegal stat name.  Single wildcard must appear at end.");
        }
      }
    }
  }
View Full Code Here

  {
    aggStr = aggStr.toUpperCase();
    Aggregator agg = aggregatorMap.get(aggStr);
    if (agg == null)
    {
      throw new HelixException("Unknown aggregator type " + aggStr);
    }
    return agg;
  }
View Full Code Here

  public static String getAggregatorStr(String expression)
      throws HelixException
  {
    if (!expression.contains("("))
    {
      throw new HelixException(expression
          + " does not contain a valid aggregator.  No parentheses found");
    }
    String aggName = expression.substring(0, expression.indexOf("("));
    if (!aggregatorMap.containsKey(aggName.toUpperCase()))
    {
      throw new HelixException("aggregator <" + aggName + "> is unknown type");
    }
    return aggName;
  }
View Full Code Here

    // verify correct number of args
    int requiredNumArgs = aggregatorMap.get(aggregator.toUpperCase())
        .getRequiredNumArgs();
    if (numArgs != requiredNumArgs)
    {
      throw new HelixException(expression + " contains " + args.length
          + " arguments, but requires " + requiredNumArgs);
    }
    return args;
  }
View Full Code Here

          expression.lastIndexOf(")")));
    }
    String[] statList = justStats.split(argDelim);
    if (statList.length < 1)
    {
      throw new HelixException(expression
          + " does not contain any aggregator stats");
    }
    return statList;
  }
View Full Code Here

      throws HelixException
  {
    String[] stats = getAggregatorStats(expression);
    if (stats.length > 1)
    {
      throw new HelixException(expression + " contains more than 1 stat");
    }
    return stats[0];
  }
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

TOP

Related Classes of com.linkedin.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.