public class ConnectionHandler
extends java.lang.Object
StreamSession
.
Internally, ConnectionHandler manages thread to receive incoming StreamMessage
and thread to
send outgoing message. Messages are encoded/decoded on those thread and handed to
StreamSession.messageReceived(org.apache.cassandra.streaming.messages.StreamMessage)
.
Modifier and Type | Method and Description |
---|---|
com.google.common.util.concurrent.ListenableFuture<?> |
close() |
com.google.common.util.concurrent.ListenableFuture<?> |
closeIncoming() |
com.google.common.util.concurrent.ListenableFuture<?> |
closeOutgoing() |
void |
initiate()
Set up incoming message handler and initiate streaming.
|
void |
initiateOnReceivingSide(IncomingStreamingConnection connection,
boolean isForOutgoing,
int version)
Set up outgoing message handler on receiving side.
|
boolean |
isOutgoingConnected() |
void |
sendMessage(StreamMessage message) |
void |
sendMessages(java.util.Collection<? extends StreamMessage> messages)
Enqueue messages to be sent.
|
public void initiate() throws java.io.IOException
java.io.IOException
public void initiateOnReceivingSide(IncomingStreamingConnection connection, boolean isForOutgoing, int version) throws java.io.IOException
connection
- Incoming connection to use for OutgoingMessageHandler
.version
- Streaming message versionjava.io.IOException
public com.google.common.util.concurrent.ListenableFuture<?> close()
public com.google.common.util.concurrent.ListenableFuture<?> closeOutgoing()
public com.google.common.util.concurrent.ListenableFuture<?> closeIncoming()
public void sendMessages(java.util.Collection<? extends StreamMessage> messages)
messages
- messages to sendpublic void sendMessage(StreamMessage message)
public boolean isOutgoingConnected()
Copyright © 2017 The Apache Software Foundation