[ 
https://issues.apache.org/jira/browse/OODT-341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13212261#comment-13212261
 ] 

[email protected] commented on OODT-341:
----------------------------------------------------


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

Ship it!


After testing I believe this is good to go.


trunk/grid/src/main/java/org/apache/oodt/grid/ProductQueryServlet.java
<https://reviews.apache.org/r/3543/#comment11427>

    I remember receiving partial responses. Also the servlet API says to flush 
the output stream to commit the response. This is especially needed since we 
don't know the length of the response.
    
    
http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/ServletResponse.html#getOutputStream()



trunk/grid/src/main/java/org/apache/oodt/grid/ProductQueryServlet.java
<https://reviews.apache.org/r/3543/#comment11428>

    Quoted from servlet API here 
http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpServlet.html#doGet(javax.servlet.http.HttpServletRequest,%20javax.servlet.http.HttpServletResponse):
    
    Where possible, set the Content-Length header (with the 
ServletResponse.setContentLength(int) method), to allow the servlet container 
to use a persistent connection to return its response to the client, improving 
performance. The content length is automatically set if the entire response 
fits inside the response buffer.
    
    When using HTTP 1.1 chunked encoding (which means that the response has a 
Transfer-Encoding header), do not set the Content-Length header.
    -----
    Thus, we don't set Content-Length and always use chunked Transfer-Encoding.
    
    Tested using cURL to watch the header values.
    Tomcat 5.5.35 : works
    Tomcat 6.0.35: works
    Tomcat 7.0.25: works



trunk/xmlps/src/main/java/org/apache/oodt/xmlps/product/DBMSExecutor.java
<https://reviews.apache.org/r/3543/#comment11425>

    it is organized. OODT first, JDK second, removed unused imports.



trunk/xmlps/src/main/java/org/apache/oodt/xmlps/product/XMLPSProductHandler.java
<https://reviews.apache.org/r/3543/#comment11426>

    yep organized.


- Ricky


On 2012-01-19 02:54:44, Ricky Nguyen wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/3543/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-01-19 02:54:44)
bq.  
bq.  
bq.  Review request for oodt.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  See OODT-341: https://issues.apache.org/jira/browse/OODT-341
bq.  
bq.  * CDEResult extends org.apache.oodt.xmlquery.Result
bq.  * CDEResult mimetype is always "text/plain"
bq.  * CDEResult size is always 0
bq.  * CDEResult inputstream is CDEResultInputStream
bq.  * CDEResultInputStream has IO methods and wraps a CDEResult
bq.  * CDEResult wraps a ResultSet and returns rows as Strings, applying 
MappingFuncs if a Mapping is provided, and appending constant fields if a List 
of CDEValues is provided.
bq.  * ProductQueryServlet relies on servlet container to handle Content-Length 
(and possibly Transfer-Encoding: chunked)
bq.  
bq.  
bq.  This addresses bug OODT-341.
bq.      https://issues.apache.org/jira/browse/OODT-341
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    trunk/grid/src/main/java/org/apache/oodt/grid/ProductQueryServlet.java 
1183564 
bq.    trunk/xmlps/pom.xml 1233127 
bq.    
trunk/xmlps/src/main/java/org/apache/oodt/xmlps/product/DBMSExecutor.java 
1233127 
bq.    
trunk/xmlps/src/main/java/org/apache/oodt/xmlps/product/XMLPSProductHandler.java
 1233127 
bq.    trunk/xmlps/src/main/java/org/apache/oodt/xmlps/structs/CDEResult.java 
1233127 
bq.    
trunk/xmlps/src/main/java/org/apache/oodt/xmlps/structs/CDEResultInputStream.java
 PRE-CREATION 
bq.    
trunk/xmlps/src/test/java/org/apache/oodt/xmlps/structs/TestCDEResult.java 
PRE-CREATION 
bq.    
trunk/xmlps/src/test/java/org/apache/oodt/xmlps/structs/TestCDEResultInputStream.java
 PRE-CREATION 
bq.  
bq.  Diff: https://reviews.apache.org/r/3543/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  Runs in Tomcat 7. I've used it at CHLA.
bq.  NOT tested in other app servers. Which other app servers should I test?
bq.  NOT tested MappingFuncs. Is it necessary?
bq.  Added 2 unit tests: TestCDEResult and TestCDEResultInputStream, which both 
pass.
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Ricky
bq.  
bq.


                
> XMLPS should be able to stream large results
> --------------------------------------------
>
>                 Key: OODT-341
>                 URL: https://issues.apache.org/jira/browse/OODT-341
>             Project: OODT
>          Issue Type: Improvement
>          Components: xmlps
>    Affects Versions: 0.4
>            Reporter: Ricky Nguyen
>            Assignee: Chris A. Mattmann
>             Fix For: 0.4
>
>         Attachments: rickdn-grid-oodt-341.patch, rickdn-xmlps-oodt-341.patch, 
> rickdn-xmlps-oodt-341_1.patch
>
>
> Currently, XMLPS stores *ALL* the rows of a ResultSet in a CDEResult object.  
> In addition, this CDEResult is converted to a String for the HTTPResponse, 
> nearly doubling the memory usage.  With large results, heap space can easily 
> run out, despite increasing max heap space for the servlet container (e.g. 
> -Xmx1024m).  XMLPS should be able to stream/chunk its results, taking into 
> consideration the following:
> # ResultSets _represent_ an iterable collection of rows without actually 
> _storing_ all the rows in memory
> # HTTPResponse#getOutputStream() offers a streaming response, where chunked 
> transfer-encoding and content-length headers are managed automatically by the 
> servlet container (such as Tomcat)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to