Apply PF* (string, binary) commands to Pipeline
* Apply PF* (string, binary) commands to Pipeline * PF* Pipeline (string, binary) commands to interface ** pfadd / pfcount : BinaryRedisPipeline, RedisPipeline ** pfmerge : MultiKeyBinaryRedisPipeline, MultiKeyCommandsPipeline
This commit is contained in:
@@ -1261,7 +1261,7 @@ public class BinaryClient extends Connection {
|
|||||||
public void pfcount(final byte[] key) {
|
public void pfcount(final byte[] key) {
|
||||||
sendCommand(PFCOUNT, key);
|
sendCommand(PFCOUNT, key);
|
||||||
}
|
}
|
||||||
public void pfmerge(final byte[] deskey, final byte[]... sourcekeys) {
|
public void pfmerge(final byte[] destkey, final byte[]... sourcekeys) {
|
||||||
sendCommand(PFMERGE, joinParameters(deskey, sourcekeys));
|
sendCommand(PFMERGE, joinParameters(destkey, sourcekeys));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,4 +210,8 @@ public interface BinaryRedisPipeline {
|
|||||||
Response<Long> bitcount(byte[] key);
|
Response<Long> bitcount(byte[] key);
|
||||||
|
|
||||||
Response<Long> bitcount(byte[] key, long start, long end);
|
Response<Long> bitcount(byte[] key, long start, long end);
|
||||||
|
|
||||||
|
Response<Long> pfadd(final byte[] key, final byte[]... elements);
|
||||||
|
|
||||||
|
Response<Long> pfcount(final byte[] key);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import redis.clients.jedis.exceptions.JedisAskDataException;
|
|||||||
import redis.clients.jedis.exceptions.JedisClusterException;
|
import redis.clients.jedis.exceptions.JedisClusterException;
|
||||||
import redis.clients.jedis.exceptions.JedisClusterMaxRedirectionsException;
|
import redis.clients.jedis.exceptions.JedisClusterMaxRedirectionsException;
|
||||||
import redis.clients.jedis.exceptions.JedisConnectionException;
|
import redis.clients.jedis.exceptions.JedisConnectionException;
|
||||||
import redis.clients.jedis.exceptions.JedisException;
|
|
||||||
import redis.clients.jedis.exceptions.JedisMovedDataException;
|
import redis.clients.jedis.exceptions.JedisMovedDataException;
|
||||||
import redis.clients.jedis.exceptions.JedisRedirectionException;
|
import redis.clients.jedis.exceptions.JedisRedirectionException;
|
||||||
import redis.clients.util.JedisClusterCRC16;
|
import redis.clients.util.JedisClusterCRC16;
|
||||||
|
|||||||
@@ -65,4 +65,6 @@ public interface MultiKeyBinaryRedisPipeline {
|
|||||||
Response<byte[]> randomKeyBinary();
|
Response<byte[]> randomKeyBinary();
|
||||||
|
|
||||||
Response<Long> bitop(BitOP op, final byte[] destKey, byte[]... srcKeys);
|
Response<Long> bitop(BitOP op, final byte[] destKey, byte[]... srcKeys);
|
||||||
|
|
||||||
|
Response<String> pfmerge(final byte[] destkey, final byte[]... sourcekeys);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,4 +64,6 @@ public interface MultiKeyCommandsPipeline {
|
|||||||
Response<String> randomKey();
|
Response<String> randomKey();
|
||||||
|
|
||||||
Response<Long> bitop(BitOP op, final String destKey, String... srcKeys);
|
Response<Long> bitop(BitOP op, final String destKey, String... srcKeys);
|
||||||
|
|
||||||
|
Response<String> pfmerge(final String destkey, final String... sourcekeys);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -446,4 +446,16 @@ abstract class MultiKeyPipelineBase extends PipelineBase implements
|
|||||||
client.clusterSetSlotImporting(slot, nodeId);
|
client.clusterSetSlotImporting(slot, nodeId);
|
||||||
return getResponse(BuilderFactory.STRING);
|
return getResponse(BuilderFactory.STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response<String> pfmerge(byte[] destkey, byte[]... sourcekeys) {
|
||||||
|
client.pfmerge(destkey, sourcekeys);
|
||||||
|
return getResponse(BuilderFactory.STRING);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response<String> pfmerge(String destkey, String... sourcekeys) {
|
||||||
|
client.pfmerge(destkey, sourcekeys);
|
||||||
|
return getResponse(BuilderFactory.STRING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,5 +124,5 @@ public class Pipeline extends MultiKeyPipelineBase {
|
|||||||
currentMulti = new MultiResponseBuilder();
|
currentMulti = new MultiResponseBuilder();
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1204,4 +1204,28 @@ abstract class PipelineBase extends Queable implements BinaryRedisPipeline,
|
|||||||
return getResponse(BuilderFactory.STRING);
|
return getResponse(BuilderFactory.STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response<Long> pfadd(byte[] key, byte[]... elements) {
|
||||||
|
getClient(key).pfadd(key, elements);
|
||||||
|
return getResponse(BuilderFactory.LONG);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response<Long> pfcount(byte[] key) {
|
||||||
|
getClient(key).pfcount(key);
|
||||||
|
return getResponse(BuilderFactory.LONG);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response<Long> pfadd(String key, String... elements) {
|
||||||
|
getClient(key).pfadd(key, elements);
|
||||||
|
return getResponse(BuilderFactory.LONG);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response<Long> pfcount(String key) {
|
||||||
|
getClient(key).pfcount(key);
|
||||||
|
return getResponse(BuilderFactory.LONG);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,4 +188,8 @@ public interface RedisPipeline {
|
|||||||
Response<Long> bitcount(String key);
|
Response<Long> bitcount(String key);
|
||||||
|
|
||||||
Response<Long> bitcount(String key, long start, long end);
|
Response<Long> bitcount(String key, long start, long end);
|
||||||
|
|
||||||
|
Response<Long> pfadd(final String key, final String... elements);
|
||||||
|
|
||||||
|
Response<Long> pfcount(final String key);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user