[
https://issues.apache.org/jira/browse/SQOOP-1795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14223090#comment-14223090
]
Jarek Jarcec Cecho commented on SQOOP-1795:
-------------------------------------------
I'm responding to [~vybs] comment from SQOOP-1784:
{quote}
@jarcec, the tons of things that are in memory, having a request wrapper is not
going to increase the memory requirements of Sqoop. I have experience with past
projects that do have a custom wrapper to avoid these pitfalls.
{quote}
I would argue that the fact that we're trying to read the request body multiple
times means that we are doing something that we should not be doing and that
solution that is copying entire request into memory, is just hiding that fact.
If we have multiple structures in the request body, then we should read the
body only once and parse both structures. In the case of SQOOP-1784, the code
is actually going to the body to find something that is not there and hence we
should avoid that action all-together in my mind.
> Sqoop2: Retrieve Http post data in plausible manner
> ---------------------------------------------------
>
> Key: SQOOP-1795
> URL: https://issues.apache.org/jira/browse/SQOOP-1795
> Project: Sqoop
> Issue Type: Sub-task
> Reporter: Qian Xu
> Assignee: Qian Xu
> Priority: Minor
> Fix For: 1.99.5
>
>
> The situation of dealing with the post data is very tricky IMHO.
> 1. {{getRequest().getReader()}} must be called at the first place. As reading
> position cannot be reset, you might get unexpected result without notice.
> SQOOP-1784 is a case of the situation.
> 2. Sqoop client sends post data as a JSON object rather than query string
> format. Usually it'd suggest to wrap the JSON object as value, and key can be
> named as "jsonObject". The server will call
> {{ctx.getParameterValue("jsonObject")}} to get the value.
> I'd suggest to have a {{getRawPostData()}}, so that callers can put finger
> away from {{getReader()}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)