Examples of RoundRobin


Examples of co.cask.cdap.api.annotation.RoundRobin

   * @return A new instance of {@link ConsumerConfig}.
   */
  private ConsumerConfig getConsumerConfig(BasicFlowletContext flowletContext, Method method) {
    // Determine input queue partition type
    HashPartition hashPartition = method.getAnnotation(HashPartition.class);
    RoundRobin roundRobin = method.getAnnotation(RoundRobin.class);
    DequeueStrategy strategy = DequeueStrategy.FIFO;
    String hashKey = null;

    Preconditions.checkArgument(!(hashPartition != null && roundRobin != null),
                                "Only one strategy allowed for process() method: %s", method.getName());
View Full Code Here

Examples of co.cask.tigon.api.annotation.RoundRobin

   * @return A new instance of {@link ConsumerConfig}.
   */
  private ConsumerConfig getConsumerConfig(BasicFlowletContext flowletContext, Method method) {
    // Determine input queue partition type
    HashPartition hashPartition = method.getAnnotation(HashPartition.class);
    RoundRobin roundRobin = method.getAnnotation(RoundRobin.class);
    DequeueStrategy strategy = DequeueStrategy.FIFO;
    String hashKey = null;

    Preconditions.checkArgument(!(hashPartition != null && roundRobin != null),
                                "Only one strategy allowed for process() method: %s", method.getName());
View Full Code Here

Examples of de.mhus.lib.persistence.RoundRobin

 
  private void persistence() {
    try {
      if (MSingleton.instance().isPersistence()) {
        File f = MSingleton.instance().getPersistenceManager().sessionScope().getPersistenceFile(getJmxName() + "_" + name + ".rrd");
        rrd = new RoundRobin(MTimeInterval.HOUR_IN_MILLISECOUNDS , f);
      }
    } catch (Throwable t) {
      log().t(t);
    }
  }
View Full Code Here

Examples of org.apache.stratos.autoscaler.algorithm.RoundRobin

        if(log.isDebugEnabled()){
            log.debug(String.format("Partition algorithm is ", partitionAlgorithm));
        }
        if(Constants.ROUND_ROBIN_ALGORITHM_ID.equals(partitionAlgorithm)){

            autoscaleAlgorithm = new RoundRobin();
        } else if(Constants.ONE_AFTER_ANOTHER_ALGORITHM_ID.equals(partitionAlgorithm)){

            autoscaleAlgorithm = new OneAfterAnother();
        } else {
            if(log.isErrorEnabled()){
View Full Code Here

Examples of org.apache.stratos.load.balancer.algorithm.RoundRobin

        member = new Member("service1", "cluster1", "np1", "p1", "m3");
        member.setStatus(MemberStatus.Activated);
        members.add(member);

        RoundRobin algorithm = new RoundRobin();
        algorithm.setMembers(members);

        AlgorithmContext algorithmContext = new AlgorithmContext("service1", "cluster1");
        Member nextMember = algorithm.getNextMember(algorithmContext);
        Assert.assertEquals("Expected member not found", true, "m1".equals(nextMember.getMemberId()));

        nextMember = algorithm.getNextMember(algorithmContext);
        Assert.assertEquals("Expected member not found", true, "m2".equals(nextMember.getMemberId()));

        nextMember = algorithm.getNextMember(algorithmContext);
        Assert.assertEquals("Expected member not found", true, "m3".equals(nextMember.getMemberId()));

        nextMember = algorithm.getNextMember(algorithmContext);
        Assert.assertEquals("Expected member not found", true, "m1".equals(nextMember.getMemberId()));
    }
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.RoundRobin

    private static Log log = LogFactory.getLog(LoadbalanceAlgorithmFactory.class);

    public static LoadbalanceAlgorithm createLoadbalanceAlgorithm(OMElement loadbalanceElement, List endpoints) {

        //default algorithm is round robin
        LoadbalanceAlgorithm algorithm = new RoundRobin(endpoints);

        OMAttribute policyAttribute = loadbalanceElement.getAttribute(new QName(null,
                XMLConfigConstants.LOADBALANCE_POLICY));
        OMAttribute algoAttribute = loadbalanceElement.getAttribute(new QName(null,
                XMLConfigConstants.LOADBALANCE_ALGORITHM));

        if (policyAttribute != null && algoAttribute != null) {
            String msg = "You cannot specify both the 'policy' & 'algorithm' in the configuration. " +
                         "It is sufficient to provide only the 'algorithm'.";
            log.fatal(msg); // We cannot continue execution. Hence it is logged at fatal level
            throw new SynapseException(msg);
        }

        if (algoAttribute != null) {
            String algorithmStr = algoAttribute.getAttributeValue().trim();
            try {
                algorithm = (LoadbalanceAlgorithm) Class.forName(algorithmStr).newInstance();
                algorithm.setEndpoints(endpoints);
            } catch (Exception e) {
                String msg = "Cannot instantiate LoadbalanceAlgorithm implementation class " +
                             algorithmStr;
                log.fatal(msg, e); // We cannot continue execution. Hence it is logged at fatal level
                throw new SynapseException(msg, e);
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.RoundRobin

        if(algoAttribute != null) {
            algorithmName = algoAttribute.getAttributeValue();
        }

        if(algorithmName.equalsIgnoreCase("roundRobin")) {
                algorithm = new RoundRobin(endpoints);
        }

        return algorithm;
    }
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.RoundRobin

                AnonymousListMediator elseMediator = new AnonymousListMediator();
                filterMediator.setElseMediator(elseMediator);
                elseMediator.addChild(new LogMediator());
                elseMediator.addChild(send);
                /* if there are ncew endpoints we are removing the current sequence */
                RoundRobin algorithm = new RoundRobin(childEndpoints);
                lb.setAlgorithm(algorithm);
                /* adding all the endpoints started since the current main sequence is removing */
                if(!"set".equals(System.getProperty("lb.disable"))){
                    lb.setMembers(new ArrayList<Member>(addedEndpointList.values()));
                }
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.RoundRobin

        if(algoAttribute != null) {
            algorithmName = algoAttribute.getAttributeValue();
        }

        if(algorithmName.equalsIgnoreCase("roundRobin")) {
                algorithm = new RoundRobin(endpoints);
        }

        return algorithm;
    }
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.RoundRobin

        if(algoAttribute != null) {
            algorithmName = algoAttribute.getAttributeValue();
        }

        if(algorithmName.equalsIgnoreCase("roundRobin")) {
                algorithm = new RoundRobin(endpoints);
        }

        return algorithm;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.