当前位置: 首页>>代码示例>>Java>>正文


Java Descriptor.Version方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:22,代码来源:RowIndexEntry.java

示例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);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:23,代码来源:RowIndexEntry.java

示例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;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:10,代码来源:AtomDeserializer.java

示例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);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:11,代码来源:ColumnFamilyStore.java

示例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());
    }
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:38,代码来源:SimpleSliceReader.java

示例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;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:10,代码来源:StreamReader.java

示例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);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:10,代码来源:RangeTombstone.java

示例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);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:9,代码来源:StreamReader.java

示例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;
        }
    };
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:32,代码来源:Column.java

示例10: deserializeFromSSTable

import org.apache.cassandra.io.sstable.Descriptor; //导入方法依赖的package包/类
public ColumnFamily deserializeFromSSTable(DataInput in, Descriptor.Version version)
{
    throw new UnsupportedOperationException();
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:ColumnFamilySerializer.java

示例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);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:OnDiskAtom.java

示例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);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:7,代码来源:RangeTombstone.java

示例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);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:7,代码来源:CFMetaData.java

示例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);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:CFMetaData.java

示例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);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:CFMetaData.java


注:本文中的org.apache.cassandra.io.sstable.Descriptor.Version方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。