Search in sources :

Example 1 with ApplicationReferenceAlarmList

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

the class ApplicationReferenceAlarmListEsPersistenceDAO method get.

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

Example 2 with ApplicationReferenceAlarmList

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

the class ApplicationReferenceMetricAlarmToListNodeProcessor method process.

@Override
public void process(ApplicationReferenceAlarm applicationReferenceAlarm, Next<ApplicationReferenceAlarmList> next) {
    String id = applicationReferenceAlarm.getLastTimeBucket() + Const.ID_SPLIT + applicationReferenceAlarm.getSourceValue() + Const.ID_SPLIT + applicationReferenceAlarm.getAlarmType() + Const.ID_SPLIT + applicationReferenceAlarm.getFrontApplicationId() + Const.ID_SPLIT + applicationReferenceAlarm.getBehindApplicationId();
    ApplicationReferenceAlarmList applicationReferenceAlarmList = new ApplicationReferenceAlarmList();
    applicationReferenceAlarmList.setId(id);
    applicationReferenceAlarmList.setFrontApplicationId(applicationReferenceAlarm.getFrontApplicationId());
    applicationReferenceAlarmList.setBehindApplicationId(applicationReferenceAlarm.getBehindApplicationId());
    applicationReferenceAlarmList.setSourceValue(applicationReferenceAlarm.getSourceValue());
    applicationReferenceAlarmList.setAlarmType(applicationReferenceAlarm.getAlarmType());
    applicationReferenceAlarmList.setTimeBucket(applicationReferenceAlarm.getLastTimeBucket());
    applicationReferenceAlarmList.setAlarmContent(applicationReferenceAlarm.getAlarmContent());
    next.execute(applicationReferenceAlarmList);
}
Also used : ApplicationReferenceAlarmList(org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmList)

Example 3 with ApplicationReferenceAlarmList

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

the class ApplicationReferenceAlarmListH2PersistenceDAO method h2DataToStreamData.

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

Aggregations

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