You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/08/09 13:35:50 UTC

[skywalking] branch polish created (now 82dbede)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a change to branch polish
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


      at 82dbede  Remove statement, version, and endtime from segment entity.

This branch includes the following new commits:

     new 82dbede  Remove statement, version, and endtime from segment entity.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[skywalking] 01/01: Remove statement, version, and endtime from segment entity.

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch polish
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit 82dbede2eed431f71c4e2a722041c139b25e7f5c
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Mon Aug 9 21:34:51 2021 +0800

    Remove statement, version, and endtime from segment entity.
    
    * Trace segment wouldn't be recognized as a TopN sample service. Add through #4694 experimentally, but it caused performance impact.
    * Remove `version` and `endTime` in the segment entity. Reduce indexing payload.
---
 CHANGES.md                                         |  5 +++-
 .../parser/listener/SegmentAnalysisListener.java   |  2 --
 .../analysis/manual/segment/SegmentDispatcher.java |  2 --
 .../analysis/manual/segment/SegmentRecord.java     | 28 +---------------------
 .../skywalking/oap/server/core/source/Segment.java |  6 -----
 .../query/ProfileThreadSnapshotQueryEsDAO.java     |  2 --
 .../elasticsearch/query/TraceQueryEsDAO.java       |  2 --
 .../influxdb/query/ProfileThreadSnapshotQuery.java | 10 +++-----
 .../storage/plugin/influxdb/query/TraceQuery.java  | 10 +++-----
 .../h2/dao/H2ProfileThreadSnapshotQueryDAO.java    |  2 --
 .../plugin/jdbc/h2/dao/H2SegmentRecordBuilder.java | 14 -----------
 .../plugin/jdbc/h2/dao/H2TraceQueryDAO.java        |  6 +----
 12 files changed, 12 insertions(+), 77 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 53a3e47..3e4bc9c 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -17,9 +17,12 @@ Release Notes.
   1.21.
 * kubernetes java client upgrade from 12.0.1 to 13.0.0
 * Add `event` http receiver
-* Support Metric level function `serviceRelation` in `MAL`. 
+* Support Metric level function `serviceRelation` in `MAL`.
 * Support envoy metrics binding into the topology.
 * Fix openapi-definitions folder not being read correctly.
+* Trace segment wouldn't be recognized as a TopN sample service. Add through #4694 experimentally, but it caused
+  performance impact.
+* Remove `version` and `endTime` in the segment entity. Reduce indexing payload. 
 
 #### UI
 
diff --git a/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SegmentAnalysisListener.java b/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SegmentAnalysisListener.java
index 4c8c96d..7085a33 100644
--- a/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SegmentAnalysisListener.java
+++ b/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SegmentAnalysisListener.java
@@ -98,10 +98,8 @@ public class SegmentAnalysisListener implements FirstAnalysisListener, EntryAnal
         segment.setLatency(duration);
         segment.setStartTime(startTimestamp);
         segment.setTimeBucket(timeBucket);
-        segment.setEndTime(endTimestamp);
         segment.setIsError(BooleanUtils.booleanToValue(isError));
         segment.setDataBinary(segmentObject.toByteArray());
-        segment.setVersion(3);
 
         endpointName = namingControl.formatEndpointName(serviceName, span.getOperationName());
         endpointId = IDManager.EndpointID.buildId(
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentDispatcher.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentDispatcher.java
index 7f7f632..899c7ec 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentDispatcher.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentDispatcher.java
@@ -35,12 +35,10 @@ public class SegmentDispatcher implements SourceDispatcher<Segment> {
         segment.setEndpointName(source.getEndpointName());
         segment.setEndpointId(source.getEndpointId());
         segment.setStartTime(source.getStartTime());
-        segment.setEndTime(source.getEndTime());
         segment.setLatency(source.getLatency());
         segment.setIsError(source.getIsError());
         segment.setDataBinary(source.getDataBinary());
         segment.setTimeBucket(source.getTimeBucket());
-        segment.setVersion(source.getVersion());
         segment.setTagsRawData(source.getTags());
         segment.setTags(Tag.Util.toStringList(source.getTags()));
 
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentRecord.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentRecord.java
index 0603f94..7af4419 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentRecord.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentRecord.java
@@ -22,7 +22,6 @@ import java.util.Base64;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import joptsimple.internal.Strings;
 import lombok.Getter;
 import lombok.Setter;
 import org.apache.skywalking.apm.util.StringUtil;
@@ -30,7 +29,6 @@ import org.apache.skywalking.oap.server.core.Const;
 import org.apache.skywalking.oap.server.core.analysis.Stream;
 import org.apache.skywalking.oap.server.core.analysis.manual.searchtag.Tag;
 import org.apache.skywalking.oap.server.core.analysis.record.Record;
-import org.apache.skywalking.oap.server.core.analysis.topn.TopN;
 import org.apache.skywalking.oap.server.core.analysis.worker.RecordStreamProcessor;
 import org.apache.skywalking.oap.server.core.source.DefaultScopeDefine;
 import org.apache.skywalking.oap.server.core.storage.StorageHashMapBuilder;
@@ -50,11 +48,9 @@ public class SegmentRecord extends Record {
     public static final String ENDPOINT_NAME = "endpoint_name";
     public static final String ENDPOINT_ID = "endpoint_id";
     public static final String START_TIME = "start_time";
-    public static final String END_TIME = "end_time";
     public static final String LATENCY = "latency";
     public static final String IS_ERROR = "is_error";
     public static final String DATA_BINARY = "data_binary";
-    public static final String VERSION = "version";
     public static final String TAGS = "tags";
 
     @Setter
@@ -67,10 +63,6 @@ public class SegmentRecord extends Record {
     private String traceId;
     @Setter
     @Getter
-    @Column(columnName = TopN.STATEMENT)
-    private String statement;
-    @Setter
-    @Getter
     @Column(columnName = SERVICE_ID)
     private String serviceId;
     @Setter
@@ -91,11 +83,7 @@ public class SegmentRecord extends Record {
     private long startTime;
     @Setter
     @Getter
-    @Column(columnName = END_TIME)
-    private long endTime;
-    @Setter
-    @Getter
-    @Column(columnName = LATENCY, dataType = Column.ValueDataType.SAMPLED_RECORD)
+    @Column(columnName = LATENCY)
     private int latency;
     @Setter
     @Getter
@@ -107,10 +95,6 @@ public class SegmentRecord extends Record {
     private byte[] dataBinary;
     @Setter
     @Getter
-    @Column(columnName = VERSION, storageOnly = true)
-    private int version;
-    @Setter
-    @Getter
     @Column(columnName = TAGS)
     private List<String> tags;
     /**
@@ -130,20 +114,14 @@ public class SegmentRecord extends Record {
 
         @Override
         public Map<String, Object> entity2Storage(SegmentRecord storageData) {
-            storageData.statement = Strings.join(new String[] {
-                storageData.endpointName,
-                storageData.traceId
-            }, " - ");
             Map<String, Object> map = new HashMap<>();
             map.put(SEGMENT_ID, storageData.getSegmentId());
             map.put(TRACE_ID, storageData.getTraceId());
-            map.put(TopN.STATEMENT, storageData.getStatement());
             map.put(SERVICE_ID, storageData.getServiceId());
             map.put(SERVICE_INSTANCE_ID, storageData.getServiceInstanceId());
             map.put(ENDPOINT_NAME, storageData.getEndpointName());
             map.put(ENDPOINT_ID, storageData.getEndpointId());
             map.put(START_TIME, storageData.getStartTime());
-            map.put(END_TIME, storageData.getEndTime());
             map.put(LATENCY, storageData.getLatency());
             map.put(IS_ERROR, storageData.getIsError());
             map.put(TIME_BUCKET, storageData.getTimeBucket());
@@ -152,7 +130,6 @@ public class SegmentRecord extends Record {
             } else {
                 map.put(DATA_BINARY, new String(Base64.getEncoder().encode(storageData.getDataBinary())));
             }
-            map.put(VERSION, storageData.getVersion());
             map.put(TAGS, storageData.getTags());
             return map;
         }
@@ -162,13 +139,11 @@ public class SegmentRecord extends Record {
             SegmentRecord record = new SegmentRecord();
             record.setSegmentId((String) dbMap.get(SEGMENT_ID));
             record.setTraceId((String) dbMap.get(TRACE_ID));
-            record.setStatement((String) dbMap.get(TopN.STATEMENT));
             record.setServiceId((String) dbMap.get(SERVICE_ID));
             record.setServiceInstanceId((String) dbMap.get(SERVICE_INSTANCE_ID));
             record.setEndpointName((String) dbMap.get(ENDPOINT_NAME));
             record.setEndpointId((String) dbMap.get(ENDPOINT_ID));
             record.setStartTime(((Number) dbMap.get(START_TIME)).longValue());
-            record.setEndTime(((Number) dbMap.get(END_TIME)).longValue());
             record.setLatency(((Number) dbMap.get(LATENCY)).intValue());
             record.setIsError(((Number) dbMap.get(IS_ERROR)).intValue());
             record.setTimeBucket(((Number) dbMap.get(TIME_BUCKET)).longValue());
@@ -177,7 +152,6 @@ public class SegmentRecord extends Record {
             } else {
                 record.setDataBinary(Base64.getDecoder().decode((String) dbMap.get(DATA_BINARY)));
             }
-            record.setVersion(((Number) dbMap.get(VERSION)).intValue());
             // Don't read the tags as they has been in the data binary already.
             return record;
         }
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Segment.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Segment.java
index c135bb6..8715abf 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Segment.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Segment.java
@@ -62,9 +62,6 @@ public class Segment extends Source {
     private long startTime;
     @Setter
     @Getter
-    private long endTime;
-    @Setter
-    @Getter
     private int latency;
     @Setter
     @Getter
@@ -74,8 +71,5 @@ public class Segment extends Source {
     private byte[] dataBinary;
     @Setter
     @Getter
-    private int version;
-    @Setter
-    @Getter
     private List<Tag> tags = new ArrayList<>();
 }
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/ProfileThreadSnapshotQueryEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/ProfileThreadSnapshotQueryEsDAO.java
index b3ec95d..0a86efd 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/ProfileThreadSnapshotQueryEsDAO.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/ProfileThreadSnapshotQueryEsDAO.java
@@ -183,14 +183,12 @@ public class ProfileThreadSnapshotQueryEsDAO extends EsDAO implements IProfileTh
         segmentRecord.setServiceId((String) searchHit.getSourceAsMap().get(SegmentRecord.SERVICE_ID));
         segmentRecord.setEndpointName((String) searchHit.getSourceAsMap().get(SegmentRecord.ENDPOINT_NAME));
         segmentRecord.setStartTime(((Number) searchHit.getSourceAsMap().get(SegmentRecord.START_TIME)).longValue());
-        segmentRecord.setEndTime(((Number) searchHit.getSourceAsMap().get(SegmentRecord.END_TIME)).longValue());
         segmentRecord.setLatency(((Number) searchHit.getSourceAsMap().get(SegmentRecord.LATENCY)).intValue());
         segmentRecord.setIsError(((Number) searchHit.getSourceAsMap().get(SegmentRecord.IS_ERROR)).intValue());
         String dataBinaryBase64 = (String) searchHit.getSourceAsMap().get(SegmentRecord.DATA_BINARY);
         if (!Strings.isNullOrEmpty(dataBinaryBase64)) {
             segmentRecord.setDataBinary(Base64.getDecoder().decode(dataBinaryBase64));
         }
-        segmentRecord.setVersion(((Number) searchHit.getSourceAsMap().get(SegmentRecord.VERSION)).intValue());
         return segmentRecord;
     }
 
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/TraceQueryEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/TraceQueryEsDAO.java
index e1948f6..0127969 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/TraceQueryEsDAO.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/TraceQueryEsDAO.java
@@ -176,14 +176,12 @@ public class TraceQueryEsDAO extends EsDAO implements ITraceQueryDAO {
             segmentRecord.setServiceId((String) searchHit.getSourceAsMap().get(SegmentRecord.SERVICE_ID));
             segmentRecord.setEndpointName((String) searchHit.getSourceAsMap().get(SegmentRecord.ENDPOINT_NAME));
             segmentRecord.setStartTime(((Number) searchHit.getSourceAsMap().get(SegmentRecord.START_TIME)).longValue());
-            segmentRecord.setEndTime(((Number) searchHit.getSourceAsMap().get(SegmentRecord.END_TIME)).longValue());
             segmentRecord.setLatency(((Number) searchHit.getSourceAsMap().get(SegmentRecord.LATENCY)).intValue());
             segmentRecord.setIsError(((Number) searchHit.getSourceAsMap().get(SegmentRecord.IS_ERROR)).intValue());
             String dataBinaryBase64 = (String) searchHit.getSourceAsMap().get(SegmentRecord.DATA_BINARY);
             if (!Strings.isNullOrEmpty(dataBinaryBase64)) {
                 segmentRecord.setDataBinary(Base64.getDecoder().decode(dataBinaryBase64));
             }
-            segmentRecord.setVersion(((Number) searchHit.getSourceAsMap().get(SegmentRecord.VERSION)).intValue());
             segmentRecords.add(segmentRecord);
         }
         return segmentRecords;
diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/ProfileThreadSnapshotQuery.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/ProfileThreadSnapshotQuery.java
index 040074f..437af48 100644
--- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/ProfileThreadSnapshotQuery.java
+++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/ProfileThreadSnapshotQuery.java
@@ -169,11 +169,9 @@ public class ProfileThreadSnapshotQuery implements IProfileThreadSnapshotQueryDA
             .column(SegmentRecord.SERVICE_ID)
             .column(SegmentRecord.ENDPOINT_NAME)
             .column(SegmentRecord.START_TIME)
-            .column(SegmentRecord.END_TIME)
             .column(SegmentRecord.LATENCY)
             .column(SegmentRecord.IS_ERROR)
             .column(SegmentRecord.DATA_BINARY)
-            .column(SegmentRecord.VERSION)
             .from(client.getDatabase(), SegmentRecord.INDEX_NAME)
             .where();
 
@@ -194,12 +192,10 @@ public class ProfileThreadSnapshotQuery implements IProfileThreadSnapshotQueryDA
         segmentRecord.setServiceId((String) values.get(3));
         segmentRecord.setEndpointName((String) values.get(4));
         segmentRecord.setStartTime(((Number) values.get(5)).longValue());
-        segmentRecord.setEndTime(((Number) values.get(6)).longValue());
-        segmentRecord.setLatency(((Number) values.get(7)).intValue());
-        segmentRecord.setIsError(((Number) values.get(8)).intValue());
-        segmentRecord.setVersion(((Number) values.get(10)).intValue());
+        segmentRecord.setLatency(((Number) values.get(6)).intValue());
+        segmentRecord.setIsError(((Number) values.get(7)).intValue());
 
-        final String base64 = (String) values.get(9);
+        final String base64 = (String) values.get(8);
         if (!Strings.isNullOrEmpty(base64)) {
             segmentRecord.setDataBinary(Base64.getDecoder().decode(base64));
         }
diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/TraceQuery.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/TraceQuery.java
index 135e84f..a523bd7 100644
--- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/TraceQuery.java
+++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/TraceQuery.java
@@ -184,11 +184,9 @@ public class TraceQuery implements ITraceQueryDAO {
                                                              .column(SegmentRecord.SERVICE_INSTANCE_ID)
                                                              .column(SegmentRecord.ENDPOINT_NAME)
                                                              .column(SegmentRecord.START_TIME)
-                                                             .column(SegmentRecord.END_TIME)
                                                              .column(SegmentRecord.LATENCY)
                                                              .column(SegmentRecord.IS_ERROR)
                                                              .column(SegmentRecord.DATA_BINARY)
-                                                             .column(SegmentRecord.VERSION)
                                                              .from(client.getDatabase(), SegmentRecord.INDEX_NAME)
                                                              .where();
 
@@ -210,12 +208,10 @@ public class TraceQuery implements ITraceQueryDAO {
             segmentRecord.setServiceInstanceId((String) values.get(4));
             segmentRecord.setEndpointName((String) values.get(5));
             segmentRecord.setStartTime(((Number) values.get(6)).longValue());
-            segmentRecord.setEndTime(((Number) values.get(7)).longValue());
-            segmentRecord.setLatency(((Number) values.get(8)).intValue());
-            segmentRecord.setIsError(((Number) values.get(9)).intValue());
-            segmentRecord.setVersion(((Number) values.get(11)).intValue());
+            segmentRecord.setLatency(((Number) values.get(7)).intValue());
+            segmentRecord.setIsError(((Number) values.get(8)).intValue());
 
-            String base64 = (String) values.get(10);
+            String base64 = (String) values.get(9);
             if (!Strings.isNullOrEmpty(base64)) {
                 segmentRecord.setDataBinary(Base64.getDecoder().decode(base64));
             }
diff --git a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2ProfileThreadSnapshotQueryDAO.java b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2ProfileThreadSnapshotQueryDAO.java
index 9791673..466379e 100644
--- a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2ProfileThreadSnapshotQueryDAO.java
+++ b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2ProfileThreadSnapshotQueryDAO.java
@@ -178,14 +178,12 @@ public class H2ProfileThreadSnapshotQueryDAO implements IProfileThreadSnapshotQu
                     segmentRecord.setServiceInstanceId(resultSet.getString(SegmentRecord.SERVICE_INSTANCE_ID));
                     segmentRecord.setEndpointName(resultSet.getString(SegmentRecord.ENDPOINT_NAME));
                     segmentRecord.setStartTime(resultSet.getLong(SegmentRecord.START_TIME));
-                    segmentRecord.setEndTime(resultSet.getLong(SegmentRecord.END_TIME));
                     segmentRecord.setLatency(resultSet.getInt(SegmentRecord.LATENCY));
                     segmentRecord.setIsError(resultSet.getInt(SegmentRecord.IS_ERROR));
                     String dataBinaryBase64 = resultSet.getString(SegmentRecord.DATA_BINARY);
                     if (!Strings.isNullOrEmpty(dataBinaryBase64)) {
                         segmentRecord.setDataBinary(Base64.getDecoder().decode(dataBinaryBase64));
                     }
-                    segmentRecord.setVersion(resultSet.getInt(SegmentRecord.VERSION));
                     return segmentRecord;
                 }
             }
diff --git a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2SegmentRecordBuilder.java b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2SegmentRecordBuilder.java
index 54afcf0..a712cc7 100644
--- a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2SegmentRecordBuilder.java
+++ b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2SegmentRecordBuilder.java
@@ -22,18 +22,15 @@ import java.util.Base64;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import joptsimple.internal.Strings;
 import org.apache.skywalking.apm.util.StringUtil;
 import org.apache.skywalking.oap.server.core.Const;
 import org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord;
 import org.apache.skywalking.oap.server.core.analysis.record.Record;
-import org.apache.skywalking.oap.server.core.analysis.topn.TopN;
 import org.apache.skywalking.oap.server.library.util.CollectionUtils;
 
 import static org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord.DATA_BINARY;
 import static org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord.ENDPOINT_ID;
 import static org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord.ENDPOINT_NAME;
-import static org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord.END_TIME;
 import static org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord.IS_ERROR;
 import static org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord.LATENCY;
 import static org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord.SEGMENT_ID;
@@ -43,7 +40,6 @@ import static org.apache.skywalking.oap.server.core.analysis.manual.segment.Segm
 import static org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord.TAGS;
 import static org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord.TIME_BUCKET;
 import static org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord.TRACE_ID;
-import static org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord.VERSION;
 
 /**
  * H2/MySQL is different from standard {@link org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord.Builder},
@@ -60,20 +56,14 @@ public class H2SegmentRecordBuilder extends AbstractSearchTagBuilder<Record> {
     @Override
     public Map<String, Object> entity2Storage(Record record) {
         SegmentRecord storageData = (SegmentRecord) record;
-        storageData.setStatement(Strings.join(new String[] {
-            storageData.getEndpointName(),
-            storageData.getTraceId()
-        }, " - "));
         Map<String, Object> map = new HashMap<>();
         map.put(SEGMENT_ID, storageData.getSegmentId());
         map.put(TRACE_ID, storageData.getTraceId());
-        map.put(TopN.STATEMENT, storageData.getStatement());
         map.put(SERVICE_ID, storageData.getServiceId());
         map.put(SERVICE_INSTANCE_ID, storageData.getServiceInstanceId());
         map.put(ENDPOINT_NAME, storageData.getEndpointName());
         map.put(ENDPOINT_ID, storageData.getEndpointId());
         map.put(START_TIME, storageData.getStartTime());
-        map.put(END_TIME, storageData.getEndTime());
         map.put(LATENCY, storageData.getLatency());
         map.put(IS_ERROR, storageData.getIsError());
         map.put(TIME_BUCKET, storageData.getTimeBucket());
@@ -82,7 +72,6 @@ public class H2SegmentRecordBuilder extends AbstractSearchTagBuilder<Record> {
         } else {
             map.put(DATA_BINARY, new String(Base64.getEncoder().encode(storageData.getDataBinary())));
         }
-        map.put(VERSION, storageData.getVersion());
         analysisSearchTag(storageData.getTagsRawData(), map);
         return map;
     }
@@ -92,13 +81,11 @@ public class H2SegmentRecordBuilder extends AbstractSearchTagBuilder<Record> {
         SegmentRecord record = new SegmentRecord();
         record.setSegmentId((String) dbMap.get(SEGMENT_ID));
         record.setTraceId((String) dbMap.get(TRACE_ID));
-        record.setStatement((String) dbMap.get(TopN.STATEMENT));
         record.setServiceId((String) dbMap.get(SERVICE_ID));
         record.setServiceInstanceId((String) dbMap.get(SERVICE_INSTANCE_ID));
         record.setEndpointName((String) dbMap.get(ENDPOINT_NAME));
         record.setEndpointId((String) dbMap.get(ENDPOINT_ID));
         record.setStartTime(((Number) dbMap.get(START_TIME)).longValue());
-        record.setEndTime(((Number) dbMap.get(END_TIME)).longValue());
         record.setLatency(((Number) dbMap.get(LATENCY)).intValue());
         record.setIsError(((Number) dbMap.get(IS_ERROR)).intValue());
         record.setTimeBucket(((Number) dbMap.get(TIME_BUCKET)).longValue());
@@ -107,7 +94,6 @@ public class H2SegmentRecordBuilder extends AbstractSearchTagBuilder<Record> {
         } else {
             record.setDataBinary(Base64.getDecoder().decode((String) dbMap.get(DATA_BINARY)));
         }
-        record.setVersion(((Number) dbMap.get(VERSION)).intValue());
         // Don't read the tags as they has been in the data binary already.
         return record;
     }
diff --git a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2TraceQueryDAO.java b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2TraceQueryDAO.java
index 7838371..c533c9c 100644
--- a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2TraceQueryDAO.java
+++ b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2TraceQueryDAO.java
@@ -225,11 +225,9 @@ public class H2TraceQueryDAO implements ITraceQueryDAO {
                             SegmentRecord.SERVICE_INSTANCE_ID + ", " +
                             SegmentRecord.ENDPOINT_NAME + ", " +
                             SegmentRecord.START_TIME + ", " +
-                            SegmentRecord.END_TIME + ", " +
                             SegmentRecord.LATENCY + ", " +
                             SegmentRecord.IS_ERROR + ", " +
-                            SegmentRecord.DATA_BINARY + ", " +
-                            SegmentRecord.VERSION +  " from " +
+                            SegmentRecord.DATA_BINARY + " from " +
                             SegmentRecord.INDEX_NAME + " where " + SegmentRecord.TRACE_ID + " = ?", traceId
             )) {
                 while (resultSet.next()) {
@@ -240,14 +238,12 @@ public class H2TraceQueryDAO implements ITraceQueryDAO {
                     segmentRecord.setServiceInstanceId(resultSet.getString(SegmentRecord.SERVICE_INSTANCE_ID));
                     segmentRecord.setEndpointName(resultSet.getString(SegmentRecord.ENDPOINT_NAME));
                     segmentRecord.setStartTime(resultSet.getLong(SegmentRecord.START_TIME));
-                    segmentRecord.setEndTime(resultSet.getLong(SegmentRecord.END_TIME));
                     segmentRecord.setLatency(resultSet.getInt(SegmentRecord.LATENCY));
                     segmentRecord.setIsError(resultSet.getInt(SegmentRecord.IS_ERROR));
                     String dataBinaryBase64 = resultSet.getString(SegmentRecord.DATA_BINARY);
                     if (!Strings.isNullOrEmpty(dataBinaryBase64)) {
                         segmentRecord.setDataBinary(Base64.getDecoder().decode(dataBinaryBase64));
                     }
-                    segmentRecord.setVersion(resultSet.getInt(SegmentRecord.VERSION));
                     segmentRecords.add(segmentRecord);
                 }
             }