Review Board 1.7.22


SQOOP-1041 Framework upgrade in JdbcRepository returns the outdated value

Review Request #11073 - Created May 12, 2013 and submitted

Jarek Cecho
SQOOP-1041
Reviewers
Sqoop
sqoop-sqoop2
I've put a condition to call the framework upgrade only if the forms are different. Unfortunately we're currently not serializing the framework version, so there is no better way.
Both unit and integration tests seems to be working.
core/src/main/java/org/apache/sqoop/repository/JdbcRepository.java
Revision bc6af37 New Change
[20] 180 lines
[+20] [+] public MFramework registerFramework(final MFramework mFramework) {
181
        MFramework result = handler.findFramework(conn);
181
        MFramework result = handler.findFramework(conn);
182
        if (result == null) {
182
        if (result == null) {
183
          handler.registerFramework(mFramework, conn);
183
          handler.registerFramework(mFramework, conn);
184
          return mFramework;
184
          return mFramework;
185
        } else {
185
        } else {

    
   
186
          // We're currently not serializing framework version into repository

    
   
187
          // so let's just compare the structure to see if we need upgrade.

    
   
188
          if(!mFramework.equals(result)) {
186
          upgradeFramework(mFramework);
189
            upgradeFramework(mFramework);

    
   
190
            return mFramework;

    
   
191
          }
187
          return result;
192
          return result;
188
        }
193
        }
189
      }
194
      }
190
    });
195
    });
191
  }
196
  }
[+20] [20] 362 lines
  1. core/src/main/java/org/apache/sqoop/repository/JdbcRepository.java: Loading...