@Test public void testHistogramActionIntervalMinuteNoFilter() throws FoxtrotException, JsonProcessingException { HistogramRequest histogramRequest = new HistogramRequest(); histogramRequest.setTable(TestUtils.TEST_TABLE_NAME); histogramRequest.setPeriod(Period.minutes); LessThanFilter lessThanFilter = new LessThanFilter(); lessThanFilter.setTemporal(true); lessThanFilter.setField("_timestamp"); lessThanFilter.setValue(System.currentTimeMillis()); histogramRequest.setFilters(Lists.<Filter>newArrayList(lessThanFilter)); HistogramResponse response = HistogramResponse.class.cast(getQueryExecutor().execute(histogramRequest)); filterNonZeroCounts(response); List<HistogramResponse.Count> counts = new ArrayList<HistogramResponse.Count>(); counts.add(new HistogramResponse.Count(1397651100000L, 2)); counts.add(new HistogramResponse.Count(1397658060000L, 3)); counts.add(new HistogramResponse.Count(1397658180000L, 1)); counts.add(new HistogramResponse.Count(1397758200000L, 1)); counts.add(new HistogramResponse.Count(1397958060000L, 1)); counts.add(new HistogramResponse.Count(1398653100000L, 2)); counts.add(new HistogramResponse.Count(1398658200000L, 1)); assertTrue(response.getCounts() .equals(counts)); }
@Override public ActionResponse execute(HistogramRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse response = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } }
HistogramAction extends Action<HistogramRequest> { @Override public ActionResponse execute(HistogramRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse response = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } }
HistogramAction extends Action<HistogramRequest> { @Override public ActionResponse execute(HistogramRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse response = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } HistogramAction(HistogramRequest parameter, AnalyticsLoader analyticsLoader); }
HistogramAction extends Action<HistogramRequest> { @Override public ActionResponse execute(HistogramRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse response = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } HistogramAction(HistogramRequest parameter, AnalyticsLoader analyticsLoader); @Override String getMetricKey(); @Override void preprocess(); @Override String getRequestCacheKey(); @Override void validateImpl(HistogramRequest parameter); @Override ActionResponse execute(HistogramRequest parameter); @Override SearchRequestBuilder getRequestBuilder(HistogramRequest parameter); @Override ActionResponse getResponse(org.elasticsearch.action.ActionResponse response, HistogramRequest parameter); }
HistogramAction extends Action<HistogramRequest> { @Override public ActionResponse execute(HistogramRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse response = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } HistogramAction(HistogramRequest parameter, AnalyticsLoader analyticsLoader); @Override String getMetricKey(); @Override void preprocess(); @Override String getRequestCacheKey(); @Override void validateImpl(HistogramRequest parameter); @Override ActionResponse execute(HistogramRequest parameter); @Override SearchRequestBuilder getRequestBuilder(HistogramRequest parameter); @Override ActionResponse getResponse(org.elasticsearch.action.ActionResponse response, HistogramRequest parameter);  }