• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TypeSizes类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.cassandra.db.TypeSizes的典型用法代码示例。如果您正苦于以下问题:Java TypeSizes类的具体用法?Java TypeSizes怎么用?Java TypeSizes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TypeSizes类属于org.apache.cassandra.db包,在下文中一共展示了TypeSizes类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(ColumnSubselection subSel, int version)
{
    long size = 0;

    ColumnDefinition column = subSel.column();
    size += TypeSizes.sizeofWithShortLength(column.name.bytes);
    size += 1; // kind
    switch (subSel.kind())
    {
        case SLICE:
            Slice slice = (Slice)subSel;
            size += column.cellPathSerializer().serializedSize(slice.from);
            size += column.cellPathSerializer().serializedSize(slice.to);
            break;
        case ELEMENT:
            Element element = (Element)subSel;
            size += column.cellPathSerializer().serializedSize(element.element);
            break;
    }
    return size;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:22,代码来源:ColumnSubselection.java


示例2: skip

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public void skip(DataInputPlus in) throws IOException
{
    clusteringSerializer.skip(in);
    clusteringSerializer.skip(in);
    if (version.storeRows())
    {
        in.readUnsignedVInt();
        in.readVInt();
        if (in.readBoolean())
            DeletionTime.serializer.skip(in);
    }
    else
    {
        in.skipBytes(TypeSizes.sizeof(0L));
        in.skipBytes(TypeSizes.sizeof(0L));
    }
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:18,代码来源:IndexInfo.java


示例3: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(PrepareResponse response, int version)
{
    long size = TypeSizes.sizeof(response.promised)
              + Commit.serializer.serializedSize(response.inProgressCommit, version);

    if (version < MessagingService.VERSION_30)
    {
        size += UUIDSerializer.serializer.serializedSize(response.mostRecentCommit.ballot, version);
        size += PartitionUpdate.serializer.serializedSize(response.mostRecentCommit.update, version);
    }
    else
    {
        size += Commit.serializer.serializedSize(response.mostRecentCommit, version);
    }
    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:17,代码来源:PrepareResponse.java


示例4: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(FileMessageHeader header, int version)
{
    long size = UUIDSerializer.serializer.serializedSize(header.cfId, version);
    size += TypeSizes.sizeof(header.sequenceNumber);
    size += TypeSizes.sizeof(header.version.toString());

    if (version >= StreamMessage.VERSION_22)
        size += TypeSizes.sizeof(header.format.name);

    size += TypeSizes.sizeof(header.estimatedKeys);

    size += TypeSizes.sizeof(header.sections.size());
    for (Pair<Long, Long> section : header.sections)
    {
        size += TypeSizes.sizeof(section.left);
        size += TypeSizes.sizeof(section.right);
    }
    size += CompressionInfo.serializer.serializedSize(header.compressionInfo, version);
    size += TypeSizes.sizeof(header.sstableLevel);

    if (version >= StreamMessage.VERSION_30)
        size += SerializationHeader.serializer.serializedSize(header.version, header.header);

    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:26,代码来源:FileMessageHeader.java


示例5: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(FileMessageHeader header, int version)
{
    long size = UUIDSerializer.serializer.serializedSize(header.cfId, version);
    size += TypeSizes.NATIVE.sizeof(header.sequenceNumber);
    size += TypeSizes.NATIVE.sizeof(header.version);
    size += TypeSizes.NATIVE.sizeof(header.estimatedKeys);

    size += TypeSizes.NATIVE.sizeof(header.sections.size());
    for (Pair<Long, Long> section : header.sections)
    {
        size += TypeSizes.NATIVE.sizeof(section.left);
        size += TypeSizes.NATIVE.sizeof(section.right);
    }
    size += CompressionInfo.serializer.serializedSize(header.compressionInfo, version);
    return size;
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:17,代码来源:FileMessageHeader.java


示例6: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
int serializedSize()
{
    int size = TypeSizes.sizeof(version);
    size += TypeSizes.sizeof(timestamp);

    size += TypeSizes.sizeof(hostId.getMostSignificantBits());
    size += TypeSizes.sizeof(hostId.getLeastSignificantBits());

    byte[] paramsBytes = JSONValue.toJSONString(parameters).getBytes(StandardCharsets.UTF_8);
    size += TypeSizes.sizeof(paramsBytes.length);
    size += 4; // size checksum
    size += paramsBytes.length;
    size += 4; // total checksum

    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:17,代码来源:HintsDescriptor.java


示例7: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize()
{
  int bitLength = getNumWords();
  int pageSize = getPageSize();
  int pageCount = getPageCount();

  long size = TypeSizes.sizeof(bitLength); // length
  for (int p = 0; p < pageCount; p++)
  {
    long[] bits = getPage(p);
    for (int i = 0; i < pageSize && bitLength-- > 0; i++)
      size += TypeSizes.sizeof(bits[i]); // bucket
  }
  return size;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:16,代码来源:OpenBitSet.java


示例8: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(EstimatedHistogram eh)
{
    int size = 0;

    long[] offsets = eh.getBucketOffsets();
    long[] buckets = eh.getBuckets(false);
    size += TypeSizes.sizeof(buckets.length);
    for (int i = 0; i < buckets.length; i++)
    {
        size += TypeSizes.sizeof(offsets[i == 0 ? 0 : i - 1]);
        size += TypeSizes.sizeof(buckets[i]);
    }
    return size;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:15,代码来源:EstimatedHistogram.java


示例9: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(IntervalTree<C, D, I> it, int version)
{
    long size = TypeSizes.sizeof(0);
    for (Interval<C, D> interval : it)
    {
        size += pointSerializer.serializedSize(interval.min);
        size += pointSerializer.serializedSize(interval.max);
        size += dataSerializer.serializedSize(interval.data);
    }
    return size;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:12,代码来源:IntervalTree.java


示例10: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(StreamingHistogram histogram)
{
    long size = TypeSizes.sizeof(histogram.maxBinSize);
    Map<Number, long[]> entries = histogram.getAsMap();
    size += TypeSizes.sizeof(entries.size());
    // size of entries = size * (8(double) + 8(long))
    size += entries.size() * (8L + 8L);
    return size;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:10,代码来源:StreamingHistogram.java


示例11: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(AbstractBounds<T> ab, int version)
{
    int size = version < MessagingService.VERSION_30
             ? TypeSizes.sizeof(kindInt(ab))
             : 1;
    size += serializer.serializedSize(ab.left, version);
    size += serializer.serializedSize(ab.right, version);
    return size;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:10,代码来源:AbstractBounds.java


示例12: dataSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public int dataSize()
{
    CellPath path = path();
    return TypeSizes.sizeof(timestamp())
           + TypeSizes.sizeof(ttl())
           + TypeSizes.sizeof(localDeletionTime())
           + value().remaining()
           + (path == null ? 0 : path.dataSize());
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:10,代码来源:AbstractCell.java


示例13: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(CompressionParams parameters, int version)
{
    long size = TypeSizes.sizeof(parameters.sstableCompressor.getClass().getSimpleName());
    size += TypeSizes.sizeof(parameters.otherOptions.size());
    for (Map.Entry<String, String> entry : parameters.otherOptions.entrySet())
    {
        size += TypeSizes.sizeof(entry.getKey());
        size += TypeSizes.sizeof(entry.getValue());
    }
    size += TypeSizes.sizeof(parameters.chunkLength());
    return size;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:13,代码来源:CompressionParams.java


示例14: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public int serializedSize(Version version, CompactionMetadata component) throws IOException
{
    int sz = 0;
    if (version.hasCompactionAncestors())
    {   // write empty ancestor marker
        sz = 4;
    }
    byte[] serializedCardinality = component.cardinalityEstimator.getBytes();
    return TypeSizes.sizeof(serializedCardinality.length) + serializedCardinality.length + sz;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:11,代码来源:CompactionMetadata.java


示例15: deserialize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public CompactionMetadata deserialize(Version version, DataInputPlus in) throws IOException
{
    if (version.hasCompactionAncestors())
    { // skip ancestors
        int nbAncestors = in.readInt();
        in.skipBytes(nbAncestors * TypeSizes.sizeof(nbAncestors));
    }
    ICardinality cardinality = HyperLogLogPlus.Builder.build(ByteBufferUtil.readBytes(in, in.readInt()));
    return new CompactionMetadata(cardinality);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:11,代码来源:CompactionMetadata.java


示例16: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(TypeSizes type) {
  int bitLength = getNumWords();
  int pageSize = getPageSize();
  int pageCount = getPageCount();

  long size = type.sizeof(bitLength); // length
  for (int p = 0; p < pageCount; p++) {
    long[] bits = getPage(p);
    for (int i = 0; i < pageSize && bitLength-- > 0; i++)
      size += type.sizeof(bits[i]); // bucket
  }
  return size;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:14,代码来源:OpenBitSet.java


示例17: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(GossipDigest gDigest, int version)
{
    long size = CompactEndpointSerializationHelper.serializedSize(gDigest.endpoint);
    size += TypeSizes.sizeof(gDigest.generation);
    size += TypeSizes.sizeof(gDigest.maxVersion);
    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:8,代码来源:GossipDigest.java


示例18: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(MerkleTree mt, int version)
{
    long size = 1 // mt.hashdepth
         + TypeSizes.NATIVE.sizeof(mt.maxsize)
         + TypeSizes.NATIVE.sizeof(mt.size)
         + TypeSizes.NATIVE.sizeof(mt.partitioner.getClass().getCanonicalName());

    // full range
    size += Token.serializer.serializedSize(mt.fullRange.left, TypeSizes.NATIVE);
    size += Token.serializer.serializedSize(mt.fullRange.right, TypeSizes.NATIVE);

    size += Hashable.serializer.serializedSize(mt.root, version);
    return size;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:15,代码来源:MerkleTree.java


示例19: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(EstimatedHistogram eh, TypeSizes typeSizes)
{
    int size = 0;

    long[] offsets = eh.getBucketOffsets();
    long[] buckets = eh.getBuckets(false);
    size += typeSizes.sizeof(buckets.length);
    for (int i = 0; i < buckets.length; i++)
    {
        size += typeSizes.sizeof(offsets[i == 0 ? 0 : i - 1]);
        size += typeSizes.sizeof(buckets[i]);
    }
    return size;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:15,代码来源:EstimatedHistogram.java


示例20: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入依赖的package包/类
public long serializedSize(StreamingHistogram histogram, TypeSizes typeSizes)
{
    long size = typeSizes.sizeof(histogram.maxBinSize);
    Map<Double, Long> entries = histogram.getAsMap();
    size += typeSizes.sizeof(entries.size());
    // size of entries = size * (8(double) + 8(long))
    size += entries.size() * (8 + 8);
    return size;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:10,代码来源:StreamingHistogram.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Array类代码示例发布时间:2022-05-22
下一篇:
Java TranslatableTable类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap