Search in sources :

Example 1 with LogLevelResponse

use of com.hortonworks.streamline.streams.storm.common.logger.LogLevelResponse in project streamline by hortonworks.

the class StormRestAPIClient method buildLogLevelResponse.

private LogLevelResponse buildLogLevelResponse(Map<String, Object> logLevelResponseMap) {
    Map<String, Object> loggerToLevel = (Map<String, Object>) logLevelResponseMap.get("namedLoggerLevels");
    if (loggerToLevel == null) {
        return new LogLevelResponse();
    }
    LogLevelResponse response = new LogLevelResponse();
    loggerToLevel.forEach((logger, level) -> {
        LogLevelLoggerResponse loggerResponse = LogLevelLoggerResponse.of((Map<String, Object>) level);
        response.addLoggerResponse(logger, loggerResponse);
    });
    return response;
}
Also used : LogLevelLoggerResponse(com.hortonworks.streamline.streams.storm.common.logger.LogLevelLoggerResponse) LogLevelResponse(com.hortonworks.streamline.streams.storm.common.logger.LogLevelResponse) MultivaluedHashMap(javax.ws.rs.core.MultivaluedHashMap) Map(java.util.Map)

Example 2 with LogLevelResponse

use of com.hortonworks.streamline.streams.storm.common.logger.LogLevelResponse in project streamline by hortonworks.

the class StormTopologyActionsImpl method configureLogLevel.

@Override
public LogLevelInformation configureLogLevel(TopologyLayout topology, LogLevel targetLogLevel, int durationSecs, String asUser) throws Exception {
    String stormTopologyId = StormTopologyUtil.findStormTopologyId(client, topology.getId(), asUser);
    if (StringUtils.isEmpty(stormTopologyId)) {
        return null;
    }
    LogLevelResponse response = client.configureLog(stormTopologyId, ROOT_LOGGER_NAME, targetLogLevel.name(), durationSecs, asUser);
    return convertLogLevelResponseToLogLevelInformation(response);
}
Also used : LogLevelResponse(com.hortonworks.streamline.streams.storm.common.logger.LogLevelResponse)

Example 3 with LogLevelResponse

use of com.hortonworks.streamline.streams.storm.common.logger.LogLevelResponse in project streamline by hortonworks.

the class StormTopologyActionsImpl method getLogLevel.

@Override
public LogLevelInformation getLogLevel(TopologyLayout topology, String asUser) throws Exception {
    String stormTopologyId = StormTopologyUtil.findStormTopologyId(client, topology.getId(), asUser);
    if (StringUtils.isEmpty(stormTopologyId)) {
        return null;
    }
    LogLevelResponse response = client.getLogLevel(stormTopologyId, asUser);
    return convertLogLevelResponseToLogLevelInformation(response);
}
Also used : LogLevelResponse(com.hortonworks.streamline.streams.storm.common.logger.LogLevelResponse)

Aggregations

LogLevelResponse (com.hortonworks.streamline.streams.storm.common.logger.LogLevelResponse)3 LogLevelLoggerResponse (com.hortonworks.streamline.streams.storm.common.logger.LogLevelLoggerResponse)1 Map (java.util.Map)1 MultivaluedHashMap (javax.ws.rs.core.MultivaluedHashMap)1