Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
AMBARI-25126.fix ambari-metric exception printed in namenode (#16)
* AMBARI-25126.fix ambari-metric exception printed in namenode

* Delete ambari-metrics.iml
  • Loading branch information
asagjj authored and avijayanhwx committed Apr 1, 2019
1 parent 4ca5ffd commit a197d284c583be1a96134215d61fbfc2ec62b66c
Showing 1 changed file with 4 additions and 0 deletions.
@@ -36,6 +36,10 @@ public MetricSinkWriteShardHostnameHashingStrategy(String hostname) {

@Override
public String findCollectorShard(List<String> collectorHosts) {
if(collectorHosts.size() ==0) {
LOG.warn("No metrics collectors alive, please check collector status!");
return "";
}
long index = hostnameHash % collectorHosts.size();
index = index < 0 ? index + collectorHosts.size() : index;
String collectorHost = collectorHosts.get((int) index);

0 comments on commit a197d28

Please sign in to comment.