use of com.ctrip.xpipe.endpoint.HostPort in project x-pipe by ctripcorp.
the class VersionMonitor method addRedis.
@Override
protected void addRedis(BaseSamplePlan<VersionInstanceResult> plan, String dcId, RedisMeta redisMeta) {
HostPort hostPort = new HostPort(redisMeta.getIp(), redisMeta.getPort());
log.debug("[addRedis]{}", hostPort);
plan.addRedis(dcId, redisMeta, new VersionInstanceResult());
}
use of com.ctrip.xpipe.endpoint.HostPort in project x-pipe by ctripcorp.
the class SentinelCollector4Keeper method collect.
@Override
public void collect(SentinelSample sentinelSample) {
String clusterId = sentinelSample.getSamplePlan().getClusterId();
String shardId = sentinelSample.getSamplePlan().getShardId();
sentinelSample.getSamplePlan().getHostPort2SampleResult().forEach(((hostPort, instanceSentinelResult) -> {
if (metaCache.inBackupDc(hostPort)) {
ClusterShardHostPort entry = new ClusterShardHostPort(clusterId, shardId, hostPort);
doCollect(entry, instanceSentinelResult);
}
}));
}
use of com.ctrip.xpipe.endpoint.HostPort in project x-pipe by ctripcorp.
the class DefaultRedisSessionManager method getInUseRedises.
private Set<HostPort> getInUseRedises() {
Set<HostPort> redisInUse = new HashSet<>();
List<DcMeta> dcMetas = new LinkedList<>(metaCache.getXpipeMeta().getDcs().values());
if (dcMetas.isEmpty())
return null;
for (DcMeta dcMeta : dcMetas) {
if (dcMeta == null)
break;
for (ClusterMeta clusterMeta : dcMeta.getClusters().values()) {
for (ShardMeta shardMeta : clusterMeta.getShards().values()) {
for (RedisMeta redisMeta : shardMeta.getRedises()) {
redisInUse.add(new HostPort(redisMeta.getIp(), redisMeta.getPort()));
}
}
}
}
return redisInUse;
}
use of com.ctrip.xpipe.endpoint.HostPort in project x-pipe by ctripcorp.
the class Sample method addInstanceSuccess.
@SuppressWarnings("unchecked")
public <C> void addInstanceSuccess(String host, int port, C context) {
BaseInstanceResult<C> instanceResult = samplePlan.findInstanceResult(new HostPort(host, port));
if (instanceResult != null && !instanceResult.isDone()) {
instanceResult.success(System.nanoTime(), context);
remainingRedisCount.decrementAndGet();
}
}
use of com.ctrip.xpipe.endpoint.HostPort in project x-pipe by ctripcorp.
the class Sample method addInstanceFail.
public <C> void addInstanceFail(String host, int port, Throwable th) {
BaseInstanceResult<C> instanceResult = samplePlan.findInstanceResult(new HostPort(host, port));
if (instanceResult != null && !instanceResult.isDone()) {
instanceResult.fail(System.nanoTime(), th);
remainingRedisCount.decrementAndGet();
}
}
Aggregations