forked from D-Net/dnet-hadoop
Corrections for LaReferencia ending period
This commit is contained in:
parent
915b3287a8
commit
9a1512004f
|
@ -171,14 +171,14 @@ public class LaReferenciaDownloadLogs {
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
// Setting the starting period
|
// Setting the starting period
|
||||||
Calendar start = ExecuteWorkflow.startingLogPeriod;
|
Calendar start = (Calendar) ExecuteWorkflow.startingLogPeriod.clone();
|
||||||
logger.info("Starting period for log download: " + sdf.format(start.getTime()));
|
logger.info("Starting period for log download: " + sdf.format(start.getTime()));
|
||||||
|
|
||||||
// Setting the ending period (last day of the month)
|
// Setting the ending period (last day of the month)
|
||||||
Calendar end = ExecuteWorkflow.endingLogPeriod;
|
Calendar end = (Calendar) ExecuteWorkflow.endingLogPeriod.clone();
|
||||||
end.add(Calendar.MONTH, +1);
|
end.add(Calendar.MONTH, +1);
|
||||||
end.add(Calendar.DAY_OF_MONTH, -1);
|
end.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
logger.info("Starting period for log download: " + sdf.format(end.getTime()));
|
logger.info("Ending period for log download: " + sdf.format(end.getTime()));
|
||||||
|
|
||||||
PreparedStatement st = ConnectDB
|
PreparedStatement st = ConnectDB
|
||||||
.getHiveConnection()
|
.getHiveConnection()
|
||||||
|
|
|
@ -112,14 +112,14 @@ public class PiwikDownloadLogs {
|
||||||
logger.info("Downloading from repos with the followins piwikIds: " + piwikIdToVisit);
|
logger.info("Downloading from repos with the followins piwikIds: " + piwikIdToVisit);
|
||||||
|
|
||||||
// Setting the starting period
|
// Setting the starting period
|
||||||
Calendar start = ExecuteWorkflow.startingLogPeriod;
|
Calendar start = (Calendar) ExecuteWorkflow.startingLogPeriod.clone();
|
||||||
logger.info("Starting period for log download: " + sdf.format(start.getTime()));
|
logger.info("Starting period for log download: " + sdf.format(start.getTime()));
|
||||||
|
|
||||||
// Setting the ending period (last day of the month)
|
// Setting the ending period (last day of the month)
|
||||||
Calendar end = ExecuteWorkflow.endingLogPeriod;
|
Calendar end = (Calendar) ExecuteWorkflow.endingLogPeriod.clone();
|
||||||
end.add(Calendar.MONTH, +1);
|
end.add(Calendar.MONTH, +1);
|
||||||
end.add(Calendar.DAY_OF_MONTH, -1);
|
end.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
logger.info("Starting period for log download: " + sdf.format(end.getTime()));
|
logger.info("Ending period for log download: " + sdf.format(end.getTime()));
|
||||||
|
|
||||||
for (int siteId : piwikIdToVisit) {
|
for (int siteId : piwikIdToVisit) {
|
||||||
|
|
||||||
|
|
|
@ -475,8 +475,8 @@ public class PiwikStatsDB {
|
||||||
"WHERE p.source=d.piwik_id and p.id=ro.oid " +
|
"WHERE p.source=d.piwik_id and p.id=ro.oid " +
|
||||||
"GROUP BY d.id, ro.id, month " +
|
"GROUP BY d.id, ro.id, month " +
|
||||||
"ORDER BY d.id, ro.id, month";
|
"ORDER BY d.id, ro.id, month";
|
||||||
logger.info("Created downloads_stats_tmp table");
|
|
||||||
stmt.executeUpdate(sql);
|
stmt.executeUpdate(sql);
|
||||||
|
logger.info("Created downloads_stats_tmp table");
|
||||||
|
|
||||||
logger.info("Dropping downloads_stats table");
|
logger.info("Dropping downloads_stats table");
|
||||||
String drop_pageviews_stats = "DROP TABLE IF EXISTS " +
|
String drop_pageviews_stats = "DROP TABLE IF EXISTS " +
|
||||||
|
|
Loading…
Reference in New Issue