Search in sources :

Example 1 with StreamCoordinator

use of org.apache.cassandra.streaming.StreamCoordinator in project cassandra by apache.

the class CassandraEntireSSTableStreamWriterTest method setupStreamingSessionForTest.

private StreamSession setupStreamingSessionForTest() {
    StreamCoordinator streamCoordinator = new StreamCoordinator(StreamOperation.BOOTSTRAP, 1, new NettyStreamingConnectionFactory(), false, false, null, PreviewKind.NONE);
    StreamResultFuture future = StreamResultFuture.createInitiator(UUID.randomUUID(), StreamOperation.BOOTSTRAP, Collections.<StreamEventHandler>emptyList(), streamCoordinator);
    InetAddressAndPort peer = FBUtilities.getBroadcastAddressAndPort();
    streamCoordinator.addSessionInfo(new SessionInfo(peer, 0, peer, Collections.emptyList(), Collections.emptyList(), StreamSession.State.INITIALIZED));
    StreamSession session = streamCoordinator.getOrCreateOutboundSession(peer);
    session.init(future);
    return session;
}
Also used : StreamResultFuture(org.apache.cassandra.streaming.StreamResultFuture) InetAddressAndPort(org.apache.cassandra.locator.InetAddressAndPort) NettyStreamingConnectionFactory(org.apache.cassandra.streaming.async.NettyStreamingConnectionFactory) StreamSession(org.apache.cassandra.streaming.StreamSession) StreamCoordinator(org.apache.cassandra.streaming.StreamCoordinator) SessionInfo(org.apache.cassandra.streaming.SessionInfo)

Example 2 with StreamCoordinator

use of org.apache.cassandra.streaming.StreamCoordinator in project cassandra by apache.

the class EntireSSTableStreamConcurrentComponentMutationTest method setupStreamingSessionForTest.

private StreamSession setupStreamingSessionForTest() {
    StreamCoordinator streamCoordinator = new StreamCoordinator(StreamOperation.BOOTSTRAP, 1, new NettyStreamingConnectionFactory(), false, false, null, PreviewKind.NONE);
    StreamResultFuture future = StreamResultFuture.createInitiator(UUID.randomUUID(), StreamOperation.BOOTSTRAP, Collections.emptyList(), streamCoordinator);
    InetAddressAndPort peer = FBUtilities.getBroadcastAddressAndPort();
    streamCoordinator.addSessionInfo(new SessionInfo(peer, 0, peer, Collections.emptyList(), Collections.emptyList(), StreamSession.State.INITIALIZED));
    StreamSession session = streamCoordinator.getOrCreateOutboundSession(peer);
    session.init(future);
    return session;
}
Also used : StreamResultFuture(org.apache.cassandra.streaming.StreamResultFuture) InetAddressAndPort(org.apache.cassandra.locator.InetAddressAndPort) NettyStreamingConnectionFactory(org.apache.cassandra.streaming.async.NettyStreamingConnectionFactory) StreamSession(org.apache.cassandra.streaming.StreamSession) StreamCoordinator(org.apache.cassandra.streaming.StreamCoordinator) SessionInfo(org.apache.cassandra.streaming.SessionInfo)

Example 3 with StreamCoordinator

use of org.apache.cassandra.streaming.StreamCoordinator in project cassandra by apache.

the class LocalSyncTaskTest method assertNumInOut.

private static void assertNumInOut(StreamPlan plan, int expectedIncoming, int expectedOutgoing) {
    StreamCoordinator coordinator = plan.getCoordinator();
    StreamSession session = Iterables.getOnlyElement(coordinator.getAllStreamSessions());
    assertEquals(expectedIncoming, session.getNumRequests());
    assertEquals(expectedOutgoing, session.getNumTransfers());
}
Also used : StreamSession(org.apache.cassandra.streaming.StreamSession) StreamCoordinator(org.apache.cassandra.streaming.StreamCoordinator)

Aggregations

StreamCoordinator (org.apache.cassandra.streaming.StreamCoordinator)3 StreamSession (org.apache.cassandra.streaming.StreamSession)3 InetAddressAndPort (org.apache.cassandra.locator.InetAddressAndPort)2 SessionInfo (org.apache.cassandra.streaming.SessionInfo)2 StreamResultFuture (org.apache.cassandra.streaming.StreamResultFuture)2 NettyStreamingConnectionFactory (org.apache.cassandra.streaming.async.NettyStreamingConnectionFactory)2