@Override protected Term toTerm(List<? extends ColumnSpecification> receivers, Raw raw, String keyspace, VariableSpecifications boundNames) throws InvalidRequestException { assert receivers.size() == 1; Term term = raw.prepare(keyspace, receivers.get(0)); term.collectMarkerSpecification(boundNames); return term; }
@Override protected Term toTerm(List<? extends ColumnSpecification> receivers, Raw raw, String keyspace, VariableSpecifications boundNames) throws InvalidRequestException { assert receivers.size() == 1; Term term = raw.prepare(keyspace, receivers.get(0)); term.collectMarkerSpecification(boundNames); return term; }
@Override protected Term toTerm(List<? extends ColumnSpecification> receivers, Raw raw, String keyspace, VariableSpecifications boundNames) throws InvalidRequestException { Term term = raw.prepare(keyspace, receivers.get(0)); term.collectMarkerSpecification(boundNames); return term; }
@Override protected Term toTerm(List<? extends ColumnSpecification> receivers, Raw raw, String keyspace, VariableSpecifications boundNames) throws InvalidRequestException { Term term = raw.prepare(keyspace, receivers.get(0)); term.collectMarkerSpecification(boundNames); return term; }
public Operation prepare(CFMetaData cfm, ColumnDefinition receiver) throws InvalidRequestException { assert receiver.type instanceof MapType; Term k = selector.prepare(cfm.ksName, Maps.keySpecOf(receiver)); Term v = value.prepare(cfm.ksName, Maps.valueSpecOf(receiver)); return new Maps.AdderByKey(receiver, v, k); }
public static ByteBuffer asBytes(String keyspace, String term, AbstractType type) { ColumnSpecification receiver = new ColumnSpecification(keyspace, "--dummy--", new ColumnIdentifier("(dummy)", true), type); Term.Raw rawTerm = CQLFragmentParser.parseAny(CqlParser::term, term, "CQL term"); return rawTerm.prepare(keyspace, receiver).bindAndGet(QueryOptions.DEFAULT); } }
public Term prepare(String keyspace, ColumnSpecification receiver) throws InvalidRequestException { if (!term.testAssignment(keyspace, castedSpecOf(keyspace, receiver)).isAssignable()) throw new InvalidRequestException(String.format("Cannot cast value %s to type %s", term, type)); if (!testAssignment(keyspace, receiver).isAssignable()) throw new InvalidRequestException(String.format("Cannot assign value %s to %s of type %s", this, receiver.name, receiver.type.asCQL3Type())); return term.prepare(keyspace, receiver); }
public Operation prepare(CFMetaData cfm, ColumnDefinition receiver) throws InvalidRequestException { if (!receiver.type.isUDT()) throw new InvalidRequestException(String.format("Invalid operation (%s) for non-UDT column %s", toString(receiver), receiver.name)); else if (!receiver.type.isMultiCell()) throw new InvalidRequestException(String.format("Invalid operation (%s) for frozen UDT column %s", toString(receiver), receiver.name)); int fieldPosition = ((UserType) receiver.type).fieldPosition(field); if (fieldPosition == -1) throw new InvalidRequestException(String.format("UDT column %s does not have a field named %s", receiver.name, field)); Term val = value.prepare(cfm.ksName, UserTypes.fieldSpecOf(receiver, fieldPosition)); return new UserTypes.SetterByField(receiver, field, val); }
public Term prepare(String keyspace, ColumnSpecification receiver) throws InvalidRequestException { if (!term.testAssignment(keyspace, castedSpecOf(keyspace, receiver)).isAssignable()) throw new InvalidRequestException(String.format("Cannot cast value %s to type %s", term, type)); if (!testAssignment(keyspace, receiver).isAssignable()) throw new InvalidRequestException(String.format("Cannot assign value %s to %s of type %s", this, receiver.name, receiver.type.asCQL3Type())); return term.prepare(keyspace, receiver); }
public Operation prepare(CFMetaData cfm, ColumnDefinition receiver) throws InvalidRequestException { Term v = value.prepare(cfm.ksName, receiver); if (!(receiver.type instanceof ListType)) throw new InvalidRequestException(String.format("Invalid operation (%s) for non list column %s", toString(receiver), receiver.name)); else if (!(receiver.type.isMultiCell())) throw new InvalidRequestException(String.format("Invalid operation (%s) for frozen list column %s", toString(receiver), receiver.name)); return new Lists.Prepender(receiver, v); }
public Operation prepare(CFMetaData cfm, ColumnDefinition receiver) throws InvalidRequestException { assert receiver.type instanceof MapType; Term k = selector.prepare(cfm.ksName, Maps.keySpecOf(receiver)); Term v = value.prepare(cfm.ksName, Maps.valueSpecOf(receiver)); return new Maps.AdderByKey(receiver, v, k); }
public Attributes prepare(String ksName, String cfName) throws InvalidRequestException { Term ts = timestamp == null ? null : timestamp.prepare(ksName, timestampReceiver(ksName, cfName)); Term ttl = timeToLive == null ? null : timeToLive.prepare(ksName, timeToLiveReceiver(ksName, cfName)); return new Attributes(ts, ttl); }
public void prepareValue(CFMetaData cfm, AbstractType<?> expressionType, VariableSpecifications boundNames) { ColumnSpecification spec = new ColumnSpecification(cfm.ksName, cfm.ksName, valueColId, expressionType); value = valueRaw.prepare(cfm.ksName, spec); value.collectMarkerSpecification(boundNames); }
@Override protected Term toTerm(List<? extends ColumnSpecification> receivers, Raw raw, String keyspace, VariableSpecifications boundNames) throws InvalidRequestException { Term term = raw.prepare(keyspace, receivers.get(0)); term.collectMarkerSpecification(boundNames); return term; }
public Term prepare(String keyspace, ColumnSpecification receiver) throws InvalidRequestException { if (!term.testAssignment(keyspace, castedSpecOf(keyspace, receiver)).isAssignable()) throw new InvalidRequestException(String.format("Cannot cast value %s to type %s", term, type)); if (!testAssignment(keyspace, receiver).isAssignable()) throw new InvalidRequestException(String.format("Cannot assign value %s to %s of type %s", this, receiver.name, receiver.type.asCQL3Type())); return term.prepare(keyspace, receiver); }
public Attributes prepare(String ksName, String cfName) throws InvalidRequestException { Term ts = timestamp == null ? null : timestamp.prepare(ksName, timestampReceiver(ksName, cfName)); Term ttl = timeToLive == null ? null : timeToLive.prepare(ksName, timeToLiveReceiver(ksName, cfName)); return new Attributes(ts, ttl); }
/** Returns a Term for the limit or null if no limit is set */ private Term prepareLimit(VariableSpecifications boundNames, Term.Raw limit, String keyspace, ColumnSpecification limitReceiver) throws InvalidRequestException { if (limit == null) return null; Term prepLimit = limit.prepare(keyspace, limitReceiver); prepLimit.collectMarkerSpecification(boundNames); return prepLimit; }
public void prepareValue(CFMetaData cfm, AbstractType<?> expressionType, VariableSpecifications boundNames) { ColumnSpecification spec = new ColumnSpecification(cfm.ksName, cfm.ksName, valueColId, expressionType); value = valueRaw.prepare(cfm.ksName, spec); value.collectMarkerSpecification(boundNames); }
public Attributes prepare(String ksName, String cfName) throws InvalidRequestException { Term ts = timestamp == null ? null : timestamp.prepare(ksName, timestampReceiver(ksName, cfName)); Term ttl = timeToLive == null ? null : timeToLive.prepare(ksName, timeToLiveReceiver(ksName, cfName)); return new Attributes(ts, ttl); }
/** Returns a Term for the limit or null if no limit is set */ private Term prepareLimit(VariableSpecifications boundNames, Term.Raw limit, String keyspace, ColumnSpecification limitReceiver) throws InvalidRequestException { if (limit == null) return null; Term prepLimit = limit.prepare(keyspace, limitReceiver); prepLimit.collectMarkerSpecification(boundNames); return prepLimit; }