mirror of https://github.com/apache/lucene.git
close the request we created
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1023520 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
05d93646cc
commit
d656ba9873
|
@ -23,6 +23,7 @@ import org.apache.solr.common.params.SolrParams;
|
|||
import org.apache.solr.common.util.NamedList;
|
||||
import org.apache.solr.common.util.XML;
|
||||
import org.apache.solr.core.SolrCore;
|
||||
import org.apache.solr.request.LocalSolrQueryRequest;
|
||||
import org.apache.solr.request.SolrQueryRequest;
|
||||
import org.apache.solr.request.SolrQueryRequestBase;
|
||||
import org.apache.solr.response.SolrQueryResponse;
|
||||
|
@ -117,15 +118,13 @@ public class XmlUpdateRequestHandler extends ContentStreamHandlerBase {
|
|||
*/
|
||||
@Deprecated
|
||||
public void doLegacyUpdate(Reader input, Writer output) {
|
||||
try {
|
||||
SolrCore core = SolrCore.getSolrCore();
|
||||
SolrCore core = SolrCore.getSolrCore();
|
||||
SolrQueryRequest req = new LocalSolrQueryRequest(core, new HashMap<String,String[]>());
|
||||
|
||||
try {
|
||||
// Old style requests do not choose a custom handler
|
||||
UpdateRequestProcessorChain processorFactory = core.getUpdateProcessingChain(null);
|
||||
|
||||
SolrParams params = new MapSolrParams(new HashMap<String, String>());
|
||||
SolrQueryRequestBase req = new SolrQueryRequestBase(core, params) {
|
||||
};
|
||||
SolrQueryResponse rsp = new SolrQueryResponse(); // ignored
|
||||
XMLStreamReader parser = inputFactory.createXMLStreamReader(input);
|
||||
UpdateRequestProcessor processor = processorFactory.createProcessor(req, rsp);
|
||||
|
@ -142,6 +141,9 @@ public class XmlUpdateRequestHandler extends ContentStreamHandlerBase {
|
|||
log.error("Error writing to output stream: " + ee);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
req.close();
|
||||
}
|
||||
}
|
||||
//////////////////////// SolrInfoMBeans methods //////////////////////
|
||||
|
||||
|
|
Loading…
Reference in New Issue