Unverified Commit 21cc39c6 authored by 吴晟's avatar 吴晟 Committed by GitHub
Browse files

Merge pull request #616 from OpenSkywalking/feature/history-data-delete

Delete history data
parents 6ad2eca0 6a5172a4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,3 +37,4 @@ storage:
    cluster_nodes: {ES_ADDRESSES}
    index_shards_number: 2
    index_replicas_number: 0
    ttl: 7
+1 −0
Original line number Diff line number Diff line
@@ -37,3 +37,4 @@ ui:
#    cluster_nodes: localhost:9300
#    index_shards_number: 2
#    index_replicas_number: 0
#    ttl: 7
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ import org.elasticsearch.client.IndicesAdminClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.reindex.DeleteByQueryAction;
import org.elasticsearch.index.reindex.DeleteByQueryRequestBuilder;
import org.elasticsearch.transport.client.PreBuiltTransportClient;
import org.skywalking.apm.collector.client.Client;
import org.skywalking.apm.collector.client.ClientException;
@@ -146,6 +148,10 @@ public class ElasticSearchClient implements Client {
        return client.prepareGet(indexName, "type", id);
    }

    public DeleteByQueryRequestBuilder prepareDelete() {
        return DeleteByQueryAction.INSTANCE.newRequestBuilder(client);
    }

    public MultiGetRequestBuilder prepareMultiGet() {
        return client.prepareMultiGet();
    }
+9 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ package org.skywalking.apm.collector.core.util;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author peng-yongsheng
@@ -34,10 +35,18 @@ public class CollectionUtils {
        return list == null || list.size() == 0;
    }

    public static boolean isEmpty(Set set) {
        return set == null || set.size() == 0;
    }

    public static boolean isNotEmpty(List list) {
        return !isEmpty(list);
    }

    public static boolean isNotEmpty(Set set) {
        return !isEmpty(set);
    }

    public static boolean isNotEmpty(Map map) {
        return !isEmpty(map);
    }
+2 −0
Original line number Diff line number Diff line
@@ -29,4 +29,6 @@ public interface IPersistenceDAO<Insert, Update, DataImpl extends Data> extends
    Insert prepareBatchInsert(DataImpl data);

    Update prepareBatchUpdate(DataImpl data);

    void deleteHistory(Long startTimestamp, Long endTimestamp);
}
Loading