@Deprecated public void validateForIndexing() { checkFalse(value.remaining() > FBUtilities.MAX_UNSIGNED_SHORT, "Index expression values may not be larger than 64K"); }
private void validateSecondaryIndexSelections(boolean selectsOnlyStaticColumns) { checkFalse(keyIsInRelation(), "Select on indexed columns and with IN clause for the PRIMARY KEY are not supported"); // When the user only select static columns, the intent is that we don't query the whole partition but just // the static parts. But 1) we don't have an easy way to do that with 2i and 2) since we don't support index on // static columns // so far, 2i means that you've restricted a non static column, so the query is somewhat non-sensical. checkFalse(selectsOnlyStaticColumns, "Queries using 2ndary indexes don't support selecting only static columns"); }
@Deprecated public void validateForIndexing() { checkFalse(value.remaining() > FBUtilities.MAX_UNSIGNED_SHORT, "Index expression values may not be larger than 64K"); }
private static void verifyOrderingIsAllowed(StatementRestrictions restrictions) throws InvalidRequestException { checkFalse(restrictions.usesSecondaryIndexing(), "ORDER BY with 2ndary indexes is not supported."); checkFalse(restrictions.isKeyRange(), "ORDER BY is only supported when the partition key is restricted by an EQ or an IN."); }
public void validate(ClientState state) throws InvalidRequestException { checkFalse(hasConditions() && attrs.isTimestampSet(), "Cannot provide custom timestamp for conditional updates"); checkFalse(isCounter() && attrs.isTimestampSet(), "Cannot provide custom timestamp for counter updates"); checkFalse(isCounter() && attrs.isTimeToLiveSet(), "Cannot provide custom TTL for counter updates"); checkFalse(isView(), "Cannot directly modify a materialized view"); }
public void validate(ClientState state) throws InvalidRequestException { checkFalse(hasConditions() && attrs.isTimestampSet(), "Cannot provide custom timestamp for conditional updates"); checkFalse(isCounter() && attrs.isTimestampSet(), "Cannot provide custom timestamp for counter updates"); checkFalse(isCounter() && attrs.isTimeToLiveSet(), "Cannot provide custom TTL for counter updates"); checkFalse(isView(), "Cannot directly modify a materialized view"); }
private void validateOperationOnDurations(AbstractType<?> type) { if (type.referencesDuration() && operator.isSlice()) { checkFalse(type.isCollection(), "Slice conditions are not supported on collections containing durations"); checkFalse(type.isTuple(), "Slice conditions are not supported on tuples containing durations"); checkFalse(type.isUDT(), "Slice conditions are not supported on UDTs containing durations"); throw invalidRequest("Slice conditions are not supported on durations", operator); } } }
@Override public MultiCBuilder appendTo(MultiCBuilder builder, QueryOptions options) { builder.addElementToAll(value.bindAndGet(options)); checkFalse(builder.containsNull(), "Invalid null value in condition for column %s", columnDef.name); checkFalse(builder.containsUnset(), "Invalid unset value for column %s", columnDef.name); return builder; }
@Override public MultiCBuilder appendTo(MultiCBuilder builder, QueryOptions options) { builder.addEachElementToAll(getValues(options)); checkFalse(builder.containsNull(), "Invalid null value in condition for column %s", columnDef.name); checkFalse(builder.containsUnset(), "Invalid unset value for column %s", columnDef.name); return builder; }
private void validateOperationOnDurations(AbstractType<?> type) { if (type.referencesDuration() && operator.isSlice()) { checkFalse(type.isCollection(), "Slice conditions are not supported on collections containing durations"); checkFalse(type.isTuple(), "Slice conditions are not supported on tuples containing durations"); checkFalse(type.isUDT(), "Slice conditions are not supported on UDTs containing durations"); throw invalidRequest("Slice conditions are not supported on durations", operator); } } }
@Override public MultiCBuilder appendTo(MultiCBuilder builder, QueryOptions options) { builder.addElementToAll(value.bindAndGet(options)); checkFalse(builder.containsNull(), "Invalid null value in condition for column %s", columnDef.name); checkFalse(builder.containsUnset(), "Invalid unset value for column %s", columnDef.name); return builder; }
@Override public MultiCBuilder appendTo(MultiCBuilder builder, QueryOptions options) { builder.addEachElementToAll(getValues(options)); checkFalse(builder.containsNull(), "Invalid null value in condition for column %s", columnDef.name); checkFalse(builder.containsUnset(), "Invalid unset value for column %s", columnDef.name); return builder; }
@Override public void validate(ReadCommand command) throws InvalidRequestException { Optional<RowFilter.Expression> target = getTargetExpression(command.rowFilter().getExpressions()); if (target.isPresent()) { ByteBuffer indexValue = target.get().getIndexValue(); checkFalse(indexValue.remaining() > FBUtilities.MAX_UNSIGNED_SHORT, "Index expression values may not be larger than 64K"); } }
@Override public void validate(ReadCommand command) throws InvalidRequestException { Optional<RowFilter.Expression> target = getTargetExpression(command.rowFilter().getExpressions()); if (target.isPresent()) { ByteBuffer indexValue = target.get().getIndexValue(); checkFalse(indexValue.remaining() > FBUtilities.MAX_UNSIGNED_SHORT, "Index expression values may not be larger than 64K"); } }
@Override public MultiCBuilder appendTo(MultiCBuilder builder, QueryOptions options) { Tuples.Value t = ((Tuples.Value) value.bind(options)); List<ByteBuffer> values = t.getElements(); for (int i = 0, m = values.size(); i < m; i++) { builder.addElementToAll(values.get(i)); checkFalse(builder.containsNull(), "Invalid null value for column %s", columnDefs.get(i).name); } return builder; }
@Override protected List<ByteBuffer> getValues(QueryOptions options) { Terminal term = marker.bind(options); checkNotNull(term, "Invalid null value for column %s", columnDef.name); checkFalse(term == Constants.UNSET_VALUE, "Invalid unset value for column %s", columnDef.name); Term.MultiItemTerminal lval = (Term.MultiItemTerminal) term; return lval.getElements(); }
/** If ALLOW FILTERING was not specified, this verifies that it is not needed */ private void checkNeedsFiltering(StatementRestrictions restrictions) throws InvalidRequestException { // non-key-range non-indexed queries cannot involve filtering underneath if (!parameters.allowFiltering && (restrictions.isKeyRange() || restrictions.usesSecondaryIndexing())) { // We will potentially filter data if either: // - Have more than one IndexExpression // - Have no index expression and the row filter is not the identity checkFalse(restrictions.needFiltering(), StatementRestrictions.REQUIRES_ALLOW_FILTERING_MESSAGE); } }
/** If ALLOW FILTERING was not specified, this verifies that it is not needed */ private void checkNeedsFiltering(StatementRestrictions restrictions) throws InvalidRequestException { // non-key-range non-indexed queries cannot involve filtering underneath if (!parameters.allowFiltering && (restrictions.isKeyRange() || restrictions.usesSecondaryIndexing())) { // We will potentially filter data if either: // - Have more than one IndexExpression // - Have no index expression and the row filter is not the identity checkFalse(restrictions.needFiltering(), StatementRestrictions.REQUIRES_ALLOW_FILTERING_MESSAGE); } }
public List<ByteBuffer> getValues(QueryOptions options) throws InvalidRequestException { Terminal term = marker.bind(options); checkNotNull(term, "Invalid null value for column %s", columnDef.name); checkFalse(term == Constants.UNSET_VALUE, "Invalid unset value for column %s", columnDef.name); Term.MultiItemTerminal lval = (Term.MultiItemTerminal) term; return lval.getElements(); } }
public List<ByteBuffer> getValues(QueryOptions options) throws InvalidRequestException { Terminal term = marker.bind(options); checkNotNull(term, "Invalid null value for column %s", columnDef.name); checkFalse(term == Constants.UNSET_VALUE, "Invalid unset value for column %s", columnDef.name); Term.MultiItemTerminal lval = (Term.MultiItemTerminal) term; return lval.getElements(); } }