public Node getOrCreateOriginNode(String origin){ StatisticNode statisticNode = (StatisticNode)this.originCountMap.get(origin); if (statisticNode == null) { try { this.lock.lock(); statisticNode = (StatisticNode)this.originCountMap.get(origin); if (statisticNode == null) { statisticNode = new StatisticNode(); HashMap<String, StatisticNode> newMap = new HashMap(this.originCountMap.size() + 1); newMap.putAll(this.originCountMap); newMap.put(origin, statisticNode); this.originCountMap = newMap; } } finally { this.lock.unlock(); } }
return statisticNode; }
trace
1 2 3 4 5 6 7 8
publicvoidtrace(Throwable throwable, int count){ if (count > 0) { if (!BlockException.isBlockException(throwable)) { this.increaseExceptionQps(count); }
/* * if context origin is set, we should get or create a new {@link Node} of * the specific origin. */ if (!"".equals(context.getOrigin())) { Node originNode = node.getClusterNode().getOrCreateOriginNode(context.getOrigin()); context.getCurEntry().setOriginNode(originNode); }