mirror of
https://github.com/apache/sqoop.git
synced 2025-05-03 00:10:26 +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:
parent
6efcec0da2
commit
a7358e3585
@ -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;
|
||||
}
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user