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;
}
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;
}
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());
}
Aggregations