Review Board 1.7.22


SQOOP-971 Add dynamic reconfiguration ability to RepositoryManager, ConnectorManager and FrameworkManager

Review Request #11920 - Created June 17, 2013 and submitted

Mengwei Ding
SQOOP-971
Reviewers
Sqoop
abe, hshreedharan, jarcec
sqoop-sqoop2
commit 8f40d46cf416979271058a21d45c328710608624
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Date:   Thu Jun 20 15:02:56 2013 -0700

    SQOOP-971 Add dynamic reconfiguration ability to RepositoryManager, ConnectorManager and FrameworkManager

:100644 100644 500189a... 0540f6b... M	core/src/main/java/org/apache/sqoop/connector/ConnectorManager.java
:100644 100644 f59d132... eb7c1dc... M	core/src/main/java/org/apache/sqoop/core/CoreError.java
:000000 100644 0000000... d25ce41... A	core/src/main/java/org/apache/sqoop/core/Reconfigurable.java
:100644 100644 deb24c9... 13bbfc2... M	core/src/main/java/org/apache/sqoop/core/SqoopConfiguration.java
:100644 100644 84896d6... 90bb327... M	core/src/main/java/org/apache/sqoop/core/SqoopServer.java
:100644 100644 145a2c1... a81306b... M	core/src/main/java/org/apache/sqoop/framework/FrameworkManager.java
:000000 100644 0000000... 9e90cac... A	core/src/main/java/org/apache/sqoop/framework/JobManager.java
:100644 100644 3339c59... e709975... M	core/src/main/java/org/apache/sqoop/repository/JdbcRepositoryProvider.java
:100644 100644 955306d... d35b080... M	core/src/main/java/org/apache/sqoop/repository/RepositoryManager.java
:100644 100644 4ea52e9... 1ec6bdf... M	core/src/main/java/org/apache/sqoop/repository/RepositoryProvider.java
:100644 100644 de9a24b... b61a6d6... M	server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java

 
core/src/main/java/org/apache/sqoop/connector/ConnectorManager.java
Revision 500189a New Change
[20] 30 lines
[+20]
31

    
   
31

   
32
import org.apache.log4j.Logger;
32
import org.apache.log4j.Logger;
33
import org.apache.sqoop.common.SqoopException;
33
import org.apache.sqoop.common.SqoopException;
34
import org.apache.sqoop.connector.spi.SqoopConnector;
34
import org.apache.sqoop.connector.spi.SqoopConnector;
35
import org.apache.sqoop.core.ConfigurationConstants;
35
import org.apache.sqoop.core.ConfigurationConstants;

    
   
36
import org.apache.sqoop.core.Reconfigurable;

    
   
37
import org.apache.sqoop.core.SqoopConfiguration;

    
   
38
import org.apache.sqoop.core.SqoopConfiguration.CoreConfigurationListener;
36
import org.apache.sqoop.repository.Repository;
39
import org.apache.sqoop.repository.Repository;
37
import org.apache.sqoop.repository.RepositoryManager;
40
import org.apache.sqoop.repository.RepositoryManager;
38
import org.apache.sqoop.repository.RepositoryTransaction;
41
import org.apache.sqoop.repository.RepositoryTransaction;
39
import org.apache.sqoop.model.MConnector;
42
import org.apache.sqoop.model.MConnector;
40

    
   
43

   
41
public class ConnectorManager {
44
public class ConnectorManager implements Reconfigurable {
42

    
   
45

   
43
  /**
46
  /**
44
   * Logger object.
47
   * Logger object.
45
   */
48
   */
46
  private static final Logger LOG = Logger.getLogger(ConnectorManager.class);
49
  private static final Logger LOG = Logger.getLogger(ConnectorManager.class);
[+20] [20] 135 lines
[+20] [+] public synchronized void initialize() {
182
      throw new SqoopException(ConnectorError.CONN_0001, ex);
185
      throw new SqoopException(ConnectorError.CONN_0001, ex);
183
    }
186
    }
184

    
   
187

   
185
    registerConnectors();
188
    registerConnectors();
186

    
   
189

   

    
   
190
    SqoopConfiguration.getInstance().getProvider().registerListener(new CoreConfigurationListener(this));

    
   
191

   
187
    if (LOG.isInfoEnabled()) {
192
    if (LOG.isInfoEnabled()) {
188
      LOG.info("Connectors loaded: " + handlerMap);
193
      LOG.info("Connectors loaded: " + handlerMap);
189
    }
194
    }
190
  }
195
  }
191

    
   
196

   
[+20] [20] 37 lines
[+20] [+] private synchronized void registerConnectors() {
229

    
   
234

   
230
  public synchronized void destroy() {
235
  public synchronized void destroy() {
231
      handlerMap = null;
236
      handlerMap = null;
232
      nameMap = null;
237
      nameMap = null;
233
  }
238
  }

    
   
239

   

    
   
240
  @Override

    
   
241
  public synchronized void configurationChanged() {

    
   
242
    LOG.info("Begin connector manager reconfiguring");

    
   
243
    // If there are configuration options for ConnectorManager,

    
   
244
    // implement the reconfiguration procedure right here.

    
   
245
    LOG.info("Connector manager reconfigured");

    
   
246
  }

    
   
247

   
234
}
248
}
core/src/main/java/org/apache/sqoop/core/CoreError.java
Revision f59d132 New Change
 
core/src/main/java/org/apache/sqoop/core/Reconfigurable.java
New File
 
core/src/main/java/org/apache/sqoop/core/SqoopConfiguration.java
Revision deb24c9 New Change
 
core/src/main/java/org/apache/sqoop/framework/FrameworkManager.java
Revision 704b809 New Change
 
core/src/main/java/org/apache/sqoop/framework/JobManager.java
Revision fd9aac9 New Change
 
core/src/main/java/org/apache/sqoop/repository/JdbcRepositoryProvider.java
Revision 3339c59 New Change
 
core/src/main/java/org/apache/sqoop/repository/RepositoryManager.java
Revision 955306d New Change
 
core/src/main/java/org/apache/sqoop/repository/RepositoryProvider.java
Revision 4ea52e9 New Change
 
server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java
Revision 1c40fc1 New Change
 
  1. core/src/main/java/org/apache/sqoop/connector/ConnectorManager.java: Loading...
  2. core/src/main/java/org/apache/sqoop/core/CoreError.java: Loading...
  3. core/src/main/java/org/apache/sqoop/core/Reconfigurable.java: Loading...
  4. core/src/main/java/org/apache/sqoop/core/SqoopConfiguration.java: Loading...
  5. core/src/main/java/org/apache/sqoop/framework/FrameworkManager.java: Loading...
  6. core/src/main/java/org/apache/sqoop/framework/JobManager.java: Loading...
  7. core/src/main/java/org/apache/sqoop/repository/JdbcRepositoryProvider.java: Loading...
  8. core/src/main/java/org/apache/sqoop/repository/RepositoryManager.java: Loading...
  9. core/src/main/java/org/apache/sqoop/repository/RepositoryProvider.java: Loading...
  10. server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java: Loading...