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


Java TypeSizes.sizeof方法代码示例

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


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

示例1: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入方法依赖的package包/类
public long serializedSize(RepairJobDesc desc, int version)
{
    int size = 0;
    if (version >= MessagingService.VERSION_21)
    {
        size += TypeSizes.sizeof(desc.parentSessionId != null);
        if (desc.parentSessionId != null)
            size += UUIDSerializer.serializer.serializedSize(desc.parentSessionId, version);
    }
    size += UUIDSerializer.serializer.serializedSize(desc.sessionId, version);
    size += TypeSizes.sizeof(desc.keyspace);
    size += TypeSizes.sizeof(desc.columnFamily);
    size += TypeSizes.sizeof(desc.ranges.size());
    for (Range<Token> rt : desc.ranges)
    {
        size += AbstractBounds.tokenSerializer.serializedSize(rt, version);
    }
    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:20,代码来源:RepairJobDesc.java

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入方法依赖的package包/类
public long serializedSize(GossipDigestAck2 ack2, int version)
{
    long size = TypeSizes.sizeof(ack2.epStateMap.size());
    for (Map.Entry<InetAddress, EndpointState> entry : ack2.epStateMap.entrySet())
        size += CompactEndpointSerializationHelper.serializedSize(entry.getKey())
                + EndpointState.serializer.serializedSize(entry.getValue(), version);
    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:9,代码来源:GossipDigestAck2.java

示例12: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入方法依赖的package包/类
public long serializedSize(IRowCacheEntry entry)
{
    int size = TypeSizes.sizeof(true);
    if (entry instanceof RowCacheSentinel)
        size += TypeSizes.sizeof(((RowCacheSentinel) entry).sentinelId);
    else
        size += CachedPartition.cacheSerializer.serializedSize((CachedPartition) entry);
    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:10,代码来源:SerializingCacheProvider.java

示例13: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入方法依赖的package包/类
public long serializedSize(EndpointState epState, int version)
{
    long size = HeartBeatState.serializer.serializedSize(epState.getHeartBeatState(), version);
    Set<Map.Entry<ApplicationState, VersionedValue>> states = epState.states();
    size += TypeSizes.sizeof(states.size());
    for (Map.Entry<ApplicationState, VersionedValue> state : states)
    {
        VersionedValue value = state.getValue();
        size += TypeSizes.sizeof(state.getKey().ordinal());
        size += VersionedValue.serializer.serializedSize(value, version);
    }
    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:14,代码来源:EndpointState.java

示例14: 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

示例15: serializedSize

import org.apache.cassandra.db.TypeSizes; //导入方法依赖的package包/类
public long serializedSize(PrepareMessage message, int version)
{
    long size;
    TypeSizes sizes = TypeSizes.NATIVE;
    size = sizes.sizeof(message.cfIds.size());
    for (UUID cfId : message.cfIds)
        size += UUIDSerializer.serializer.serializedSize(cfId, version);
    size += UUIDSerializer.serializer.serializedSize(message.parentRepairSession, version);
    size += sizes.sizeof(message.ranges.size());
    for (Range r : message.ranges)
        size += Range.serializer.serializedSize(r, version);
    return size;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:14,代码来源:PrepareMessage.java


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