wu-sheng commented on a change in pull request #7429:
URL: https://github.com/apache/skywalking/pull/7429#discussion_r685712930
##########
File path:
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/endpoint/EndpointTraffic.java
##########
@@ -101,7 +103,9 @@ public EndpointTraffic storage2Entity(Map<String, Object>
dbMap) {
public Map<String, Object> entity2Storage(EndpointTraffic storageData)
{
Map<String, Object> map = new HashMap<>();
map.put(SERVICE_ID, storageData.getServiceId());
- map.put(NAME, storageData.getName());
+ if (nonNull(storageData.getName())) {
+ map.put(NAME, storageData.getName());
+ }
Review comment:
I think this should not be added. Once this has error, the IDManager
would face NPE already.
##########
File path:
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/segment/SegmentRecord.java
##########
@@ -119,7 +121,9 @@ public String id() {
map.put(TRACE_ID, storageData.getTraceId());
map.put(SERVICE_ID, storageData.getServiceId());
map.put(SERVICE_INSTANCE_ID, storageData.getServiceInstanceId());
- map.put(ENDPOINT_NAME, storageData.getEndpointName());
+ if (nonNull(storageData.getEndpointName())) {
+ map.put(ENDPOINT_NAME, storageData.getEndpointName());
+ }
map.put(ENDPOINT_ID, storageData.getEndpointId());
Review comment:
I think this should not be added. Once this has error, the code already
has bug. Trace should not have no endpoint.
##########
File path:
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/service/ServiceTraffic.java
##########
@@ -115,7 +116,9 @@ public ServiceTraffic storage2Entity(final Map<String,
Object> dbMap) {
}
}
Map<String, Object> map = new HashMap<>();
- map.put(NAME, serviceName);
+ if (nonNull(serviceName)) {
+ map.put(NAME, serviceName);
+ }
Review comment:
I think this should not be added. Once this has error, the IDManager
would face NPE already.
##########
File path:
oap-server/server-storage-plugin/storage-zipkin-elasticsearch7-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/zipkin/ZipkinSpanRecord.java
##########
@@ -120,7 +122,9 @@ public String id() {
map.put(SPAN_ID, storageData.getSpanId());
map.put(SERVICE_ID, storageData.getServiceId());
map.put(SERVICE_INSTANCE_ID, storageData.getServiceInstanceId());
- map.put(ENDPOINT_NAME, storageData.getEndpointName());
+ if (nonNull(storageData.getEndpointName())) {
+ map.put(ENDPOINT_NAME, storageData.getEndpointName());
+ }
Review comment:
I think this should not be added. Once this has error, the code already
has bug. Trace should not have no endpoint.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]