@Test public void testFlatAggregateQuery(){ ListQueryResource resource = new ListQueryResource(); ListQueryAPIResponseEntity response = null; String query = null; String start = DateTimeUtil.secondsToHumanDate(0); String end = DateTimeUtil.secondsToHumanDate((endTime + 24 * 3600) / 1000); query = TEST_TIME_SERIES_API_SERVICE +"[@cluster=\"test4UT\" AND @datacenter=\"dc1\"]<@cluster>{count}"; response = resource.listQuery(query, start, end, 100000, null, false, false, 1, 0, false, 0, null); Assert.assertNotNull(response); Assert.assertTrue("Support is null, should success: "+query,response.isSuccess()); query = TEST_TIME_SERIES_API_SERVICE +"[@cluster=\"test4UT\" AND @datacenter=\"dc1\"]<@cluster>{max(field1)}.{max(field1) desc}"; response = resource.listQuery(query, start, end, 100000, null, false, false, 1, 0, false, 0, null); Assert.assertNotNull(response); Assert.assertTrue("Support is null, should success: "+query,response.isSuccess()); query = TEST_TIME_SERIES_API_SERVICE +"[@cluster=\"test4UT\" AND @datacenter=\"dc1\"]<@cluster>{min(field1)}.{min(field1) desc}"; response = resource.listQuery(query, start, end, 100000, null, false, false, 1, 0, false, 0, null); Assert.assertNotNull(response); Assert.assertTrue("Support is null, should success: "+query,response.isSuccess()); query = TEST_TIME_SERIES_API_SERVICE +"[@cluster=\"test4UT\" AND @datacenter=\"dc1\"]<@cluster>{sum(field1)}.{sum(field1) desc}"; response = resource.listQuery(query, start, end, 100000, null, false, false, 1, 0, false, 0, null); Assert.assertNotNull(response); Assert.assertTrue("Support is null, should success: "+query,response.isSuccess()); query = TEST_TIME_SERIES_API_SERVICE +"[@cluster=\"test4UT\" AND @datacenter=\"dc1\"]<@cluster>{avg(field1)}.{avg(field1) desc}"; response = resource.listQuery(query, start, end, 100000, null, false, false, 1, 0, false, 0, null); Assert.assertNotNull(response); Assert.assertTrue("Support is null, should success: "+query,response.isSuccess()); query = TEST_TIME_SERIES_API_SERVICE +"[@cluster=\"test4UT\" AND @datacenter=\"dc1\"]<@cluster>{count}.{count desc}"; response = resource.listQuery(query, start, end, 100000, null, false, false, 1, 0, false, 0, null); Assert.assertNotNull(response); Assert.assertTrue("Support is null, should success: "+query,response.isSuccess()); query = TEST_TIME_SERIES_API_SERVICE +"[@cluster=\"test4UT\" AND @datacenter=\"dc1\"]<@cluster,@datacenter>{max(field1),min(field1),avg(field1),sum(field1),count}.{sum(field1) desc}"; response = resource.listQuery(query, start, end, 100000, null, false, false, 1, 0, false, 0, null); Assert.assertNotNull(response); Assert.assertTrue("Support is null, should success: " + query, response.isSuccess()); query = TEST_TIME_SERIES_API_SERVICE +"[@cluster=\"test4UT\" AND @datacenter=\"dc1\"]<@cluster,@datacenter>{max(field1),min(field1),avg(field1),sum(field1),count}.{count desc}"; response = resource.listQuery(query, start, end, 100000, null, false, false, 1, 0, false, 0, null); Assert.assertNotNull(response); Assert.assertTrue("Support is null, should success: " + query, response.isSuccess()); }
public ListQueryAPIResponseEntity listQuery(@QueryParam("query") String query, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime, @QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey, @QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries, @QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top, @QueryParam("filterIfMissing") boolean filterIfMissing, @QueryParam("parallel") int parallel, @QueryParam("metricName") String metricName){ return listQuery(query, startTime, endTime, pageSize, startRowkey, treeAgg, timeSeries, intervalmin, top, filterIfMissing, parallel, metricName,true); }
ListQueryResource { public ListQueryAPIResponseEntity listQuery(@QueryParam("query") String query, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime, @QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey, @QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries, @QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top, @QueryParam("filterIfMissing") boolean filterIfMissing, @QueryParam("parallel") int parallel, @QueryParam("metricName") String metricName){ return listQuery(query, startTime, endTime, pageSize, startRowkey, treeAgg, timeSeries, intervalmin, top, filterIfMissing, parallel, metricName,true); } }
ListQueryResource { public ListQueryAPIResponseEntity listQuery(@QueryParam("query") String query, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime, @QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey, @QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries, @QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top, @QueryParam("filterIfMissing") boolean filterIfMissing, @QueryParam("parallel") int parallel, @QueryParam("metricName") String metricName){ return listQuery(query, startTime, endTime, pageSize, startRowkey, treeAgg, timeSeries, intervalmin, top, filterIfMissing, parallel, metricName,true); }  }
ListQueryResource { public ListQueryAPIResponseEntity listQuery(@QueryParam("query") String query, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime, @QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey, @QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries, @QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top, @QueryParam("filterIfMissing") boolean filterIfMissing, @QueryParam("parallel") int parallel, @QueryParam("metricName") String metricName){ return listQuery(query, startTime, endTime, pageSize, startRowkey, treeAgg, timeSeries, intervalmin, top, filterIfMissing, parallel, metricName,true); }  ListQueryAPIResponseEntity listQuery(@QueryParam("query") String query,
												@QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime,
												@QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey,
												@QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries,
												@QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top,
												@QueryParam("filterIfMissing") boolean filterIfMissing,
												@QueryParam("parallel") int parallel,
												@QueryParam("metricName") String metricName); @GET @Produces({MediaType.APPLICATION_JSON}) ListQueryAPIResponseEntity listQuery(@QueryParam("query") String query, 
			@QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime,
			@QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey, 
			@QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries, 
			@QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top,
			@QueryParam("filterIfMissing") boolean filterIfMissing,
			@QueryParam("parallel") int parallel,
			@QueryParam("metricName") String metricName,
			@QueryParam("verbose") Boolean verbose); @GET @Path("/legacy") @Produces({MediaType.APPLICATION_JSON}) @Deprecated ListQueryAPIResponseEntity listQueryWithoutCoprocessor(@QueryParam("query") String query,
	                                                              @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime,
	                                                              @QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey,
	                                                              @QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries,
	                                                              @QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top,
	                                                              @QueryParam("filterIfMissing") boolean filterIfMissing,
	                                                              @QueryParam("parallel") int parallel,
	                                                              @QueryParam("metricName") String metricName,
																  @QueryParam("verbose") Boolean verbose); @GET @Path("/jsonp") @Produces({"application/x-javascript", "application/json", "application/xml"}) JSONWithPadding listQueryWithJsonp(@QueryParam("query") String query, 
			@QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime,
			@QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey, 
			@QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries, 
			@QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top,
			@QueryParam("filterIfMissing") boolean filterIfMissing,
			@QueryParam("parallel") int parallel,
			@QueryParam("update") String callback,
			@QueryParam("verbose") boolean verbose); }
ListQueryResource { public ListQueryAPIResponseEntity listQuery(@QueryParam("query") String query, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime, @QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey, @QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries, @QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top, @QueryParam("filterIfMissing") boolean filterIfMissing, @QueryParam("parallel") int parallel, @QueryParam("metricName") String metricName){ return listQuery(query, startTime, endTime, pageSize, startRowkey, treeAgg, timeSeries, intervalmin, top, filterIfMissing, parallel, metricName,true); }  ListQueryAPIResponseEntity listQuery(@QueryParam("query") String query,
												@QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime,
												@QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey,
												@QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries,
												@QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top,
												@QueryParam("filterIfMissing") boolean filterIfMissing,
												@QueryParam("parallel") int parallel,
												@QueryParam("metricName") String metricName); @GET @Produces({MediaType.APPLICATION_JSON}) ListQueryAPIResponseEntity listQuery(@QueryParam("query") String query, 
			@QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime,
			@QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey, 
			@QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries, 
			@QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top,
			@QueryParam("filterIfMissing") boolean filterIfMissing,
			@QueryParam("parallel") int parallel,
			@QueryParam("metricName") String metricName,
			@QueryParam("verbose") Boolean verbose); @GET @Path("/legacy") @Produces({MediaType.APPLICATION_JSON}) @Deprecated ListQueryAPIResponseEntity listQueryWithoutCoprocessor(@QueryParam("query") String query,
	                                                              @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime,
	                                                              @QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey,
	                                                              @QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries,
	                                                              @QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top,
	                                                              @QueryParam("filterIfMissing") boolean filterIfMissing,
	                                                              @QueryParam("parallel") int parallel,
	                                                              @QueryParam("metricName") String metricName,
																  @QueryParam("verbose") Boolean verbose); @GET @Path("/jsonp") @Produces({"application/x-javascript", "application/json", "application/xml"}) JSONWithPadding listQueryWithJsonp(@QueryParam("query") String query, 
			@QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime,
			@QueryParam("pageSize") int pageSize, @QueryParam("startRowkey") String startRowkey, 
			@QueryParam("treeAgg") boolean treeAgg, @QueryParam("timeSeries") boolean timeSeries, 
			@QueryParam("intervalmin") long intervalmin, @QueryParam("top") int top,
			@QueryParam("filterIfMissing") boolean filterIfMissing,
			@QueryParam("parallel") int parallel,
			@QueryParam("update") String callback,
			@QueryParam("verbose") boolean verbose);  }