use of org.elasticsearch.index.reindex.BulkByScrollResponse in project incubator-skywalking by apache.
the class InstanceReferenceAlarmEsPersistenceDAO method deleteHistory.
@Override
public void deleteHistory(Long startTimestamp, Long endTimestamp) {
long startTimeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(startTimestamp);
long endTimeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(endTimestamp);
BulkByScrollResponse response = getClient().prepareDelete(QueryBuilders.rangeQuery(InstanceReferenceAlarmTable.COLUMN_LAST_TIME_BUCKET).gte(startTimeBucket).lte(endTimeBucket), InstanceReferenceAlarmTable.TABLE).get();
long deleted = response.getDeleted();
logger.info("Delete {} rows history from {} index.", deleted, InstanceReferenceAlarmTable.TABLE);
}
use of org.elasticsearch.index.reindex.BulkByScrollResponse in project incubator-skywalking by apache.
the class ServiceReferenceAlarmEsPersistenceDAO method deleteHistory.
@Override
public void deleteHistory(Long startTimestamp, Long endTimestamp) {
long startTimeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(startTimestamp);
long endTimeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(endTimestamp);
BulkByScrollResponse response = getClient().prepareDelete(QueryBuilders.rangeQuery(ServiceReferenceAlarmTable.COLUMN_LAST_TIME_BUCKET).gte(startTimeBucket).lte(endTimeBucket), ServiceReferenceAlarmTable.TABLE).get();
long deleted = response.getDeleted();
logger.info("Delete {} rows history from {} index.", deleted, ServiceReferenceAlarmTable.TABLE);
}
use of org.elasticsearch.index.reindex.BulkByScrollResponse in project incubator-skywalking by apache.
the class ApplicationReferenceAlarmEsPersistenceDAO method deleteHistory.
@Override
public void deleteHistory(Long startTimestamp, Long endTimestamp) {
long startTimeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(startTimestamp);
long endTimeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(endTimestamp);
BulkByScrollResponse response = getClient().prepareDelete(QueryBuilders.rangeQuery(ApplicationReferenceAlarmTable.COLUMN_LAST_TIME_BUCKET).gte(startTimeBucket).lte(endTimeBucket), ApplicationReferenceAlarmTable.TABLE).get();
long deleted = response.getDeleted();
logger.info("Delete {} rows history from {} index.", deleted, ApplicationReferenceAlarmTable.TABLE);
}
use of org.elasticsearch.index.reindex.BulkByScrollResponse in project incubator-skywalking by apache.
the class InstanceReferenceAlarmListEsPersistenceDAO method deleteHistory.
@Override
public void deleteHistory(Long startTimestamp, Long endTimestamp) {
long startTimeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(startTimestamp);
long endTimeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(endTimestamp);
BulkByScrollResponse response = getClient().prepareDelete(QueryBuilders.rangeQuery(InstanceReferenceAlarmListTable.COLUMN_TIME_BUCKET).gte(startTimeBucket).lte(endTimeBucket), InstanceReferenceAlarmListTable.TABLE).get();
long deleted = response.getDeleted();
logger.info("Delete {} rows history from {} index.", deleted, InstanceReferenceAlarmListTable.TABLE);
}
use of org.elasticsearch.index.reindex.BulkByScrollResponse in project incubator-skywalking by apache.
the class AbstractPersistenceEsDAO method deleteHistory.
@Override
public final void deleteHistory(Long startTimestamp, Long endTimestamp) {
long startTimeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(startTimestamp);
long endTimeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(endTimestamp);
BulkByScrollResponse response = getClient().prepareDelete(QueryBuilders.rangeQuery(timeBucketColumnNameForDelete()).gte(startTimeBucket).lte(endTimeBucket), tableName()).get();
long deleted = response.getDeleted();
logger.info("Delete {} rows history from {} index.", deleted, tableName());
}
Aggregations