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());
}
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;
}
Aggregations