Review Board 1.7.22


SQOOP-784: Sqoop2: Creating job for connection with id > 1 will results in NullPointerException

Review Request #8641 - Created Dec. 17, 2012 and submitted

Jarek Cecho
SQOOP-784
Reviewers
Sqoop
sqoop-sqoop2
It seems that we were using connection id instead of connector id.

 
client/src/main/java/org/apache/sqoop/client/shell/CreateJobFunction.java
Revision 2b55adc New Change
[20] 102 lines
[+20] [+] private void createJob(String connectionId, String type) throws IOException {
103

    
   
103

   
104
    MConnection connection = connectionBean.getConnections().get(0);
104
    MConnection connection = connectionBean.getConnections().get(0);
105

    
   
105

   
106
    connectorBean = readConnector(String.valueOf(connection.getConnectorId()));
106
    connectorBean = readConnector(String.valueOf(connection.getConnectorId()));
107
    MConnector connector = connectorBean.getConnectors().get(0);
107
    MConnector connector = connectorBean.getConnectors().get(0);
108
    ResourceBundle connectorBundle = connectorBean.getResourceBundles().get(connection.getPersistenceId());
108
    ResourceBundle connectorBundle = connectorBean.getResourceBundles().get(connector.getPersistenceId());
109

    
   
109

   
110
    MJob.Type jobType = MJob.Type.valueOf(type.toUpperCase());
110
    MJob.Type jobType = MJob.Type.valueOf(type.toUpperCase());
111

    
   
111

   
112
    MJob job = new MJob(
112
    MJob job = new MJob(
113
      connector.getPersistenceId(),
113
      connector.getPersistenceId(),
[+20] [20] 30 lines
  1. client/src/main/java/org/apache/sqoop/client/shell/CreateJobFunction.java: Loading...