use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.get.GetResponse in project incubator-skywalking by apache.
the class AbstractPersistenceEsDAO method get.
@Override
public final STREAM_DATA get(String id) {
GetResponse getResponse = getClient().prepareGet(tableName(), id).get();
if (getResponse.isExists()) {
STREAM_DATA streamData = esDataToStreamData(getResponse.getSource());
streamData.setId(id);
return streamData;
} else {
return null;
}
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.get.GetResponse in project incubator-skywalking by apache.
the class InstanceReferenceAlarmListEsPersistenceDAO method get.
@Override
public InstanceReferenceAlarmList get(String id) {
GetResponse getResponse = getClient().prepareGet(InstanceReferenceAlarmListTable.TABLE, id).get();
if (getResponse.isExists()) {
InstanceReferenceAlarmList serviceReferenceAlarmList = new InstanceReferenceAlarmList();
serviceReferenceAlarmList.setId(id);
Map<String, Object> source = getResponse.getSource();
serviceReferenceAlarmList.setFrontApplicationId(((Number) source.get(InstanceReferenceAlarmListTable.COLUMN_FRONT_APPLICATION_ID)).intValue());
serviceReferenceAlarmList.setBehindApplicationId(((Number) source.get(InstanceReferenceAlarmListTable.COLUMN_BEHIND_APPLICATION_ID)).intValue());
serviceReferenceAlarmList.setFrontInstanceId(((Number) source.get(InstanceReferenceAlarmListTable.COLUMN_FRONT_INSTANCE_ID)).intValue());
serviceReferenceAlarmList.setBehindInstanceId(((Number) source.get(InstanceReferenceAlarmListTable.COLUMN_BEHIND_INSTANCE_ID)).intValue());
serviceReferenceAlarmList.setSourceValue(((Number) source.get(InstanceReferenceAlarmListTable.COLUMN_SOURCE_VALUE)).intValue());
serviceReferenceAlarmList.setAlarmType(((Number) source.get(InstanceReferenceAlarmListTable.COLUMN_ALARM_TYPE)).intValue());
serviceReferenceAlarmList.setAlarmContent((String) source.get(InstanceReferenceAlarmListTable.COLUMN_ALARM_CONTENT));
serviceReferenceAlarmList.setTimeBucket(((Number) source.get(InstanceReferenceAlarmListTable.COLUMN_TIME_BUCKET)).longValue());
return serviceReferenceAlarmList;
} else {
return null;
}
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.get.GetResponse in project incubator-skywalking by apache.
the class ServiceAlarmListEsPersistenceDAO method get.
@Override
public ServiceAlarmList get(String id) {
GetResponse getResponse = getClient().prepareGet(ServiceAlarmListTable.TABLE, id).get();
if (getResponse.isExists()) {
ServiceAlarmList serviceAlarmList = new ServiceAlarmList();
serviceAlarmList.setId(id);
Map<String, Object> source = getResponse.getSource();
serviceAlarmList.setApplicationId(((Number) source.get(ServiceAlarmListTable.COLUMN_APPLICATION_ID)).intValue());
serviceAlarmList.setInstanceId(((Number) source.get(ServiceAlarmListTable.COLUMN_INSTANCE_ID)).intValue());
serviceAlarmList.setServiceId(((Number) source.get(ServiceAlarmListTable.COLUMN_SERVICE_ID)).intValue());
serviceAlarmList.setSourceValue(((Number) source.get(ServiceAlarmListTable.COLUMN_SOURCE_VALUE)).intValue());
serviceAlarmList.setAlarmType(((Number) source.get(ServiceAlarmListTable.COLUMN_ALARM_TYPE)).intValue());
serviceAlarmList.setAlarmContent((String) source.get(ServiceAlarmListTable.COLUMN_ALARM_CONTENT));
serviceAlarmList.setTimeBucket(((Number) source.get(ServiceAlarmListTable.COLUMN_TIME_BUCKET)).longValue());
return serviceAlarmList;
} else {
return null;
}
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.get.GetResponse in project incubator-skywalking by apache.
the class ApplicationEsCacheDAO method getApplication.
@Override
public Application getApplication(int applicationId) {
logger.debug("get application code, applicationId: {}", applicationId);
ElasticSearchClient client = getClient();
GetRequestBuilder getRequestBuilder = client.prepareGet(ApplicationTable.TABLE, String.valueOf(applicationId));
GetResponse getResponse = getRequestBuilder.get();
if (getResponse.isExists()) {
Application application = new Application();
application.setApplicationId(applicationId);
application.setApplicationCode((String) getResponse.getSource().get(ApplicationTable.COLUMN_APPLICATION_CODE));
application.setIsAddress(((Number) getResponse.getSource().get(ApplicationTable.COLUMN_IS_ADDRESS)).intValue());
return application;
}
return null;
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.get.GetResponse in project incubator-skywalking by apache.
the class NetworkAddressEsCacheDAO method getAddressById.
@Override
public String getAddressById(int addressId) {
logger.debug("get network address, address id: {}", addressId);
ElasticSearchClient client = getClient();
GetRequestBuilder getRequestBuilder = client.prepareGet(NetworkAddressTable.TABLE, String.valueOf(addressId));
GetResponse getResponse = getRequestBuilder.get();
if (getResponse.isExists()) {
return (String) getResponse.getSource().get(NetworkAddressTable.COLUMN_NETWORK_ADDRESS);
}
return Const.EMPTY_STRING;
}
Aggregations