com.netflix.dyno.connectionpool.Host.getPort()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中com.netflix.dyno.connectionpool.Host.getPort()方法的一些代码示例,展示了Host.getPort()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Host.getPort()方法的具体详情如下:
包路径:com.netflix.dyno.connectionpool.Host
类名称:Host
方法名:getPort

Host.getPort介绍

暂无

代码示例

代码示例来源:origin: Netflix/conductor

@Inject
public RedisSentinelJedisProvider(HostSupplier hostSupplier, DynomiteConfiguration configuration) {
  GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
  poolConfig.setMinIdle(5);
  poolConfig.setMaxTotal(1000);
  logger.info("Starting conductor server using redis_sentinel and cluster " + configuration.getClusterName());
  Set<String> sentinels = new HashSet<>();
  for (Host host : hostSupplier.getHosts()) {
    sentinels.add(host.getHostName() + ":" + host.getPort());
  }
  jedisPool = new JedisSentinelPool(configuration.getClusterName(), sentinels, poolConfig);
}

代码示例来源:origin: Netflix/conductor

@Override
  public JedisCommands get() {
    // FIXME Do we really want to ignore all additional hosts?
    Host host = Lists.newArrayList(hostSupplier.getHosts()).get(0);

    GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
    poolConfig.setMinIdle(5);
    poolConfig.setMaxTotal(1000);
    logger.info("Starting conductor server using redis_cluster " + configuration.getClusterName());
    return new JedisCluster(new HostAndPort(host.getHostName(), host.getPort()), poolConfig);
  }
}

代码示例来源:origin: Netflix/conductor

@Override
  public JedisCommands get() {
    // FIXME This doesn't seem very safe, but is how it was in the code this was moved from.
    Host host = new ArrayList<Host>(hostSupplier.getHosts()).get(0);
    GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
    poolConfig.setMinIdle(5);
    poolConfig.setMaxTotal(1000);
    return new JedisCluster(new HostAndPort(host.getHostName(), host.getPort()), poolConfig);
  }
}

代码示例来源:origin: com.netflix.conductor/conductor-redis-persistence

@Inject
public RedisSentinelJedisProvider(HostSupplier hostSupplier, DynomiteConfiguration configuration) {
  GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
  poolConfig.setMinIdle(5);
  poolConfig.setMaxTotal(1000);
  logger.info("Starting conductor server using redis_sentinel and cluster " + configuration.getClusterName());
  Set<String> sentinels = new HashSet<>();
  for (Host host : hostSupplier.getHosts()) {
    sentinels.add(host.getHostName() + ":" + host.getPort());
  }
  jedisPool = new JedisSentinelPool(configuration.getClusterName(), sentinels, poolConfig);
}

代码示例来源:origin: com.netflix.dyno/dyno-core

sb.append("\nHost: " + host.getHostAddress() + ":" + host.getPort() + ":" + host.getRack() + "\t");
sb.append(" borrowed: " + hStats.getConnectionsBorrowed());
sb.append(" returned: " + hStats.getConnectionsReturned());

代码示例来源:origin: com.netflix.conductor/conductor-redis-persistence

@Override
  public JedisCommands get() {
    // FIXME Do we really want to ignore all additional hosts?
    Host host = Lists.newArrayList(hostSupplier.getHosts()).get(0);

    GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
    poolConfig.setMinIdle(5);
    poolConfig.setMaxTotal(1000);
    logger.info("Starting conductor server using redis_cluster " + configuration.getClusterName());
    return new JedisCluster(new HostAndPort(host.getHostName(), host.getPort()), poolConfig);
  }
}

代码示例来源:origin: com.netflix.conductor/conductor-redis-persistence

@Override
  public JedisCommands get() {
    // FIXME This doesn't seem very safe, but is how it was in the code this was moved from.
    Host host = new ArrayList<Host>(hostSupplier.getHosts()).get(0);
    GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
    poolConfig.setMinIdle(5);
    poolConfig.setMaxTotal(1000);
    return new JedisCluster(new HostAndPort(host.getHostName(), host.getPort()), poolConfig);
  }
}

代码示例来源:origin: Netflix/dyno-queues

redisConnRead = new DynoClientProxy(dynoNonQuorumClient);
} else {
  JedisPool pool = new JedisPool(redisPoolConfig, hostAddress, host.getPort(), 0);
  redisConn = new JedisProxy(pool);
  redisConnRead = new JedisProxy(pool);

代码示例来源:origin: com.netflix.dyno/dyno-core

hostFromTokenMapSupplier.getPort(), hostFromTokenMapSupplier.getSecurePort(), hostFromTokenMapSupplier.getRack(),
         hostFromTokenMapSupplier.getDatacenter(), Host.Status.Up, hostFromTokenMapSupplier.getHashtag(),
         hostFromTokenMapSupplier.getPassword()));
  hostFromTokenMapSupplier.getPort(), hostFromTokenMapSupplier.getSecurePort(), hostFromTokenMapSupplier.getRack(),
  hostFromTokenMapSupplier.getDatacenter(), Host.Status.Down, hostFromTokenMapSupplier.getHashtag(),
  hostFromTokenMapSupplier.getPassword()));
h.getPort(), h.getSecurePort(), h.getRack(),
h.getDatacenter(), Host.Status.Down, h.getHashtag()));

代码示例来源:origin: com.netflix.dyno/dyno-jedis

public JedisConnection(HostConnectionPool<Jedis> hostPool) {
  this.hostPool = hostPool;
  Host host = hostPool.getHost();
  if (sslSocketFactory == null) {
    JedisShardInfo shardInfo = new JedisShardInfo(host.getHostAddress(), host.getPort(),
        hostPool.getConnectionTimeout(), hostPool.getSocketTimeout(), Sharded.DEFAULT_WEIGHT);
    shardInfo.setPassword(host.getPassword());
    jedisClient = new Jedis(shardInfo);
  } else {
    JedisShardInfo shardInfo = new JedisShardInfo(host.getHostAddress(), host.getPort(),
        hostPool.getConnectionTimeout(), hostPool.getSocketTimeout(), Sharded.DEFAULT_WEIGHT,
        true, sslSocketFactory, new SSLParameters(), null);
    shardInfo.setPassword(host.getPassword());
    jedisClient = new Jedis(shardInfo);
  }
}

代码示例来源:origin: com.netflix.dyno/dyno-core

connection.getContext().setMetadata("port", connection.getHost().getPort());

相关文章