@Test public void testQuery(){ }
@Override @SuppressWarnings("unchecked") public <E extends Object> QueryResult<E> query(CompiledQuery query, EntityDefinition entityDefinition) throws IOException { QueryResult<E> result = new QueryResult<E>(); try { GenericQuery reader = GenericQueryBuilder .select(query.getSearchCondition().getOutputFields()) .from(query.getServiceName(),query.getRawQuery().getMetricName()).where(query.getSearchCondition()) .groupBy(query.isHasAgg(), query.getGroupByFields(), query.getAggregateFunctionTypes(), query.getAggregateFields()) .timeSeries(query.getRawQuery().isTimeSeries(),query.getRawQuery().getIntervalmin()) .treeAgg(query.getRawQuery().isTreeAgg()) .orderBy(query.getSortOptions(),query.getSortFunctions(),query.getSortFields()) .top(query.getRawQuery().getTop()) .parallel(query.getRawQuery().getParallel()) .build(); List<E> entities = reader.result(); result.setData(entities); result.setFirstTimestamp(reader.getFirstTimeStamp()); result.setLastTimestamp(reader.getLastTimestamp()); result.setSize(entities.size()); if(!query.isHasAgg()) result.setEntityType((Class<E>) entityDefinition.getEntityClass()); result.setSuccess(true); } catch (Exception e) { LOG.error(e.getMessage(),e); throw new IOException(e); } return result; }
HBaseStorage extends DataStorageBase { @Override @SuppressWarnings("unchecked") public <E extends Object> QueryResult<E> query(CompiledQuery query, EntityDefinition entityDefinition) throws IOException { QueryResult<E> result = new QueryResult<E>(); try { GenericQuery reader = GenericQueryBuilder .select(query.getSearchCondition().getOutputFields()) .from(query.getServiceName(),query.getRawQuery().getMetricName()).where(query.getSearchCondition()) .groupBy(query.isHasAgg(), query.getGroupByFields(), query.getAggregateFunctionTypes(), query.getAggregateFields()) .timeSeries(query.getRawQuery().isTimeSeries(),query.getRawQuery().getIntervalmin()) .treeAgg(query.getRawQuery().isTreeAgg()) .orderBy(query.getSortOptions(),query.getSortFunctions(),query.getSortFields()) .top(query.getRawQuery().getTop()) .parallel(query.getRawQuery().getParallel()) .build(); List<E> entities = reader.result(); result.setData(entities); result.setFirstTimestamp(reader.getFirstTimeStamp()); result.setLastTimestamp(reader.getLastTimestamp()); result.setSize(entities.size()); if(!query.isHasAgg()) result.setEntityType((Class<E>) entityDefinition.getEntityClass()); result.setSuccess(true); } catch (Exception e) { LOG.error(e.getMessage(),e); throw new IOException(e); } return result; } }
HBaseStorage extends DataStorageBase { @Override @SuppressWarnings("unchecked") public <E extends Object> QueryResult<E> query(CompiledQuery query, EntityDefinition entityDefinition) throws IOException { QueryResult<E> result = new QueryResult<E>(); try { GenericQuery reader = GenericQueryBuilder .select(query.getSearchCondition().getOutputFields()) .from(query.getServiceName(),query.getRawQuery().getMetricName()).where(query.getSearchCondition()) .groupBy(query.isHasAgg(), query.getGroupByFields(), query.getAggregateFunctionTypes(), query.getAggregateFields()) .timeSeries(query.getRawQuery().isTimeSeries(),query.getRawQuery().getIntervalmin()) .treeAgg(query.getRawQuery().isTreeAgg()) .orderBy(query.getSortOptions(),query.getSortFunctions(),query.getSortFields()) .top(query.getRawQuery().getTop()) .parallel(query.getRawQuery().getParallel()) .build(); List<E> entities = reader.result(); result.setData(entities); result.setFirstTimestamp(reader.getFirstTimeStamp()); result.setLastTimestamp(reader.getLastTimestamp()); result.setSize(entities.size()); if(!query.isHasAgg()) result.setEntityType((Class<E>) entityDefinition.getEntityClass()); result.setSuccess(true); } catch (Exception e) { LOG.error(e.getMessage(),e); throw new IOException(e); } return result; }  }
HBaseStorage extends DataStorageBase { @Override @SuppressWarnings("unchecked") public <E extends Object> QueryResult<E> query(CompiledQuery query, EntityDefinition entityDefinition) throws IOException { QueryResult<E> result = new QueryResult<E>(); try { GenericQuery reader = GenericQueryBuilder .select(query.getSearchCondition().getOutputFields()) .from(query.getServiceName(),query.getRawQuery().getMetricName()).where(query.getSearchCondition()) .groupBy(query.isHasAgg(), query.getGroupByFields(), query.getAggregateFunctionTypes(), query.getAggregateFields()) .timeSeries(query.getRawQuery().isTimeSeries(),query.getRawQuery().getIntervalmin()) .treeAgg(query.getRawQuery().isTreeAgg()) .orderBy(query.getSortOptions(),query.getSortFunctions(),query.getSortFields()) .top(query.getRawQuery().getTop()) .parallel(query.getRawQuery().getParallel()) .build(); List<E> entities = reader.result(); result.setData(entities); result.setFirstTimestamp(reader.getFirstTimeStamp()); result.setLastTimestamp(reader.getLastTimestamp()); result.setSize(entities.size()); if(!query.isHasAgg()) result.setEntityType((Class<E>) entityDefinition.getEntityClass()); result.setSuccess(true); } catch (Exception e) { LOG.error(e.getMessage(),e); throw new IOException(e); } return result; }  @Override void init(); @Override ModifyResult<String> update(List<E> entities, EntityDefinition entityDefinition); @Override ModifyResult<String> create(List<E> entities, EntityDefinition entityDefinition); @Override ModifyResult<String> delete(List<E> entities, EntityDefinition entityDefinition); @Override ModifyResult<String> deleteByID(List<String> ids, EntityDefinition entityDefinition); @Override ModifyResult<String> delete(CompiledQuery query, EntityDefinition entityDefinition); @Override @SuppressWarnings("unchecked") QueryResult<E> query(CompiledQuery query, EntityDefinition entityDefinition); @Override QueryResult<E> queryById(List<String> ids, EntityDefinition entityDefinition); @Override void close(); }
HBaseStorage extends DataStorageBase { @Override @SuppressWarnings("unchecked") public <E extends Object> QueryResult<E> query(CompiledQuery query, EntityDefinition entityDefinition) throws IOException { QueryResult<E> result = new QueryResult<E>(); try { GenericQuery reader = GenericQueryBuilder .select(query.getSearchCondition().getOutputFields()) .from(query.getServiceName(),query.getRawQuery().getMetricName()).where(query.getSearchCondition()) .groupBy(query.isHasAgg(), query.getGroupByFields(), query.getAggregateFunctionTypes(), query.getAggregateFields()) .timeSeries(query.getRawQuery().isTimeSeries(),query.getRawQuery().getIntervalmin()) .treeAgg(query.getRawQuery().isTreeAgg()) .orderBy(query.getSortOptions(),query.getSortFunctions(),query.getSortFields()) .top(query.getRawQuery().getTop()) .parallel(query.getRawQuery().getParallel()) .build(); List<E> entities = reader.result(); result.setData(entities); result.setFirstTimestamp(reader.getFirstTimeStamp()); result.setLastTimestamp(reader.getLastTimestamp()); result.setSize(entities.size()); if(!query.isHasAgg()) result.setEntityType((Class<E>) entityDefinition.getEntityClass()); result.setSuccess(true); } catch (Exception e) { LOG.error(e.getMessage(),e); throw new IOException(e); } return result; }  @Override void init(); @Override ModifyResult<String> update(List<E> entities, EntityDefinition entityDefinition); @Override ModifyResult<String> create(List<E> entities, EntityDefinition entityDefinition); @Override ModifyResult<String> delete(List<E> entities, EntityDefinition entityDefinition); @Override ModifyResult<String> deleteByID(List<String> ids, EntityDefinition entityDefinition); @Override ModifyResult<String> delete(CompiledQuery query, EntityDefinition entityDefinition); @Override @SuppressWarnings("unchecked") QueryResult<E> query(CompiledQuery query, EntityDefinition entityDefinition); @Override QueryResult<E> queryById(List<String> ids, EntityDefinition entityDefinition); @Override void close();  }