lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r586617 - in /lucene/solr/trunk/src/java/org/apache/solr/request: JSONResponseWriter.java PHPResponseWriter.java PHPSerializedResponseWriter.java PythonResponseWriter.java RubyResponseWriter.java TextResponseWriter.java
Date Fri, 19 Oct 2007 21:26:05 GMT
Author: yonik
Date: Fri Oct 19 14:26:05 2007
New Revision: 586617

URL: http://svn.apache.org/viewvc?rev=586617&view=rev
Log:
SOLR-377: make sure FastWriter buffer is flushed after writing response

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java
    lucene/solr/trunk/src/java/org/apache/solr/request/PHPResponseWriter.java
    lucene/solr/trunk/src/java/org/apache/solr/request/PHPSerializedResponseWriter.java
    lucene/solr/trunk/src/java/org/apache/solr/request/PythonResponseWriter.java
    lucene/solr/trunk/src/java/org/apache/solr/request/RubyResponseWriter.java
    lucene/solr/trunk/src/java/org/apache/solr/request/TextResponseWriter.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java?rev=586617&r1=586616&r2=586617&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java Fri Oct 19
14:26:05 2007
@@ -43,7 +43,11 @@
 
   public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException
{
     JSONWriter w = new JSONWriter(writer, req, rsp);
-    w.writeResponse();
+    try {
+      w.writeResponse();
+    } finally {
+      w.close();
+    }
   }
 
   public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {
@@ -83,7 +87,6 @@
     if(wrapperFunction!=null) {
         writer.write(')');
     }
-    writer.flushBuffer();
   }
 
   protected void writeKey(String fname, boolean needsEscaping) throws IOException {

Modified: lucene/solr/trunk/src/java/org/apache/solr/request/PHPResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/request/PHPResponseWriter.java?rev=586617&r1=586616&r2=586617&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/request/PHPResponseWriter.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/request/PHPResponseWriter.java Fri Oct 19 14:26:05
2007
@@ -31,7 +31,11 @@
   
  public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException
{
     PHPWriter w = new PHPWriter(writer, req, rsp);
-    w.writeResponse();
+    try {
+      w.writeResponse();
+    } finally {
+      w.close();
+    }
   }
 
   public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {

Modified: lucene/solr/trunk/src/java/org/apache/solr/request/PHPSerializedResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/request/PHPSerializedResponseWriter.java?rev=586617&r1=586616&r2=586617&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/request/PHPSerializedResponseWriter.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/request/PHPSerializedResponseWriter.java Fri
Oct 19 14:26:05 2007
@@ -43,7 +43,11 @@
   
  public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException
{
     PHPSerializedWriter w = new PHPSerializedWriter(writer, req, rsp);
-    w.writeResponse();
+    try {
+      w.writeResponse();
+    } finally {
+      w.close();
+    }
   }
 
   public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {

Modified: lucene/solr/trunk/src/java/org/apache/solr/request/PythonResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/request/PythonResponseWriter.java?rev=586617&r1=586616&r2=586617&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/request/PythonResponseWriter.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/request/PythonResponseWriter.java Fri Oct 19
14:26:05 2007
@@ -31,7 +31,11 @@
   
   public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException
{
     PythonWriter w = new PythonWriter(writer, req, rsp);
-    w.writeResponse();
+    try {
+      w.writeResponse();
+    } finally {
+      w.close();
+    }
   }
 
   public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {

Modified: lucene/solr/trunk/src/java/org/apache/solr/request/RubyResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/request/RubyResponseWriter.java?rev=586617&r1=586616&r2=586617&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/request/RubyResponseWriter.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/request/RubyResponseWriter.java Fri Oct 19
14:26:05 2007
@@ -30,7 +30,11 @@
   
  public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException
{
     RubyWriter w = new RubyWriter(writer, req, rsp);
-    w.writeResponse();
+    try {
+      w.writeResponse();
+    } finally {
+      w.close();
+    }
   }
 
   public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {

Modified: lucene/solr/trunk/src/java/org/apache/solr/request/TextResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/request/TextResponseWriter.java?rev=586617&r1=586616&r2=586617&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/request/TextResponseWriter.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/request/TextResponseWriter.java Fri Oct 19
14:26:05 2007
@@ -59,6 +59,11 @@
     returnFields = rsp.getReturnFields();
   }
 
+  /** done with this ResponseWriter... make sure any buffers are flushed to writer */
+  public void close() throws IOException {
+    writer.flushBuffer();
+  }
+
   /** returns the Writer that the response is being written to */
   public Writer getWriter() { return writer; }
 



Mime
View raw message