本文整理汇总了Java中org.apache.cassandra.db.TypeSizes类的典型用法代码示例。如果您正苦于以下问题:Java TypeSizes类的具体用法?Java TypeSizes怎么用?Java TypeSizes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeSizes类属于org.apache.cassandra.db包,在下文中一共展示了TypeSizes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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));
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
示例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);
}