Move pfcount(keys) method to multikey interfaces

This commit is contained in:
Alok Singh
2014-04-28 16:41:09 -07:00
parent cd722e5a82
commit b633024c11
6 changed files with 10 additions and 20 deletions

View File

@@ -1503,16 +1503,4 @@ public class JedisCluster implements JedisCommands, BasicCommands {
}
}.run(key);
}
@Override
public long pfcount(final String... keys) {
return new JedisClusterCommand<Long>(connectionHandler,
timeout, maxRedirections) {
@Override
public Long execute(Jedis connection) {
return connection.pfcount(keys);
}
}.run(keys[0]);
}
}

View File

@@ -245,5 +245,4 @@ public interface JedisCommands {
long pfcount(final String key);
long pfcount(final String...keys);
}

View File

@@ -81,4 +81,6 @@ public interface MultiKeyCommands {
ScanResult<String> scan(final String cursor);
String pfmerge(final String destkey, final String... sourcekeys);
long pfcount(final String...keys);
}

View File

@@ -66,4 +66,6 @@ public interface MultiKeyCommandsPipeline {
Response<Long> bitop(BitOP op, final String destKey, String... srcKeys);
Response<String> pfmerge(final String destkey, final String... sourcekeys);
Response<Long> pfcount(final String...keys);
}

View File

@@ -458,4 +458,10 @@ abstract class MultiKeyPipelineBase extends PipelineBase implements
client.pfmerge(destkey, sourcekeys);
return getResponse(BuilderFactory.STRING);
}
@Override
public Response<Long> pfcount(String...keys) {
client.pfcount(keys);
return getResponse(BuilderFactory.LONG);
}
}

View File

@@ -582,11 +582,4 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
Jedis j = getShard(key);
return j.pfcount(key);
}
@Override
public long pfcount(String... keys) {
//The command will be sent to the first shard.
Jedis j = getShard(keys[0]);
return j.pfcount(keys);
}
}