本文整理汇总了Java中org.apache.cassandra.config.CFMetaData.isSuper方法的典型用法代码示例。如果您正苦于以下问题:Java CFMetaData.isSuper方法的具体用法?Java CFMetaData.isSuper怎么用?Java CFMetaData.isSuper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.config.CFMetaData
的用法示例。
在下文中一共展示了CFMetaData.isSuper方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decodeCellName
import org.apache.cassandra.config.CFMetaData; //导入方法依赖的package包/类
public static LegacyCellName decodeCellName(CFMetaData metadata, ByteBuffer cellname, boolean readAllAsDynamic) throws UnknownColumnException
{
Clustering clustering = decodeClustering(metadata, cellname);
if (metadata.isSuper())
return decodeForSuperColumn(metadata, clustering, CompositeType.extractComponent(cellname, 1));
if (metadata.isDense() || (metadata.isCompactTable() && readAllAsDynamic))
return new LegacyCellName(clustering, metadata.compactValueColumn(), null);
ByteBuffer column = metadata.isCompound() ? CompositeType.extractComponent(cellname, metadata.comparator.size()) : cellname;
if (column == null)
{
// Tables for composite 2ndary indexes used to be compound but dense, but we've transformed them into regular tables
// (non compact ones) but with no regular column (i.e. we only care about the clustering). So we'll get here
// in that case, and what we want to return is basically a row marker.
if (metadata.partitionColumns().isEmpty())
return new LegacyCellName(clustering, null, null);
// Otherwise, we shouldn't get there
throw new IllegalArgumentException("No column name component found in cell name");
}
// Row marker, this is ok
if (!column.hasRemaining())
return new LegacyCellName(clustering, null, null);
ColumnDefinition def = metadata.getColumnDefinition(column);
if ((def == null) || def.isPrimaryKeyColumn())
{
// If it's a compact table, it means the column is in fact a "dynamic" one
if (metadata.isCompactTable())
return new LegacyCellName(Clustering.make(column), metadata.compactValueColumn(), null);
if (def == null)
throw new UnknownColumnException(metadata, column);
else
throw new IllegalArgumentException("Cannot add primary key column to partition update");
}
ByteBuffer collectionElement = metadata.isCompound() ? CompositeType.extractComponent(cellname, metadata.comparator.size() + 1) : null;
// Note that because static compact columns are translated to static defs in the new world order, we need to force a static
// clustering if the definition is static (as it might not be in this case).
return new LegacyCellName(def.isStatic() ? Clustering.STATIC_CLUSTERING : clustering, def, collectionElement);
}