Package org.apache.blur.thrift.generated

Examples of org.apache.blur.thrift.generated.BlurResults


    long start = System.nanoTime();
    int position = 0;
    do {
      blurQueryRow.setStart(position);
      long s = System.nanoTime();
      BlurResults resultsRow = client.query(tableName, blurQueryRow);
      long e = System.nanoTime();
      System.out.println("RUNNING QUERY.... starting at [" + position + "] took [" + (e - s) / 1000000.0 + " ms]");
      // assertRowResults(resultsRow);
      assertEquals(numberOfDocs * passes, resultsRow.getTotalResults());

      for (BlurResult blurResult : resultsRow.getResults()) {
        System.out.println(blurResult);
        position++;
      }
    } while (position < numberOfDocs * passes);
    long end = System.nanoTime();
View Full Code Here


  }

  public static BlurResults convertToHits(BlurResultIterable hitsIterable, BlurQuery query,
      AtomicLongArray facetCounts, ExecutorService executor, Selector selector, final Iface iface, final String table)
      throws InterruptedException, ExecutionException, BlurException {
    BlurResults results = new BlurResults();
    results.setTotalResults(hitsIterable.getTotalResults());
    results.setShardInfo(hitsIterable.getShardInfo());
    if (query.minimumNumberOfResults > 0) {
      Tracer trace = Trace.trace("convertToHits - skipTo", Trace.param("start", query.start));
      hitsIterable.skipTo(query.start);
      trace.done();
      BlurIterator<BlurResult, BlurException> iterator = hitsIterable.iterator();
      for (int count = 0; count < query.fetch && iterator.hasNext(); count++) {
        results.addToResults(iterator.next());
      }
    }
    if (results.results == null) {
      results.results = new ArrayList<BlurResult>();
    }
View Full Code Here

    blurQueryRow.setSelector(new Selector());
    for (int i = 0; i < 250; i++) {
      blurQueryRow.addToFacets(new Facet("test.facet:" + i, Long.MAX_VALUE));
    }

    BlurResults resultsRow = client.query(tableName, blurQueryRow);
    assertEquals(numberOfDocs, resultsRow.getTotalResults());
    System.out.println(resultsRow.getFacetCounts());

    System.out.println();

  }
View Full Code Here

    blurQueryRow.setUseCacheIfPresent(false);
    blurQueryRow.setCacheResult(false);
    blurQueryRow.setSelector(new Selector());
    blurQueryRow.addToFacets(new Facet("test.facetFixed:test", 50));

    BlurResults resultsRow = client.query(tableName, blurQueryRow);
    // assertRowResults(resultsRow);
    System.out.println("Pass [" + pass + "]");
    assertEquals(numberOfDocs * pass, resultsRow.getTotalResults());

    List<Long> facetCounts = resultsRow.getFacetCounts();
    for (Long l : facetCounts) {
      System.out.println("Count [" + l + "]");
      assertTrue(l >= 50);
    }
    pass++;
View Full Code Here

    BlurQuery blurQuery = new BlurQuery();
    blurQuery.setUseCacheIfPresent(false);
    Query query = new Query();
    query.setQuery("test.test:value");
    blurQuery.setQuery(query);
    BlurResults results1 = client.query(tableName, blurQuery);
    assertEquals(numberOfDocs, results1.getTotalResults());
    assertRowResults(results1);

    miniCluster.killShardServer(1);

    // make sure the WAL syncs
View Full Code Here

      Terminal terminal = reader.getTerminal();
      maxWidth = terminal.getWidth() - 15;
      out.setLineLimit(terminal.getHeight() - 2);
    }
    long s = System.nanoTime();
    BlurResults blurResults = client.query(tablename, blurQuery);
    long e = System.nanoTime();
    long timeInNanos = e - s;

    printSummary(out, blurResults, maxWidth, timeInNanos);
    lineBreak(out, maxWidth);

    int hit = 0;
    for (BlurResult result : blurResults.getResults()) {
      double score = result.getScore();
      out.println("      hit : " + hit);
      out.println("    score : " + score);
      if (Main.debug) {
        String locationId = result.getLocationId();
View Full Code Here

    if (reader == null) {
      throw new BlurException("This command can only be run with a proper jline environment.", null, ErrorType.UNKNOWN);
    }

    long s = System.nanoTime();
    BlurResults blurResults = client.query(tablename, blurQuery);
    long e = System.nanoTime();
    long timeInNanos = e - s;
    if (blurResults.getTotalResults() == 0) {
      out.println("No results found in [" + timeInNanos / 1000000.0 + " ms].");
      return;
    }

    String prompt = reader.getPrompt();
    reader.setPrompt("");
    final TableDisplay tableDisplay = new TableDisplay(reader);
    tableDisplay.setDescription(white(blurResults.getTotalResults() + " results found in [" + timeInNanos / 1000000.0
        + " ms].  " + getFetchMetaData(blurResults)));
    tableDisplay.setSeperator(" ");
    try {

      final AtomicBoolean viewing = new AtomicBoolean(true);
View Full Code Here

    QueryResponse response = new QueryResponse();
    long start = System.currentTimeMillis();

    try {
      BlurQuery blurQuery = BlurQueryHelper.from(params);
      BlurResults results = client().query(tableName, blurQuery);
      NamedList<Object> resp = new NamedList<Object>();

      resp.add("response", BlurResultHelper.from(results));

      response.setResponse(resp);
View Full Code Here

  private void assertTotalResults(String table, String q, long expected) throws BlurException, TException {
    BlurQuery bquery = new BlurQuery();
    Query query = new Query();
    query.setQuery(q);
    bquery.setQuery(query);
    BlurResults results = client().query(table, bquery);

    assertEquals("Should find our row.", expected, results.getTotalResults());
  }
View Full Code Here

    Query query = new Query();
    query.setQuery(q);
    query.setRowQuery(false);
    bquery.setQuery(query);

    BlurResults results = client().query(table, bquery);

    assertEquals("Should find our record.", expected, results.getTotalResults());

  }
View Full Code Here

TOP

Related Classes of org.apache.blur.thrift.generated.BlurResults

Copyright © 2018 www.massapicom. 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.