Package com.dianping.cat.consumer.cross.model.entity

Examples of com.dianping.cat.consumer.cross.model.entity.CrossReport.accept()


    for (; startTime < endTime; startTime += TimeHelper.ONE_DAY) {
      try {
        CrossReport reportModel = m_reportService.queryCrossReport(domain, new Date(startTime), new Date(startTime
              + TimeHelper.ONE_DAY));
        reportModel.accept(merger);
      } catch (Exception e) {
        Cat.logError(e);
      }
    }
    CrossReport crossReport = merger.getCrossReport();
View Full Code Here


    for (; startTime < endTime; startTime = startTime + TimeHelper.ONE_HOUR) {
      Date date = new Date(startTime);
      CrossReport reportModel = m_reportService.queryCrossReport(domain, date, new Date(date.getTime()
            + TimeHelper.ONE_HOUR));

      reportModel.accept(merger);
    }
    CrossReport crossReport = merger.getCrossReport();
    crossReport.getDomainNames().addAll(domainSet);
    crossReport.setStartTime(period);
    crossReport.setEndTime(endDate);
View Full Code Here

    CrossReport reportNew = DefaultSaxParser.parse(newXml);
    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("cross_analyzer_merger.xml"), "utf-8");
    CrossReportMerger merger = new CrossReportMerger(new CrossReport(reportOld.getDomain()));

    reportOld.accept(merger);
    reportNew.accept(merger);

    Assert.assertEquals("Check the merge result!", expected.replace("\r", ""), merger.getCrossReport().toString()
          .replace("\r", ""));
    Assert.assertEquals("Source report is changed!", newXml.replace("\r", ""), reportNew.toString().replace("\r", ""));
  }
View Full Code Here

    CrossReport reportNew = DefaultSaxParser.parse(newXml);
    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("CrossReportMergeResult.xml"), "utf-8");
    CrossReportMerger merger = new CrossReportMerger(new CrossReport(reportOld.getDomain()));

    reportOld.accept(merger);
    reportNew.accept(merger);

    Assert.assertEquals("Check the merge result!", expected.replaceAll("\r", ""), merger.getCrossReport()
          .toString().replaceAll("\r", ""));
    Assert.assertEquals("Source report is changed!", newXml.replaceAll("\r", ""),
          reportNew.toString().replaceAll("\r", ""));
View Full Code Here

          try {
            if (xml != null && xml.length() > 0) {// for old xml storage
              CrossReport reportModel = com.dianping.cat.consumer.cross.model.transform.DefaultSaxParser
                    .parse(xml);
              reportModel.accept(merger);
            } else {// for new binary storage, binary is same to report id
              CrossReport reportModel = queryFromHourlyBinary(report.getId(), domain);

              reportModel.accept(merger);
            }
View Full Code Here

                    .parse(xml);
              reportModel.accept(merger);
            } else {// for new binary storage, binary is same to report id
              CrossReport reportModel = queryFromHourlyBinary(report.getId(), domain);

              reportModel.accept(merger);
            }
          } catch (DalNotFoundException e) {
            //ignore
          } catch (Exception e) {
            Cat.logError(e);
View Full Code Here

    }
    CrossReportMerger merger = new CrossReportMerger(new CrossReport(request.getDomain()));
    for (ModelResponse<CrossReport> response : responses) {
      CrossReport model = response.getModel();
      if (model != null) {
        model.accept(merger);
      }
    }

    return merger.getCrossReport();
  }
View Full Code Here

              DailyReportEntity.READSET_FULL);
        String xml = report.getContent();

        if (xml != null && xml.length() > 0) {
          CrossReport reportModel = com.dianping.cat.consumer.cross.model.transform.DefaultSaxParser.parse(xml);
          reportModel.accept(merger);
        } else {
          CrossReport reportModel = queryFromDailyBinary(report.getId(), domain);

          reportModel.accept(merger);
        }
View Full Code Here

          CrossReport reportModel = com.dianping.cat.consumer.cross.model.transform.DefaultSaxParser.parse(xml);
          reportModel.accept(merger);
        } else {
          CrossReport reportModel = queryFromDailyBinary(report.getId(), domain);

          reportModel.accept(merger);
        }
      } catch (DalNotFoundException e) {
        //ignore
      } catch (Exception e) {
        Cat.logError(e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.