use of org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm in project incubator-skywalking by apache.
the class ApplicationAlarmEsPersistenceDAO method get.
@Override
public ApplicationAlarm get(String id) {
GetResponse getResponse = getClient().prepareGet(ApplicationAlarmTable.TABLE, id).get();
if (getResponse.isExists()) {
ApplicationAlarm instanceAlarm = new ApplicationAlarm();
instanceAlarm.setId(id);
Map<String, Object> source = getResponse.getSource();
instanceAlarm.setApplicationId(((Number) source.get(ApplicationAlarmTable.COLUMN_APPLICATION_ID)).intValue());
instanceAlarm.setSourceValue(((Number) source.get(ApplicationAlarmTable.COLUMN_SOURCE_VALUE)).intValue());
instanceAlarm.setAlarmType(((Number) source.get(ApplicationAlarmTable.COLUMN_ALARM_TYPE)).intValue());
instanceAlarm.setAlarmContent((String) source.get(ApplicationAlarmTable.COLUMN_ALARM_CONTENT));
instanceAlarm.setLastTimeBucket(((Number) source.get(ApplicationAlarmTable.COLUMN_LAST_TIME_BUCKET)).longValue());
return instanceAlarm;
} else {
return null;
}
}
use of org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm in project incubator-skywalking by apache.
the class ApplicationMetricAlarmAssertWorker method newAlarmObject.
@Override
protected ApplicationAlarm newAlarmObject(String id, ApplicationMetric inputMetric) {
ApplicationAlarm applicationAlarm = new ApplicationAlarm();
applicationAlarm.setId(id + Const.ID_SPLIT + inputMetric.getApplicationId());
applicationAlarm.setApplicationId(inputMetric.getApplicationId());
return applicationAlarm;
}
use of org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm in project incubator-skywalking by apache.
the class ApplicationAlarmH2PersistenceDAO method h2DataToStreamData.
@Override
protected ApplicationAlarm h2DataToStreamData(ResultSet resultSet) throws SQLException {
ApplicationAlarm applicationAlarm = new ApplicationAlarm();
applicationAlarm.setId(resultSet.getString(ApplicationAlarmTable.COLUMN_ID));
applicationAlarm.setSourceValue(resultSet.getInt(ApplicationAlarmTable.COLUMN_SOURCE_VALUE));
applicationAlarm.setAlarmType(resultSet.getInt(ApplicationAlarmTable.COLUMN_ALARM_TYPE));
applicationAlarm.setApplicationId(resultSet.getInt(ApplicationAlarmTable.COLUMN_APPLICATION_ID));
applicationAlarm.setLastTimeBucket(resultSet.getLong(ApplicationAlarmTable.COLUMN_LAST_TIME_BUCKET));
applicationAlarm.setAlarmContent(resultSet.getString(ApplicationAlarmTable.COLUMN_ALARM_CONTENT));
return applicationAlarm;
}
Aggregations