Review Board 1.7.22


Fix for SQOOP-1075: Persist framework version in repository

Review Request #12774 - Created July 19, 2013 and submitted

Raghav Gautam
SQOOP-1075
Reviewers
Sqoop
sqoop-sqoop2
A summary of changes:
1. MFramework: added fields, getter & setter method for version. Made changes to other methods to take version into account.
2. MConnector: since it extends MFramework, can use his version field and methods
3. FrameworkBean, FormSerialization: encode/decode version field to json
4. DerbyRepositoryHandler, DerbyRepoError: added private methods to persist/fetch framework version; update framework version when registering/updating framework
5. TestFrameworkHandling: added test - the test checks for current version of framework, changes it to lower version updates the framework and checks the version of framework once again
6. TestSqoopClient, TestUtils, TestMFramework, FrameworkManager, DerbyTestCase: added version parameter to the MFramework constructor call.
I have added new tests.
All the unit tests are passing.
client/src/test/java/org/apache/sqoop/client/TestSqoopClient.java
Revision 1778cf1 New Change
[20] 181 lines
[+20] [+] private MConnector connector(long id) {
182
    connector.setPersistenceId(id);
182
    connector.setPersistenceId(id);
183
    return connector;
183
    return connector;
184
  }
184
  }
185

    
   
185

   
186
  private MFramework framework() {
186
  private MFramework framework() {
187
    MFramework framework = new MFramework(new MConnectionForms(null), new LinkedList<MJobForms>());
187
    MFramework framework = new MFramework(new MConnectionForms(null), new LinkedList<MJobForms>(),

    
   
188
      MFramework.CURRENT_VERSION);
188
    framework.setPersistenceId(1);
189
    framework.setPersistenceId(1);
189
    return framework;
190
    return framework;
190
  }
191
  }
191
}
192
}
common/src/main/java/org/apache/sqoop/json/FrameworkBean.java
Revision ad4753b New Change
 
common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java
Revision 98768d6 New Change
 
common/src/main/java/org/apache/sqoop/model/MConnector.java
Revision 1c2c422 New Change
 
common/src/main/java/org/apache/sqoop/model/MFramework.java
Revision 694f022 New Change
 
common/src/test/java/org/apache/sqoop/json/TestUtil.java
Revision b88d7a4 New Change
 
common/src/test/java/org/apache/sqoop/model/TestMFramework.java
Revision a5366ca New Change
 
core/src/main/java/org/apache/sqoop/framework/FrameworkManager.java
Revision ad6cd0f New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoError.java
Revision aeb7533 New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
Revision f717abf New Change
 
repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/DerbyTestCase.java
Revision 677b0be New Change
 
repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestFrameworkHandling.java
Revision 66611d4 New Change
 
  1. client/src/test/java/org/apache/sqoop/client/TestSqoopClient.java: Loading...
  2. common/src/main/java/org/apache/sqoop/json/FrameworkBean.java: Loading...
  3. common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java: Loading...
  4. common/src/main/java/org/apache/sqoop/model/MConnector.java: Loading...
  5. common/src/main/java/org/apache/sqoop/model/MFramework.java: Loading...
  6. common/src/test/java/org/apache/sqoop/json/TestUtil.java: Loading...
  7. common/src/test/java/org/apache/sqoop/model/TestMFramework.java: Loading...
  8. core/src/main/java/org/apache/sqoop/framework/FrameworkManager.java: Loading...
  9. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoError.java: Loading...
  10. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java: Loading...
  11. repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/DerbyTestCase.java: Loading...
  12. repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestFrameworkHandling.java: Loading...