public void applyUpdates(FilteredPartition current, PartitionUpdate updates) throws InvalidRequestException { Map<DecoratedKey, Partition> map = stmt.requiresRead() ? Collections.<DecoratedKey, Partition>singletonMap(key, current) : null; UpdateParameters params = new UpdateParameters(cfm, updates.columns(), options, timestamp, stmt.getTimeToLive(options), map); stmt.addUpdateForKey(updates, clustering, params); } }
public void applyUpdates(FilteredPartition current, PartitionUpdate updates) throws InvalidRequestException { Map<DecoratedKey, Partition> map = stmt.requiresRead() ? Collections.<DecoratedKey, Partition>singletonMap(key, current) : null; UpdateParameters params = new UpdateParameters(cfm, updates.columns(), options, timestamp, stmt.getTimeToLive(options), map); stmt.addUpdateForKey(updates, clustering, params); } }
public void applyUpdates(FilteredPartition current, PartitionUpdate updates) throws InvalidRequestException { // No slice statements currently require a read, but this maintains consistency with RowUpdate, and future proofs us Map<DecoratedKey, Partition> map = stmt.requiresRead() ? Collections.<DecoratedKey, Partition>singletonMap(key, current) : null; UpdateParameters params = new UpdateParameters(cfm, updates.columns(), options, timestamp, stmt.getTimeToLive(options), map); stmt.addUpdateForKey(updates, slice, params); } }
public void applyUpdates(FilteredPartition current, PartitionUpdate updates) throws InvalidRequestException { // No slice statements currently require a read, but this maintains consistency with RowUpdate, and future proofs us Map<DecoratedKey, Partition> map = stmt.requiresRead() ? Collections.<DecoratedKey, Partition>singletonMap(key, current) : null; UpdateParameters params = new UpdateParameters(cfm, updates.columns(), options, timestamp, stmt.getTimeToLive(options), map); stmt.addUpdateForKey(updates, slice, params); } }
public void applyUpdates(FilteredPartition current, PartitionUpdate updates) throws InvalidRequestException { Map<DecoratedKey, Partition> map = stmt.requiresRead() ? Collections.<DecoratedKey, Partition>singletonMap(key, current) : null; UpdateParameters params = new UpdateParameters(cfm, updates.columns(), options, timestamp, stmt.getTimeToLive(options), map); stmt.addUpdateForKey(updates, clustering, params); } }
public void applyUpdates(FilteredPartition current, PartitionUpdate updates) throws InvalidRequestException { // No slice statements currently require a read, but this maintains consistency with RowUpdate, and future proofs us Map<DecoratedKey, Partition> map = stmt.requiresRead() ? Collections.<DecoratedKey, Partition>singletonMap(key, current) : null; UpdateParameters params = new UpdateParameters(cfm, updates.columns(), options, timestamp, stmt.getTimeToLive(options), map); stmt.addUpdateForKey(updates, slice, params); } }
public void applyUpdates(ColumnFamily current, ColumnFamily updates) throws InvalidRequestException { Map<ByteBuffer, CQL3Row> map = null; if (stmt.requiresRead()) { // Uses the "current" values read by Paxos for lists operation that requires a read Iterator<CQL3Row> iter = cfm.comparator.CQL3RowBuilder(cfm, now).group(current.iterator(new ColumnSlice[]{ rowPrefix.slice() })); if (iter.hasNext()) { map = Collections.singletonMap(key, iter.next()); assert !iter.hasNext() : "We shoudn't be updating more than one CQL row per-ModificationStatement"; } } UpdateParameters params = new UpdateParameters(cfm, options, timestamp, stmt.getTimeToLive(options), map); stmt.addUpdateForKey(updates, key, rowPrefix, params); } }
/** * Convert statement into a list of mutations to apply on the server * * @param options value for prepared statement markers * @param local if true, any requests (for collections) performed by getMutation should be done locally only. * @param now the current timestamp in microseconds to use if no timestamp is user provided. * * @return list of the mutations * @throws InvalidRequestException on invalid requests */ private Collection<? extends IMutation> getMutations(QueryOptions options, boolean local, long now) throws RequestExecutionException, RequestValidationException { List<ByteBuffer> keys = buildPartitionKeyNames(options); Composite clusteringPrefix = createClusteringPrefix(options); UpdateParameters params = makeUpdateParameters(keys, clusteringPrefix, options, local, now); Collection<IMutation> mutations = new ArrayList<IMutation>(keys.size()); for (ByteBuffer key: keys) { ThriftValidation.validateKey(cfm, key); ColumnFamily cf = ArrayBackedSortedColumns.factory.create(cfm); addUpdateForKey(cf, key, clusteringPrefix, params); Mutation mut = new Mutation(cfm.ksName, key, cf); mutations.add(isCounter() ? new CounterMutation(mut, options.getConsistency()) : mut); } return mutations; }
statement.addUpdateForKey(mut.addOrGet(statement.cfm), key, clusteringPrefix, params);
addUpdateForKey(upd, slice, params); addUpdateForKey(upd, Clustering.EMPTY, params); addUpdateForKey(upd, clustering, params);
addUpdateForKey(upd, slice, params); addUpdateForKey(upd, Clustering.EMPTY, params); addUpdateForKey(upd, clustering, params);
addUpdateForKey(upd, slice, params); addUpdateForKey(upd, Clustering.EMPTY, params); addUpdateForKey(upd, clustering, params);