Example usage for org.apache.solr.client.solrj.response UpdateResponse getQTime

List of usage examples for org.apache.solr.client.solrj.response UpdateResponse getQTime

Introduction

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

Prototype

public int getQTime() 

Source Link

Usage

From source file:com.idealista.solrmeter.model.statistic.OperationTimeHistory.java

License:Apache License

@Override
public void onAddedDocument(UpdateResponse response) {
    addedUpdatesInLastInterval = addTime(updatesTime, (long) response.getQTime(), addedUpdatesInLastInterval);
}

From source file:com.idealista.solrmeter.model.statistic.OperationTimeHistory.java

License:Apache License

@Override
public void onCommit(UpdateResponse response) {
    addedCommitsInLastInterval = addTime(commitTime, (long) response.getQTime(), addedCommitsInLastInterval);
}

From source file:de.qaware.chronix.solr.client.add.SolrAddingService.java

License:Apache License

private static boolean evaluate(UpdateResponse response) {
    LOGGER.debug("Response returned: Status code {}, Elapsed time {}, QTime {}", response.getStatus(),
            response.getElapsedTime(), response.getQTime());
    //any other status code means 'there was an error'
    return response.getStatus() == 0;
}

From source file:net.hasor.search.server.rsf.service.SorlDumpService.java

License:Apache License

private UpdateSearchResult doExecute(ExecuteService exec) {
    try {// ww w  . j a  va 2 s  . co  m
        SolrClient solrClient = this.getSolrClient();
        RsfOptionSet optionSet = this.getRsfOptionSet();
        String commit = optionSet.getOption(OptionConstant.COMMIT_KEY);
        //
        UpdateResponse res = exec.doExecute(solrClient);
        if (StringUtils.equalsBlankIgnoreCase(commit, OptionConstant.COMMIT_VALUE)) {
            boolean waitFlush = StrUtils.parseBool(optionSet.getOption(OptionConstant.WAIT_FLUSH_KEY), true);
            boolean waitSearcher = StrUtils.parseBool(optionSet.getOption(OptionConstant.WAIT_SEARCHER_KEY),
                    true);
            boolean softCommit = StrUtils.parseBool(optionSet.getOption(OptionConstant.SOFT_COMMIT_KEY), false);
            res = solrClient.commit(waitFlush, waitSearcher, softCommit);
        }
        //
        UpdateSearchResult result = new UpdateSearchResult();
        result.setSuccess(false);
        result.setElapsedTime(res.getElapsedTime());
        result.setStatus(res.getStatus());
        result.setQueryTime(res.getQTime());
        return result;
    } catch (Throwable e) {
        UpdateSearchResult result = new UpdateSearchResult();
        result.setSuccess(false);
        result.setThrowable(new SearchException(e.getMessage()));
        LoggerHelper.logSevere(e.getMessage(), e);
        return result;
    }
}

From source file:org.zaizi.sensefy.api.utils.JSONHelper.java

License:Open Source License

/**
 * Builds a JSON as ok AbstractSensefyResponse, taking the query time from the update response
 * /*  w  w w .  j a v  a 2s.  co  m*/
 * @param process
 * @return
 * @throws JSONException
 */
public static JSONObject buildOkUpdateJson(UpdateResponse process) throws JSONException {
    JSONObject obj = new JSONObject();
    obj.put("status", 200);
    obj.put("Qtime", process.getQTime());
    return obj;
}