Was modified findLatest(...) method & BaseTimeseriesService(...) constructor for set limit and order by values
This commit is contained in:
		
							parent
							
								
									94f3680f24
								
							
						
					
					
						commit
						1e1beaaeac
					
				@ -42,4 +42,8 @@ public class BaseReadTsKvQuery extends BaseTsKvQuery implements ReadTsKvQuery {
 | 
			
		||||
        this(key, startTs, endTs, endTs - startTs, 1, Aggregation.AVG, "DESC");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public BaseReadTsKvQuery(String key, long startTs, long endTs, int limit, String orderBy) {
 | 
			
		||||
        this(key, startTs, endTs, endTs - startTs, limit, Aggregation.AVG, orderBy);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -75,7 +75,10 @@ public class BaseTimeseriesService implements TimeseriesService {
 | 
			
		||||
            EntityView entityView = entityViewService.findEntityViewById((EntityViewId) entityId);
 | 
			
		||||
            Collection<String> matchingKeys = chooseKeysForEntityView(entityView, keys);
 | 
			
		||||
            List<ReadTsKvQuery> queries = new ArrayList<>();
 | 
			
		||||
            matchingKeys.forEach(key -> queries.add(new BaseReadTsKvQuery(key, entityView.getStartTs(), entityView.getEndTs())));
 | 
			
		||||
 | 
			
		||||
            matchingKeys.forEach(key -> queries.add(
 | 
			
		||||
                    new BaseReadTsKvQuery(key, entityView.getStartTs(), entityView.getEndTs(), 1, "ASC")));
 | 
			
		||||
 | 
			
		||||
            return timeseriesDao.findAllAsync(entityView.getEntityId(), updateQueriesForEntityView(entityView, queries));
 | 
			
		||||
        }
 | 
			
		||||
        keys.forEach(key -> futures.add(timeseriesDao.findLatest(entityId, key)));
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user