Search in sources :

Example 1 with InfoResultExtractor

use of com.ctrip.xpipe.redis.core.protocal.cmd.InfoResultExtractor in project x-pipe by ctripcorp.

the class XRedisXpipeCommandTest method getSyncFull.

private Integer getSyncFull(RedisMeta redis) throws Exception {
    SimpleObjectPool<NettyClient> keyPool = getXpipeNettyClientKeyedObjectPool().getKeyPool(new InetSocketAddress(redis.getIp(), redis.getPort()));
    InfoCommand infoCommand = new InfoCommand(keyPool, InfoCommand.INFO_TYPE.STATS, scheduled);
    String value = infoCommand.execute().get();
    Integer sync_full = new InfoResultExtractor(value).extractAsInteger("sync_full");
    return sync_full;
}
Also used : NettyClient(com.ctrip.xpipe.netty.commands.NettyClient) InfoResultExtractor(com.ctrip.xpipe.redis.core.protocal.cmd.InfoResultExtractor) InetSocketAddress(java.net.InetSocketAddress) InfoCommand(com.ctrip.xpipe.redis.core.protocal.cmd.InfoCommand)

Example 2 with InfoResultExtractor

use of com.ctrip.xpipe.redis.core.protocal.cmd.InfoResultExtractor in project x-pipe by ctripcorp.

the class AbstractRedisTest method getInfoKey.

protected String getInfoKey(RedisMeta slaveMeta, String infoSection, String key) throws Exception {
    SimpleObjectPool<NettyClient> keyPool = getXpipeNettyClientKeyedObjectPool().getKeyPool(new InetSocketAddress(slaveMeta.getIp(), slaveMeta.getPort()));
    String info = new InfoCommand(keyPool, infoSection, scheduled).execute().get();
    return new InfoResultExtractor(info).extract(key);
}
Also used : NettyClient(com.ctrip.xpipe.netty.commands.NettyClient) InfoResultExtractor(com.ctrip.xpipe.redis.core.protocal.cmd.InfoResultExtractor) InetSocketAddress(java.net.InetSocketAddress) InfoCommand(com.ctrip.xpipe.redis.core.protocal.cmd.InfoCommand)

Aggregations

NettyClient (com.ctrip.xpipe.netty.commands.NettyClient)2 InfoCommand (com.ctrip.xpipe.redis.core.protocal.cmd.InfoCommand)2 InfoResultExtractor (com.ctrip.xpipe.redis.core.protocal.cmd.InfoResultExtractor)2 InetSocketAddress (java.net.InetSocketAddress)2