Examples of CouchQueryResults


Examples of ca.carleton.gcrc.couch.client.CouchQueryResults

 
  private void activity() {
    CouchQuery query = new CouchQuery();
    query.setViewName("server_work");
   
    CouchQueryResults results;
    try {
      results = dd.performQuery(query);
    } catch (Exception e) {
      logger.error("Error accessing server",e);
      waitMillis(60 * 1000); // wait a minute
      return;
    }
   
    // Check for work
    String docId = null;
    JSONArray state = null;
    for(JSONObject row : results.getRows()) {
      String id = row.optString("id");
      if( false == docIdsToSkip.contains(id) ) {
        // Found some work
        docId = id;
        state = row.optJSONArray("key");
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchQueryResults

 
  private void activity() {
    CouchQuery query = new CouchQuery();
    query.setViewName("server_work");
   
    CouchQueryResults results;
    Work work = null;
    try {
      results = dd.performQuery(query);
      work = getWork(results);
    } catch (Exception e) {
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchQueryResults

 
  private void activity() {
    CouchQuery query = new CouchQuery();
    query.setViewName("server_work");
   
    CouchQueryResults results;
    try {
      results = dd.performQuery(query);
    } catch (Exception e) {
      logger.error("Error accessing server",e);
      waitMillis(60 * 1000); // wait a minute
      return;
    }
   
    // Check for work
    String docId = null;
    JSONArray state = null;
    for(JSONObject row : results.getRows()) {
      String id = row.optString("id");
      if( false == docIdsToSkip.contains(id) ) {
        // Found some work
        docId = id;
        state = row.optJSONArray("key");
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchQueryResults

   
    CouchQuery query = new CouchQuery();
    query.setViewName("date-index");
    query.setIncludeDocs(false);
    query.setReduce(false);
    CouchQueryResults queryResults = atlasDesignDocument.performQuery(query);
   
    results.documentWithIntervals = new ArrayList<DocumentWithInterval>(queryResults.getRows().size());
    for(JSONObject row : queryResults.getRows()){
      String docId = row.optString("id");
      JSONArray jsonInterval = row.optJSONArray("value");
      long min = 0;
      long max = -1;
      if( null != jsonInterval && jsonInterval.length() >= 2 ){
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchQueryResults

    CouchQuery query = new CouchQuery();
    query.setViewName("date-index");
    query.setIncludeDocs(false);
    query.setReduce(false);
    CouchQueryResults queryResults = atlasDesignDocument.performQuery(query);
   
    results.documentWithIntervals = new ArrayList<DocumentWithInterval>(queryResults.getRows().size());
    for(JSONObject row : queryResults.getRows()){
      String docId = row.optString("id");
      JSONArray jsonInterval = row.optJSONArray("value");
      results.intervalCount++;
      long min = 0;
      long max = -1;
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchQueryResults

    List<TreeElement> elements = new Vector<TreeElement>();

    CouchQuery query = new CouchQuery();
    query.setViewName("date-index");
    query.setReduce(false);
    CouchQueryResults result = atlasDesign.performQuery(query);
    for(JSONObject row : result.getRows()){
      String docId = row.getString("id");
      Integer clusterId = null;
      {
        Object indexObj = row.get("key");
        if( JSONObject.NULL.equals(indexObj) ){
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchQueryResults

   
    CouchQuery query = new CouchQuery();
    query.setViewName("date-index");
    query.setReduce(false);
    query.setKeys(keys);
    CouchQueryResults result = atlasDesign.performQuery(query);
    for(JSONObject row : result.getRows()){
      String docId = row.getString("id");
      Integer elemClusterId = null;
      {
        Object indexObj = row.get("key");
        if( JSONObject.NULL.equals(indexObj) ){
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchQueryResults

    CouchQuery query = new CouchQuery();
    query.setViewName("date-index");
    query.setReduce(true);
    query.setGrouping(true);
    CouchQueryResults result = atlasDesign.performQuery(query);
    for(JSONObject row : result.getRows()){
      Integer clusterId = null;
      {
        Object indexObj = row.get("key");
        if( JSONObject.NULL.equals(indexObj) ){
          indexObj = null;
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchQueryResults

   
    CouchQuery query = new CouchQuery();
    query.setViewName("date-index");
    query.setIncludeDocs(false);
    query.setReduce(false);
    CouchQueryResults queryResults = atlasDesignDocument.performQuery(query);
   
    results.documentWithIntervals = new ArrayList<DocumentWithInterval>(queryResults.getRows().size());
    for(JSONObject row : queryResults.getRows()){
      String docId = row.optString("id");
      JSONArray jsonInterval = row.optJSONArray("value");
      long min = 0;
      long max = -1;
      if( null != jsonInterval && jsonInterval.length() >= 2 ){
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchQueryResults

    CouchQuery query = new CouchQuery();
    query.setViewName("date-index");
    query.setIncludeDocs(false);
    query.setReduce(false);
    query.setKeys(keys);
    CouchQueryResults queryResults = atlasDesignDocument.performQuery(query);
   
    results.documentWithIntervals = new ArrayList<DocumentWithInterval>(queryResults.getRows().size());
    for(JSONObject row : queryResults.getRows()){
      String docId = row.optString("id");
      JSONArray key = row.optJSONArray("value");
      results.intervalCount++;
      long min = 0;
      long max = -1;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.