private static Address getSendAddress(HazelcastClientInstanceImpl client, int partitionId) throws IOException { Address address; if (client.getClientConfig().getNetworkConfig().isSmartRouting()) { address = client.getClientPartitionService().getPartitionOwner(partitionId); if (address == null) { throw new IOException("Partition does not have an owner. partitionId: " + partitionId); } } else { address = client.getConnectionManager().getOwnerConnectionAddress(); if (address == null) { throw new IOException("NonSmartClientInvocationService: Owner connection is not available."); } } return address; }
private static Address getSendAddress(HazelcastClientInstanceImpl client, int partitionId) throws IOException { Address address; if (client.getClientConfig().getNetworkConfig().isSmartRouting()) { address = client.getClientPartitionService().getPartitionOwner(partitionId); if (address == null) { throw new IOException("Partition does not have an owner. partitionId: " + partitionId); } } else { address = client.getConnectionManager().getOwnerConnectionAddress(); if (address == null) { throw new IOException("NonSmartClientInvocationService: Owner connection is not available."); } } return address; }
@Override public void invokeOnPartitionOwner(ClientInvocation invocation, int partitionId) throws IOException { final Address owner = partitionService.getPartitionOwner(partitionId); if (owner == null) { throw new IOException("Partition does not have an owner. partitionId: " + partitionId); } if (!isMember(owner)) { throw new TargetNotMemberException("Partition owner '" + owner + "' is not a member."); } invocation.getClientMessage().setPartitionId(partitionId); Connection connection = getOrTriggerConnect(owner, invocation.getClientMessage().acquiresResource()); send(invocation, (ClientConnection) connection); }
@Override public void invokeOnPartitionOwner(ClientInvocation invocation, int partitionId) throws IOException { final Address owner = partitionService.getPartitionOwner(partitionId); if (owner == null) { throw new IOException("Partition does not have an owner. partitionId: " + partitionId); } if (!isMember(owner)) { throw new TargetNotMemberException("Partition owner '" + owner + "' is not a member."); } invocation.getClientMessage().setPartitionId(partitionId); Connection connection = getOrTriggerConnect(owner, invocation.getClientMessage().acquiresResource()); send(invocation, (ClientConnection) connection); }