Search in sources :

Example 1 with LogLevelLoggerResponse

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

the class StormTopologyActionsImpl method convertLogLevelResponseToLogLevelInformation.

private LogLevelInformation convertLogLevelResponseToLogLevelInformation(LogLevelResponse response) {
    Map<String, LogLevelLoggerResponse> namedLoggerLevels = response.getNamedLoggerLevels();
    LogLevelLoggerResponse resp = namedLoggerLevels.get(ROOT_LOGGER_NAME);
    if (resp == null) {
        return LogLevelInformation.disabled();
    }
    return LogLevelInformation.enabled(LogLevel.valueOf(resp.getTargetLevel()), resp.getTimeoutEpoch());
}
Also used : LogLevelLoggerResponse(com.hortonworks.streamline.streams.storm.common.logger.LogLevelLoggerResponse)

Example 2 with LogLevelLoggerResponse

use of com.hortonworks.streamline.streams.storm.common.logger.LogLevelLoggerResponse 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)

Aggregations

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