@Test public void testStatsActionWithoutNestingNoPercentile() throws FoxtrotException { StatsRequest request = new StatsRequest(); request.setTable(TestUtils.TEST_TABLE_NAME); request.setField("battery"); request.setFlags(EnumSet.of(AnalyticsRequestFlags.STATS_SKIP_PERCENTILES)); StatsResponse statsResponse = StatsResponse.class.cast(getQueryExecutor().execute(request)); assertNotNull(statsResponse); assertNotNull(statsResponse.getResult()); assertEquals(150, statsResponse.getResult() .getStats() .get("sum") .intValue()); assertEquals(5, statsResponse.getResult() .getStats() .get("count") .intValue()); assertNull(statsResponse.getBuckets()); assertNull(statsResponse.getResult().getPercentiles()); }
@Override public ActionResponse execute(StatsRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse response = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } }
StatsAction extends Action<StatsRequest> { @Override public ActionResponse execute(StatsRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse response = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } }
StatsAction extends Action<StatsRequest> { @Override public ActionResponse execute(StatsRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse response = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } StatsAction(StatsRequest parameter, AnalyticsLoader analyticsLoader); }
StatsAction extends Action<StatsRequest> { @Override public ActionResponse execute(StatsRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse response = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } StatsAction(StatsRequest parameter, AnalyticsLoader analyticsLoader); @Override void preprocess(); @Override String getMetricKey(); @Override String getRequestCacheKey(); @Override void validateImpl(StatsRequest parameter); @Override ActionResponse execute(StatsRequest parameter); @Override SearchRequestBuilder getRequestBuilder(StatsRequest parameter); @Override ActionResponse getResponse(org.elasticsearch.action.ActionResponse response, StatsRequest parameter); }
StatsAction extends Action<StatsRequest> { @Override public ActionResponse execute(StatsRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse response = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } StatsAction(StatsRequest parameter, AnalyticsLoader analyticsLoader); @Override void preprocess(); @Override String getMetricKey(); @Override String getRequestCacheKey(); @Override void validateImpl(StatsRequest parameter); @Override ActionResponse execute(StatsRequest parameter); @Override SearchRequestBuilder getRequestBuilder(StatsRequest parameter); @Override ActionResponse getResponse(org.elasticsearch.action.ActionResponse response, StatsRequest parameter);  }