Revision 47676
Added by Claudio Atzori almost 7 years ago
MongoLoggerClient.java | ||
---|---|---|
26 | 26 |
|
27 | 27 |
import static com.mongodb.client.model.Filters.and; |
28 | 28 |
import static com.mongodb.client.model.Filters.eq; |
29 |
import static com.mongodb.client.model.Filters.regex; |
|
29 | 30 |
|
30 | 31 |
/** |
31 | 32 |
* Created by claudio on 20/10/2016. |
... | ... | |
51 | 52 |
return and( |
52 | 53 |
eq("parentDatasourceId", dsId), |
53 | 54 |
eq("system:profileFamily", "aggregator"), |
54 |
eq("system:isCompletedSuccessfully", "true")); |
|
55 |
eq("system:isCompletedSuccessfully", "true"), |
|
56 |
regex("system:wfName", "(collect|transform)", "i")); |
|
55 | 57 |
} |
56 | 58 |
|
57 | 59 |
private synchronized MongoCollection<Document> getCollection() { |
... | ... | |
65 | 67 |
@Cacheable("datasources-mongo-cache") |
66 | 68 |
public List<AggregationInfo> getAggregationHistory(final String dsId) throws ApiException { |
67 | 69 |
|
68 |
log.warn("getAggregationHistory(): not using cache");
|
|
70 |
log.warn(String.format("getAggregationHistory(dsId = %s): not using cache", dsId));
|
|
69 | 71 |
|
70 | 72 |
final Bson query = getQuery(dsId); |
71 |
|
|
72 | 73 |
return Utils.stream(getCollection().find(query).projection(fields).limit(limit).sort(dbo("system:startHumanDate", -1)).iterator()) |
73 | 74 |
.map(getMapper()) |
74 | 75 |
.filter(ai -> ai.getNumberOfRecords() >= 0 && StringUtils.isNotBlank(ai.getDate())) |
Also available in: Unified diff
fine grained operations