◆ SystemLogAccumulator()
org.turro.log.SystemLogAccumulator.SystemLogAccumulator |
( |
Dao |
dao | ) |
|
◆ accumulate()
static void org.turro.log.SystemLogAccumulator.accumulate |
( |
| ) |
|
|
static |
Definition at line 38 of file SystemLogAccumulator.java.
40 new Thread(accumulator,
"ElephantLog accumulator").start();
SystemLogAccumulator(Dao dao)
◆ run()
void org.turro.log.SystemLogAccumulator.run |
( |
| ) |
|
Definition at line 60 of file SystemLogAccumulator.java.
61 Date until =
new CheckDate().addYears(-MAX_YEARS).getDate();
63 SqlClause.select(Words.csv(
"l.logType").add(
"l.generatorPath").add(
"l.entityPath")
64 .add(
"l.generatorName").add(
"l.entityName").add(
"l.comment")
65 .add(
"sum(l.counts)").add(
"max(l.dateLog)").toString())
67 .where().smallerOrEqual(
"l.dateLog", until)
68 .groupBy(Words.csv(
"l.logType").add(
"l.generatorPath").add(
"l.entityPath")
69 .add(
"l.generatorName").add(
"l.entityName").add(
"l.comment").toString())
71 .resultList(Object[].
class).forEach(c -> {
72 SystemLog sl =
new SystemLog();
73 sl.setLogType((SystemLogType) c[0]);
74 sl.setGeneratorPath((String) c[1]);
75 sl.setEntityPath((String) c[2]);
76 sl.setGeneratorName((String) c[3]);
77 sl.setEntityName((String) c[4]);
78 sl.setComment((String) c[5]);
79 sl.setCounts((
int)(
long) c[6]);
81 sl.setData(getDataFrom(sl, (Date) c[7]));
84 SqlClause.delete(
"SystemLog").where().smaller(
"logDate", until);
The documentation for this class was generated from the following file: