本文整理汇总了Java中org.apache.solr.client.solrj.response.QueryResponse.getNextCursorMark方法的典型用法代码示例。如果您正苦于以下问题:Java QueryResponse.getNextCursorMark方法的具体用法?Java QueryResponse.getNextCursorMark怎么用?Java QueryResponse.getNextCursorMark使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.solr.client.solrj.response.QueryResponse
的用法示例。
在下文中一共展示了QueryResponse.getNextCursorMark方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processQuery
import org.apache.solr.client.solrj.response.QueryResponse; //导入方法依赖的package包/类
private void processQuery(SolrQuery query, WorkLog workLog) throws SolrServerException, IOException {
log.debug("Query for rule : {}", query.toString());
Timer.Context context = getTimer(getName() + ".processQuery").time();
// need to commit here so that we can ignore documents just processed
client.commit();
boolean more = true;
String cursor = CursorMarkParams.CURSOR_MARK_START;
while (more) {
query.set(CursorMarkParams.CURSOR_MARK_PARAM, cursor);
Timer.Context contextQuery = getTimer(getName() + ".query").time();
QueryResponse response = client.query(query);
workLog.ranSearch();
SolrDocumentList results = response.getResults();
log.debug("Found {} (of {} docs) in QT = {} ms", results.size(), results.getNumFound(), response.getQTime());
String nextCursor = response.getNextCursorMark();
if (nextCursor == null || cursor.equals(nextCursor)) {
more = false;
}
distributeResponse(results, workLog);
cursor = nextCursor;
contextQuery.stop();
}
// We do this at a higher level too, so this would seem redundant. There is a trade-off. Allowing parallelism
// between rules means rules can sometimes be re-processed redundantly. The higher level waitUntilCaughtUp() will
// ensure we never process rules at the same time rules are being changed.
// By doing a wait here as well however, we can collect accurate statistics about how much actual write activity we
// are really generating by passing the workLog into the work pool.
// When we have a better awareness of the typical work patterns it might be worth disabling this method call and
// then stop collecting the metrics to improve throughput.
waitUntilCaughtUp();
context.stop();
}
示例2: updateCursorMark
import org.apache.solr.client.solrj.response.QueryResponse; //导入方法依赖的package包/类
private void updateCursorMark(QueryResponse response) {
if (cursorMark.equals(response.getNextCursorMark())) {
done = true;
}
cursorMark = response.getNextCursorMark();
}
示例3: assertHashNextCursorMark
import org.apache.solr.client.solrj.response.QueryResponse; //导入方法依赖的package包/类
/**
* Given a QueryResponse returned by SolrServer.query, asserts that the
* response does include {@link #CURSOR_MARK_NEXT} key and returns it
* @see SolrServer#query
*/
private String assertHashNextCursorMark(QueryResponse rsp) {
String r = rsp.getNextCursorMark();
assertNotNull(CURSOR_MARK_NEXT+" is null/missing", r);
return r;
}