Search in sources :

Example 1 with StreamWriter

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

the class OutgoingFileMessage method serialize.

public synchronized void serialize(DataOutputStreamPlus out, int version, StreamSession session) throws IOException {
    if (completed) {
        return;
    }
    CompressionInfo compressionInfo = FileMessageHeader.serializer.serialize(header, out, version);
    final SSTableReader reader = ref.get();
    StreamWriter writer = compressionInfo == null ? new StreamWriter(reader, header.sections, session) : new CompressedStreamWriter(reader, header.sections, compressionInfo, session);
    writer.write(out);
}
Also used : SSTableReader(org.apache.cassandra.io.sstable.format.SSTableReader) StreamWriter(org.apache.cassandra.streaming.StreamWriter) CompressedStreamWriter(org.apache.cassandra.streaming.compress.CompressedStreamWriter) CompressionInfo(org.apache.cassandra.streaming.compress.CompressionInfo) CompressedStreamWriter(org.apache.cassandra.streaming.compress.CompressedStreamWriter)

Aggregations

SSTableReader (org.apache.cassandra.io.sstable.format.SSTableReader)1 StreamWriter (org.apache.cassandra.streaming.StreamWriter)1 CompressedStreamWriter (org.apache.cassandra.streaming.compress.CompressedStreamWriter)1 CompressionInfo (org.apache.cassandra.streaming.compress.CompressionInfo)1