Review Board 1.7.22


SQOOP-854 pg_bulkload: Return value of pg_bulkload utility is being ignored

Review Request #9167 - Created Jan. 30, 2013 and submitted

Jarek Cecho
SQOOP-854
Reviewers
Sqoop
sqoop-trunk
I've added check of the return value.
Tested on real cluster.

Diff revision 1 (Latest)

  1. src/java/org/apache/sqoop/mapreduce/PGBulkloadExportMapper.java: Loading...
src/java/org/apache/sqoop/mapreduce/PGBulkloadExportMapper.java
Revision 14d064a51725b23fe79990df8288554b4a22556a New Change
[20] 203 lines
[+20] [+] protected void cleanup(Context context)
204
    out.close();
204
    out.close();
205
    try {
205
    try {
206
      thread.join();
206
      thread.join();
207
    } finally {
207
    } finally {
208
      // block until the process is done.
208
      // block until the process is done.
209
      int result = 0;

   
210
      if (null != process) {
209
      if (null != process) {
211
        while (true) {
210
        while (true) {
212
          try {
211
          try {
213
            result = process.waitFor();
212
            int returnValue = process.waitFor();

    
   
213

   

    
   
214
            // Check pg_bulkload's process return value

    
   
215
            if (returnValue != 0) {

    
   
216
              throw new RuntimeException(

    
   
217
                "Unexpected return value from pg_bulkload: "+ returnValue);

    
   
218
            }
214
          } catch (InterruptedException ie) {
219
          } catch (InterruptedException ie) {
215
            // interrupted; loop around.
220
            // interrupted; loop around.
216
            continue;
221
            continue;
217
          }
222
          }
218
          break;
223
          break;
[+20] [20] 72 lines
  1. src/java/org/apache/sqoop/mapreduce/PGBulkloadExportMapper.java: Loading...