本文整理汇总了Java中org.apache.cassandra.io.sstable.Descriptor.Version方法的典型用法代码示例。如果您正苦于以下问题:Java Descriptor.Version方法的具体用法?Java Descriptor.Version怎么用?Java Descriptor.Version使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.io.sstable.Descriptor
的用法示例。
在下文中一共展示了Descriptor.Version方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public RowIndexEntry deserialize(DataInput in, Descriptor.Version version) throws IOException
{
long position = in.readLong();
int size = in.readInt();
if (size > 0)
{
DeletionTime deletionTime = DeletionTime.serializer.deserialize(in);
int entries = in.readInt();
List<IndexHelper.IndexInfo> columnsIndex = new ArrayList<IndexHelper.IndexInfo>(entries);
for (int i = 0; i < entries; i++)
columnsIndex.add(IndexHelper.IndexInfo.deserialize(in));
return new IndexedEntry(position, deletionTime, columnsIndex);
}
else
{
return new RowIndexEntry(position);
}
}
示例2: deserialize
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public RowIndexEntry deserialize(DataInput in, Descriptor.Version version) throws IOException
{
long position = in.readLong();
int size = in.readInt();
if (size > 0)
{
DeletionTime deletionTime = DeletionTime.serializer.deserialize(in);
int entries = in.readInt();
ISerializer<IndexHelper.IndexInfo> idxSerializer = type.indexSerializer();
List<IndexHelper.IndexInfo> columnsIndex = new ArrayList<IndexHelper.IndexInfo>(entries);
for (int i = 0; i < entries; i++)
columnsIndex.add(idxSerializer.deserialize(in));
return new IndexedEntry(position, deletionTime, columnsIndex);
}
else
{
return new RowIndexEntry(position);
}
}
示例3: AtomDeserializer
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public AtomDeserializer(CellNameType type, DataInput in, ColumnSerializer.Flag flag, int expireBefore, Descriptor.Version version)
{
this.type = type;
this.nameDeserializer = type.newDeserializer(in);
this.in = in;
this.flag = flag;
this.expireBefore = expireBefore;
this.version = version;
}
示例4: getTempSSTablePath
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
private String getTempSSTablePath(File directory, Descriptor.Version version)
{
Descriptor desc = new Descriptor(version,
directory,
keyspace.getName(),
name,
fileIndexGenerator.incrementAndGet(),
true);
return desc.filenameFor(Component.DATA);
}
示例5: SimpleSliceReader
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的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());
}
}
示例6: StreamReader
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public StreamReader(FileMessageHeader header, StreamSession session)
{
this.session = session;
this.cfId = header.cfId;
this.estimatedKeys = header.estimatedKeys;
this.sections = header.sections;
this.inputVersion = new Descriptor.Version(header.version);
this.repairedAt = header.repairedAt;
}
示例7: deserializeBody
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public RangeTombstone deserializeBody(DataInput in, ByteBuffer min, Descriptor.Version version) throws IOException
{
ByteBuffer max = ByteBufferUtil.readWithShortLength(in);
if (max.remaining() <= 0)
throw ColumnSerializer.CorruptColumnException.create(in, max);
DeletionTime dt = DeletionTime.serializer.deserialize(in);
return new RangeTombstone(min, max, dt);
}
示例8: StreamReader
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public StreamReader(FileMessageHeader header, StreamSession session)
{
this.session = session;
this.cfId = header.cfId;
this.estimatedKeys = header.estimatedKeys;
this.sections = header.sections;
this.inputVersion = new Descriptor.Version(header.version);
}
示例9: onDiskIterator
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
/**
* For 2.0-formatted sstables (where column count is not stored), @param count should be Integer.MAX_VALUE,
* and we will look for the end-of-row column name marker instead of relying on that.
*/
public static Iterator<OnDiskAtom> onDiskIterator(final DataInput in, final int count, final ColumnSerializer.Flag flag, final int expireBefore, final Descriptor.Version version)
{
return new AbstractIterator<OnDiskAtom>()
{
int i = 0;
protected OnDiskAtom computeNext()
{
if (i++ >= count)
return endOfData();
OnDiskAtom atom;
try
{
atom = onDiskSerializer().deserializeFromSSTable(in, flag, expireBefore, version);
}
catch (IOException e)
{
throw new IOError(e);
}
if (atom == null)
return endOfData();
return atom;
}
};
}
示例10: deserializeFromSSTable
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public ColumnFamily deserializeFromSSTable(DataInput in, Descriptor.Version version)
{
throw new UnsupportedOperationException();
}
示例11: deserializeFromSSTable
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public OnDiskAtom deserializeFromSSTable(DataInput in, Descriptor.Version version) throws IOException
{
return deserializeFromSSTable(in, ColumnSerializer.Flag.LOCAL, Integer.MIN_VALUE, version);
}
示例12: deserializeBody
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public RangeTombstone deserializeBody(DataInput in, Composite min, Descriptor.Version version) throws IOException
{
Composite max = type.serializer().deserialize(in);
DeletionTime dt = DeletionTime.serializer.deserialize(in);
return new RangeTombstone(min, max, dt);
}
示例13: getOnDiskIterator
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public Iterator<OnDiskAtom> getOnDiskIterator(DataInput in, int count, ColumnSerializer.Flag flag, int expireBefore, Descriptor.Version version)
{
if (version.hasSuperColumns && cfType == ColumnFamilyType.Super)
return SuperColumns.onDiskIterator(in, count, flag, expireBefore);
return Column.onDiskIterator(in, count, flag, expireBefore, version);
}
示例14: getOnDiskIterator
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public Iterator<OnDiskAtom> getOnDiskIterator(DataInput in, Descriptor.Version version)
{
return getOnDiskIterator(in, ColumnSerializer.Flag.LOCAL, Integer.MIN_VALUE, version);
}
示例15: getOnDiskDeserializer
import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public AtomDeserializer getOnDiskDeserializer(DataInput in, Descriptor.Version version)
{
return new AtomDeserializer(comparator, in, ColumnSerializer.Flag.LOCAL, Integer.MIN_VALUE, version);
}