本文整理汇总了Java中com.lambdaworks.redis.protocol.CommandKeyword类的典型用法代码示例。如果您正苦于以下问题:Java CommandKeyword类的具体用法?Java CommandKeyword怎么用?Java CommandKeyword使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CommandKeyword类属于com.lambdaworks.redis.protocol包,在下文中一共展示了CommandKeyword类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: requestPing
import com.lambdaworks.redis.protocol.CommandKeyword; //导入依赖的package包/类
public Requests requestPing() {
Requests requests = new Requests();
for (Map.Entry<RedisURI, StatefulRedisConnection<String, String>> entry : connections.entrySet()) {
CommandArgs<String, String> args = new CommandArgs<>(StringCodec.ASCII).add(CommandKeyword.NODES);
Command<String, String, String> command = new Command<>(CommandType.PING, new StatusOutput<>(StringCodec.ASCII),
args);
TimedAsyncCommand<String, String, String> timedCommand = new TimedAsyncCommand<>(command);
entry.getValue().dispatch(timedCommand);
requests.addRequest(entry.getKey(), timedCommand);
}
return requests;
}
示例2: build
import com.lambdaworks.redis.protocol.CommandKeyword; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <V> void build(CommandArgs<K, V> args) {
if (copy) {
args.add(CommandKeyword.COPY);
}
if (replace) {
args.add(CommandKeyword.REPLACE);
}
if (keys.size() > 1) {
args.add(CommandType.KEYS);
args.addKeys(keys);
}
}
示例3: build
import com.lambdaworks.redis.protocol.CommandKeyword; //导入依赖的package包/类
public <V> void build(CommandArgs<K, V> args) {
if (sort != null && sort != Sort.none) {
args.add(sort.name());
}
if (count != null) {
args.add(CommandKeyword.COUNT).add(count);
}
if (storeKey != null) {
args.add("STORE").addKey(storeKey);
}
if (storeDistKey != null) {
args.add("STOREDIST").addKey(storeDistKey);
}
}
示例4: requestTopology
import com.lambdaworks.redis.protocol.CommandKeyword; //导入依赖的package包/类
public Requests requestTopology() {
Requests requests = new Requests();
for (Map.Entry<RedisURI, StatefulRedisConnection<String, String>> entry : connections.entrySet()) {
CommandArgs<String, String> args = new CommandArgs<>(StringCodec.UTF8).add(CommandKeyword.NODES);
Command<String, String, String> command = new Command<>(CommandType.CLUSTER, new StatusOutput<>(StringCodec.UTF8),
args);
TimedAsyncCommand<String, String, String> timedCommand = new TimedAsyncCommand<>(command);
entry.getValue().dispatch(timedCommand);
requests.addRequest(entry.getKey(), timedCommand);
}
return requests;
}
示例5: requestClients
import com.lambdaworks.redis.protocol.CommandKeyword; //导入依赖的package包/类
public Requests requestClients() {
Requests requests = new Requests();
for (Map.Entry<RedisURI, StatefulRedisConnection<String, String>> entry : connections.entrySet()) {
CommandArgs<String, String> args = new CommandArgs<>(StringCodec.UTF8).add(CommandKeyword.LIST);
Command<String, String, String> command = new Command<>(CommandType.CLIENT, new StatusOutput<>(StringCodec.UTF8),
args);
TimedAsyncCommand<String, String, String> timedCommand = new TimedAsyncCommand<>(command);
entry.getValue().dispatch(timedCommand);
requests.addRequest(entry.getKey(), timedCommand);
}
return requests;
}
示例6: build
import com.lambdaworks.redis.protocol.CommandKeyword; //导入依赖的package包/类
public <K, V> void build(CommandArgs<K, V> args) {
if (withdistance) {
args.add("withdist");
}
if (withhash) {
args.add("withhash");
}
if (withcoordinates) {
args.add("withcoord");
}
if (sort != null && sort != Sort.none) {
args.add(sort.name());
}
if (count != null) {
args.add(CommandKeyword.COUNT).add(count);
}
}
示例7: getMoveTarget
import com.lambdaworks.redis.protocol.CommandKeyword; //导入依赖的package包/类
static HostAndPort getMoveTarget(String errorMessage) {
LettuceAssert.notEmpty(errorMessage, "ErrorMessage must not be empty");
LettuceAssert.isTrue(errorMessage.startsWith(CommandKeyword.MOVED.name()), "ErrorMessage must start with "
+ CommandKeyword.MOVED);
String[] movedMessageParts = errorMessage.split(" ");
LettuceAssert.isTrue(movedMessageParts.length >= 3, "ErrorMessage must consist of 3 tokens (" + errorMessage + ")");
return HostAndPort.parseCompat(movedMessageParts[2]);
}
示例8: getAskTarget
import com.lambdaworks.redis.protocol.CommandKeyword; //导入依赖的package包/类
static HostAndPort getAskTarget(String errorMessage) {
LettuceAssert.notEmpty(errorMessage, "ErrorMessage must not be empty");
LettuceAssert.isTrue(errorMessage.startsWith(CommandKeyword.ASK.name()), "ErrorMessage must start with "
+ CommandKeyword.ASK);
String[] movedMessageParts = errorMessage.split(" ");
LettuceAssert.isTrue(movedMessageParts.length >= 3, "ErrorMessage must consist of 3 tokens (" + errorMessage + ")");
return HostAndPort.parseCompat(movedMessageParts[2]);
}
示例9: add
import com.lambdaworks.redis.protocol.CommandKeyword; //导入依赖的package包/类
@Override
public DisqueCommandArgs<K, V> add(CommandKeyword keyword) {
return (DisqueCommandArgs<K, V>) super.add(keyword);
}
示例10: remove
import com.lambdaworks.redis.protocol.CommandKeyword; //导入依赖的package包/类
public Command<K, V, String> remove(K key) {
CommandArgs<K, V> args = new CommandArgs<>(codec).add(CommandKeyword.REMOVE).addKey(key);
return createCommand(SENTINEL, new StatusOutput<>(codec), args);
}