Review Board 1.7.22


SQOOP-806 Sqoop2: Put "creation" and "lastUpdate" date to Connection and Job objects

Review Request #8801 - Created Jan. 2, 2013 and submitted

Jarek Cecho
SQOOP-806
Reviewers
Sqoop
sqoop-sqoop2
I've added proposed functionality.
* I've added or enhanced existing unit tests
* I've tested it on real cluster
client/src/main/java/org/apache/sqoop/client/shell/ShowConnectionFunction.java
Revision 17cb84a71a6833de9e6caef9a020cb2919f7fae0 New Change
[20] 22 lines
[+20]
23
import org.apache.sqoop.json.ConnectionBean;
23
import org.apache.sqoop.json.ConnectionBean;
24
import org.apache.sqoop.model.MConnection;
24
import org.apache.sqoop.model.MConnection;
25
import org.codehaus.groovy.tools.shell.IO;
25
import org.codehaus.groovy.tools.shell.IO;
26

    
   
26

   
27
import java.io.PrintWriter;
27
import java.io.PrintWriter;

    
   
28
import java.text.DateFormat;
28
import java.text.MessageFormat;
29
import java.text.MessageFormat;
29
import java.util.List;
30
import java.util.List;
30

    
   
31

   
31
import static org.apache.sqoop.client.utils.FormDisplayer.*;
32
import static org.apache.sqoop.client.utils.FormDisplayer.*;
32
import static org.apache.sqoop.client.core.RequestCache.*;
33
import static org.apache.sqoop.client.core.RequestCache.*;
[+20] [20] 54 lines
[+20] [+] private void showConnection(String xid) {
87
    String s = MessageFormat.format(getResource().getString(Constants
88
    String s = MessageFormat.format(getResource().getString(Constants
88
        .RES_SHOW_PROMPT_CONNS_TO_SHOW), connections.size());
89
        .RES_SHOW_PROMPT_CONNS_TO_SHOW), connections.size());
89

    
   
90

   
90
    io.out.println(s);
91
    io.out.println(s);
91

    
   
92

   

    
   
93
    DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);

    
   
94

   
92
    for (MConnection connection : connections) {
95
    for (MConnection connection : connections) {
93
      s =  MessageFormat.format(getResource().getString
96
      s =  MessageFormat.format(
94
          (Constants.RES_SHOW_PROMPT_CONN_INFO), connection.getPersistenceId(),
97
        getResource().getString(Constants.RES_SHOW_PROMPT_CONN_INFO),
95
          connection.getName());
98
        connection.getPersistenceId(),

    
   
99
        connection.getName(),

    
   
100
        formatter.format(connection.getCreationDate()),

    
   
101
        formatter.format(connection.getLastUpdateDate())

    
   
102
      );
96
      io.out.println(s);
103
      io.out.println(s);
97

    
   
104

   
98
      long connectorId = connection.getConnectorId();
105
      long connectorId = connection.getConnectorId();
99

    
   
106

   
100
      // Display connector part
107
      // Display connector part
[+20] [20] 9 lines
client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java
Revision b0780ef48644813a374f37b99832b6e6ded3d6ca New Change
 
client/src/main/resources/client-resource.properties
Revision 7bc7486a29a3663e4926e40c8b8623a829ac010f New Change
 
common/src/main/java/org/apache/sqoop/json/ConnectionBean.java
Revision 4562047420879264ff27e5fcab63cb14b590bd01 New Change
 
common/src/main/java/org/apache/sqoop/json/JobBean.java
Revision 539efe03fae0edf5ce5baba6fcb14c0924f53709 New Change
 
common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java
Revision e4919b2ab0e03185ccfd407745b9063162a5a158 New Change
 
common/src/main/java/org/apache/sqoop/model/MAccountableEntity.java
New File
 
common/src/main/java/org/apache/sqoop/model/MConnection.java
Revision 5af25a9fea472c1d0173fa9f813d4445b4aca247 New Change
 
common/src/main/java/org/apache/sqoop/model/MJob.java
Revision 87f222dd735fd3dd3982a9fd6b2ced719c89f19a New Change
 
common/src/main/java/org/apache/sqoop/model/MSubmission.java
Revision 24f175bd5690d69dc9dd0306eb9c83b17c922e89 New Change
 
common/src/test/java/org/apache/sqoop/json/TestConnectionBean.java
Revision c11b600492446ada15a5cdf125db1a896b995723 New Change
 
common/src/test/java/org/apache/sqoop/json/TestJobBean.java
Revision 521b2b9751799529acd3980ad62f6deea98b5a55 New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
Revision c62730ccd077663c763ece7df0c044acd437ffcc New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaConstants.java
Revision 875b41aad6e2e72fc6f110316532afbf4655a459 New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
Revision d0fd598c77e7b849e7a73b18344d7ed9ad7b7093 New Change
 
  1. client/src/main/java/org/apache/sqoop/client/shell/ShowConnectionFunction.java: Loading...
  2. client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java: Loading...
  3. client/src/main/resources/client-resource.properties: Loading...
  4. common/src/main/java/org/apache/sqoop/json/ConnectionBean.java: Loading...
  5. common/src/main/java/org/apache/sqoop/json/JobBean.java: Loading...
  6. common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java: Loading...
  7. common/src/main/java/org/apache/sqoop/model/MAccountableEntity.java: Loading...
  8. common/src/main/java/org/apache/sqoop/model/MConnection.java: Loading...
  9. common/src/main/java/org/apache/sqoop/model/MJob.java: Loading...
  10. common/src/main/java/org/apache/sqoop/model/MSubmission.java: Loading...
  11. common/src/test/java/org/apache/sqoop/json/TestConnectionBean.java: Loading...
  12. common/src/test/java/org/apache/sqoop/json/TestJobBean.java: Loading...
  13. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java: Loading...
  14. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaConstants.java: Loading...
  15. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java: Loading...