forked from D-Net/dnet-hadoop
56 lines
1.6 KiB
Java
Executable File
56 lines
1.6 KiB
Java
Executable File
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
|
|
package eu.dnetlib.oa.graph.usagestatsbuild.export;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Calendar;
|
|
import java.util.Date;
|
|
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.apache.log4j.BasicConfigurator;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import eu.dnetlib.dhp.application.ArgumentApplicationParser;
|
|
|
|
/**
|
|
* @author D. Pierrakos
|
|
*/
|
|
public class ExecuteWorkflow {
|
|
|
|
static String dbHiveUrl;
|
|
static String dbImpalaUrl;
|
|
static String usageRawDataDBSchema;
|
|
static String usageStatsDBSchema;
|
|
static String usagestatsPermanentDBSchema;
|
|
static String statsDBSchema;
|
|
|
|
public static void main(String args[]) throws Exception {
|
|
|
|
// Sending the logs to the console
|
|
BasicConfigurator.configure();
|
|
|
|
final ArgumentApplicationParser parser = new ArgumentApplicationParser(
|
|
IOUtils
|
|
.toString(
|
|
UsageStatsExporter.class
|
|
.getResourceAsStream(
|
|
"/eu/dnetlib/dhp/oa/graph/usagestatsupdate/export/usagestatupdate_parameters.json")));
|
|
parser.parseArgument(args);
|
|
|
|
dbHiveUrl = parser.get("dbHiveUrl");
|
|
dbImpalaUrl = parser.get("dbImpalaUrl");
|
|
usageRawDataDBSchema = parser.get("usageRawDataDB");
|
|
usageStatsDBSchema = parser.get("usageStatsDB");
|
|
usagestatsPermanentDBSchema = parser.get("usagestatsPermanentDBSchema");
|
|
statsDBSchema = parser.get("statsDB");
|
|
|
|
UsageStatsExporter usagestatsExport = new UsageStatsExporter();
|
|
usagestatsExport.export();
|
|
}
|
|
}
|