@Override
  public ByteBuffer processStorageCommand(String key, byte[] value, int flags, Cache cache) {
    Region<Object, ValueWrapper> r = getMemcachedRegion(cache);
    Object oldVal = r.replace(key, ValueWrapper.getWrappedValue(value, flags));
    String reply = null;
    if (oldVal == null) {
      reply = Reply.NOT_STORED.toString();
    } else {
      reply = Reply.STORED.toString();
    }
    return asciiCharset.encode(reply);
  }
general format of the command is:<br>
<code>
&lt;command name&gt; &lt;key&gt; &lt;flags&gt; &lt;exptime&gt; &lt;bytes&gt; [noreply]\r\n
</code><br>

"replace" means "store this data, but only if the server *does* already hold data for this key".
geode-memcached/src/main/java/org/apache/geode/internal/memcached/commands/ReplaceCommand.java