Review Board 1.7.22


SQOOP-943 Sqoop2: Repository wide configuration of immutable disk structures

Review Request #9849 - Created March 11, 2013 and submitted

Jarek Cecho
SQOOP-943
Reviewers
Sqoop
sqoop-sqoop2
I've promote the idea of immutable on disk structures to a first class citizen. I've also removed similar concept from JDBC Repository implementation as it would be duplicating functionality.
Unit and integration tests seems to be passing.
core/src/main/java/org/apache/sqoop/repository/JdbcRepository.java
Revision d42e34afc9af0fe0c654c93159809ed93999043b New Change
[20] 28 lines
[+20]
29
import org.apache.sqoop.model.MJob;
29
import org.apache.sqoop.model.MJob;
30
import org.apache.sqoop.model.MSubmission;
30
import org.apache.sqoop.model.MSubmission;
31

    
   
31

   
32
public class JdbcRepository extends Repository {
32
public class JdbcRepository extends Repository {
33

    
   
33

   
34
  private static final Logger LOG =
34
  private static final Logger LOG = Logger.getLogger(JdbcRepository.class);
35
      Logger.getLogger(JdbcRepository.class);

   
36

    
   
35

   
37
  private final JdbcRepositoryHandler handler;
36
  private final JdbcRepositoryHandler handler;
38
  private final JdbcRepositoryContext repoContext;
37
  private final JdbcRepositoryContext repoContext;
39

    
   
38

   
40
  protected JdbcRepository(JdbcRepositoryHandler handler,
39
  protected JdbcRepository(JdbcRepositoryHandler handler,
[+20] [20] 81 lines
[+20] [+] public JdbcRepositoryTransaction getTransaction() {
122

    
   
121

   
123
  /**
122
  /**
124
   * {@inheritDoc}
123
   * {@inheritDoc}
125
   */
124
   */
126
  @Override
125
  @Override

    
   
126
  public void createOrUpdateInternals() {

    
   
127
    doWithConnection(new DoWithConnection() {

    
   
128
      @Override

    
   
129
      public Object doIt(Connection conn) throws Exception {

    
   
130
        if (!handler.schemaExists()) {

    
   
131
          LOG.info("Creating repository schema objects");

    
   
132
          handler.createSchema();

    
   
133
        }

    
   
134

   

    
   
135
        return null;

    
   
136
      }

    
   
137
    });

    
   
138
  }

    
   
139

   

    
   
140
  /**

    
   
141
   * {@inheritDoc}

    
   
142
   */

    
   
143
  @Override

    
   
144
  public boolean haveSuitableInternals() {

    
   
145
    return (Boolean) doWithConnection(new DoWithConnection() {

    
   
146
      @Override

    
   
147
      public Object doIt(Connection conn) throws Exception {

    
   
148
        return handler.schemaExists();

    
   
149
      }

    
   
150
    });

    
   
151
  }

    
   
152

   

    
   
153
  /**

    
   
154
   * {@inheritDoc}

    
   
155
   */

    
   
156
  @Override
127
  public MConnector registerConnector(final MConnector mConnector) {
157
  public MConnector registerConnector(final MConnector mConnector) {
128

    
   
158

   
129
    return (MConnector) doWithConnection(new DoWithConnection() {
159
    return (MConnector) doWithConnection(new DoWithConnection() {
130
      @Override
160
      @Override
131
      public Object doIt(Connection conn) throws Exception {
161
      public Object doIt(Connection conn) throws Exception {
[+20] [20] 427 lines
core/src/main/java/org/apache/sqoop/repository/JdbcRepositoryContext.java
Revision 8989fb6fb00a8278f7d6d457dbe5b9193fd2d58e New Change
 
core/src/main/java/org/apache/sqoop/repository/JdbcRepositoryProvider.java
Revision 3339c597b92131ed87b3ee1a95c1c7d75c5212dc New Change
 
core/src/main/java/org/apache/sqoop/repository/RepoConfigurationConstants.java
Revision 8939f8a12356155a5bb76b4d8da40ae82abc1506 New Change
 
core/src/main/java/org/apache/sqoop/repository/Repository.java
Revision 21dd759ea0825438de26b3538acca95a72a2a359 New Change
 
core/src/main/java/org/apache/sqoop/repository/RepositoryError.java
Revision 4cae7bafe4086b5c5816b57c5b1eee523f6ece7c New Change
 
core/src/main/java/org/apache/sqoop/repository/RepositoryManager.java
Revision 955306d1536a53d5ec93b17c2ce1255f3f06df54 New Change
 
dist/src/main/server/conf/sqoop.properties
Revision 5131aad897cb765e84d3aec32e0eb05846f01676 New Change
 
test/src/main/java/org/apache/sqoop/test/minicluster/SqoopMiniCluster.java
Revision 3620c28a6323f37302ad6a3d877163cf09d9e20f New Change
 
  1. core/src/main/java/org/apache/sqoop/repository/JdbcRepository.java: Loading...
  2. core/src/main/java/org/apache/sqoop/repository/JdbcRepositoryContext.java: Loading...
  3. core/src/main/java/org/apache/sqoop/repository/JdbcRepositoryProvider.java: Loading...
  4. core/src/main/java/org/apache/sqoop/repository/RepoConfigurationConstants.java: Loading...
  5. core/src/main/java/org/apache/sqoop/repository/Repository.java: Loading...
  6. core/src/main/java/org/apache/sqoop/repository/RepositoryError.java: Loading...
  7. core/src/main/java/org/apache/sqoop/repository/RepositoryManager.java: Loading...
  8. dist/src/main/server/conf/sqoop.properties: Loading...
  9. test/src/main/java/org/apache/sqoop/test/minicluster/SqoopMiniCluster.java: Loading...