Review Board 1.7.22


SQOOP-865 Sqoop2: Client request case is incorrectly setting the framework validations

Review Request #9328 - Created Feb. 6, 2013 and submitted

Jarek Cecho
SQOOP-865
Reviewers
Sqoop
sqoop-sqoop2
I've fixed code that is applying validations on client side.
I've tested it on real cluster.
client/src/main/java/org/apache/sqoop/client/core/RequestCache.java
Revision a5d70c5 New Change
[20] 102 lines
[+20] [+] public static ValidationBean createConnection(MConnection connection) {
103
    ValidationBean bean = createConnection(connection);
103
    ValidationBean bean = createConnection(connection);
104

    
   
104

   
105
    Validation connector = bean.getConnectorValidation();
105
    Validation connector = bean.getConnectorValidation();
106
    Validation framework = bean.getFrameworkValidation();
106
    Validation framework = bean.getFrameworkValidation();
107

    
   
107

   
108
    FormUtils.applyValidation(connection.getConnectorPart().getForms(),
108
    FormUtils.applyValidation(connection.getConnectorPart().getForms(), connector);
109
      connector);
109
    FormUtils.applyValidation(connection.getFrameworkPart().getForms(), framework);
110
    FormUtils.applyValidation(connection.getFrameworkPart().getForms(),

   
111
      connector);

   
112

    
   
110

   
113
    Long id = bean.getId();
111
    Long id = bean.getId();
114
    if(id != null) {
112
    if(id != null) {
115
      connection.setPersistenceId(id);
113
      connection.setPersistenceId(id);
116
    }
114
    }
[+20] [20] 15 lines
[+20] [+] public static ValidationBean updateConnection(MConnection connection) {
132
    ValidationBean bean = updateConnection(connection);
130
    ValidationBean bean = updateConnection(connection);
133

    
   
131

   
134
    Validation connector = bean.getConnectorValidation();
132
    Validation connector = bean.getConnectorValidation();
135
    Validation framework = bean.getFrameworkValidation();
133
    Validation framework = bean.getFrameworkValidation();
136

    
   
134

   
137
    FormUtils.applyValidation(connection.getConnectorPart().getForms(),
135
    FormUtils.applyValidation(connection.getConnectorPart().getForms(), connector);
138
      connector);
136
    FormUtils.applyValidation(connection.getFrameworkPart().getForms(), framework);
139
    FormUtils.applyValidation(connection.getFrameworkPart().getForms(),

   
140
      connector);

   
141

    
   
137

   
142
    Long id = bean.getId();
138
    Long id = bean.getId();
143
    if(id != null) {
139
    if(id != null) {
144
      connection.setPersistenceId(id);
140
      connection.setPersistenceId(id);
145
    }
141
    }
[+20] [20] 13 lines
[+20] [+] public static ValidationBean createJob(MJob job) {
159
    ValidationBean bean = createJob(job);
155
    ValidationBean bean = createJob(job);
160

    
   
156

   
161
    Validation connector = bean.getConnectorValidation();
157
    Validation connector = bean.getConnectorValidation();
162
    Validation framework = bean.getFrameworkValidation();
158
    Validation framework = bean.getFrameworkValidation();
163

    
   
159

   
164
    FormUtils.applyValidation(job.getConnectorPart().getForms(),
160
    FormUtils.applyValidation(job.getConnectorPart().getForms(), connector);
165
      connector);
161
    FormUtils.applyValidation(job.getFrameworkPart().getForms(), framework);
166
    FormUtils.applyValidation(job.getFrameworkPart().getForms(),

   
167
      connector);

   
168

    
   
162

   
169
    Long id = bean.getId();
163
    Long id = bean.getId();
170
    if(id != null) {
164
    if(id != null) {
171
      job.setPersistenceId(id);
165
      job.setPersistenceId(id);
172
    }
166
    }
[+20] [20] 13 lines
[+20] [+] public static ValidationBean updateJob(MJob job) {
186
    ValidationBean bean = updateJob(job);
180
    ValidationBean bean = updateJob(job);
187

    
   
181

   
188
    Validation connector = bean.getConnectorValidation();
182
    Validation connector = bean.getConnectorValidation();
189
    Validation framework = bean.getFrameworkValidation();
183
    Validation framework = bean.getFrameworkValidation();
190

    
   
184

   
191
    FormUtils.applyValidation(job.getConnectorPart().getForms(),
185
    FormUtils.applyValidation(job.getConnectorPart().getForms(), connector);
192
      connector);
186
    FormUtils.applyValidation(job.getFrameworkPart().getForms(), framework);
193
    FormUtils.applyValidation(job.getFrameworkPart().getForms(),

   
194
      connector);

   
195

    
   
187

   
196
    Long id = bean.getId();
188
    Long id = bean.getId();
197
    if(id != null) {
189
    if(id != null) {
198
      job.setPersistenceId(id);
190
      job.setPersistenceId(id);
199
    }
191
    }
[+20] [20] 30 lines
  1. client/src/main/java/org/apache/sqoop/client/core/RequestCache.java: Loading...