@Test public void testTrendActionNullField() throws FoxtrotException, JsonProcessingException { TrendRequest trendRequest = new TrendRequest(); trendRequest.setTable(TestUtils.TEST_TABLE_NAME); BetweenFilter betweenFilter = new BetweenFilter(); betweenFilter.setFrom(1L); betweenFilter.setTo(System.currentTimeMillis()); betweenFilter.setTemporal(true); betweenFilter.setField("_timestamp"); trendRequest.setFilters(Collections.<Filter>singletonList(betweenFilter)); trendRequest.setField(null); try { getQueryExecutor().execute(trendRequest); fail("Should have thrown exception"); } catch (FoxtrotException e) { assertEquals(ErrorCode.MALFORMED_QUERY, e.getCode()); } }
@Override public ActionResponse execute(TrendRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse searchResponse = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(searchResponse, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } }
TrendAction extends Action<TrendRequest> { @Override public ActionResponse execute(TrendRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse searchResponse = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(searchResponse, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } }
TrendAction extends Action<TrendRequest> { @Override public ActionResponse execute(TrendRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse searchResponse = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(searchResponse, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } TrendAction(TrendRequest parameter, AnalyticsLoader analyticsLoader); }
TrendAction extends Action<TrendRequest> { @Override public ActionResponse execute(TrendRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse searchResponse = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(searchResponse, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } TrendAction(TrendRequest parameter, AnalyticsLoader analyticsLoader); @Override void preprocess(); @Override String getMetricKey(); @Override String getRequestCacheKey(); @Override void validateImpl(TrendRequest parameter); @Override ActionResponse execute(TrendRequest parameter); @Override SearchRequestBuilder getRequestBuilder(TrendRequest parameter); @Override ActionResponse getResponse(org.elasticsearch.action.ActionResponse response, TrendRequest parameter); }
TrendAction extends Action<TrendRequest> { @Override public ActionResponse execute(TrendRequest parameter) { SearchRequestBuilder searchRequestBuilder = getRequestBuilder(parameter); try { SearchResponse searchResponse = searchRequestBuilder.execute() .actionGet(getGetQueryTimeout()); return getResponse(searchResponse, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } TrendAction(TrendRequest parameter, AnalyticsLoader analyticsLoader); @Override void preprocess(); @Override String getMetricKey(); @Override String getRequestCacheKey(); @Override void validateImpl(TrendRequest parameter); @Override ActionResponse execute(TrendRequest parameter); @Override SearchRequestBuilder getRequestBuilder(TrendRequest parameter); @Override ActionResponse getResponse(org.elasticsearch.action.ActionResponse response, TrendRequest parameter);  }