Authored by wangning

.分隔符处理修改

@@ -275,27 +275,25 @@ public class TraceAnalyzeHandler implements TraceHandler, Serializable { @@ -275,27 +275,25 @@ public class TraceAnalyzeHandler implements TraceHandler, Serializable {
275 public Iterator<Tuple2<String, SpanIpResult>> call(Tuple2<String, SortedTrace> tuple2) throws Exception { 275 public Iterator<Tuple2<String, SpanIpResult>> call(Tuple2<String, SortedTrace> tuple2) throws Exception {
276 276
277 List<Tuple2<String, SpanIpResult>> resultList = Lists.newArrayList(); 277 List<Tuple2<String, SpanIpResult>> resultList = Lists.newArrayList();
278 -  
279 - String minuteStart = tuple2._1.split("\\.")[0];  
280 - String traceMD5 = tuple2._1.split("\\.")[1]; 278 + String minuteStart = StringUtils.split(tuple2._1, '.')[0];
  279 + String traceMD5 = StringUtils.split(tuple2._1, '.')[1];
281 SortedTrace sortTrace = tuple2._2; 280 SortedTrace sortTrace = tuple2._2;
282 List<SpanInfo> sortSpanList = sortTrace.getSortSpanList(); 281 List<SpanInfo> sortSpanList = sortTrace.getSortSpanList();
283 for (SpanInfo spanInfo : sortSpanList) { 282 for (SpanInfo spanInfo : sortSpanList) {
284 283
285 String ip = ""; 284 String ip = "";
286 //只有root和resttemplate才会生成ip 285 //只有root和resttemplate才会生成ip
287 -// if(spanInfo.getTraceid().equals(spanInfo.getSpanid())){  
288 -// ip = spanInfo.getIp();  
289 -// }else{  
290 -// if(StringUtils.isNotBlank(spanInfo.getHttpHost())){  
291 -// ip = spanInfo.getHttpHost();  
292 -// }  
293 -// }  
294 - ip = spanInfo.getIp(); 286 + if(spanInfo.getTraceid().equals(spanInfo.getSpanid())){
  287 + ip = spanInfo.getIp();
  288 + }else{
  289 + if(StringUtils.isNotBlank(spanInfo.getHttpHost())){
  290 + ip = spanInfo.getHttpHost();
  291 + }
  292 + }
295 293
296 -// if(StringUtils.isBlank(ip)){  
297 -// continue;  
298 -// } 294 + if(StringUtils.isBlank(ip)){
  295 + continue;
  296 + }
299 297
300 SpanIpResult spanIpResult = new SpanIpResult(); 298 SpanIpResult spanIpResult = new SpanIpResult();
301 String spanName = spanInfo.getName(); 299 String spanName = spanInfo.getName();