private SimpleBound(ColumnCondition condition, QueryOptions options) throws InvalidRequestException { super(condition.column, condition.operator); assert !(column.type instanceof CollectionType) && condition.field == null; assert condition.operator != Operator.IN; this.value = condition.value.bindAndGet(options); }
private ElementAccessBound(ColumnCondition condition, QueryOptions options) throws InvalidRequestException { super(condition.column, condition.operator); assert column.type instanceof CollectionType && condition.collectionElement != null; assert condition.operator != Operator.IN; this.collectionElement = condition.collectionElement.bindAndGet(options); this.value = condition.value.bindAndGet(options); }
@Override public List<ByteBuffer> values(QueryOptions options) throws InvalidRequestException { return Collections.singletonList(value.bindAndGet(options)); }
@Override public List<ByteBuffer> values(QueryOptions options) throws InvalidRequestException { return Collections.singletonList(value.bindAndGet(options)); }
@Override protected List<ByteBuffer> getValues(QueryOptions options) { List<ByteBuffer> buffers = new ArrayList<>(values.size()); for (Term value : values) buffers.add(value.bindAndGet(options)); return buffers; }
@Override public List<ByteBuffer> bounds(Bound b, QueryOptions options) throws InvalidRequestException { return Collections.singletonList(slice.bound(b).bindAndGet(options)); }
@Override public List<ByteBuffer> bounds(Bound b, QueryOptions options) throws InvalidRequestException { return Collections.singletonList(slice.bound(b).bindAndGet(options)); }
public Selector newInstance(QueryOptions options) { return new TermSelector(term.bindAndGet(options), type); } };
@Override public void addRowFilterTo(RowFilter filter, SecondaryIndexManager indexManager, QueryOptions options) { filter.add(columnDef, Operator.EQ, value.bindAndGet(options)); }
private UDTFieldAccessBound(ColumnCondition condition, QueryOptions options) throws InvalidRequestException { super(condition.column, condition.operator); assert column.type.isUDT() && condition.field != null; assert condition.operator != Operator.IN; this.field = condition.field; this.value = condition.value.bindAndGet(options); }
private UDTFieldAccessBound(ColumnCondition condition, QueryOptions options) throws InvalidRequestException { super(condition.column, condition.operator); assert column.type.isUDT() && condition.field != null; assert condition.operator != Operator.IN; this.field = condition.field; this.value = condition.value.bindAndGet(options); }
public ByteBuffer bindAndGet(QueryOptions options) throws InvalidRequestException { List<ByteBuffer> buffers = new ArrayList<>(terms.size()); for (Term t : terms) { ByteBuffer functionArg = t.bindAndGet(options); RequestValidations.checkBindValueSet(functionArg, "Invalid unset value for argument in call to function %s", fun.name().name); buffers.add(functionArg); } return executeInternal(options.getProtocolVersion(), fun, buffers); }
public void execute(DecoratedKey partitionKey, UpdateParameters params) throws InvalidRequestException { ByteBuffer bytes = t.bindAndGet(params.options); if (bytes == null) throw new InvalidRequestException("Invalid null value for counter increment"); if (bytes == ByteBufferUtil.UNSET_BYTE_BUFFER) return; long increment = ByteBufferUtil.toLong(bytes); params.addCounter(column, increment); } }
@Override public void addRowFilterTo(RowFilter filter, SecondaryIndexManager indexManager, QueryOptions options) { Pair<Operator, ByteBuffer> operation = makeSpecific(value.bindAndGet(options)); // there must be a suitable INDEX for LIKE_XXX expressions RowFilter.SimpleExpression expression = filter.add(columnDef, operation.left, operation.right); indexManager.getBestIndexFor(expression) .orElseThrow(() -> invalidRequest("%s is only supported on properly indexed columns", expression)); }
public void addToRowFilter(RowFilter filter, CFMetaData cfm, QueryOptions options) { filter.addCustomIndexExpression(cfm, cfm.getIndexes() .get(targetIndex.getIdx()) .orElseThrow(() -> IndexRestrictions.indexNotFound(targetIndex, cfm)), value.bindAndGet(options)); } }
@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.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 void addRowFilterTo(RowFilter filter, SecondaryIndexManager indexManager, QueryOptions options) { for (Bound b : Bound.values()) if (hasBound(b)) filter.add(columnDef, slice.getIndexOperator(b), slice.bound(b).bindAndGet(options)); }
@Override public MultiCBuilder appendBoundTo(MultiCBuilder builder, Bound bound, QueryOptions options) { Bound b = bound.reverseIfNeeded(getFirstColumn()); if (!hasBound(b)) return builder; ByteBuffer value = slice.bound(b).bindAndGet(options); checkBindValueSet(value, "Invalid unset value for column %s", columnDef.name); return builder.addElementToAll(value); }
@Override public MultiCBuilder appendBoundTo(MultiCBuilder builder, Bound bound, QueryOptions options) { Bound b = bound.reverseIfNeeded(getFirstColumn()); if (!hasBound(b)) return builder; ByteBuffer value = slice.bound(b).bindAndGet(options); checkBindValueSet(value, "Invalid unset value for column %s", columnDef.name); return builder.addElementToAll(value); }