src/java/org/apache/cassandra/thrift/ThriftValidation.java
/**
     * Validates the column names but not the parent path or data
     */
Validates the column names but not the parent path or data
Validates the column names but not the parent path or data
private static void validateColumnNames(CFMetaData metadata, ByteBuffer superColumnName, Iterable<ByteBuffer> column_names)
            throws InvalidRequestException
    {
        if (superColumnName != null)
        {
            if (superColumnName.remaining() > IColumn.MAX_NAME_LENGTH)
                throw new InvalidRequestException("supercolumn name length must not be greater than " + IColumn.MAX_NAME_LENGTH);
            if (superColumnName.remaining() == 0)
                throw new InvalidRequestException("supercolumn name must not be empty");
            if (metadata.cfType == ColumnFamilyType.Standard)
                throw new InvalidRequestException("supercolumn specified to ColumnFamily " + metadata.cfName + " containing normal columns");
        }
        AbstractType comparator = metadata.getComparatorFor(superColumnName);
        for (ByteBuffer name : column_names)
        {
            if (name.remaining() > IColumn.MAX_NAME_LENGTH)
                throw new InvalidRequestException("column name length must not be greater than " + IColumn.MAX_NAME_LENGTH);
            if (name.remaining() == 0)
                throw new InvalidRequestException("column name must not be empty");
            try
            {
                comparator.validate(name);
            }
            catch (MarshalException e)
            {
                throw new InvalidRequestException(e.getMessage());
            }
        }
    }
private static void validateColumnNames ( CFMetaData metadata , ByteBuffer superColumnName , Iterable < ByteBuffer > column_names ) throws InvalidRequestException { if ( superColumnName != null ) { if ( superColumnName . remaining ( ) > IColumn . MAX_NAME_LENGTH ) throw new InvalidRequestException ( "supercolumn name length must not be greater than " + IColumn . MAX_NAME_LENGTH ) ; if ( superColumnName . remaining ( ) == 0 ) throw new InvalidRequestException ( "supercolumn name must not be empty" ) ; if ( metadata . cfType == ColumnFamilyType . Standard ) throw new InvalidRequestException ( "supercolumn specified to ColumnFamily " + metadata . cfName + " containing normal columns" ) ; } AbstractType comparator = metadata . getComparatorFor ( superColumnName ) ; for ( ByteBuffer name : column_names ) { if ( name . remaining ( ) > IColumn . MAX_NAME_LENGTH ) throw new InvalidRequestException ( "column name length must not be greater than " + IColumn . MAX_NAME_LENGTH ) ; if ( name . remaining ( ) == 0 ) throw new InvalidRequestException ( "column name must not be empty" ) ; try { comparator . validate ( name ) ; } catch ( MarshalException e ) { throw new InvalidRequestException ( e . getMessage ( ) ) ; } } }
Validates the column names but not the parent path or data
Validates the column names but not the parent path or data