Entry mutation, call writer if needed or skip to {@link #mutationMayStore()}
512475
public void mutationMayCallWriter() {
    CacheWriter<K, V> _writer = writer();
    if (_writer == null) {
      skipWritingNoWriter();
      return;
    }
    if (remove) {
      try {
        entry.nextProcessingStep(WRITE);
        _writer.delete(key);
      } catch (Throwable t) {
        onWriteFailure(t);
        return;
      }
      onWriteSuccess();
      return;
    }
    if (newValueOrException instanceof ExceptionWrapper) {
      skipWritingForException();
      return;
    }
    entry.nextProcessingStep(WRITE);
    try {
      _writer.write(key, newValueOrException);
    } catch (Throwable t) {
      onWriteFailure(t);
      return;
    }
    onWriteSuccess();
  }
703531
public <T, K> void put(ColumnFamily<K, String> columnFamily, T item)
            throws Exception {
        @SuppressWarnings({ "unchecked" })
        Class<T> clazz = (Class<T>) item.getClass();
        Mapping<T> mapping = getMapping(clazz);
        @SuppressWarnings({ "unchecked" })
        Class<K> idFieldClass = (Class<K>) mapping.getIdFieldClass(); // safe -
                                                                      // after
                                                                      // erasure,
                                                                      // this is
                                                                      // all
                                                                      // just
                                                                      // Class
                                                                      // anyway

        MutationBatch mutationBatch = keyspace.prepareMutationBatch();
        ColumnListMutation<String> columnListMutation = mutationBatch.withRow(
                columnFamily, mapping.getIdValue(item, idFieldClass));
        mapping.fillMutation(item, columnListMutation);

        mutationBatch.execute();
    }
425660
@Override
    public D newDocument(String id, int expiry, T content, long cas, MutationToken mutationToken) {
        LOGGER.warn("This transcoder ({}) does not support mutation tokens - this method is a " +
            "stub and needs to be implemented on custom transcoders.", this.getClass().getSimpleName());
        return newDocument(id, expiry, content, cas);
    }
745042
public boolean advance() {
        // Stack / register variable for performance
        int mut = mutationsPointer >= 0 ? mutations.getMutation(mutationsPointer) : NON_MUTATION;

        // This if is required to process all non-insertions with the same
        // position, before other mutation types and match
        if (getRawTypeCode(mut) == RAW_MUTATION_TYPE_INSERTION)
            mut = getPosition(mut) != seq1Position ? NON_MUTATION : mut;
        else if (getPosition(mut) != seq1Position - 1)
            mut = NON_MUTATION;

        if (mut != NON_MUTATION) {
            switch (Mutation.getRawTypeCode(mut)) {
                case RAW_MUTATION_TYPE_SUBSTITUTION:
                    --seq1Position;
                    --seq2Position;
                    break;

                case RAW_MUTATION_TYPE_DELETION:
                    --seq1Position;
                    break;

                case RAW_MUTATION_TYPE_INSERTION:
                    --seq2Position;
                    break;
            }
            --mutationsPointer;
        } else {
            --seq1Position;
            --seq2Position;
        }

        currentMutation = mut;

        return seq1Position >= seq1From;
    }
1119507
@Override
  public <N> MutationResult insertCounter(final K key, final String cf, final HCounterColumn<N> c) {
    addCounter(key,cf, c);
    return execute();
  }
189431
public static <E> DocumentFragment<Mutation> convertToSubDocumentResult(ResponseStatus status, Mutation mutation, E element) {
        return new DocumentFragment<Mutation>(null, 0, null,
                Collections.singletonList(SubdocOperationResult.createResult(null, mutation, status, element)));
    }
61027
@Override
    public ENTRY update(final ENTRY entry) throws CouldNotPerformException {
        if (entry == null) {
            throw new NotAvailableException("entry");
        }
        log("Update " + entry + "...");
        try {
            checkWriteAccess();
            lock();
            try {
                try {
                    // validate update
                    if (!entryMap.containsKey(entry.getId())) {
                        throw new InvalidStateException("Entry not registered!");
                    }
                    // perform update
                    sandbox.update(entry);
                    // check if the new message results in an update after consistency checks
                    final boolean changed = !isSandbox() && ((sandbox instanceof MockRegistrySandbox) || !get(entry).equals(sandbox.get(entry)));
                    pluginPool.beforeUpdate(entry);
                    entryMap.put(entry.getId(), entry);
                    finishTransaction();
                    pluginPool.afterUpdate(entry);
                    // test if the entry has changed at all by this update method
                    if (changed) {
                        notifySuccessfulTransaction();
                    }
                } finally {
                    syncSandbox();
                }
            } finally {
                unlock();
            }
        } catch (CouldNotPerformException ex) {
            throw new CouldNotPerformException("Could not update " + entry + " in " + this + "!", ex);
        }
        notifyObservers();
        return get(entry);
    }
1139228
private MapEntryUpdateResult<K, byte[]> replaceIf(
      long index, K key, MapEntryValue newValue, Predicate<MapEntryValue> predicate) {
    MapEntryValue oldValue = entries().get(key);

    // If the key is not set or the current value doesn't match the predicate, return a PRECONDITION_FAILED error.
    if (valueIsNull(oldValue) || !predicate.test(oldValue)) {
      return new MapEntryUpdateResult<>(
          MapEntryUpdateResult.Status.PRECONDITION_FAILED,
          index,
          key,
          toVersioned(oldValue));
    }

    // If the key has been locked by a transaction, return a WRITE_LOCK error.
    if (preparedKeys.contains(key)) {
      return new MapEntryUpdateResult<>(MapEntryUpdateResult.Status.WRITE_LOCK, index, key, null);
    }

    putValue(key, newValue);
    Versioned<byte[]> result = toVersioned(oldValue);
    publish(new AtomicMapEvent<>(AtomicMapEvent.Type.UPDATE, key, toVersioned(newValue), result));
    return new MapEntryUpdateResult<>(MapEntryUpdateResult.Status.OK, index, key, result);
  }
1100412
public static void generateMutations(long seq, TxLog txLog, Consumer<Mutation> consumer) {
    Map<Bytes, Mutation> mutationMap = new HashMap<>();
    for (LogEntry le : txLog.getLogEntries()) {
      LogEntry.Operation op = le.getOp();
      Column col = le.getColumn();
      byte[] cf = col.getFamily().toArray();
      byte[] cq = col.getQualifier().toArray();
      byte[] cv = col.getVisibility().toArray();
      if (op.equals(LogEntry.Operation.DELETE) || op.equals(LogEntry.Operation.SET)) {
        Mutation m = mutationMap.computeIfAbsent(le.getRow(), k -> new Mutation(k.toArray()));
        if (op.equals(LogEntry.Operation.DELETE)) {
          if (col.isVisibilitySet()) {
            m.putDelete(cf, cq, new ColumnVisibility(cv), seq);
          } else {
            m.putDelete(cf, cq, seq);
          }
        } else {
          if (col.isVisibilitySet()) {
            m.put(cf, cq, new ColumnVisibility(cv), seq, le.getValue().toArray());
          } else {
            m.put(cf, cq, seq, le.getValue().toArray());
          }
        }
      }
    }
    mutationMap.values().forEach(consumer);
  }
756342
public C fillLockMutation(MutationBatch m, Long time, Integer ttl) {
        if (lockColumn != null) {
            if (!lockColumn.equals(columnStrategy.generateLockColumn()))
                throw new IllegalStateException("Can't change prefix or lockId after acquiring the lock");
        }
        else {
            lockColumn = columnStrategy.generateLockColumn();
        }
        
        Long timeoutValue 
              = (time == null)
              ? new Long(0)
              : time + TimeUnit.MICROSECONDS.convert(timeout, timeoutUnits);
              
        m.withRow(columnFamily, key).putColumn(lockColumn, generateTimeoutValue(timeoutValue), ttl);
        return lockColumn;
    }
605132
public void updateEntry(CmsUUID entryId) {

        getChildren(entryId, CmsSitemapTreeItem.getItemById(entryId).isOpen(), null);
    }
638915
function (mutation) {
        // bail out for empty or unsupported mutations
        if (!(mutation && isPrimitiveMutation(mutation))) {
            return;
        }

        // if autoCompact is set, we need to compact while adding
        if (this.autoCompact) {
            this.addAndCompact(mutation);
            return;
        }

        // otherwise just push to the stream of mutations
        this.stream.push(mutation);
    }
1010164
@Override
    public String writeSingle(String key) throws Exception {
        MutationBatch m = keyspace.prepareMutationBatch().withConsistencyLevel(ConsistencyLevel.valueOf(config.getWriteConsistencyLevel()));

        ColumnListMutation<Integer> colsMutation = m.withRow(this.CF, key);

        for (int i = 0; i < config.getColsPerRow(); i++) {
            colsMutation.putColumn(i, dataGenerator.getRandomValue());
        }

        m.execute();

        return ResultOK;
    }
1273119
@InternalApi
  public void adapt(RowMutations mutations, MutationApi<?> mutationApi) {
    mutationAdapters.rowMutationsAdapter.adapt(mutations, mutationApi);
  }
404572
public RowMutation adaptEntry(RowMutations mutations) {
    RowMutation rowMutation = newRowMutationModel(mutations.getRow());
    adapt(mutations, rowMutation);
    return rowMutation;
  }
948997
@Override
    public boolean advance() {
        if (currentMutation != NON_MUTATION_1) { // Prevents invocation on the first execution of the method

            // This will be executed starting from the second call of the advance() method
            if (currentMutation != NON_MUTATION) {
                switch (Mutation.getRawTypeCode(currentMutation)) {
                    case RAW_MUTATION_TYPE_SUBSTITUTION:
                        ++seq1Position;
                        ++seq2Position;
                        break;

                    case RAW_MUTATION_TYPE_DELETION:
                        ++seq1Position;
                        break;

                    case RAW_MUTATION_TYPE_INSERTION:
                        ++seq2Position;
                        break;
                }
                ++mutationsPointer;
            } else {
                ++seq1Position;
                ++seq2Position;
            }

        }

        // Setting current state
        currentMutation = mutationsPointer < mutations.size() &&
                mutations.getPositionByIndex(mutationsPointer) == seq1Position ? mutations.getMutation(mutationsPointer) :
                NON_MUTATION;

        return seq1Position < seq1To || currentMutation != NON_MUTATION;
    }
678943
@Override
  public CompletableFuture<Void> mutate(final Mutation mutation) {
    return toCompletableFuture(helper.mutate(mutation))
        .thenApply(r -> null);
  }