use of org.apache.cassandra.net.AsyncStreamingOutputPlus in project cassandra by apache.
the class ZeroCopyStreamingBenchmark method blockStreamWriter.
@Benchmark
@BenchmarkMode(Mode.Throughput)
public void blockStreamWriter(BenchmarkState state) throws Exception {
EmbeddedChannel channel = createMockNettyChannel();
AsyncStreamingOutputPlus out = new AsyncStreamingOutputPlus(channel);
state.blockStreamWriter.write(out);
out.close();
channel.finishAndReleaseAll();
}
use of org.apache.cassandra.net.AsyncStreamingOutputPlus in project cassandra by apache.
the class EntireSSTableStreamingCorrectFilesCountTest method test.
@Test
public void test() throws Exception {
FileCountingStreamEventHandler streamEventHandler = new FileCountingStreamEventHandler();
StreamSession session = setupStreamingSessionForTest(streamEventHandler);
Collection<OutgoingStream> outgoingStreams = store.getStreamManager().createOutgoingStreams(session, rangesAtEndpoint, NO_PENDING_REPAIR, PreviewKind.NONE);
session.addTransferStreams(outgoingStreams);
AsyncStreamingOutputPlus out = constructDataOutputStream();
for (OutgoingStream outgoingStream : outgoingStreams) {
outgoingStream.write(session, out, MessagingService.VERSION_40);
// verify hardlinks are removed after streaming
Descriptor descriptor = ((CassandraOutgoingFile) outgoingStream).getRef().get().descriptor;
assertTrue(descriptor.getTemporaryFiles().isEmpty());
}
int totalNumberOfFiles = session.transfers.get(store.metadata.id).getTotalNumberOfFiles();
assertEquals(ComponentManifest.create(sstable.descriptor).components().size(), totalNumberOfFiles);
assertEquals(streamEventHandler.fileNames.size(), totalNumberOfFiles);
}
Aggregations