added debugging of filter queries in thread dump thread names

This commit is contained in:
Michael Peter Christen 2014-07-11 17:34:41 +02:00
parent f319ef268f
commit 525575bd97
4 changed files with 9 additions and 4 deletions

View File

@ -391,6 +391,7 @@ public abstract class AbstractSolrConnector implements SolrConnector {
// construct query
StringBuilder sb = new StringBuilder(23);
sb.append("{!raw f=").append(CollectionSchema.id.getSolrFieldName()).append('}').append(id);
//query.setQuery(sb.toString());
query.setQuery("*:*");
query.addFilterQuery(sb.toString());
query.clearSorts();

View File

@ -199,8 +199,9 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo
// during the solr query we set the thread name to the query string to get more debugging info in thread dumps
String q = req.getParams().get("q");
String fq = req.getParams().get("fq");
String threadname = Thread.currentThread().getName();
if (q != null) Thread.currentThread().setName("solr query: q = " + q);
if (q != null) Thread.currentThread().setName("solr query: q = " + q + (fq == null ? "" : ", fq = " + fq));
SolrQueryResponse rsp = new SolrQueryResponse();
NamedList<Object> responseHeader = new SimpleOrderedMap<Object>();
@ -302,8 +303,9 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo
if (this.server == null) throw new IOException("server disconnected");
// during the solr query we set the thread name to the query string to get more debugging info in thread dumps
String q = params.get("q");
String fq = params.get("fq");
String threadname = Thread.currentThread().getName();
if (q != null) Thread.currentThread().setName("solr query: q = " + q);
if (q != null) Thread.currentThread().setName("solr query: q = " + q + (fq == null ? "" : ", fq = " + fq));
QueryResponse rsp;
try {
rsp = this.server.query(params);

View File

@ -99,8 +99,9 @@ public class RemoteSolrConnector extends SolrServerConnector implements SolrConn
public QueryResponse getResponseByParams(ModifiableSolrParams params) throws IOException {
// during the solr query we set the thread name to the query string to get more debugging info in thread dumps
String q = params.get("q");
String fq = params.get("fq");
String threadname = Thread.currentThread().getName();
if (q != null) Thread.currentThread().setName("solr query: q = " + q);
if (q != null) Thread.currentThread().setName("solr query: q = " + q + (fq == null ? "" : ", fq = " + fq));
QueryRequest request = new QueryRequest(params);
ResponseParser responseParser = useBinaryResponseWriter ? new BinaryResponseParser() : new XMLResponseParser();

View File

@ -293,8 +293,9 @@ public abstract class SolrServerConnector extends AbstractSolrConnector implemen
if (this.server == null) throw new IOException("server disconnected");
// during the solr query we set the thread name to the query string to get more debugging info in thread dumps
String q = params.get("q");
String fq = params.get("fq");
String threadname = Thread.currentThread().getName();
if (q != null) Thread.currentThread().setName("solr query: q = " + q);
if (q != null) Thread.currentThread().setName("solr query: q = " + q + (fq == null ? "" : ", fq = " + fq));
QueryResponse rsp;
try {
rsp = this.server.query(params);