use of org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm in project incubator-skywalking by apache.
the class ServiceAlarmEsPersistenceDAO method get.
@Override
public ServiceAlarm get(String id) {
GetResponse getResponse = getClient().prepareGet(ServiceAlarmTable.TABLE, id).get();
if (getResponse.isExists()) {
ServiceAlarm serviceAlarm = new ServiceAlarm();
serviceAlarm.setId(id);
Map<String, Object> source = getResponse.getSource();
serviceAlarm.setApplicationId(((Number) source.get(ServiceAlarmTable.COLUMN_APPLICATION_ID)).intValue());
serviceAlarm.setInstanceId(((Number) source.get(ServiceAlarmTable.COLUMN_INSTANCE_ID)).intValue());
serviceAlarm.setServiceId(((Number) source.get(ServiceAlarmTable.COLUMN_SERVICE_ID)).intValue());
serviceAlarm.setSourceValue(((Number) source.get(ServiceAlarmTable.COLUMN_SOURCE_VALUE)).intValue());
serviceAlarm.setAlarmType(((Number) source.get(ServiceAlarmTable.COLUMN_ALARM_TYPE)).intValue());
serviceAlarm.setAlarmContent((String) source.get(ServiceAlarmTable.COLUMN_ALARM_CONTENT));
serviceAlarm.setLastTimeBucket(((Number) source.get(ServiceAlarmTable.COLUMN_LAST_TIME_BUCKET)).longValue());
return serviceAlarm;
} else {
return null;
}
}
use of org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm in project incubator-skywalking by apache.
the class ServiceMetricAlarmAssertWorker method newAlarmObject.
@Override
protected ServiceAlarm newAlarmObject(String id, ServiceMetric inputMetric) {
ServiceAlarm serviceAlarm = new ServiceAlarm();
serviceAlarm.setId(id + Const.ID_SPLIT + inputMetric.getServiceId());
serviceAlarm.setApplicationId(inputMetric.getApplicationId());
serviceAlarm.setInstanceId(inputMetric.getInstanceId());
serviceAlarm.setServiceId(inputMetric.getServiceId());
return serviceAlarm;
}
use of org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm in project incubator-skywalking by apache.
the class ServiceAlarmH2PersistenceDAO method h2DataToStreamData.
@Override
protected ServiceAlarm h2DataToStreamData(ResultSet resultSet) throws SQLException {
ServiceAlarm serviceAlarm = new ServiceAlarm();
serviceAlarm.setId(resultSet.getString(ServiceAlarmTable.COLUMN_ID));
serviceAlarm.setSourceValue(resultSet.getInt(ServiceAlarmTable.COLUMN_SOURCE_VALUE));
serviceAlarm.setAlarmType(resultSet.getInt(ServiceAlarmTable.COLUMN_ALARM_TYPE));
serviceAlarm.setApplicationId(resultSet.getInt(ServiceAlarmTable.COLUMN_APPLICATION_ID));
serviceAlarm.setInstanceId(resultSet.getInt(ServiceAlarmTable.COLUMN_INSTANCE_ID));
serviceAlarm.setServiceId(resultSet.getInt(ServiceAlarmTable.COLUMN_SERVICE_ID));
serviceAlarm.setLastTimeBucket(resultSet.getLong(ServiceAlarmTable.COLUMN_LAST_TIME_BUCKET));
serviceAlarm.setAlarmContent(resultSet.getString(ServiceAlarmTable.COLUMN_ALARM_CONTENT));
return serviceAlarm;
}
Aggregations