Java Code Examples for redis.clients.util.Sharded#DEFAULT_WEIGHT

The following examples show how to use redis.clients.util.Sharded#DEFAULT_WEIGHT . 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: JedisShardInfo.java    From cachecloud with Apache License 2.0 5 votes vote down vote up
public JedisShardInfo(String host) {
  super(Sharded.DEFAULT_WEIGHT);
  URI uri = URI.create(host);
  if (JedisURIHelper.isValid(uri)) {
    this.host = uri.getHost();
    this.port = uri.getPort();
    this.password = JedisURIHelper.getPassword(uri);
    this.db = JedisURIHelper.getDBIndex(uri);
  } else {
    this.host = host;
    this.port = Protocol.DEFAULT_PORT;
  }
}
 
Example 2
Source File: JedisShardInfo.java    From cachecloud with Apache License 2.0 5 votes vote down vote up
public JedisShardInfo(URI uri) {
  super(Sharded.DEFAULT_WEIGHT);
  if (!JedisURIHelper.isValid(uri)) {
    throw new InvalidURIException(String.format(
      "Cannot open Redis connection due invalid URI. %s", uri.toString()));
  }

  this.host = uri.getHost();
  this.port = uri.getPort();
  this.password = JedisURIHelper.getPassword(uri);
  this.db = JedisURIHelper.getDBIndex(uri);
}
 
Example 3
Source File: JedisShardInfo.java    From cachecloud with Apache License 2.0 4 votes vote down vote up
public JedisShardInfo(String host, int port, int timeout) {
  this(host, port, timeout, timeout, Sharded.DEFAULT_WEIGHT);
}
 
Example 4
Source File: JedisShardInfo.java    From cachecloud with Apache License 2.0 4 votes vote down vote up
public JedisShardInfo(String host, int port, int timeout, String name) {
  this(host, port, timeout, timeout, Sharded.DEFAULT_WEIGHT);
  this.name = name;
}