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 {
|
public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse res) throws IOException {
|
||||||
Exception e1 = res.getException();
|
Exception e1 = res.getException();
|
||||||
if(e1 != null) {
|
if(e1 != null) {
|
||||||
e1.printStackTrace(new PrintWriter(writer));
|
if(!(e1 instanceof IgnoreException)) {
|
||||||
|
e1.printStackTrace(new PrintWriter(writer));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SolrRequestInfo info = SolrRequestInfo.getRequestInfo();
|
SolrRequestInfo info = SolrRequestInfo.getRequestInfo();
|
||||||
|
@ -175,8 +177,7 @@ public class SortingResponseWriter implements QueryResponseWriter {
|
||||||
while(ex != null) {
|
while(ex != null) {
|
||||||
String m = ex.getMessage();
|
String m = ex.getMessage();
|
||||||
if(m != null && m.contains("Broken pipe")) {
|
if(m != null && m.contains("Broken pipe")) {
|
||||||
logger.info("Early client disconnect during export");
|
throw new IgnoreException();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
ex = ex.getCause();
|
ex = ex.getCause();
|
||||||
}
|
}
|
||||||
|
@ -194,7 +195,16 @@ public class SortingResponseWriter implements QueryResponseWriter {
|
||||||
writer.flush();
|
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,
|
protected void writeDoc(SortDoc sortDoc,
|
||||||
|
|
Loading…
Reference in New Issue