Search in sources :

Example 1 with ApplicationReferenceAlarm

use of org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm in project incubator-skywalking by apache.

the class ApplicationReferenceAlarmEsPersistenceDAO method get.

@Override
public ApplicationReferenceAlarm get(String id) {
    GetResponse getResponse = getClient().prepareGet(ApplicationReferenceAlarmTable.TABLE, id).get();
    if (getResponse.isExists()) {
        ApplicationReferenceAlarm applicationReferenceAlarm = new ApplicationReferenceAlarm();
        applicationReferenceAlarm.setId(id);
        Map<String, Object> source = getResponse.getSource();
        applicationReferenceAlarm.setFrontApplicationId(((Number) source.get(ApplicationReferenceAlarmTable.COLUMN_FRONT_APPLICATION_ID)).intValue());
        applicationReferenceAlarm.setBehindApplicationId(((Number) source.get(ApplicationReferenceAlarmTable.COLUMN_BEHIND_APPLICATION_ID)).intValue());
        applicationReferenceAlarm.setSourceValue(((Number) source.get(ApplicationReferenceAlarmTable.COLUMN_SOURCE_VALUE)).intValue());
        applicationReferenceAlarm.setAlarmType(((Number) source.get(ApplicationReferenceAlarmTable.COLUMN_ALARM_TYPE)).intValue());
        applicationReferenceAlarm.setAlarmContent((String) source.get(ApplicationReferenceAlarmTable.COLUMN_ALARM_CONTENT));
        applicationReferenceAlarm.setLastTimeBucket(((Number) source.get(ApplicationReferenceAlarmTable.COLUMN_LAST_TIME_BUCKET)).longValue());
        return applicationReferenceAlarm;
    } else {
        return null;
    }
}
Also used : GetResponse(org.elasticsearch.action.get.GetResponse) ApplicationReferenceAlarm(org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm)

Example 2 with ApplicationReferenceAlarm

use of org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm in project incubator-skywalking by apache.

the class ApplicationReferenceMetricAlarmAssertWorker method newAlarmObject.

@Override
protected ApplicationReferenceAlarm newAlarmObject(String id, ApplicationReferenceMetric inputMetric) {
    ApplicationReferenceAlarm applicationReferenceAlarm = new ApplicationReferenceAlarm();
    applicationReferenceAlarm.setId(id + Const.ID_SPLIT + inputMetric.getFrontApplicationId() + Const.ID_SPLIT + inputMetric.getBehindApplicationId());
    applicationReferenceAlarm.setFrontApplicationId(inputMetric.getFrontApplicationId());
    applicationReferenceAlarm.setBehindApplicationId(inputMetric.getBehindApplicationId());
    return applicationReferenceAlarm;
}
Also used : ApplicationReferenceAlarm(org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm)

Example 3 with ApplicationReferenceAlarm

use of org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm in project incubator-skywalking by apache.

the class ApplicationReferenceAlarmH2PersistenceDAO method h2DataToStreamData.

@Override
protected ApplicationReferenceAlarm h2DataToStreamData(ResultSet resultSet) throws SQLException {
    ApplicationReferenceAlarm applicationReferenceAlarm = new ApplicationReferenceAlarm();
    applicationReferenceAlarm.setId(resultSet.getString(ApplicationReferenceAlarmTable.COLUMN_ID));
    applicationReferenceAlarm.setSourceValue(resultSet.getInt(ApplicationReferenceAlarmTable.COLUMN_SOURCE_VALUE));
    applicationReferenceAlarm.setAlarmType(resultSet.getInt(ApplicationReferenceAlarmTable.COLUMN_ALARM_TYPE));
    applicationReferenceAlarm.setFrontApplicationId(resultSet.getInt(ApplicationReferenceAlarmTable.COLUMN_FRONT_APPLICATION_ID));
    applicationReferenceAlarm.setBehindApplicationId(resultSet.getInt(ApplicationReferenceAlarmTable.COLUMN_BEHIND_APPLICATION_ID));
    applicationReferenceAlarm.setLastTimeBucket(resultSet.getLong(ApplicationReferenceAlarmTable.COLUMN_LAST_TIME_BUCKET));
    applicationReferenceAlarm.setAlarmContent(resultSet.getString(ApplicationReferenceAlarmTable.COLUMN_ALARM_CONTENT));
    return applicationReferenceAlarm;
}
Also used : ApplicationReferenceAlarm(org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm)

Aggregations

ApplicationReferenceAlarm (org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm)3 GetResponse (org.elasticsearch.action.get.GetResponse)1