/** * Send a {@link TransportMessage} to the given remote * * @return true if the message was written to the send buffer, false otherwise */ public boolean sendMessage(final int nodeId, final BufferWriter writer) { return clientTransport.getOutput().sendMessage(nodeId, writer); }
/** * Send a request to the given address * * @return the client request to poll for a response, or null if the request could not be written * at the moment */ public ActorFuture<ClientResponse> sendRequest( final int nodeId, final BufferWriter writer, final Duration timeout) { return clientTransport.getOutput().sendRequest(nodeId, writer, timeout); }
/** * Send a {@link TransportMessage} to the given remote * * @return true if the message was written to the send buffer, false otherwise */ public boolean sendMessage(final int nodeId, final BufferWriter writer) { return clientTransport.getOutput().sendMessage(nodeId, writer); }
/** * Send a request to the given address * * @return the client request to poll for a response, or null if the request could not be written * at the moment */ public ActorFuture<ClientResponse> sendRequest( final int nodeId, final BufferWriter writer, final Duration timeout) { return clientTransport.getOutput().sendRequest(nodeId, writer, timeout); }
public ControlMessageRequestBuilder createControlMessageRequest() { return new ControlMessageRequestBuilder(transport.getOutput(), nodeId, msgPackHelper); }
private ActorFuture<ClientResponse> sendEventTo(GossipEvent event, int nodeId, Duration timeout) { return clientTransport.getOutput().sendRequest(nodeId, event, timeout); }
public ControlMessageRequestBuilder createControlMessageRequest() { return new ControlMessageRequestBuilder(transport.getOutput(), nodeId, msgPackHelper); }
private ActorFuture<ClientResponse> sendEventTo(GossipEvent event, int nodeId, Duration timeout) { return clientTransport.getOutput().sendRequest(nodeId, event, timeout); }
/** targets the default partition by default */ public ExecuteCommandRequestBuilder createCmdRequest(int partition) { return new ExecuteCommandRequestBuilder(transport.getOutput(), nodeId, msgPackHelper) .partitionId(partition); }
/** targets the default partition by default */ public ExecuteCommandRequestBuilder createCmdRequest() { return new ExecuteCommandRequestBuilder(transport.getOutput(), nodeId, msgPackHelper) .partitionId(defaultPartitionId); }
/** targets the default partition by default */ public ExecuteCommandRequestBuilder createCmdRequest(int partition) { return new ExecuteCommandRequestBuilder(transport.getOutput(), nodeId, msgPackHelper) .partitionId(partition); }
/** targets the default partition by default */ public ExecuteCommandRequestBuilder createCmdRequest() { return new ExecuteCommandRequestBuilder(transport.getOutput(), nodeId, msgPackHelper) .partitionId(defaultPartitionId); }
private boolean sendSubscriptionCommand( final int receiverPartitionId, final BufferWriter command) { final Int2ObjectHashMap<NodeInfo> partitionLeaders = partitionListener.getPartitionLeaders(); final NodeInfo partitionLeader = partitionLeaders.get(receiverPartitionId); if (partitionLeader == null) { // retry when no leader is known return true; } return subscriptionClient.getOutput().sendMessage(partitionLeader.getNodeId(), command); }
private boolean sendSubscriptionCommand( final int receiverPartitionId, final BufferWriter command) { final Int2ObjectHashMap<NodeInfo> partitionLeaders = partitionListener.getPartitionLeaders(); final NodeInfo partitionLeader = partitionLeaders.get(receiverPartitionId); if (partitionLeader == null) { // retry when no leader is known return true; } return subscriptionClient.getOutput().sendMessage(partitionLeader.getNodeId(), command); }
public MemberReplicateLogController( Raft raft, RaftMember member, ClientTransport clientTransport) { this.member = member; this.nodeId = member.getNodeId(); this.name = String.format("raft-repl-%s-%d", raft.getName(), nodeId); this.raft = raft; this.heartbeatInterval = raft.getConfiguration().getHeartbeatIntervalDuration(); this.clientOutput = clientTransport.getOutput(); this.logStream = raft.getLogStream(); this.reader = new BufferedLogStreamReader(logStream, true); }
public MemberReplicateLogController( Raft raft, RaftMember member, ClientTransport clientTransport) { this.member = member; this.nodeId = member.getNodeId(); this.name = String.format("raft-repl-%s-%d", raft.getName(), nodeId); this.raft = raft; this.heartbeatInterval = raft.getConfiguration().getHeartbeatIntervalDuration(); this.clientOutput = clientTransport.getOutput(); this.logStream = raft.getLogStream(); this.reader = new BufferedLogStreamReader(logStream, true); }
/** Only use if node id is not known, i.e. on initial join with contact points */ public ActorFuture<ClientResponse> sendPing(SocketAddress socketAddress, Duration timeout) { gossipFailureDetectionEvent .reset() .eventType(GossipEventType.PING) .senderId(membershipList.self().getId()); clientTransport.registerEndpoint(UNKNOWN_NODE_ID, socketAddress); return clientTransport .getOutput() .sendRequest(UNKNOWN_NODE_ID, gossipFailureDetectionEvent, timeout); } }
/** Only use if node id is not known, i.e. on initial join with contact points */ public ActorFuture<ClientResponse> sendPing(SocketAddress socketAddress, Duration timeout) { gossipFailureDetectionEvent .reset() .eventType(GossipEventType.PING) .senderId(membershipList.self().getId()); clientTransport.registerEndpoint(UNKNOWN_NODE_ID, socketAddress); return clientTransport .getOutput() .sendRequest(UNKNOWN_NODE_ID, gossipFailureDetectionEvent, timeout); } }
final ActorFuture<ClientResponse> pushResponseFuture = managementApi .getOutput() .sendRequestWithRetry( () -> partitionLeaderId,
final ActorFuture<ClientResponse> pushResponseFuture = managementApi .getOutput() .sendRequestWithRetry( () -> partitionLeaderId,