예제 #1
0
  public static void validatePredicate(
      String keyspace, ColumnParent column_parent, SlicePredicate predicate)
      throws InvalidRequestException {
    if (predicate.column_names == null && predicate.slice_range == null)
      throw new InvalidRequestException(
          "predicate column_names and slice_range may not both be null");
    if (predicate.column_names != null && predicate.slice_range != null)
      throw new InvalidRequestException(
          "predicate column_names and slice_range may not both be present");

    if (predicate.getSlice_range() != null)
      validateRange(keyspace, column_parent, predicate.slice_range);
    else validateColumns(keyspace, column_parent, predicate.column_names);
  }
예제 #2
0
  public static void validateSlicePredicate(
      String keyspace, String cfName, ByteBuffer scName, SlicePredicate predicate)
      throws InvalidRequestException {
    if (predicate.column_names == null && predicate.slice_range == null)
      throw new InvalidRequestException(
          "A SlicePredicate must be given a list of Columns, a SliceRange, or both");

    if (predicate.slice_range != null)
      validateRange(
          keyspace, new ColumnParent(cfName).setSuper_column(scName), predicate.slice_range);

    if (predicate.column_names != null)
      validateColumns(keyspace, cfName, scName, predicate.column_names);
  }