org.apache.cassandra.thrift

## Class ThriftValidation

- java.lang.Object
- - org.apache.cassandra.thrift.ThriftValidation

-     public class ThriftValidation
      extends java.lang.Object

  This has a lot of building blocks for CassandraServer to call to make sure it has valid input -- ensuring column names conform to the declared comparator, for instance. The methods here mostly try to do just one part of the validation so they can be combined for different needs -- supercolumns vs regular, range slices vs named, batch vs single-column. (ValidateColumnPath is the main exception in that it includes keyspace and CF validation.)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ThriftValidation()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `validateColumnData(CFMetaData metadata, java.nio.ByteBuffer scName, Column column)` Validates the data part of the column (everything in the column object but the name, which is assumed to be valid)
    `static CFMetaData` | `validateColumnFamily(java.lang.String keyspaceName, java.lang.String cfName)`
    `static CFMetaData` | `validateColumnFamily(java.lang.String keyspaceName, java.lang.String cfName, boolean isCommutativeOp)`
    `static CFMetaData` | `validateColumnFamilyWithCompactMode(java.lang.String keyspaceName, java.lang.String cfName, boolean noCompactMode)`
    `static void` | `validateColumnNames(CFMetaData metadata, ColumnParent column_parent, java.lang.Iterable<java.nio.ByteBuffer> column_names)`
    `static void` | `validateColumnOrSuperColumn(CFMetaData metadata, ColumnOrSuperColumn cosc)`
    `static void` | `validateColumnParent(CFMetaData metadata, ColumnParent column_parent)`
    `static void` | `validateColumnPath(CFMetaData metadata, ColumnPath column_path)` validates all parts of the path to the column, including the column name
    `static void` | `validateDeletion(CFMetaData metadata, Deletion del)`
    `static boolean` | `validateFilterClauses(CFMetaData metadata, java.util.List<IndexExpression> index_clause)`
    `static void` | `validateIndexClauses(CFMetaData metadata, IndexClause index_clause)`
    `static void` | `validateKey(CFMetaData metadata, java.nio.ByteBuffer key)`
    `static void` | `validateKeyRange(CFMetaData metadata, java.nio.ByteBuffer superColumn, KeyRange range)`
    `static void` | `validateKeyspace(java.lang.String keyspaceName)`
    `static void` | `validateKeyspaceNotSystem(java.lang.String modifiedKeyspace)`
    `static void` | `validateKeyspaceNotYetExisting(java.lang.String newKsName)`
    `static void` | `validateMutation(CFMetaData metadata, Mutation mut)`
    `static void` | `validatePredicate(CFMetaData metadata, ColumnParent column_parent, SlicePredicate predicate)`
    `static void` | `validateRange(CFMetaData metadata, ColumnParent column_parent, SliceRange range)`
    `static void` | `validateSlicePredicate(CFMetaData metadata, java.nio.ByteBuffer scName, SlicePredicate predicate)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ThriftValidation

          public ThriftValidation()

  - ### Method Detail

    - #### validateKey

          public static void validateKey(CFMetaData metadata,
                                         java.nio.ByteBuffer key)
                                  throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateKeyspace

          public static void validateKeyspace(java.lang.String keyspaceName)
                                       throws KeyspaceNotDefinedException

      Throws:
        `KeyspaceNotDefinedException`

    - #### validateColumnFamily

          public static CFMetaData validateColumnFamily(java.lang.String keyspaceName,
                                                        java.lang.String cfName,
                                                        boolean isCommutativeOp)
                                                 throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateColumnFamily

          public static CFMetaData validateColumnFamily(java.lang.String keyspaceName,
                                                        java.lang.String cfName)
                                                 throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateColumnFamilyWithCompactMode

          public static CFMetaData validateColumnFamilyWithCompactMode(java.lang.String keyspaceName,
                                                                       java.lang.String cfName,
                                                                       boolean noCompactMode)
                                                                throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateColumnPath

          public static void validateColumnPath(CFMetaData metadata,
                                                ColumnPath column_path)
                                         throws InvalidRequestException

      validates all parts of the path to the column, including the column name
      Throws:
        `InvalidRequestException`

    - #### validateColumnParent

          public static void validateColumnParent(CFMetaData metadata,
                                                  ColumnParent column_parent)
                                           throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateColumnNames

          public static void validateColumnNames(CFMetaData metadata,
                                                 ColumnParent column_parent,
                                                 java.lang.Iterable<java.nio.ByteBuffer> column_names)
                                          throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateRange

          public static void validateRange(CFMetaData metadata,
                                           ColumnParent column_parent,
                                           SliceRange range)
                                    throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateColumnOrSuperColumn

          public static void validateColumnOrSuperColumn(CFMetaData metadata,
                                                         ColumnOrSuperColumn cosc)
                                                  throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateMutation

          public static void validateMutation(CFMetaData metadata,
                                              Mutation mut)
                                       throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateDeletion

          public static void validateDeletion(CFMetaData metadata,
                                              Deletion del)
                                       throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateSlicePredicate

          public static void validateSlicePredicate(CFMetaData metadata,
                                                    java.nio.ByteBuffer scName,
                                                    SlicePredicate predicate)
                                             throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateColumnData

          public static void validateColumnData(CFMetaData metadata,
                                                java.nio.ByteBuffer scName,
                                                Column column)
                                         throws InvalidRequestException

      Validates the data part of the column (everything in the column object but the name, which is assumed to be valid)
      Throws:
        `InvalidRequestException`

    - #### validatePredicate

          public static void validatePredicate(CFMetaData metadata,
                                               ColumnParent column_parent,
                                               SlicePredicate predicate)
                                        throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateKeyRange

          public static void validateKeyRange(CFMetaData metadata,
                                              java.nio.ByteBuffer superColumn,
                                              KeyRange range)
                                       throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateIndexClauses

          public static void validateIndexClauses(CFMetaData metadata,
                                                  IndexClause index_clause)
                                           throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateFilterClauses

          public static boolean validateFilterClauses(CFMetaData metadata,
                                                      java.util.List<IndexExpression> index_clause)
                                               throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateKeyspaceNotYetExisting

          public static void validateKeyspaceNotYetExisting(java.lang.String newKsName)
                                                     throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### validateKeyspaceNotSystem

          public static void validateKeyspaceNotSystem(java.lang.String modifiedKeyspace)
                                                throws InvalidRequestException

      Throws:
        `InvalidRequestException`

Copyright © 2018 The Apache Software Foundation