remove method to create a query based on tags
was only used in tests
This commit is contained in:
@@ -51,7 +51,7 @@ public class PerformanceDbTest {
|
||||
final Tags tags = Tags.STRING_COMPRESSOR.createAndAddToDictionary("myKey", "myValue");
|
||||
db.putEntry(new Entry(date, value, tags));
|
||||
|
||||
final Result result = db.get(Query.createQuery(tags, DateTimeRange.ofDay(nowInUtc)));
|
||||
final Result result = db.get(Query.createQuery("myKey=myValue", DateTimeRange.ofDay(nowInUtc)));
|
||||
final LongList stream = result.singleGroup().flatMap();
|
||||
|
||||
Assertions.assertEquals(2, stream.size());
|
||||
@@ -76,7 +76,7 @@ public class PerformanceDbTest {
|
||||
db.putEntry(new Entry(dayOne, valueOne, tags));
|
||||
db.putEntry(new Entry(dayTwo, valueTwo, tags));
|
||||
|
||||
final LongList stream = db.get(Query.createQuery(tags, dateRange)).singleGroup().flatMap();
|
||||
final LongList stream = db.get(Query.createQuery("myKey=myValue", dateRange)).singleGroup().flatMap();
|
||||
|
||||
Assertions.assertEquals(4, stream.size());
|
||||
|
||||
@@ -123,7 +123,7 @@ public class PerformanceDbTest {
|
||||
|
||||
db.putEntries(entries);
|
||||
|
||||
final LongList actualEntries = db.get(Query.createQuery(tags, timeRange)).singleGroup().flatMap();
|
||||
final LongList actualEntries = db.get(Query.createQuery("myKey=one", timeRange)).singleGroup().flatMap();
|
||||
Assertions.assertEquals(entries.size() * 2, actualEntries.size());
|
||||
|
||||
for (int i = 0; i < entries.size(); i++) {
|
||||
@@ -167,7 +167,7 @@ public class PerformanceDbTest {
|
||||
db.putEntries(entries);
|
||||
expected.addAll(entries);
|
||||
|
||||
final LongList actualEntries = db.get(Query.createQuery(tags, timeRange)).singleGroup().flatMap();
|
||||
final LongList actualEntries = db.get(Query.createQuery("myKey=one", timeRange)).singleGroup().flatMap();
|
||||
Assertions.assertEquals(expected.size() * 2, actualEntries.size());
|
||||
|
||||
Assertions.assertEquals(toExpectedValues(expected), actualEntries);
|
||||
@@ -185,7 +185,6 @@ public class PerformanceDbTest {
|
||||
final DateTimeRange dateRange = new DateTimeRange(from, to);
|
||||
final long numberOfEntries = timeRange.duration().toHours();
|
||||
|
||||
final Tags tagsCommon = Tags.STRING_COMPRESSOR.createAndAddToDictionary("commonKey", "commonValue");
|
||||
final Tags tagsOne = Tags.STRING_COMPRESSOR.createAndAddToDictionary("myKey", "one", "commonKey",
|
||||
"commonValue");
|
||||
final List<Entry> entriesOne = generateEntries(timeRange, numberOfEntries, 1, tagsOne);
|
||||
@@ -204,16 +203,20 @@ public class PerformanceDbTest {
|
||||
printEntries(entriesThree, "three");
|
||||
db.putEntries(entriesThree);
|
||||
|
||||
final LongList actualEntriesOne = db.get(Query.createQuery(tagsOne, dateRange)).singleGroup().flatMap();
|
||||
final LongList actualEntriesOne = db
|
||||
.get(Query.createQuery("myKey=one and commonKey=commonValue", dateRange)).singleGroup().flatMap();
|
||||
Assertions.assertEquals(toExpectedValues(entriesOne), actualEntriesOne);
|
||||
|
||||
final LongList actualEntriesTwo = db.get(Query.createQuery(tagsTwo, dateRange)).singleGroup().flatMap();
|
||||
final LongList actualEntriesTwo = db
|
||||
.get(Query.createQuery("myKey=two and commonKey=commonValue", dateRange)).singleGroup().flatMap();
|
||||
Assertions.assertEquals(toExpectedValues(entriesTwo), actualEntriesTwo);
|
||||
|
||||
final LongList actualEntriesThree = db.get(Query.createQuery(tagsThree, dateRange)).singleGroup().flatMap();
|
||||
final LongList actualEntriesThree = db
|
||||
.get(Query.createQuery("myKey=three and commonKey=commonValue", dateRange)).singleGroup().flatMap();
|
||||
Assertions.assertEquals(toExpectedValues(entriesThree), actualEntriesThree);
|
||||
|
||||
final LongList actualEntriesAll = db.get(Query.createQuery(tagsCommon, dateRange)).singleGroup().flatMap();
|
||||
final LongList actualEntriesAll = db.get(Query.createQuery("commonKey=commonValue", dateRange))
|
||||
.singleGroup().flatMap();
|
||||
final List<Entry> expectedAll = CollectionUtils.collate(entriesOne,
|
||||
CollectionUtils.collate(entriesTwo, entriesThree, EntryByDateComparator.INSTANCE),
|
||||
EntryByDateComparator.INSTANCE);
|
||||
|
||||
Reference in New Issue
Block a user