Review Board 1.7.22


SQOOP-734 Change ConnectorBean to send JSON objects rather than sets of arrays

Review Request #8323 - Created Dec. 3, 2012 and submitted

Jarek Cecho
SQOOP-734
Reviewers
Sqoop
sqoop-sqoop2
I've changed the implementation based on proposal on JIRA.
* Unit tests are passing
* Tested on real cluster
client/src/main/java/org/apache/sqoop/client/shell/ShowConnectorFunction.java
Revision a34c48c8aa5794bba72cfd6c40fa1b375256e4bb New Change
[20] 16 lines
[+20]
17
 */
17
 */
18
package org.apache.sqoop.client.shell;
18
package org.apache.sqoop.client.shell;
19

    
   
19

   
20
import java.io.PrintWriter;
20
import java.io.PrintWriter;
21
import java.util.List;
21
import java.util.List;

    
   
22
import java.util.Map;
22
import java.util.ResourceBundle;
23
import java.util.ResourceBundle;
23

    
   
24

   
24
import org.apache.commons.cli.CommandLine;
25
import org.apache.commons.cli.CommandLine;
25
import org.apache.commons.cli.OptionBuilder;
26
import org.apache.commons.cli.OptionBuilder;
26
import org.apache.sqoop.json.ConnectorBean;
27
import org.apache.sqoop.json.ConnectorBean;
[+20] [20] 49 lines
[+20] [+] public Object execute(List<String> args) {
76
  }
77
  }
77

    
   
78

   
78
  private void showConnector(String cid) {
79
  private void showConnector(String cid) {
79
    ConnectorBean connectorBean = readConnector(cid);
80
    ConnectorBean connectorBean = readConnector(cid);
80
    List<MConnector> connectors = connectorBean.getConnectors();
81
    List<MConnector> connectors = connectorBean.getConnectors();
81
    List<ResourceBundle> bundles = connectorBean.getResourceBundles();
82
    Map<Long, ResourceBundle> bundles = connectorBean.getResourceBundles();
82

    
   
83

   
83
    io.out.println("@|bold " + connectors.size() + " connector(s) to show: |@");
84
    io.out.println("@|bold " + connectors.size() + " connector(s) to show: |@");
84
    for (int i = 0; i < connectors.size(); i++) {
85
    for (int i = 0; i < connectors.size(); i++) {
85
      MConnector connector = connectors.get(i);
86
      MConnector connector = connectors.get(i);
86

    
   
87

   
[+20] [20] 4 lines
[+20] private void showConnector(String cid) {
91
      io.out.print("  Name: ");
92
      io.out.print("  Name: ");
92
      io.out.println(connector.getUniqueName());
93
      io.out.println(connector.getUniqueName());
93
      io.out.print("  Class: ");
94
      io.out.print("  Class: ");
94
      io.out.println(connector.getClassName());
95
      io.out.println(connector.getClassName());
95

    
   
96

   
96
      displayFormMetadataDetails(io, connector, bundles.get(i));
97
      displayFormMetadataDetails(io, connector, bundles.get(connector.getPersistenceId()));
97

    
   
98

   
98
    }
99
    }
99

    
   
100

   
100
    io.out.println();
101
    io.out.println();
101
  }
102
  }
102
}
103
}
common/src/main/java/org/apache/sqoop/json/ConnectionBean.java
Revision c793465fed7847d80d2d91808ed9babba43bf19e New Change
 
common/src/main/java/org/apache/sqoop/json/ConnectorBean.java
Revision f630f7521b133691d7acebb5f29717caeabf6ae0 New Change
 
common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java
Revision 3d69bf8609adc431302b9c65aaf2ef2ab60047bc New Change
 
common/src/test/java/org/apache/sqoop/json/TestConnectorBean.java
Revision dc8dd95380acaf6689683e505dd4bfb42d6b3224 New Change
 
core/src/main/java/org/apache/sqoop/connector/ConnectorManager.java
Revision 82f88fd917fdbb6dc04b5f241be365a2feb466dc New Change
 
server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java
Revision 8a522439538da72c23a189454853a0335b8087f3 New Change
 
  1. client/src/main/java/org/apache/sqoop/client/shell/ShowConnectorFunction.java: Loading...
  2. common/src/main/java/org/apache/sqoop/json/ConnectionBean.java: Loading...
  3. common/src/main/java/org/apache/sqoop/json/ConnectorBean.java: Loading...
  4. common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java: Loading...
  5. common/src/test/java/org/apache/sqoop/json/TestConnectorBean.java: Loading...
  6. core/src/main/java/org/apache/sqoop/connector/ConnectorManager.java: Loading...
  7. server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java: Loading...