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:
Joel Bernstein 2014-08-22 12:40:39 +00:00
parent acf9242850
commit 2d7427dd07
1 changed files with 13 additions and 3 deletions

View File

@ -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,