use of org.apache.cassandra.streaming.StreamDeserializingTask in project cassandra by apache.
the class StreamingMultiplexedChannel method createChannel.
private StreamingChannel createChannel(StreamingChannel.Kind kind) throws IOException {
logger.debug("Creating stream session to {} as {}", to, session.isFollower() ? "follower" : "initiator");
StreamingChannel channel = factory.create(to, messagingVersion, kind);
if (kind == StreamingChannel.Kind.CONTROL) {
executorFactory().startThread(String.format("Stream-Deserializer-%s-%s", to.toString(), channel.id()), new StreamDeserializingTask(session, channel, messagingVersion));
session.attachInbound(channel);
}
session.attachOutbound(channel);
logger.debug("Creating {}", channel.description());
return channel;
}
use of org.apache.cassandra.streaming.StreamDeserializingTask in project cassandra by apache.
the class StreamingInboundHandlerTest method StreamDeserializingTask_deriveSession_StreamInitMessage.
@Test
public void StreamDeserializingTask_deriveSession_StreamInitMessage() {
StreamInitMessage msg = new StreamInitMessage(REMOTE_ADDR, 0, UUID.randomUUID(), StreamOperation.REPAIR, UUID.randomUUID(), PreviewKind.ALL);
StreamDeserializingTask task = new StreamDeserializingTask(null, streamingChannel, streamingChannel.messagingVersion);
StreamSession session = task.deriveSession(msg);
Assert.assertNotNull(session);
}
use of org.apache.cassandra.streaming.StreamDeserializingTask in project cassandra by apache.
the class StreamingInboundHandlerTest method StreamDeserializingTask_deriveSession_NoSession.
@Test(expected = UnsupportedOperationException.class)
public void StreamDeserializingTask_deriveSession_NoSession() {
CompleteMessage msg = new CompleteMessage();
StreamDeserializingTask task = new StreamDeserializingTask(null, streamingChannel, streamingChannel.messagingVersion);
task.deriveSession(msg);
}
Aggregations