提交 a4abbd43 编写于 作者: Y youyong205

refactor report content

上级 eebab20f
......@@ -234,7 +234,6 @@ public class DefaultReportManager<T> implements ReportManager<T>, LogEnabled {
r.setPeriod(period);
r.setIp(ip);
r.setType(1);
r.setContent("");
m_reportDao.insert(r);
......
......@@ -50,7 +50,6 @@
<member name="domain" field="domain" value-type="String" length="20" nullable="false" />
<member name="period" field="period" value-type="Date" nullable="false" />
<member name="type" field="type" value-type="int" length="3" nullable="false" />
<member name="content" field="content" value-type="String" length="16777215" nullable="false" />
<member name="creation-date" field="creation_date" value-type="Date" nullable="false" />
<var name="key-id" value-type="int" key-member="id" />
<primary-key name="PRIMARY" members="id" />
......@@ -176,7 +175,6 @@
<member name="domain" field="domain" value-type="String" length="20" nullable="false" />
<member name="period" field="period" value-type="Date" nullable="false" />
<member name="type" field="type" value-type="int" length="3" nullable="false" />
<member name="content" field="content" value-type="String" length="16777215" nullable="false" />
<member name="creation-date" field="creation_date" value-type="Date" nullable="false" />
<var name="key-id" value-type="int" key-member="id" />
<primary-key name="PRIMARY" members="id" />
......@@ -262,7 +260,6 @@
<member name="ip" field="ip" value-type="String" length="20" />
<member name="domain" field="domain" value-type="String" length="50" nullable="false" />
<member name="period" field="period" value-type="Date" nullable="false" />
<member name="content" field="content" value-type="String" length="2147483647" nullable="false" />
<member name="creation-date" field="creation_date" value-type="Date" nullable="false" />
<var name="key-id" value-type="int" key-member="id" />
<primary-key name="PRIMARY" members="id" />
......@@ -388,7 +385,6 @@
<member name="domain" field="domain" value-type="String" length="20" nullable="false" />
<member name="period" field="period" value-type="Date" nullable="false" />
<member name="type" field="type" value-type="int" length="3" nullable="false" />
<member name="content" field="content" value-type="String" length="16777215" nullable="false" />
<member name="creation-date" field="creation_date" value-type="Date" nullable="false" />
<var name="key-id" value-type="int" key-member="id" />
<primary-key name="PRIMARY" members="id" />
......
......@@ -189,9 +189,6 @@
<member name="domain" />
<member name="name" />
</readset>
<readset name="CONTENT">
<member name="content" />
</readset>
</readsets>
<query-defs>
<query name="find-all-by-domain-name-period" type="SELECT" multiple="true">
......
......@@ -39,7 +39,6 @@ public class AlertReportBuilder implements TaskBuilder {
AlertReport alertReport = queryHourlyReportsByDuration(name, domain, period, TaskHelper.tomorrowZero(period));
DailyReport report = new DailyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -64,7 +63,6 @@ public class AlertReportBuilder implements TaskBuilder {
visitor.visitTopReport(topReport);
HourlyReport report = new HourlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -82,7 +80,6 @@ public class AlertReportBuilder implements TaskBuilder {
AlertReport alertReport = queryDailyReportsByDuration(domain, period, TaskHelper.nextMonthStart(period));
MonthlyReport report = new MonthlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -101,7 +98,6 @@ public class AlertReportBuilder implements TaskBuilder {
+ TimeHelper.ONE_WEEK));
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -101,7 +101,6 @@ public class DefaultReportServiceManager extends ContainerHolder implements Repo
@Override
public boolean insertDailyReport(DailyReport report, byte[] content) {
try {
report.setContent("");
m_dailyReportDao.insert(report);
int id = report.getId();
......@@ -120,7 +119,6 @@ public class DefaultReportServiceManager extends ContainerHolder implements Repo
@Override
public boolean insertHourlyReport(HourlyReport report, byte[] content) {
try {
report.setContent("");
m_hourlyReportDao.insert(report);
int id = report.getId();
......
......@@ -52,17 +52,11 @@ public class AlertReportService extends AbstractReportService<AlertReport> {
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
if (xml != null && xml.length() > 0) {
AlertReport reportModel = com.dianping.cat.home.alert.report.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
AlertReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
}
AlertReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -131,18 +125,12 @@ public class AlertReportService extends AbstractReportService<AlertReport> {
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {
AlertReport reportModel = com.dianping.cat.home.alert.report.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
AlertReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
AlertReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -153,7 +141,7 @@ public class AlertReportService extends AbstractReportService<AlertReport> {
alertReport.setStartTime(start);
alertReport.setEndTime(new Date(end.getTime() - 1));
return alertReport;
}
......@@ -162,15 +150,10 @@ public class AlertReportService extends AbstractReportService<AlertReport> {
try {
MonthlyReport entity = m_monthlyReportDao.findReportByDomainNamePeriod(start, domain, Constants.REPORT_ALERT,
MonthlyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.home.alert.report.transform.DefaultSaxParser.parse(content);
} else {
return queryFromMonthlyBinary(entity.getId(), domain);
}
return queryFromMonthlyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -182,15 +165,10 @@ public class AlertReportService extends AbstractReportService<AlertReport> {
try {
WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, Constants.REPORT_ALERT,
WeeklyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.home.alert.report.transform.DefaultSaxParser.parse(content);
} else {
return queryFromWeeklyBinary(entity.getId(), domain);
}
return queryFromWeeklyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......
......@@ -52,17 +52,11 @@ public class BugReportService extends AbstractReportService<BugReport> {
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
if (xml != null && xml.length() > 0) {
BugReport reportModel = com.dianping.cat.home.bug.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
BugReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
}
BugReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -131,18 +125,12 @@ public class BugReportService extends AbstractReportService<BugReport> {
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {
BugReport reportModel = com.dianping.cat.home.bug.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
BugReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
BugReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -162,15 +150,9 @@ public class BugReportService extends AbstractReportService<BugReport> {
try {
MonthlyReport entity = m_monthlyReportDao.findReportByDomainNamePeriod(start, domain, Constants.REPORT_BUG,
MonthlyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.home.bug.transform.DefaultSaxParser.parse(content);
} else {
return queryFromMonthlyBinary(entity.getId(), domain);
}
return queryFromMonthlyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -182,15 +164,10 @@ public class BugReportService extends AbstractReportService<BugReport> {
try {
WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, Constants.REPORT_BUG,
WeeklyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.home.bug.transform.DefaultSaxParser.parse(content);
} else {
return queryFromWeeklyBinary(entity.getId(), domain);
}
return queryFromWeeklyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......
......@@ -53,18 +53,11 @@ public class CrossReportService extends AbstractReportService<CrossReport> {
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
CrossReport reportModel = queryFromDailyBinary(report.getId(), domain);
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);
}
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -133,20 +126,12 @@ public class CrossReportService extends AbstractReportService<CrossReport> {
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
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);
}
CrossReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -168,15 +153,9 @@ public class CrossReportService extends AbstractReportService<CrossReport> {
try {
MonthlyReport entity = m_monthlyReportDao.findReportByDomainNamePeriod(start, domain, CrossAnalyzer.ID,
MonthlyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.consumer.cross.model.transform.DefaultSaxParser.parse(content);
} else {
return queryFromMonthlyBinary(entity.getId(), domain);
}
return queryFromMonthlyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -188,15 +167,10 @@ public class CrossReportService extends AbstractReportService<CrossReport> {
try {
WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, CrossAnalyzer.ID,
WeeklyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.consumer.cross.model.transform.DefaultSaxParser.parse(content);
} else {
return queryFromWeeklyBinary(entity.getId(), domain);
}
return queryFromWeeklyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......
......@@ -62,19 +62,11 @@ public class DependencyReportService extends AbstractReportService<DependencyRep
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {
DependencyReport reportModel = com.dianping.cat.consumer.dependency.model.transform.DefaultSaxParser
.parse(xml);
reportModel.accept(merger);
} else {
DependencyReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
DependencyReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......
......@@ -59,16 +59,9 @@ public class EventReportService extends AbstractReportService<EventReport> {
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
EventReport reportModel = queryFromDailyBinary(report.getId(), domain);
if (xml != null && xml.length() > 0) {
EventReport reportModel = com.dianping.cat.consumer.event.model.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
EventReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
}
reportModel.accept(merger);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......@@ -139,18 +132,10 @@ public class EventReportService extends AbstractReportService<EventReport> {
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {// for old xml storage
EventReport reportModel = com.dianping.cat.consumer.event.model.transform.DefaultSaxParser
.parse(xml);
reportModel.accept(merger);
} else {// for new binary storage, binary is same to report id
EventReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
EventReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......@@ -176,13 +161,8 @@ public class EventReportService extends AbstractReportService<EventReport> {
try {
MonthlyReport entity = m_monthlyReportDao.findReportByDomainNamePeriod(start, domain, EventAnalyzer.ID,
MonthlyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
eventReport = com.dianping.cat.consumer.event.model.transform.DefaultSaxParser.parse(content);
} else {
eventReport = queryFromMonthlyBinary(entity.getId(), domain);
}
eventReport = queryFromMonthlyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......@@ -198,13 +178,8 @@ public class EventReportService extends AbstractReportService<EventReport> {
try {
WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, EventAnalyzer.ID,
WeeklyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
eventReport = com.dianping.cat.consumer.event.model.transform.DefaultSaxParser.parse(content);
} else {
eventReport = queryFromWeeklyBinary(entity.getId(), domain);
}
eventReport = queryFromWeeklyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......
......@@ -16,7 +16,6 @@ import com.dianping.cat.consumer.heartbeat.model.entity.HeartbeatReport;
import com.dianping.cat.consumer.heartbeat.model.entity.Period;
import com.dianping.cat.consumer.heartbeat.model.transform.BaseVisitor;
import com.dianping.cat.consumer.heartbeat.model.transform.DefaultNativeParser;
import com.dianping.cat.consumer.heartbeat.model.transform.DefaultSaxParser;
import com.dianping.cat.core.dal.DailyReport;
import com.dianping.cat.core.dal.DailyReportEntity;
import com.dianping.cat.core.dal.HourlyReport;
......@@ -50,17 +49,9 @@ public class HeartbeatReportService extends AbstractReportService<HeartbeatRepor
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
HeartbeatReport reportModel = queryFromDailyBinary(report.getId(), domain);
if (xml != null && xml.length() > 0) {
HeartbeatReport reportModel = DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
HeartbeatReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
}
reportModel.accept(merger);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......@@ -74,7 +65,7 @@ public class HeartbeatReportService extends AbstractReportService<HeartbeatRepor
Set<String> domains = queryAllDomainNames(start, end, HeartbeatAnalyzer.ID);
heartbeatReport.getDomainNames().addAll(domains);
new HeartbeatConvertor().visitHeartbeatReport(heartbeatReport);
return heartbeatReport;
}
......@@ -116,17 +107,9 @@ public class HeartbeatReportService extends AbstractReportService<HeartbeatRepor
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {
HeartbeatReport reportModel = com.dianping.cat.consumer.heartbeat.model.transform.DefaultSaxParser
.parse(xml);
reportModel.accept(merger);
} else {
HeartbeatReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
HeartbeatReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......
......@@ -52,17 +52,11 @@ public class HeavyReportService extends AbstractReportService<HeavyReport> {
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
if (xml != null && xml.length() > 0) {
HeavyReport reportModel = com.dianping.cat.home.heavy.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
HeavyReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
}
HeavyReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -131,18 +125,11 @@ public class HeavyReportService extends AbstractReportService<HeavyReport> {
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {
HeavyReport reportModel = com.dianping.cat.home.heavy.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
HeavyReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
HeavyReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -162,15 +149,9 @@ public class HeavyReportService extends AbstractReportService<HeavyReport> {
try {
MonthlyReport entity = m_monthlyReportDao.findReportByDomainNamePeriod(start, domain, Constants.REPORT_HEAVY,
MonthlyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.home.heavy.transform.DefaultSaxParser.parse(content);
} else {
return queryFromMonthlyBinary(entity.getId(), domain);
}
return queryFromMonthlyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -182,15 +163,9 @@ public class HeavyReportService extends AbstractReportService<HeavyReport> {
try {
WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, Constants.REPORT_HEAVY,
WeeklyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.home.heavy.transform.DefaultSaxParser.parse(content);
} else {
return queryFromWeeklyBinary(entity.getId(), domain);
}
return queryFromWeeklyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......
......@@ -53,18 +53,11 @@ public class MatrixReportService extends AbstractReportService<MatrixReport> {
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
MatrixReport reportModel = queryFromDailyBinary(report.getId(), domain);
if (xml != null && xml.length() > 0) {
MatrixReport reportModel = com.dianping.cat.consumer.matrix.model.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
MatrixReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
}
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -133,20 +126,12 @@ public class MatrixReportService extends AbstractReportService<MatrixReport> {
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {// for old xml storage
MatrixReport reportModel = com.dianping.cat.consumer.matrix.model.transform.DefaultSaxParser
.parse(xml);
reportModel.accept(merger);
} else {// for new binary storage, binary is same to report id
MatrixReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
MatrixReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -168,15 +153,9 @@ public class MatrixReportService extends AbstractReportService<MatrixReport> {
try {
MonthlyReport entity = m_monthlyReportDao.findReportByDomainNamePeriod(start, domain, MatrixAnalyzer.ID,
MonthlyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.consumer.matrix.model.transform.DefaultSaxParser.parse(content);
} else {
return queryFromMonthlyBinary(entity.getId(), domain);
}
return queryFromMonthlyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -188,15 +167,9 @@ public class MatrixReportService extends AbstractReportService<MatrixReport> {
try {
WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, MatrixAnalyzer.ID,
WeeklyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.consumer.matrix.model.transform.DefaultSaxParser.parse(content);
} else {
return queryFromWeeklyBinary(entity.getId(), domain);
}
return queryFromWeeklyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......
......@@ -28,7 +28,7 @@ public class NetTopologyReportService extends AbstractReportService<NetGraphSet>
public NetGraphSet queryDailyReport(String domain, Date start, Date end) {
throw new RuntimeException("net topology report don't support daily report");
}
private NetGraphSet queryFromHourlyBinary(int id) throws DalException {
HourlyReportContent content = m_hourlyReportContentDao.findByPK(id, HourlyReportContentEntity.READSET_FULL);
......@@ -43,7 +43,7 @@ public class NetTopologyReportService extends AbstractReportService<NetGraphSet>
public NetGraphSet queryHourlyReport(String domain, Date start, Date end) {
long startTime = start.getTime();
String name = Constants.REPORT_NET_TOPOLOGY;
NetGraphSet netGraphSet = null;
NetGraphSet netGraphs = null;
List<HourlyReport> reports = null;
try {
......@@ -54,24 +54,14 @@ public class NetTopologyReportService extends AbstractReportService<NetGraphSet>
}
if (reports != null && reports.size() > 0) {
String xml = reports.get(0).getContent();
if (xml != null && xml.length() > 0) {
try {
netGraphSet = com.dianping.cat.home.network.transform.DefaultSaxParser.parse(xml);
} catch (Exception e) {
Cat.logError(e);
}
} else {
try {
netGraphSet = queryFromHourlyBinary(reports.get(0).getId());
} catch (DalException e) {
Cat.logError(e);
}
try {
netGraphs = queryFromHourlyBinary(reports.get(0).getId());
} catch (DalException e) {
Cat.logError(e);
}
}
return netGraphSet;
return netGraphs;
}
@Override
......
......@@ -54,17 +54,9 @@ public class ProblemReportService extends AbstractReportService<ProblemReport> {
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
ProblemReport reportModel = queryFromDailyBinary(report.getId(), domain);
if (xml != null && xml.length() > 0) {
ProblemReport reportModel = com.dianping.cat.consumer.problem.model.transform.DefaultSaxParser
.parse(xml);
reportModel.accept(merger);
} else {
ProblemReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
}
reportModel.accept(merger);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......@@ -137,18 +129,10 @@ public class ProblemReportService extends AbstractReportService<ProblemReport> {
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {// for old xml storage
ProblemReport reportModel = com.dianping.cat.consumer.problem.model.transform.DefaultSaxParser
.parse(xml);
reportModel.accept(merger);
} else {// for new binary storage, binary is same to report id
ProblemReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
ProblemReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......@@ -177,13 +161,8 @@ public class ProblemReportService extends AbstractReportService<ProblemReport> {
try {
MonthlyReport entity = m_monthlyReportDao.findReportByDomainNamePeriod(start, domain, ProblemAnalyzer.ID,
MonthlyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
problemReport = com.dianping.cat.consumer.problem.model.transform.DefaultSaxParser.parse(content);
} else {
problemReport = queryFromMonthlyBinary(entity.getId(), domain);
}
problemReport = queryFromMonthlyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......@@ -202,14 +181,8 @@ public class ProblemReportService extends AbstractReportService<ProblemReport> {
try {
WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, ProblemAnalyzer.ID,
WeeklyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
problemReport = com.dianping.cat.consumer.problem.model.transform.DefaultSaxParser.parse(content);
} else {
problemReport = queryFromWeeklyBinary(entity.getId(), domain);
}
problemReport = queryFromWeeklyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......
......@@ -52,17 +52,11 @@ public class ServiceReportService extends AbstractReportService<ServiceReport> {
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
if (xml != null && xml.length() > 0) {
ServiceReport reportModel = com.dianping.cat.home.service.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
ServiceReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
}
ServiceReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -131,18 +125,11 @@ public class ServiceReportService extends AbstractReportService<ServiceReport> {
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {
ServiceReport reportModel = com.dianping.cat.home.service.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
ServiceReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
ServiceReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -162,15 +149,9 @@ public class ServiceReportService extends AbstractReportService<ServiceReport> {
try {
MonthlyReport entity = m_monthlyReportDao.findReportByDomainNamePeriod(start, domain,
Constants.REPORT_SERVICE, MonthlyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.home.service.transform.DefaultSaxParser.parse(content);
} else {
return queryFromMonthlyBinary(entity.getId(), domain);
}
return queryFromMonthlyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -182,15 +163,10 @@ public class ServiceReportService extends AbstractReportService<ServiceReport> {
try {
WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, Constants.REPORT_SERVICE,
WeeklyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.home.service.transform.DefaultSaxParser.parse(content);
} else {
return queryFromWeeklyBinary(entity.getId(), domain);
}
return queryFromWeeklyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......
......@@ -52,18 +52,11 @@ public class StateReportService extends AbstractReportService<StateReport> {
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
StateReport reportModel = queryFromDailyBinary(report.getId(), domain);
if (xml != null && xml.length() > 0) {
StateReport reportModel = com.dianping.cat.consumer.state.model.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
StateReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
}
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -132,20 +125,12 @@ public class StateReportService extends AbstractReportService<StateReport> {
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {// for old xml storage
StateReport reportModel = com.dianping.cat.consumer.state.model.transform.DefaultSaxParser
.parse(xml);
reportModel.accept(merger);
} else {// for new binary storage, binary is same to report id
StateReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
StateReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -164,15 +149,10 @@ public class StateReportService extends AbstractReportService<StateReport> {
try {
MonthlyReport entity = m_monthlyReportDao.findReportByDomainNamePeriod(start, domain, StateAnalyzer.ID,
MonthlyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.consumer.state.model.transform.DefaultSaxParser.parse(content);
} else {
return queryFromMonthlyBinary(entity.getId(), domain);
}
return queryFromMonthlyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -184,15 +164,10 @@ public class StateReportService extends AbstractReportService<StateReport> {
try {
WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, StateAnalyzer.ID,
WeeklyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.consumer.state.model.transform.DefaultSaxParser.parse(content);
} else {
return queryFromWeeklyBinary(entity.getId(), domain);
}
return queryFromWeeklyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......
......@@ -61,18 +61,11 @@ public class TopReportService extends AbstractReportService<TopReport> {
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {
TopReport reportModel = com.dianping.cat.consumer.top.model.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
TopReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
TopReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......
......@@ -59,17 +59,9 @@ public class TransactionReportService extends AbstractReportService<TransactionR
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
TransactionReport reportModel = queryFromDailyBinary(report.getId(), domain);
if (xml != null && xml.length() > 0) {
TransactionReport reportModel = com.dianping.cat.consumer.transaction.model.transform.DefaultSaxParser
.parse(xml);
reportModel.accept(merger);
} else {
TransactionReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
}
reportModel.accept(merger);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......@@ -140,18 +132,10 @@ public class TransactionReportService extends AbstractReportService<TransactionR
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {// for old xml storage
TransactionReport reportModel = com.dianping.cat.consumer.transaction.model.transform.DefaultSaxParser
.parse(xml);
reportModel.accept(merger);
} else {// for new binary storage, binary is same to report id
TransactionReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
TransactionReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......@@ -177,13 +161,7 @@ public class TransactionReportService extends AbstractReportService<TransactionR
try {
MonthlyReport entity = m_monthlyReportDao.findReportByDomainNamePeriod(start, domain, TransactionAnalyzer.ID,
MonthlyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
transactionReport = com.dianping.cat.consumer.transaction.model.transform.DefaultSaxParser.parse(content);
} else {
transactionReport = queryFromMonthlyBinary(entity.getId(), domain);
}
transactionReport = queryFromMonthlyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......@@ -199,13 +177,7 @@ public class TransactionReportService extends AbstractReportService<TransactionR
try {
WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, TransactionAnalyzer.ID,
WeeklyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
transactionReport = com.dianping.cat.consumer.transaction.model.transform.DefaultSaxParser.parse(content);
} else {
transactionReport = queryFromWeeklyBinary(entity.getId(), domain);
}
transactionReport = queryFromWeeklyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
......
......@@ -52,17 +52,10 @@ public class UtilizationReportService extends AbstractReportService<UtilizationR
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
if (xml != null && xml.length() > 0) {
UtilizationReport reportModel = com.dianping.cat.home.utilization.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} else {
UtilizationReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
}
UtilizationReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -131,19 +124,11 @@ public class UtilizationReportService extends AbstractReportService<UtilizationR
}
if (reports != null) {
for (HourlyReport report : reports) {
String xml = report.getContent();
try {
if (xml != null && xml.length() > 0) {
UtilizationReport reportModel = com.dianping.cat.home.utilization.transform.DefaultSaxParser
.parse(xml);
reportModel.accept(merger);
} else {
UtilizationReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
}
UtilizationReport reportModel = queryFromHourlyBinary(report.getId(), domain);
reportModel.accept(merger);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -163,15 +148,9 @@ public class UtilizationReportService extends AbstractReportService<UtilizationR
try {
MonthlyReport entity = m_monthlyReportDao.findReportByDomainNamePeriod(start, domain,
Constants.REPORT_UTILIZATION, MonthlyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.home.utilization.transform.DefaultSaxParser.parse(content);
} else {
return queryFromMonthlyBinary(entity.getId(), domain);
}
return queryFromMonthlyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......@@ -183,15 +162,9 @@ public class UtilizationReportService extends AbstractReportService<UtilizationR
try {
WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain,
Constants.REPORT_UTILIZATION, WeeklyReportEntity.READSET_FULL);
String content = entity.getContent();
if (content != null && content.length() > 0) {
return com.dianping.cat.home.utilization.transform.DefaultSaxParser.parse(content);
} else {
return queryFromWeeklyBinary(entity.getId(), domain);
}
return queryFromWeeklyBinary(entity.getId(), domain);
} catch (DalNotFoundException e) {
//ignore
// ignore
} catch (Exception e) {
Cat.logError(e);
}
......
......@@ -48,7 +48,6 @@ public class BugReportBuilder implements TaskBuilder {
}
DailyReport report = new DailyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -80,7 +79,6 @@ public class BugReportBuilder implements TaskBuilder {
}
HourlyReport report = new HourlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -101,7 +99,6 @@ public class BugReportBuilder implements TaskBuilder {
}
MonthlyReport report = new MonthlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -122,7 +119,6 @@ public class BugReportBuilder implements TaskBuilder {
}
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -54,7 +54,6 @@ public class CachedReportTask implements Task {
private MonthlyReport buildMonthlyReport(String domain, Date period, String name) {
MonthlyReport report = new MonthlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -67,7 +66,6 @@ public class CachedReportTask implements Task {
private WeeklyReport buildWeeklyReport(String domain, Date period, String name) {
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -31,7 +31,6 @@ public class CrossReportBuilder implements TaskBuilder {
CrossReport crossReport = queryHourlyReportsByDuration(name, domain, period, TaskHelper.tomorrowZero(period));
DailyReport report = new DailyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -52,7 +51,6 @@ public class CrossReportBuilder implements TaskBuilder {
CrossReport crossReport = queryDailyReportsByDuration(domain, period, TaskHelper.nextMonthStart(period));
MonthlyReport report = new MonthlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -69,7 +67,6 @@ public class CrossReportBuilder implements TaskBuilder {
+ TimeHelper.ONE_WEEK));
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -54,7 +54,6 @@ public class EventReportBuilder implements TaskBuilder {
DailyReport report = new DailyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -119,7 +118,6 @@ public class EventReportBuilder implements TaskBuilder {
EventReport eventReport = queryDailyReportsByDuration(domain, period, end);
MonthlyReport report = new MonthlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -143,7 +141,6 @@ public class EventReportBuilder implements TaskBuilder {
EventReport eventReport = queryDailyReportsByDuration(domain, period, end);
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -37,7 +37,6 @@ public class HeartbeatReportBuilder implements TaskBuilder {
report.setCreationDate(new Date());
report.setDomain(domain);
report.setContent("");
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
report.setName(name);
report.setPeriod(period);
......
......@@ -37,7 +37,6 @@ public class HeavyReportBuilder implements TaskBuilder {
HeavyReport heavyReport = queryHourlyReportsByDuration(name, domain, period, TaskHelper.tomorrowZero(period));
DailyReport report = new DailyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -67,7 +66,6 @@ public class HeavyReportBuilder implements TaskBuilder {
HourlyReport report = new HourlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -83,7 +81,6 @@ public class HeavyReportBuilder implements TaskBuilder {
HeavyReport heavyReport = queryDailyReportsByDuration(domain, period, TaskHelper.nextMonthStart(period));
MonthlyReport report = new MonthlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -100,7 +97,6 @@ public class HeavyReportBuilder implements TaskBuilder {
+ TimeHelper.ONE_WEEK));
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -52,7 +52,6 @@ public class HighLoadReportBuilder implements TaskBuilder {
HighloadReport report = generateHighloadReport(period);
DailyReport dailyReport = new DailyReport();
dailyReport.setContent("");
dailyReport.setIp("");
dailyReport.setDomain("");
dailyReport.setCreationDate(new Date());
......
......@@ -64,7 +64,6 @@ public class JarReportBuilder implements TaskBuilder {
HourlyReport report = new HourlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -32,7 +32,6 @@ public class MatrixReportBuilder implements TaskBuilder {
MatrixReport matrixReport = queryHourlyReportByDuration(name, domain, period, TaskHelper.tomorrowZero(period));
DailyReport report = new DailyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -53,7 +52,6 @@ public class MatrixReportBuilder implements TaskBuilder {
MatrixReport matrixReport = queryDailyReportsByDuration(domain, period, TaskHelper.nextMonthStart(period));
MonthlyReport report = new MonthlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -70,7 +68,6 @@ public class MatrixReportBuilder implements TaskBuilder {
+ TimeHelper.ONE_WEEK));
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -75,7 +75,6 @@ public class NetTopologyReportBuilder implements TaskBuilder {
hourlyReport.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
hourlyReport.setDomain(domain);
hourlyReport.setPeriod(period);
hourlyReport.setContent("");
byte[] content = DefaultNativeBuilder.build(netGraphSet);
return m_reportService.insertHourlyReport(hourlyReport, content);
}
......
......@@ -56,7 +56,6 @@ public class ProblemReportBuilder implements TaskBuilder {
DailyReport report = new DailyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -105,7 +104,6 @@ public class ProblemReportBuilder implements TaskBuilder {
MonthlyReport report = new MonthlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -137,7 +135,6 @@ public class ProblemReportBuilder implements TaskBuilder {
+ TimeHelper.ONE_WEEK));
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -83,7 +83,6 @@ public class RouterConfigBuilder implements TaskBuilder, LogEnabled {
routerConfig.setEndTime(new Date(end.getTime() + TimeHelper.ONE_DAY));
DailyReport dailyReport = new DailyReport();
dailyReport.setContent("");
dailyReport.setCreationDate(new Date());
dailyReport.setDomain(domain);
dailyReport.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -45,7 +45,6 @@ public class ServiceReportBuilder implements TaskBuilder {
ServiceReport serviceReport = queryHourlyReportsByDuration(name, domain, period, TaskHelper.tomorrowZero(period));
DailyReport report = new DailyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -81,7 +80,6 @@ public class ServiceReportBuilder implements TaskBuilder {
}
HourlyReport report = new HourlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -97,7 +95,6 @@ public class ServiceReportBuilder implements TaskBuilder {
ServiceReport serviceReport = queryDailyReportsByDuration(domain, period, TaskHelper.nextMonthStart(period));
MonthlyReport report = new MonthlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -114,7 +111,6 @@ public class ServiceReportBuilder implements TaskBuilder {
+ TimeHelper.ONE_WEEK));
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -46,7 +46,6 @@ public class StateReportBuilder implements TaskBuilder {
StateReport stateReport = queryHourlyReportsByDuration(name, domain, period, TaskHelper.tomorrowZero(period));
DailyReport report = new DailyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -72,7 +71,6 @@ public class StateReportBuilder implements TaskBuilder {
StateReport stateReport = queryDailyReportsByDuration(domain, period, TaskHelper.nextMonthStart(period));
MonthlyReport report = new MonthlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -91,7 +89,6 @@ public class StateReportBuilder implements TaskBuilder {
StateReport stateReport = queryDailyReportsByDuration(domain, start, end);
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -39,7 +39,6 @@ public class SystemReportBuilder implements TaskBuilder {
SystemReport report = buildSystemReport(period);
DailyReport dailyReport = new DailyReport();
dailyReport.setContent("");
dailyReport.setIp("");
dailyReport.setDomain(Constants.CAT);
dailyReport.setCreationDate(new Date());
......
......@@ -61,7 +61,6 @@ public class TransactionReportBuilder implements TaskBuilder, LogEnabled {
report.setCreationDate(new Date());
report.setDomain(domain);
report.setContent("");
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
report.setName(name);
report.setPeriod(period);
......@@ -125,7 +124,6 @@ public class TransactionReportBuilder implements TaskBuilder, LogEnabled {
TransactionReport transactionReport = queryDailyReportsByDuration(domain, period, end);
MonthlyReport report = new MonthlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -149,7 +147,6 @@ public class TransactionReportBuilder implements TaskBuilder, LogEnabled {
TransactionReport transactionReport = queryDailyReportsByDuration(domain, period, end);
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -49,7 +49,6 @@ public class UtilizationReportBuilder implements TaskBuilder {
TaskHelper.tomorrowZero(period));
DailyReport report = new DailyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -124,7 +123,6 @@ public class UtilizationReportBuilder implements TaskBuilder {
HourlyReport report = new HourlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -142,7 +140,6 @@ public class UtilizationReportBuilder implements TaskBuilder {
TaskHelper.nextMonthStart(period));
MonthlyReport report = new MonthlyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......@@ -160,7 +157,6 @@ public class UtilizationReportBuilder implements TaskBuilder {
+ TimeHelper.ONE_WEEK));
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
......
......@@ -19,7 +19,6 @@ CREATE TABLE `dailyreport` (
`domain` varchar(50) NOT NULL COMMENT '报表处理的Domain信息',
`period` datetime NOT NULL COMMENT '报表时间段',
`type` tinyint(4) NOT NULL COMMENT '报表数据格式, 1/xml, 2/json, 默认1',
`content` mediumtext NOT NULL COMMENT '报表内容',
`creation_date` datetime NOT NULL COMMENT '报表创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `period` (`period`,`domain`,`name`)
......@@ -32,7 +31,6 @@ CREATE TABLE `weeklyreport` (
`domain` varchar(50) NOT NULL COMMENT '报表处理的Domain信息',
`period` datetime NOT NULL COMMENT '报表时间段',
`type` tinyint(4) NOT NULL COMMENT '报表数据格式, 1/xml, 2/json, 默认1',
`content` mediumtext NOT NULL COMMENT '报表内容',
`creation_date` datetime NOT NULL COMMENT '报表创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `period` (`period`,`domain`,`name`)
......@@ -45,7 +43,6 @@ CREATE TABLE `monthreport` (
`domain` varchar(50) NOT NULL COMMENT '报表处理的Domain信息',
`period` datetime NOT NULL COMMENT '报表时间段',
`type` tinyint(4) NOT NULL COMMENT '报表数据格式, 1/xml, 2/json, 默认1',
`content` mediumtext NOT NULL COMMENT '报表内容',
`creation_date` datetime NOT NULL COMMENT '报表创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `period` (`period`,`domain`,`name`)
......@@ -83,7 +80,6 @@ CREATE TABLE `report` (
`ip` varchar(50) DEFAULT NULL COMMENT '报表来自于哪台机器',
`domain` varchar(50) NOT NULL COMMENT '报表项目',
`period` timestamp NOT NULL COMMENT '报表时间段',
`content` longtext NULL,
`creation_date` timestamp NOT NULL COMMENT '报表创建时间',
PRIMARY KEY (`id`),
KEY `IX_Domain_Name_Period` (`domain`,`name`,`period`),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册