Package net.kuujo.vertigo.io.selector

Examples of net.kuujo.vertigo.io.selector.RoundRobinSelector


  private List<IOHook> hooks = new ArrayList<>();
  private Selector selector;

  public DefaultConnectionConfig() {
    super();
    selector = new RoundRobinSelector();
  }
View Full Code Here


    super();
    selector = new RoundRobinSelector();
  }

  public DefaultConnectionConfig(String source, String target, NetworkConfig network) {
    this(source, DEFAULT_OUT_PORT, target, DEFAULT_IN_PORT, new RoundRobinSelector(), network);
  }
View Full Code Here

  public DefaultConnectionConfig(String source, String target, Selector selector, NetworkConfig network) {
    this(source, DEFAULT_OUT_PORT, target, DEFAULT_IN_PORT, selector, network);
  }

  public DefaultConnectionConfig(String source, String out, String target, String in, NetworkConfig network) {
    this(source, out, target, in, new RoundRobinSelector(), network);
  }
View Full Code Here

    this.source.setComponent(source);
    this.source.setPort(out != null ? out : DEFAULT_OUT_PORT);
    this.target.setComponent(target);
    this.target.setPort(in != null ? in : DEFAULT_IN_PORT);
    if (selector == null) {
      selector = new RoundRobinSelector();
    }
    this.selector = selector;
  }
View Full Code Here

    return customSelect(selector);
  }

  @Override
  public ConnectionConfig roundSelect() {
    this.selector = new RoundRobinSelector();
    return this;
  }
View Full Code Here

  }

  @Override
  public ConnectionConfig customSelect(Selector selector) {
    if (selector == null) {
      this.selector = new RoundRobinSelector();
    } else if (selector instanceof RoundRobinSelector || selector instanceof RandomSelector || selector instanceof HashSelector
        || selector instanceof FairSelector || selector instanceof AllSelector) {
      this.selector = selector;
    } else {
      this.selector = new CustomSelector(selector);
View Full Code Here

      public void handle(AsyncResult<Cluster> result) {
        assertTrue(result.succeeded());
        NetworkConfig network = vertigo.createNetwork("test");
        network.addVerticle("sender", TestFeederSender.class.getName());
        network.addVerticle("receiver", TestFeederReceiver.class.getName(), 4);
        network.createConnection("sender", "out", "receiver", "in").setSelector(new RoundRobinSelector());
        Cluster cluster = result.result();
        cluster.deployNetwork(network, new Handler<AsyncResult<ActiveNetwork>>() {
          @Override
          public void handle(AsyncResult<ActiveNetwork> result) {
            if (result.failed()) {
View Full Code Here

      public void handle(AsyncResult<Cluster> result) {
        assertTrue(result.succeeded());
        NetworkConfig network = vertigo.createNetwork("test");
        network.addVerticle("sender", TestFileSender.class.getName());
        network.addVerticle("receiver", TestFileReceiver.class.getName(), 4);
        network.createConnection("sender", "out", "receiver", "in").setSelector(new RoundRobinSelector());
        Cluster cluster = result.result();
        cluster.deployNetwork(network, new Handler<AsyncResult<ActiveNetwork>>() {
          @Override
          public void handle(AsyncResult<ActiveNetwork> result) {
            if (result.failed()) {
View Full Code Here

TOP

Related Classes of net.kuujo.vertigo.io.selector.RoundRobinSelector

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.