Refactor variable name

This commit is contained in:
Derry Hamilton 2019-07-12 13:03:08 +01:00
parent d34a0902d1
commit e71832f57a

View file

@ -77,7 +77,7 @@ public class Job extends Thread {
public void run() { public void run() {
try { try {
long rowsInserted = 0; long rowsInserted = 0;
long rowNum = 0; long rowsAttempted = 0;
long stamp = System.nanoTime(); long stamp = System.nanoTime();
long nstamp; long nstamp;
int columnCount = src.getMetaData().getColumnCount(); int columnCount = src.getMetaData().getColumnCount();
@ -95,13 +95,13 @@ public class Job extends Thread {
} }
log.trace("Producer queue full."); log.trace("Producer queue full.");
} }
rowNum++; rowsAttempted++;
if(rowNum % nRowsToLog == 0) { if(rowsAttempted % nRowsToLog == 0) {
log.info(String.format("%s - Queued %s rows for %s so far",jobName,rowNum,name)); log.info(String.format("%s - Queued %s rows for %s so far",jobName,rowsAttempted,name));
} }
} }
producerLive.set(false); producerLive.set(false);
log.info(String.format("%s - Queued a total of %s rows for %s",jobName,rowNum,name)); log.info(String.format("%s - Queued a total of %s rows for %s",jobName,rowsAttempted,name));
} catch(Exception e) { } catch(Exception e) {
producerLive.set(false); // Signal we've exited. producerLive.set(false); // Signal we've exited.
threadsExit.set(true); // Signal we've exited. threadsExit.set(true); // Signal we've exited.
@ -122,7 +122,7 @@ public class Job extends Thread {
} }
public void run() { public void run() {
try { try {
long rowNum = 0; long rowsAttempted = 0;
long rowsInserted = 0; long rowsInserted = 0;
while(true) { while(true) {
@ -133,7 +133,7 @@ public class Job extends Thread {
if(row == null && producerLive.get() == false) { if(row == null && producerLive.get() == false) {
rowsInserted += arraySum(insertStatement.executeBatch()); rowsInserted += arraySum(insertStatement.executeBatch());
dConn.commit(); dConn.commit();
log.info(String.format("%s - Inserted a total of %s of %s notified rows into %s",jobName,rowsInserted,rowNum,name)); log.info(String.format("%s - Inserted a total of %s of %s notified rows into %s",jobName,rowsInserted,rowsAttempted,name));
return; return;
} }
if(threadsExit.get()) { if(threadsExit.get()) {
@ -150,14 +150,14 @@ public class Job extends Thread {
} }
insertStatement.addBatch(); insertStatement.addBatch();
rowNum++; rowsAttempted++;
if(rowNum % nRowsToLog == 0) { if(rowsAttempted % nRowsToLog == 0) {
rowsInserted += arraySum(insertStatement.executeBatch()); rowsInserted += arraySum(insertStatement.executeBatch());
dConn.commit(); dConn.commit();
log.info(String.format("%s - Inserted %s of %s notified rows into %s", log.info(String.format("%s - Inserted %s of %s notified rows into %s",
jobName, jobName,
rowsInserted, rowsInserted,
rowNum, rowsAttempted,
name)); name));
} }
} }