@Test public void testCount() throws FoxtrotException { CountRequest countRequest = new CountRequest(); countRequest.setTable(TestUtils.TEST_TABLE_NAME); countRequest.setField("os"); countRequest.setDistinct(false); CountResponse countResponse = CountResponse.class.cast(getQueryExecutor().execute(countRequest)); assertNotNull(countResponse); assertEquals(11, countResponse.getCount()); }
@Override public ActionResponse execute(CountRequest parameter) { SearchRequestBuilder query = getRequestBuilder(parameter); try { SearchResponse response = query.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } }
CountAction extends Action<CountRequest> { @Override public ActionResponse execute(CountRequest parameter) { SearchRequestBuilder query = getRequestBuilder(parameter); try { SearchResponse response = query.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } }
CountAction extends Action<CountRequest> { @Override public ActionResponse execute(CountRequest parameter) { SearchRequestBuilder query = getRequestBuilder(parameter); try { SearchResponse response = query.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } CountAction(CountRequest parameter, AnalyticsLoader analyticsLoader); }
CountAction extends Action<CountRequest> { @Override public ActionResponse execute(CountRequest parameter) { SearchRequestBuilder query = getRequestBuilder(parameter); try { SearchResponse response = query.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } CountAction(CountRequest parameter, AnalyticsLoader analyticsLoader); @Override void preprocess(); @Override String getMetricKey(); @Override String getRequestCacheKey(); @Override void validateImpl(CountRequest parameter); @Override ActionResponse execute(CountRequest parameter); @Override SearchRequestBuilder getRequestBuilder(CountRequest parameter); @Override ActionResponse getResponse(org.elasticsearch.action.ActionResponse response, CountRequest parameter); }
CountAction extends Action<CountRequest> { @Override public ActionResponse execute(CountRequest parameter) { SearchRequestBuilder query = getRequestBuilder(parameter); try { SearchResponse response = query.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } CountAction(CountRequest parameter, AnalyticsLoader analyticsLoader); @Override void preprocess(); @Override String getMetricKey(); @Override String getRequestCacheKey(); @Override void validateImpl(CountRequest parameter); @Override ActionResponse execute(CountRequest parameter); @Override SearchRequestBuilder getRequestBuilder(CountRequest parameter); @Override ActionResponse getResponse(org.elasticsearch.action.ActionResponse response, CountRequest parameter);  }