private void reportContainerCountPerHost(Host host, Set<Integer> containerIds) { DYNAMIC_LOGGER.reportGaugeValue(nameFromHost(SEGMENT_STORE_HOST_CONTAINER_COUNT, host.toString()), containerIds.size()); }
private void reportHostFailures(Host failedHost) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(SEGMENT_STORE_HOST_FAILURES), 1); DYNAMIC_LOGGER.incCounterValue(nameFromHost(SEGMENT_STORE_HOST_FAILURES, failedHost.toString()), 1); // Set to 0 the number of containers for the failed host. DYNAMIC_LOGGER.reportGaugeValue(nameFromHost(SEGMENT_STORE_HOST_CONTAINER_COUNT, failedHost.toString()), 0); }
/** * Register Host to cluster. * * @param host Host to be part of cluster. */ @Override @Synchronized public void registerHost(Host host) { Preconditions.checkNotNull(host, "host"); Exceptions.checkArgument(!entryMap.containsKey(host), "host", "host is already registered to cluster."); String hostPath = ZKPaths.makePath(getPathPrefix(), host.toString()); PersistentNode node = new PersistentNode(client, CreateMode.EPHEMERAL, false, hostPath, SerializationUtils.serialize(host)); node.start(); //start creation of ephemeral node in background. entryMap.put(host, node); }