本文整理汇总了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());
}