本文整理匯總了Java中redis.clients.jedis.HostAndPort.getHost方法的典型用法代碼示例。如果您正苦於以下問題:Java HostAndPort.getHost方法的具體用法?Java HostAndPort.getHost怎麽用?Java HostAndPort.getHost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類redis.clients.jedis.HostAndPort
的用法示例。
在下文中一共展示了HostAndPort.getHost方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initPool
import redis.clients.jedis.HostAndPort; //導入方法依賴的package包/類
private void initPool(HostAndPort master) {
if (!master.equals(currentHostMaster)) {
currentHostMaster = master;
if (factory == null) {
factory = new JaRedisFactory(master.getHost(), master.getPort(), connectionTimeout,
soTimeout, password, database, clientName);
initPool(poolConfig, factory);
} else {
factory.setHostAndPort(currentHostMaster);
internalPool.clear();
}
log.info("Created JedisPool to master at " + master);
}
}
示例2: ensureMonitored
import redis.clients.jedis.HostAndPort; //導入方法依賴的package包/類
private void ensureMonitored(HostAndPort sentinel, String masterName, String ip, int port,
int quorum) {
Jedis j = new Jedis(sentinel.getHost(), sentinel.getPort());
try {
j.sentinelMonitor(masterName, ip, port, quorum);
} catch (JedisDataException e) {
} finally {
j.close();
}
}
示例3: getHostAndPortFromNodeLine
import redis.clients.jedis.HostAndPort; //導入方法依賴的package包/類
public HostAndPort getHostAndPortFromNodeLine(String[] nodeInfoPartArray, HostAndPort current) {
String stringHostAndPort = nodeInfoPartArray[HOST_AND_PORT_INDEX];
String[] arrayHostAndPort = stringHostAndPort.split(":");
return new HostAndPort(arrayHostAndPort[0].isEmpty() ? current.getHost() : arrayHostAndPort[0],
arrayHostAndPort[1].isEmpty() ? current.getPort() : Integer.valueOf(arrayHostAndPort[1]));
}
示例4: RedisClusterTerminal
import redis.clients.jedis.HostAndPort; //導入方法依賴的package包/類
public RedisClusterTerminal(HostAndPort hp) {
super(hp.getHost(), hp.getPort());
}