-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28434/
-----------------------------------------------------------

(Updated Nov. 27, 2014, 4:59 p.m.)


Review request for Sqoop.


Changes
-------

Hide json parsing details


Bugs: SQOOP-1795
    https://issues.apache.org/jira/browse/SQOOP-1795


Repository: sqoop-sqoop2


Description
-------

Sqoop client posts parameters as JSON to server. As it is not query string 
based pattern, HttpServletRequest is not able to return the JSON using 
`getParameterValue(...)`. The current solution is to call `getReader()` to get 
raw post data. There is a danger, if the method is NOT called at the first 
place. You do not know, whether the reading position is at the beginning. You 
might get unexpected result without notice.

Expectedly:
1. For query string based pattern, caller should always use 
`getParameterValue(...)`.
2. For raw post data usage, the post data is parsed as the first parameter's 
key. 

The patch proposes to add `RequestContext.getFirstParameterName()`. so that we 
can keep fingers away from `getReader()`.


Diffs (updated)
-----

  server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java 75a069a 
  server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java d2d080b 
  server/src/main/java/org/apache/sqoop/server/RequestContext.java d0963f5 

Diff: https://reviews.apache.org/r/28434/diff/


Testing
-------

All passed. (Nits: adding unit tests)


Thanks,

Qian Xu

Reply via email to