本文整理汇总了Java中org.apache.cassandra.io.sstable.SSTableReader.getFileDataInput方法的典型用法代码示例。如果您正苦于以下问题:Java SSTableReader.getFileDataInput方法的具体用法?Java SSTableReader.getFileDataInput怎么用?Java SSTableReader.getFileDataInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.io.sstable.SSTableReader
的用法示例。
在下文中一共展示了SSTableReader.getFileDataInput方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SimpleSliceReader
import org.apache.cassandra.io.sstable.SSTableReader; //导入方法依赖的package包/类
public SimpleSliceReader(SSTableReader sstable, RowIndexEntry indexEntry, FileDataInput input, Composite finishColumn)
{
Tracing.trace("Seeking to partition beginning in data file");
this.finishColumn = finishColumn;
this.comparator = sstable.metadata.comparator;
try
{
if (input == null)
{
this.file = sstable.getFileDataInput(indexEntry.position);
this.needsClosing = true;
}
else
{
this.file = input;
input.seek(indexEntry.position);
this.needsClosing = false;
}
// Skip key and data size
ByteBufferUtil.skipShortLength(file);
emptyColumnFamily = ArrayBackedSortedColumns.factory.create(sstable.metadata);
emptyColumnFamily.delete(DeletionTime.serializer.deserialize(file));
atomIterator = emptyColumnFamily.metadata().getOnDiskIterator(file, sstable.descriptor.version);
}
catch (IOException e)
{
sstable.markSuspect();
throw new CorruptSSTableException(e, sstable.getFilename());
}
}
示例2: SimpleSliceReader
import org.apache.cassandra.io.sstable.SSTableReader; //导入方法依赖的package包/类
public SimpleSliceReader(SSTableReader sstable, RowIndexEntry indexEntry, FileDataInput input, ByteBuffer finishColumn)
{
Tracing.trace("Seeking to partition beginning in data file");
this.finishColumn = finishColumn;
this.comparator = sstable.metadata.comparator;
try
{
if (input == null)
{
this.file = sstable.getFileDataInput(indexEntry.position);
this.needsClosing = true;
}
else
{
this.file = input;
input.seek(indexEntry.position);
this.needsClosing = false;
}
Descriptor.Version version = sstable.descriptor.version;
// Skip key and data size
ByteBufferUtil.skipShortLength(file);
if (version.hasRowSizeAndColumnCount)
file.readLong();
emptyColumnFamily = EmptyColumns.factory.create(sstable.metadata);
emptyColumnFamily.delete(DeletionTime.serializer.deserialize(file));
int columnCount = version.hasRowSizeAndColumnCount ? file.readInt() : Integer.MAX_VALUE;
atomIterator = emptyColumnFamily.metadata().getOnDiskIterator(file, columnCount, sstable.descriptor.version);
}
catch (IOException e)
{
sstable.markSuspect();
throw new CorruptSSTableException(e, sstable.getFilename());
}
}