mirror of
https://github.com/rasilon/ujetl.git
synced 2026-04-11 10:29:29 +00:00
Change table to job, since it's no longer just tables
This commit is contained in:
parent
93d8be0185
commit
4ec3aa8fe8
2 changed files with 15 additions and 13 deletions
1
README.md
Normal file
1
README.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
# ujetl
|
||||||
|
|
@ -50,6 +50,9 @@ public class CopyingApp {
|
||||||
CopyingAppCommandParser cli;
|
CopyingAppCommandParser cli;
|
||||||
String jobName;
|
String jobName;
|
||||||
Integer blockSize = 100;
|
Integer blockSize = 100;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public CopyingApp(CopyingAppCommandParser cli) {
|
public CopyingApp(CopyingAppCommandParser cli) {
|
||||||
this.cli = cli;
|
this.cli = cli;
|
||||||
|
|
||||||
|
|
@ -107,28 +110,26 @@ public class CopyingApp {
|
||||||
|
|
||||||
long startTime = System.nanoTime();
|
long startTime = System.nanoTime();
|
||||||
|
|
||||||
log.info(String.format("%s - Tables are:",jobName));
|
log.info(String.format("%s - Jobs are:",jobName));
|
||||||
Object prop = config.getProperty("tables.table.name");
|
Object prop = config.getProperty("jobs.job.name");
|
||||||
if(prop instanceof Collection) {
|
if(prop instanceof Collection) {
|
||||||
int numTabs = ((Collection<?>) prop).size();
|
int numTabs = ((Collection<?>) prop).size();
|
||||||
log.info(String.format("%s - Number of tables: %s",jobName, new Integer(numTabs)));
|
log.info(String.format("%s - Number of jobs: %s",jobName, new Integer(numTabs)));
|
||||||
for(int i=0; i < numTabs; i++ ) {
|
for(int i=0; i < numTabs; i++ ) {
|
||||||
String tabName = config.getString("tables.table("+i+").name");
|
String tabName = config.getString("jobs.job("+i+").name");
|
||||||
String tabKey = config.getString("tables.table("+i+").key");
|
String tabKey = config.getString("jobs.job("+i+").key");
|
||||||
String tabSelect = config.getString("tables.table("+i+").select");
|
String tabSelect = config.getString("jobs.job("+i+").select");
|
||||||
String tabInsert = config.getString("tables.table("+i+").insert");
|
String tabInsert = config.getString("jobs.job("+i+").insert");
|
||||||
//processTable(sConn,dConn,tabName,tabKey,tabSelect,tabInsert,nRowsToLog);
|
|
||||||
Job j = new Job(sConn,dConn,tabName,jobName,tabKey,tabSelect,tabInsert,nRowsToLog,blockSize);
|
Job j = new Job(sConn,dConn,tabName,jobName,tabKey,tabSelect,tabInsert,nRowsToLog,blockSize);
|
||||||
j.start();
|
j.start();
|
||||||
j.join();
|
j.join();
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if(prop instanceof String) {
|
} else if(prop instanceof String) {
|
||||||
String tabName = config.getString("tables.table.name");
|
String tabName = config.getString("jobs.job.name");
|
||||||
String tabKey = config.getString("tables.table.key");
|
String tabKey = config.getString("jobs.job.key");
|
||||||
String tabSelect = config.getString("tables.table.select");
|
String tabSelect = config.getString("jobs.job.select");
|
||||||
String tabInsert = config.getString("tables.table.insert");
|
String tabInsert = config.getString("jobs.job.insert");
|
||||||
//processTable(sConn,dConn,tabName,tabKey,tabSelect,tabInsert,nRowsToLog);
|
|
||||||
Job j = new Job(sConn,dConn,tabName,jobName,tabKey,tabSelect,tabInsert,nRowsToLog,blockSize);
|
Job j = new Job(sConn,dConn,tabName,jobName,tabKey,tabSelect,tabInsert,nRowsToLog,blockSize);
|
||||||
j.start();
|
j.start();
|
||||||
j.join();
|
j.join();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue