Search in sources :

Example 1 with StormZkClusterState

use of com.alibaba.jstorm.cluster.StormZkClusterState in project jstorm by alibaba.

the class ServiceHandler method getSupervisorConf.

@Override
public String getSupervisorConf(String id) throws TException {
    Map<Object, Object> ret = new HashMap<>();
    ret.putAll(data.getConf());
    try {
        SupervisorInfo supervisorInfo = (SupervisorInfo) (((StormZkClusterState) this.data.getStormClusterState()).getObject(Cluster.supervisor_path(id), false));
        if (supervisorInfo != null && supervisorInfo.getSupervisorConf() != null) {
            ret.putAll(supervisorInfo.getSupervisorConf());
        } else {
            LOG.warn("supervisor conf not found in nimbus cache, supervisor id:{}, so fall back to nimbus conf", id);
        }
    } catch (Exception ex) {
        LOG.error("Error:", ex);
    }
    return JStormUtils.to_json(ret);
}
Also used : StormZkClusterState(com.alibaba.jstorm.cluster.StormZkClusterState) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) SupervisorInfo(com.alibaba.jstorm.daemon.supervisor.SupervisorInfo) InvalidParameterException(java.security.InvalidParameterException) FailedAssignTopologyException(com.alibaba.jstorm.utils.FailedAssignTopologyException) KeyNotFoundException(backtype.storm.generated.KeyNotFoundException) TException(org.apache.thrift.TException) IOException(java.io.IOException) AlreadyAliveException(backtype.storm.generated.AlreadyAliveException) TopologyAssignException(backtype.storm.generated.TopologyAssignException) FileNotFoundException(java.io.FileNotFoundException) NotAliveException(backtype.storm.generated.NotAliveException) InvalidTopologyException(backtype.storm.generated.InvalidTopologyException) KeyAlreadyExistsException(backtype.storm.generated.KeyAlreadyExistsException)

Aggregations

AlreadyAliveException (backtype.storm.generated.AlreadyAliveException)1 InvalidTopologyException (backtype.storm.generated.InvalidTopologyException)1 KeyAlreadyExistsException (backtype.storm.generated.KeyAlreadyExistsException)1 KeyNotFoundException (backtype.storm.generated.KeyNotFoundException)1 NotAliveException (backtype.storm.generated.NotAliveException)1 TopologyAssignException (backtype.storm.generated.TopologyAssignException)1 StormZkClusterState (com.alibaba.jstorm.cluster.StormZkClusterState)1 SupervisorInfo (com.alibaba.jstorm.daemon.supervisor.SupervisorInfo)1 FailedAssignTopologyException (com.alibaba.jstorm.utils.FailedAssignTopologyException)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 InvalidParameterException (java.security.InvalidParameterException)1 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 TException (org.apache.thrift.TException)1