Review Board 1.7.22


SQOOP-1111 Sqoop2: Implement version detection and structure updates into Derby repository

Review Request #12196 - Created June 30, 2013 and submitted

Jarek Cecho
SQOOP-1111
Reviewers
Sqoop
sqoop-sqoop2
I've implemented version detection, added new table for storing arbitrary key-value pairs inside the repository (for repository purpose only) and propagated changes from SQOOP-943.
Both unit and integration tests seems to be passing.
core/src/main/java/org/apache/sqoop/repository/JdbcRepository.java
Revision aa1aa8d3aee71de3ce337a1aa1fbbcc930a05429 New Change
[20] 124 lines
[+20] [+] public JdbcRepositoryTransaction getTransaction() {
125
  @Override
125
  @Override
126
  public void createOrUpdateInternals() {
126
  public void createOrUpdateInternals() {
127
    doWithConnection(new DoWithConnection() {
127
    doWithConnection(new DoWithConnection() {
128
      @Override
128
      @Override
129
      public Object doIt(Connection conn) throws Exception {
129
      public Object doIt(Connection conn) throws Exception {
130
        if (!handler.schemaExists()) {

   
131
          LOG.info("Creating repository schema objects");
130
        LOG.info("Creating repository schema objects");
132
          handler.createSchema();
131
        handler.createOrUpdateInternals(conn);
133
        }

   
134

    
   

   
135
        return null;
132
        return null;
136
      }
133
      }
137
    });
134
    });
138
  }
135
  }
139

    
   
136

   
140
  /**
137
  /**
141
   * {@inheritDoc}
138
   * {@inheritDoc}
142
   */
139
   */
143
  @Override
140
  @Override
144
  public boolean haveSuitableInternals() {
141
  public boolean haveSuitableInternals() {
145
    return (Boolean) doWithConnection(new DoWithConnection() {
142
    return (Boolean) doWithConnection(new DoWithConnection() {
146
      @Override
143
      @Override
147
      public Object doIt(Connection conn) throws Exception {
144
      public Object doIt(Connection conn) throws Exception {
148
        return handler.schemaExists();
145
        return handler.haveSuitableInternals(conn);
149
      }
146
      }
150
    });
147
    });
151
  }
148
  }
152

    
   
149

   
153
  /**
150
  /**
[+20] [20] 467 lines
core/src/main/java/org/apache/sqoop/repository/JdbcRepositoryHandler.java
Revision 538def56fc10bee6dea0363fbef5e85dfdae621a New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoConfigurationConstants.java
Revision beb983c8cd2f67d849369113300ca095de6379a4 New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoError.java
Revision 4455f48946c3621f5fb326758a1121e9bd5b3cfd New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
Revision 0ec4da1c7fcea95d3988018329c781f09a1a8ad2 New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaConstants.java
Revision 8cdbc63dd939b3ebe7b7784dd25523159651f237 New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
Revision 7a9ce505dc95cfcaab8b9e05d1310659e40a1a64 New Change
 
repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/DerbyTestCase.java
Revision 5ace598e12fe8f4b493c072797791c7eb0eb1161 New Change
 
repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestInternals.java
New File
 
  1. core/src/main/java/org/apache/sqoop/repository/JdbcRepository.java: Loading...
  2. core/src/main/java/org/apache/sqoop/repository/JdbcRepositoryHandler.java: Loading...
  3. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoConstants.java: Loading...
  4. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoError.java: Loading...
  5. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java: Loading...
  6. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaConstants.java: Loading...
  7. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java: Loading...
  8. repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/DerbyTestCase.java: Loading...
  9. repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestInternals.java: Loading...