From c8eb9dce182494de7ee37fb5971742cd9085031d Mon Sep 17 00:00:00 2001 From: Woonduk Kang Date: Wed, 13 Nov 2013 01:57:08 +0000 Subject: [PATCH] =?UTF-8?q?[=EA=B0=95=EC=9A=B4=EB=8D=95]=20[LUCYSUS-1744]?= =?UTF-8?q?=20=EC=9E=90=EB=A3=8C=EA=B5=AC=EC=A1=B0=EC=9D=98=20key=EB=A5=BC?= =?UTF-8?q?=20=EB=AC=B8=EC=9E=90=EC=97=B4=EB=A1=9C=20=EC=93=B0=EB=8A=94=20?= =?UTF-8?q?=EB=B6=80=EB=B6=84=20=EC=88=98=EC=A0=95=EC=9D=84=20=EC=9C=84?= =?UTF-8?q?=ED=95=B4=20=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-web/trunk@2885 84d0f5b1-2673-498c-a247-62c4ff18d310 --- .../rawdata/TransactionFlowStatistics.java | 16 ++++++++-------- .../FilteredApplicationMapServiceImpl.java | 7 ++++--- .../com/nhn/pinpoint/web/service/Node.java | 19 ++++++++++++++++--- .../pinpoint/web/service/SimpleNodeId.java | 3 ++- .../com/nhn/pinpoint/web/util/Mergeable.java | 10 +++++----- 5 files changed, 35 insertions(+), 20 deletions(-) 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); }