mirror of https://github.com/apache/lucene.git
SOLR-5244: Exporting Full Sorted Result Sets
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1619783 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
acf9242850
commit
2d7427dd07
|
@ -72,7 +72,9 @@ public class SortingResponseWriter implements QueryResponseWriter {
|
|||
public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse res) throws IOException {
|
||||
Exception e1 = res.getException();
|
||||
if(e1 != null) {
|
||||
e1.printStackTrace(new PrintWriter(writer));
|
||||
if(!(e1 instanceof IgnoreException)) {
|
||||
e1.printStackTrace(new PrintWriter(writer));
|
||||
}
|
||||
return;
|
||||
}
|
||||
SolrRequestInfo info = SolrRequestInfo.getRequestInfo();
|
||||
|
@ -175,8 +177,7 @@ public class SortingResponseWriter implements QueryResponseWriter {
|
|||
while(ex != null) {
|
||||
String m = ex.getMessage();
|
||||
if(m != null && m.contains("Broken pipe")) {
|
||||
logger.info("Early client disconnect during export");
|
||||
return;
|
||||
throw new IgnoreException();
|
||||
}
|
||||
ex = ex.getCause();
|
||||
}
|
||||
|
@ -194,7 +195,16 @@ public class SortingResponseWriter implements QueryResponseWriter {
|
|||
writer.flush();
|
||||
}
|
||||
|
||||
public static class IgnoreException extends IOException {
|
||||
public void printStackTrace(PrintWriter pw) {
|
||||
pw.print("Early Client Disconnect");
|
||||
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return "Early Client Disconnect";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void writeDoc(SortDoc sortDoc,
|
||||
|
|
Loading…
Reference in New Issue