本文整理汇总了Java中org.apache.cassandra.config.CFMetaData.getDroppedColumnDefinition方法的典型用法代码示例。如果您正苦于以下问题:Java CFMetaData.getDroppedColumnDefinition方法的具体用法?Java CFMetaData.getDroppedColumnDefinition怎么用?Java CFMetaData.getDroppedColumnDefinition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.config.CFMetaData
的用法示例。
在下文中一共展示了CFMetaData.getDroppedColumnDefinition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import org.apache.cassandra.config.CFMetaData; //导入方法依赖的package包/类
public Columns deserialize(DataInputPlus in, CFMetaData metadata) throws IOException
{
int length = (int)in.readUnsignedVInt();
BTree.Builder<ColumnDefinition> builder = BTree.builder(Comparator.naturalOrder());
builder.auto(false);
for (int i = 0; i < length; i++)
{
ByteBuffer name = ByteBufferUtil.readWithVIntLength(in);
ColumnDefinition column = metadata.getColumnDefinition(name);
if (column == null)
{
// If we don't find the definition, it could be we have data for a dropped column, and we shouldn't
// fail deserialization because of that. So we grab a "fake" ColumnDefinition that ensure proper
// deserialization. The column will be ignore later on anyway.
column = metadata.getDroppedColumnDefinition(name);
if (column == null)
throw new RuntimeException("Unknown column " + UTF8Type.instance.getString(name) + " during deserialization");
}
builder.add(column);
}
return new Columns(builder.build());
}
示例2: toHeader
import org.apache.cassandra.config.CFMetaData; //导入方法依赖的package包/类
public SerializationHeader toHeader(CFMetaData metadata)
{
Map<ByteBuffer, AbstractType<?>> typeMap = new HashMap<>(staticColumns.size() + regularColumns.size());
typeMap.putAll(staticColumns);
typeMap.putAll(regularColumns);
PartitionColumns.Builder builder = PartitionColumns.builder();
for (ByteBuffer name : typeMap.keySet())
{
ColumnDefinition column = metadata.getColumnDefinition(name);
if (column == null)
{
// TODO: this imply we don't read data for a column we don't yet know about, which imply this is theoretically
// racy with column addition. Currently, it is up to the user to not write data before the schema has propagated
// and this is far from being the only place that has such problem in practice. This doesn't mean we shouldn't
// improve this.
// If we don't find the definition, it could be we have data for a dropped column, and we shouldn't
// fail deserialization because of that. So we grab a "fake" ColumnDefinition that ensure proper
// deserialization. The column will be ignore later on anyway.
boolean isStatic = staticColumns.containsKey(name);
column = metadata.getDroppedColumnDefinition(name, isStatic);
if (column == null)
throw new RuntimeException("Unknown column " + UTF8Type.instance.getString(name) + " during deserialization");
}
builder.add(column);
}
return new SerializationHeader(true, keyType, clusteringTypes, builder.build(), stats, typeMap);
}
示例3: deserialize
import org.apache.cassandra.config.CFMetaData; //导入方法依赖的package包/类
public ColumnSubselection deserialize(DataInputPlus in, int version, CFMetaData metadata) throws IOException
{
ByteBuffer name = ByteBufferUtil.readWithShortLength(in);
ColumnDefinition column = metadata.getColumnDefinition(name);
if (column == null)
{
// If we don't find the definition, it could be we have data for a dropped column, and we shouldn't
// fail deserialization because of that. So we grab a "fake" ColumnDefinition that ensure proper
// deserialization. The column will be ignore later on anyway.
column = metadata.getDroppedColumnDefinition(name);
if (column == null)
throw new RuntimeException("Unknown column " + UTF8Type.instance.getString(name) + " during deserialization");
}
Kind kind = Kind.values()[in.readUnsignedByte()];
switch (kind)
{
case SLICE:
CellPath from = column.cellPathSerializer().deserialize(in);
CellPath to = column.cellPathSerializer().deserialize(in);
return new Slice(column, from, to);
case ELEMENT:
CellPath elt = column.cellPathSerializer().deserialize(in);
return new Element(column, elt);
}
throw new AssertionError();
}