5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-02 23:52:15 +08:00

SQOOP-6. Job completion percentage is inaccurate.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149945 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Bayer 2011-07-22 20:04:07 +00:00
parent 6efcec0da2
commit a7358e3585
2 changed files with 19 additions and 0 deletions

View File

@ -240,6 +240,18 @@ public boolean nextKeyValue() throws IOException {
return true;
}
/**
* @return true if nextKeyValue() would return false.
*/
protected boolean isDone() {
try {
return this.results != null
&& (results.isLast() || results.isAfterLast());
} catch (SQLException sqlE) {
return true;
}
}
protected DBInputFormat.DBInputSplit getSplit() {
return split;
}

View File

@ -18,6 +18,7 @@
package com.cloudera.sqoop.mapreduce.db;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
@ -55,6 +56,12 @@ public DataDrivenDBRecordReader(DBInputFormat.DBInputSplit split,
}
// CHECKSTYLE:ON
@Override
/** {@inheritDoc} */
public float getProgress() throws IOException {
return isDone() ? 1.0f : 0.0f;
}
/** Returns the query for selecting the records,
* subclasses can override this for custom behaviour.*/
protected String getSelectQuery() {