rewrite query completion

The old implementation searched for all possible values and then
executed each query to see what matches.
The new implementation uses several indices to find only
the matching values.
This commit is contained in:
2019-02-02 15:35:56 +01:00
parent 72e9a9ebe3
commit 76e5d441de
20 changed files with 1676 additions and 126 deletions

View File

@@ -11,8 +11,8 @@ public class Tag implements Comparable<Tag> {
}
public Tag(final String key, final String value) {
this.key = Tags.STRING_COMPRESSOR.put(key);
this.value = Tags.STRING_COMPRESSOR.put(value);
this.key = key != null ? Tags.STRING_COMPRESSOR.put(key) : -1;
this.value = value != null ? Tags.STRING_COMPRESSOR.put(value) : -1;
}
@Override

View File

@@ -72,6 +72,13 @@ public class Tags implements Comparable<Tags> {
return result;
}
public static Tags create(final String key1, final String value1, final String key2, final String value2,
final String key3, final String value3, final String key4, final String value4) {
final Tags result = TagsBuilder.create().add(key1, value1).add(key2, value2).add(key3, value3).add(key4, value4)
.build();
return result;
}
public static Tags fromBytes(final byte[] bytes) {
final List<Tag> result = new ArrayList<>();
@@ -188,7 +195,7 @@ public class Tags implements Comparable<Tags> {
@Override
public String toString() {
return "Tags [tags=" + tags + "]";
return String.valueOf(tags);
}
@Override