Example usage for org.apache.solr.client.solrj.response SolrResponseBase setElapsedTime

List of usage examples for org.apache.solr.client.solrj.response SolrResponseBase setElapsedTime

Introduction

In this page you can find the example usage for org.apache.solr.client.solrj.response SolrResponseBase setElapsedTime.

Prototype

public void setElapsedTime(long elapsedTime) 

Source Link

Usage

From source file:org.apache.blur.slur.SolrLookingBlurServer.java

License:Apache License

@SuppressWarnings("unchecked")
private <T extends SolrResponseBase> T respond(Class<T> typ, Command command) throws SolrServerException {
    SolrResponseBase response;
    long start = System.currentTimeMillis();
    try {/*from w  ww.j a v  a  2 s .  c om*/
        response = typ.newInstance();

        command.process();
    } catch (Exception e) {
        throw new SolrServerException("Unable to complete update request.", e);
    }
    response.setElapsedTime((System.currentTimeMillis() - start));
    return (T) response;
}