Esempio n. 1
0
 public static void validateColumn(String keyspace, ColumnParent column_parent, Column column)
     throws InvalidRequestException {
   validateTtl(column);
   validateColumns(keyspace, column_parent, Arrays.asList(column.name));
   try {
     AbstractType validator =
         DatabaseDescriptor.getValueValidator(keyspace, column_parent.column_family, column.name);
     if (validator != null) validator.validate(column.value);
   } catch (MarshalException me) {
     throw new InvalidRequestException(
         String.format(
             "[%s][%s][%s] = [%s] failed validation (%s)",
             keyspace,
             column_parent.getColumn_family(),
             FBUtilities.bytesToHex(column.name),
             FBUtilities.bytesToHex(column.value),
             me.getMessage()));
   }
 }