diff --git a/src/main/java/com/nhn/pinpoint/web/applicationmap/rawdata/TransactionFlowStatistics.java b/src/main/java/com/nhn/pinpoint/web/applicationmap/rawdata/TransactionFlowStatistics.java index 6d5395062..88e6ca21d 100644 --- a/src/main/java/com/nhn/pinpoint/web/applicationmap/rawdata/TransactionFlowStatistics.java +++ b/src/main/java/com/nhn/pinpoint/web/applicationmap/rawdata/TransactionFlowStatistics.java @@ -17,18 +17,18 @@ import com.nhn.pinpoint.web.util.Mergeable; */ public class TransactionFlowStatistics implements Mergeable { - protected String id; - protected String from; - protected ServiceType fromServiceType; - protected String to; - protected ServiceType toServiceType; + private String id; + private String from; + private ServiceType fromServiceType; + private String to; + private ServiceType toServiceType; /** * key = hostname */ - protected Map toHostList; - - protected Set toAgentSet; + private Map toHostList; + + private Set toAgentSet; public TransactionFlowStatistics(String from, short fromServiceType, String to, short toServiceType) { this.from = from; diff --git a/src/main/java/com/nhn/pinpoint/web/service/FilteredApplicationMapServiceImpl.java b/src/main/java/com/nhn/pinpoint/web/service/FilteredApplicationMapServiceImpl.java index 3e7410e1d..312ce2ae0 100755 --- a/src/main/java/com/nhn/pinpoint/web/service/FilteredApplicationMapServiceImpl.java +++ b/src/main/java/com/nhn/pinpoint/web/service/FilteredApplicationMapServiceImpl.java @@ -23,7 +23,6 @@ import com.nhn.pinpoint.common.bo.SpanBo; import com.nhn.pinpoint.common.bo.SpanEventBo; import com.nhn.pinpoint.web.applicationmap.ApplicationMap; import com.nhn.pinpoint.web.applicationmap.rawdata.TransactionFlowStatistics; -import com.nhn.pinpoint.web.applicationmap.rawdata.TransactionFlowStatisticsUtils; import com.nhn.pinpoint.web.dao.AgentInfoDao; import com.nhn.pinpoint.web.dao.ApplicationIndexDao; import com.nhn.pinpoint.web.dao.ApplicationTraceIndexDao; @@ -42,7 +41,7 @@ import com.nhn.pinpoint.web.vo.TransactionId; @Service public class FilteredApplicationMapServiceImpl implements FilteredApplicationMapService { - private Logger logger = LoggerFactory.getLogger(this.getClass()); + private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private TraceDao traceDao; @@ -290,7 +289,9 @@ public class FilteredApplicationMapServiceImpl implements FilteredApplicationMap timeSeriesStore.add(spanEventStatId, span.getStartTime() + spanEvent.getStartElapsed(), slot2, 1L, spanEvent.hasException()); // application timeseries statistics - timeSeriesStore.add(new SimpleNodeId(spanEvent.getDestinationId()), span.getCollectorAcceptTime(), slot2, 1L, spanEvent.hasException()); +// NodeId key = new ComplexNodeId(Node.EMPTY, new Node(spanEvent.getDestinationId())); + NodeId key = new SimpleNodeId(spanEvent.getDestinationId()); + timeSeriesStore.add(key, span.getCollectorAcceptTime(), slot2, 1L, spanEvent.hasException()); } } diff --git a/src/main/java/com/nhn/pinpoint/web/service/Node.java b/src/main/java/com/nhn/pinpoint/web/service/Node.java index 2f3ed8514..a9db5ac7b 100644 --- a/src/main/java/com/nhn/pinpoint/web/service/Node.java +++ b/src/main/java/com/nhn/pinpoint/web/service/Node.java @@ -6,9 +6,22 @@ import com.nhn.pinpoint.common.ServiceType; * @author emeroad */ public class Node { + + public static final Node EMPTY = new Node(); + private String name; private ServiceType serviceType; + public Node() { + } + + public Node(String name) { + if (name == null) { + throw new NullPointerException("name must not be null"); + } + this.name = name; + } + public Node(String name, ServiceType serviceType) { if (name == null) { throw new NullPointerException("name must not be null"); @@ -55,7 +68,7 @@ public class Node { Node node = (Node) o; - if (!name.equals(node.name)) return false; + if (name != null ? !name.equals(node.name) : node.name != null) return false; if (serviceType != node.serviceType) return false; return true; @@ -63,8 +76,8 @@ public class Node { @Override public int hashCode() { - int result = name.hashCode(); - result = 31 * result + serviceType.hashCode(); + int result = name != null ? name.hashCode() : 0; + result = 31 * result + (serviceType != null ? serviceType.hashCode() : 0); return result; } diff --git a/src/main/java/com/nhn/pinpoint/web/service/SimpleNodeId.java b/src/main/java/com/nhn/pinpoint/web/service/SimpleNodeId.java index 0eb3a6648..f7ce7dbde 100644 --- a/src/main/java/com/nhn/pinpoint/web/service/SimpleNodeId.java +++ b/src/main/java/com/nhn/pinpoint/web/service/SimpleNodeId.java @@ -3,7 +3,8 @@ package com.nhn.pinpoint.web.service; /** * @author emeroad */ -public class SimpleNodeId implements NodeId{ +@Deprecated +public class SimpleNodeId implements NodeId { private String key; public SimpleNodeId(String key) { diff --git a/src/main/java/com/nhn/pinpoint/web/util/Mergeable.java b/src/main/java/com/nhn/pinpoint/web/util/Mergeable.java index b4b29316e..6e7dd6692 100644 --- a/src/main/java/com/nhn/pinpoint/web/util/Mergeable.java +++ b/src/main/java/com/nhn/pinpoint/web/util/Mergeable.java @@ -5,10 +5,10 @@ import com.nhn.pinpoint.web.service.NodeId; /** * * @author netspider - * - * @param + * @param + * @param */ -public interface Mergeable { - public I getId(); - public T mergeWith(T o); +public interface Mergeable { + public K getId(); + public V mergeWith(V o); }