本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}