redis.clients.jedis.BinaryJedisCluster Java Examples

The following examples show how to use redis.clients.jedis.BinaryJedisCluster. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EnhancedJedisCluster.java    From super-cloudops with Apache License 2.0 6 votes vote down vote up
@Override
public ScanResult<byte[]> scan(final byte[] cursor, final ScanParams params) {

	String matchPattern = null;

	if (params == null || (matchPattern = scanMatch(params)) == null || matchPattern.isEmpty()) {
		throw new IllegalArgumentException(
				BinaryJedisCluster.class.getSimpleName() + " only supports SCAN commands with non-empty MATCH patterns");
	}

	if (JedisClusterHashTagUtil.isClusterCompliantMatchPattern(matchPattern)) {

		return new EnhancedJedisClusterCommand<ScanResult<byte[]>>(connectionHandler, maxAttempts) {
			@Override
			public ScanResult<byte[]> doExecute(Jedis connection) {
				return connection.scan(cursor, params);
			}
		}.runBinary(SafeEncoder.encode(matchPattern));
	} else {
		throw new IllegalArgumentException(BinaryJedisCluster.class.getSimpleName()
				+ " only supports SCAN commands with MATCH patterns containing hash-tags ( curly-brackets enclosed strings )");
	}
}
 
Example #2
Source File: JedisClusterProvider.java    From azeroth with Apache License 2.0 5 votes vote down vote up
/**
 *
 */
public JedisClusterProvider(String groupName, JedisPoolConfig jedisPoolConfig, String[] servers,
                            int timeout) {
    this.groupName = groupName;
    Set<HostAndPort> nodes = this.parseHostAndPort(servers);
    jedisCluster = new JedisCluster(nodes, timeout, maxRedirections, jedisPoolConfig);
    binaryJedisCluster = new BinaryJedisCluster(nodes, timeout, maxRedirections,
            jedisPoolConfig);
}
 
Example #3
Source File: JedisClusterProvider.java    From jeesuite-libs with Apache License 2.0 5 votes vote down vote up
/**
 * 
 */
public JedisClusterProvider(String groupName,JedisPoolConfig jedisPoolConfig, String[] servers, int timeout) {
	this.groupName = groupName;
	Set<HostAndPort> nodes = this.parseHostAndPort(servers);
	jedisCluster = new JedisCluster(nodes, timeout, maxRedirections,jedisPoolConfig);
	binaryJedisCluster = new BinaryJedisCluster(nodes, timeout, maxRedirections,jedisPoolConfig);
}
 
Example #4
Source File: JedisClusterProvider.java    From azeroth with Apache License 2.0 4 votes vote down vote up
@Override
public BinaryJedisCluster getBinary() {
    return binaryJedisCluster;
}
 
Example #5
Source File: JedisClusterProvider.java    From jeesuite-libs with Apache License 2.0 4 votes vote down vote up
@Override
public BinaryJedisCluster getBinary() {
	return binaryJedisCluster;
}