本文整理汇总了Java中org.apache.cassandra.config.CFMetaData.decorateKey方法的典型用法代码示例。如果您正苦于以下问题:Java CFMetaData.decorateKey方法的具体用法?Java CFMetaData.decorateKey怎么用?Java CFMetaData.decorateKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.config.CFMetaData
的用法示例。
在下文中一共展示了CFMetaData.decorateKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserializeHeader
import org.apache.cassandra.config.CFMetaData; //导入方法依赖的package包/类
public Header deserializeHeader(CFMetaData metadata, ColumnFilter selection, DataInputPlus in, int version, SerializationHelper.Flag flag) throws IOException
{
DecoratedKey key = metadata.decorateKey(ByteBufferUtil.readWithVIntLength(in));
int flags = in.readUnsignedByte();
boolean isReversed = (flags & IS_REVERSED) != 0;
if ((flags & IS_EMPTY) != 0)
{
SerializationHeader sh = new SerializationHeader(false, metadata, PartitionColumns.NONE, EncodingStats.NO_STATS);
return new Header(sh, key, isReversed, true, null, null, 0);
}
boolean hasPartitionDeletion = (flags & HAS_PARTITION_DELETION) != 0;
boolean hasStatic = (flags & HAS_STATIC_ROW) != 0;
boolean hasRowEstimate = (flags & HAS_ROW_ESTIMATE) != 0;
SerializationHeader header = SerializationHeader.serializer.deserializeForMessaging(in, metadata, selection, hasStatic);
DeletionTime partitionDeletion = hasPartitionDeletion ? header.readDeletionTime(in) : DeletionTime.LIVE;
Row staticRow = Rows.EMPTY_STATIC_ROW;
if (hasStatic)
staticRow = UnfilteredSerializer.serializer.deserializeStaticRow(in, header, new SerializationHelper(metadata, version, flag));
int rowEstimate = hasRowEstimate ? (int)in.readUnsignedVInt() : -1;
return new Header(header, key, isReversed, false, partitionDeletion, staticRow, rowEstimate);
}
示例2: PartitionUpdate
import org.apache.cassandra.config.CFMetaData; //导入方法依赖的package包/类
public PartitionUpdate(CFMetaData metadata,
ByteBuffer key,
PartitionColumns columns,
int initialRowCapacity)
{
this(metadata,
metadata.decorateKey(key),
columns,
initialRowCapacity);
}