本文整理汇总了Java中org.apache.cassandra.streaming.compress.CompressedStreamWriter类的典型用法代码示例。如果您正苦于以下问题:Java CompressedStreamWriter类的具体用法?Java CompressedStreamWriter怎么用?Java CompressedStreamWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CompressedStreamWriter类属于org.apache.cassandra.streaming.compress包,在下文中一共展示了CompressedStreamWriter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serialize
import org.apache.cassandra.streaming.compress.CompressedStreamWriter; //导入依赖的package包/类
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);
}
示例2: serialize
import org.apache.cassandra.streaming.compress.CompressedStreamWriter; //导入依赖的package包/类
public void serialize(OutgoingFileMessage message, DataOutputStreamAndChannel out, int version, StreamSession session) throws IOException
{
FileMessageHeader.serializer.serialize(message.header, out, version);
final SSTableReader reader = message.sstable;
StreamWriter writer = message.header.compressionInfo == null ?
new StreamWriter(reader, message.header.sections, session) :
new CompressedStreamWriter(reader,
message.header.sections,
message.header.compressionInfo, session);
writer.write(out.getChannel());
session.fileSent(message.header);
}
示例3: serialize
import org.apache.cassandra.streaming.compress.CompressedStreamWriter; //导入依赖的package包/类
public void serialize(FileMessage message, WritableByteChannel out, int version, StreamSession session) throws IOException
{
DataOutput output = new DataOutputStream(Channels.newOutputStream(out));
FileMessageHeader.serializer.serialize(message.header, output, version);
StreamWriter writer = message.header.compressionInfo == null ?
new StreamWriter(message.sstable, message.header.sections, session) :
new CompressedStreamWriter(message.sstable,
message.header.sections,
message.header.compressionInfo, session);
writer.write(out);
session.fileSent(message.header);
}