throw new InvalidRequestException("subcomparator_type is invalid for standard columns");
if (cf_def.column_metadata == null)
return;
AbstractType comparator = cfType == ColumnFamilyType.Standard
? TypeParser.parse(cf_def.comparator_type)
: TypeParser.parse(cf_def.subcomparator_type);
if (cf_def.key_alias != null)
{
// check if any of the columns has name equal to the cf.key_alias
for (ColumnDef columnDef : cf_def.column_metadata)
{
if (cf_def.key_alias.equals(columnDef.name))
throw new InvalidRequestException("Invalid column name: "
+ AsciiType.instance.compose(cf_def.key_alias)
+ ", because it equals to the key_alias.");
}
}
// initialize a set of names NOT in the CF under consideration
Set<String> indexNames = new HashSet<String>();
for (ColumnFamilyStore cfs : ColumnFamilyStore.all())
{
if (!cfs.getColumnFamilyName().equals(cf_def.name))
for (ColumnDefinition cd : cfs.metadata.getColumn_metadata().values())
indexNames.add(cd.getIndexName());
}
for (ColumnDef c : cf_def.column_metadata)
{
TypeParser.parse(c.validation_class);
try
{
comparator.validate(c.name);
}
catch (MarshalException e)
{
throw new InvalidRequestException(String.format("Column name %s is not valid for comparator %s",
ByteBufferUtil.bytesToHex(c.name), cf_def.comparator_type));