Package akka.cluster.ClusterEvent

Examples of akka.cluster.ClusterEvent.CurrentClusterState


  }
   
  @Override
  public void onReceive(Object message) throws Exception {
    if (message instanceof CurrentClusterState) {
      CurrentClusterState state = (CurrentClusterState) message;
      for (Member member : state.getMembers()) {
        if (member.status().equals(MemberStatus.up())) {
          ClusterState.memberLoad.put(member.address(), new AtomicInteger(0));
          models.utils.LogUtils.printLogNormal("Status Change: Member up " + ClusterState.memberLoad.size());
        }
        if (member.status().equals(MemberStatus.removed())) {
View Full Code Here


      TransformationJob job = (TransformationJob) message;
      getSender().tell(new TransformationResult(job.getText().toUpperCase()),
          getSelf());

    } else if (message instanceof CurrentClusterState) {
      CurrentClusterState state = (CurrentClusterState) message;
      for (Member member : state.getMembers()) {
        if (member.status().equals(MemberStatus.up())) {
          register(member);
        }
      }
View Full Code Here

    } else if (message instanceof JobFailed) {
      JobFailed failed = (JobFailed) message;
      System.out.println(failed);

    } else if (message instanceof CurrentClusterState) {
      CurrentClusterState state = (CurrentClusterState) message;
      nodes.clear();
      for (Member member : state.getMembers()) {
        if (member.hasRole("compute") && member.status().equals(MemberStatus.up())) {
          nodes.add(member.address());
        }
      }
View Full Code Here

  }

  @Override
  public void onReceive(Object message) {
    if (message instanceof CurrentClusterState) {
      CurrentClusterState state = (CurrentClusterState) message;
      log.info("Current members: {}", state.members());

    } else if (message instanceof MemberUp) {
      MemberUp mUp = (MemberUp) message;
      log.info("Member is Up: {}", mUp.member());
View Full Code Here

    }

    @Override
    public void onReceive(Object message) {
      if (message instanceof CurrentClusterState) {
        CurrentClusterState state = (CurrentClusterState) message;
        List<Member> members = new ArrayList<Member>();
        for (Member m : state.getMembers()) {
          if (m.status().equals(MemberStatus.up()) && m.hasRole(role))
            members.add(m);
        }
        membersByAge.clear();
        membersByAge.addAll(members);
View Full Code Here

TOP

Related Classes of akka.cluster.ClusterEvent.CurrentClusterState

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.