This job is composed of several jobs consecutive.
6.2.2.1. Pre-Jobs
The first ones called “pre-job” are those who will work set up the context variables such as the current time the list of files whose names
match our naming convention.
java.util.Calendar cal = java.util.Calendar.getInstance();
//yesterday (most recent log)
SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd"); //date format
cal.add(java.util.Calendar.DATE, -1);
String yesterday = formatter.format(cal.getTime());
context.yesterday = yesterday;
context.atc_yesterday = String.format("atc_trans_%s", yesterday);
cal.add(java.util.Calendar.DATE, -1);
String the_day_bf_yesterday = formatter.format(cal.getTime());
context.the_day_bf_yesterday = the_day_bf_yesterday;
context.atc_the_day_bf_yesterday = String.format("atc_trans_%s", the_day_bf_yesterday);
context.atc_prod_path = String.format("/data2/gctmp/pppdelde/PPP_STAT/ATC/PDT/rawData/ATC_%s.csv", yesterday); //setting up the context
As seen in the code snippet, the supposed location for the ATC is “/data2/gctmp/pppdelde/PPP_STAT/ATC/PDT/rawData/ (actually it is for the
in production log). We set the context variables as the yesterday (because it’s the latest log available, explaing the one day delay) and
the day before that in order to pass to the next 2 jobs whose tasks are to drop & create the daily db table.
Also is given the location of the csv needed in the main jobs.
6.2.2.2. Main-Jobs
Then the main one which will extract from the csv files of a certain product fed by the python script and will fill the transaction of that
product (convention name: product_transaction_currentDate). It uses a tmap in order to map attributes in the csv file onto
the db fields. Mostly, it will help cleaning up and put data in the right order.
6.2.2.3. Post-Jobs
The post-job one is a script to fill the aggregation table of that transaction table (convention name: product_agg_trans). Il will
get the transaction from the current date in order to push into this table by grouping them by a certain attributes, depending on the product.