![JAR search and dependency download from the Maven repository](/logo.png)
org.infinispan.server.resp.commands.generic.RENAME Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-server-resp Show documentation
Show all versions of infinispan-server-resp Show documentation
Infinispan Resp Protocol Server
package org.infinispan.server.resp.commands.generic;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.function.BiConsumer;
import org.infinispan.AdvancedCache;
import org.infinispan.commons.dataconversion.MediaType;
import org.infinispan.commons.util.concurrent.CompletableFutures;
import org.infinispan.server.resp.ByteBufPool;
import org.infinispan.server.resp.Resp3Handler;
import org.infinispan.server.resp.RespCommand;
import org.infinispan.server.resp.RespErrorUtil;
import org.infinispan.server.resp.RespRequestHandler;
import org.infinispan.server.resp.commands.Resp3Command;
import org.infinispan.server.resp.serialization.Resp3Response;
import io.netty.channel.ChannelHandlerContext;
/**
* RENAME Resp Command
*
* @link RENAME
* This operation is NOT atomic, it is performed in two step: old key
* removed, new key set.
* Data could get lost in case of failure of the latter.
* @since 15.0
*/
public class RENAME extends RespCommand implements Resp3Command {
public RENAME() {
super(3, 1, 2, 1);
}
@Override
public CompletionStage perform(Resp3Handler handler,
ChannelHandlerContext ctx,
List arguments) {
byte[] srcKey = arguments.get(0);
byte[] dstKey = arguments.get(1);
return rename(handler, srcKey, dstKey, ctx, Resp3Response.OK);
}
public static CompletionStage rename(Resp3Handler handler, byte[] srcKey, byte[] dstKey,
ChannelHandlerContext ctx, BiConsumer, ByteBufPool> consumer) {
BiConsumer
© 2015 - 2025 Weber Informatics LLC | Privacy Policy