当前位置: 首页>>代码示例>>Java>>正文


Java CommandKeyword类代码示例

本文整理汇总了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;
    }
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:18,代码来源:Connections.java

示例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);
    }
}
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:17,代码来源:MigrateArgs.java

示例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);
        }
    }
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:19,代码来源:GeoRadiusStoreArgs.java

示例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;
    }
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:18,代码来源:Connections.java

示例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;
    }
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:18,代码来源:Connections.java

示例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);
    }

}
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:23,代码来源:GeoArgs.java

示例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]);
    }
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:12,代码来源:ClusterDistributionChannelWriter.java

示例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]);
    }
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:12,代码来源:ClusterDistributionChannelWriter.java

示例9: add

import com.lambdaworks.redis.protocol.CommandKeyword; //导入依赖的package包/类
@Override
public DisqueCommandArgs<K, V> add(CommandKeyword keyword) {
    return (DisqueCommandArgs<K, V>) super.add(keyword);
}
 
开发者ID:mp911de,项目名称:spinach,代码行数:5,代码来源:DisqueCommandArgs.java

示例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);
}
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:5,代码来源:SentinelCommandBuilder.java


注:本文中的com.lambdaworks.redis.protocol.CommandKeyword类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。