@Test public void testGetShardManagerPeerActorAddresses() { ShardPeerAddressResolver resolver = new ShardPeerAddressResolver("config", MEMBER_1); resolver.addPeerAddress(MEMBER_1, new Address("tcp", "system1")); Address address2 = new Address("tcp", "system2"); resolver.addPeerAddress(MEMBER_2, address2); Address address3 = new Address("tcp", "system3"); resolver.addPeerAddress(MEMBER_3, address3); Collection<String> peerAddresses = resolver.getShardManagerPeerActorAddresses(); assertEquals("getShardManagerPeerActorAddresses", Sets.newHashSet( address2.toString() + "/user/shardmanager-config", address3.toString() + "/user/shardmanager-config"), Sets.newHashSet(peerAddresses)); }
Collection<String> getShardManagerPeerActorAddresses() { Collection<String> peerAddresses = new ArrayList<>(); for (Map.Entry<MemberName, Address> entry: memberNameToAddress.entrySet()) { if (!localMemberName.equals(entry.getKey())) { peerAddresses.add(getShardManagerActorPathBuilder(entry.getValue()).toString()); } } return peerAddresses; }
ShardPeerAddressResolver implements PeerAddressResolver { Collection<String> getShardManagerPeerActorAddresses() { Collection<String> peerAddresses = new ArrayList<>(); for (Map.Entry<MemberName, Address> entry: memberNameToAddress.entrySet()) { if (!localMemberName.equals(entry.getKey())) { peerAddresses.add(getShardManagerActorPathBuilder(entry.getValue()).toString()); } } return peerAddresses; } }
ShardPeerAddressResolver implements PeerAddressResolver { Collection<String> getShardManagerPeerActorAddresses() { Collection<String> peerAddresses = new ArrayList<>(); for (Map.Entry<MemberName, Address> entry: memberNameToAddress.entrySet()) { if (!localMemberName.equals(entry.getKey())) { peerAddresses.add(getShardManagerActorPathBuilder(entry.getValue()).toString()); } } return peerAddresses; } ShardPeerAddressResolver(final String shardManagerType, final MemberName localMemberName); }
ShardPeerAddressResolver implements PeerAddressResolver { Collection<String> getShardManagerPeerActorAddresses() { Collection<String> peerAddresses = new ArrayList<>(); for (Map.Entry<MemberName, Address> entry: memberNameToAddress.entrySet()) { if (!localMemberName.equals(entry.getKey())) { peerAddresses.add(getShardManagerActorPathBuilder(entry.getValue()).toString()); } } return peerAddresses; } ShardPeerAddressResolver(final String shardManagerType, final MemberName localMemberName); @Override String resolve(final String peerId); @Override void setResolved(final String peerId, final String address); }
ShardPeerAddressResolver implements PeerAddressResolver { Collection<String> getShardManagerPeerActorAddresses() { Collection<String> peerAddresses = new ArrayList<>(); for (Map.Entry<MemberName, Address> entry: memberNameToAddress.entrySet()) { if (!localMemberName.equals(entry.getKey())) { peerAddresses.add(getShardManagerActorPathBuilder(entry.getValue()).toString()); } } return peerAddresses; } ShardPeerAddressResolver(final String shardManagerType, final MemberName localMemberName); @Override String resolve(final String peerId); @Override void setResolved(final String peerId, final String address);  }