本文整理汇总了Java中org.apache.cassandra.streaming.StreamReader.read方法的典型用法代码示例。如果您正苦于以下问题:Java StreamReader.read方法的具体用法?Java StreamReader.read怎么用?Java StreamReader.read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.streaming.StreamReader
的用法示例。
在下文中一共展示了StreamReader.read方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import org.apache.cassandra.streaming.StreamReader; //导入方法依赖的package包/类
public IncomingFileMessage deserialize(ReadableByteChannel in, int version, StreamSession session) throws IOException
{
DataInputStream input = new DataInputStream(Channels.newInputStream(in));
FileMessageHeader header = FileMessageHeader.serializer.deserialize(input, version);
StreamReader reader = header.compressionInfo == null ? new StreamReader(header, session)
: new CompressedStreamReader(header, session);
try
{
return new IncomingFileMessage(reader.read(in), header);
}
catch (Throwable t)
{
JVMStabilityInspector.inspectThrowable(t);
session.doRetry(header, t);
return null;
}
}
示例2: deserialize
import org.apache.cassandra.streaming.StreamReader; //导入方法依赖的package包/类
public FileMessage deserialize(ReadableByteChannel in, int version, StreamSession session) throws IOException
{
DataInputStream input = new DataInputStream(Channels.newInputStream(in));
FileMessageHeader header = FileMessageHeader.serializer.deserialize(input, version);
StreamReader reader = header.compressionInfo == null ? new StreamReader(header, session)
: new CompressedStreamReader(header, session);
try
{
return new FileMessage(reader.read(in), header);
}
catch (Throwable e)
{
session.doRetry(header, e);
return null;
}
}
示例3: deserialize
import org.apache.cassandra.streaming.StreamReader; //导入方法依赖的package包/类
@SuppressWarnings("resource")
public IncomingFileMessage deserialize(ReadableByteChannel in, int version, StreamSession session) throws IOException
{
DataInputPlus input = new DataInputStreamPlus(Channels.newInputStream(in));
FileMessageHeader header = FileMessageHeader.serializer.deserialize(input, version);
StreamReader reader = !header.isCompressed() ? new StreamReader(header, session)
: new CompressedStreamReader(header, session);
try
{
return new IncomingFileMessage(reader.read(in), header);
}
catch (Throwable t)
{
JVMStabilityInspector.inspectThrowable(t);
throw t;
}
}
示例4: deserialize
import org.apache.cassandra.streaming.StreamReader; //导入方法依赖的package包/类
public IncomingFileMessage deserialize(ReadableByteChannel in, int version, StreamSession session) throws IOException
{
DataInputStream input = new DataInputStream(Channels.newInputStream(in));
FileMessageHeader header = FileMessageHeader.serializer.deserialize(input, version);
StreamReader reader = header.compressionInfo == null ? new StreamReader(header, session)
: new CompressedStreamReader(header, session);
try
{
return new IncomingFileMessage(reader.read(in), header);
}
catch (Throwable e)
{
session.doRetry(header, e);
return null;
}
}