Search in sources :

Example 1 with SuccinctTrie

use of com.bakdata.conquery.util.dict.SuccinctTrie in project conquery by bakdata.

the class TrieTypeGuesser method createGuess.

@Override
public Guess createGuess() {
    IntegerStore indexType = p.decideIndexType();
    SuccinctTrie trie = new SuccinctTrie(Dataset.PLACEHOLDER, UUID.randomUUID().toString());
    StringTypeDictionary type = new StringTypeDictionary(indexType, trie);
    for (byte[] v : p.getDecoded()) {
        trie.add(v);
    }
    StringTypeEncoded result = new StringTypeEncoded(type, p.getEncoding());
    return new Guess(result, indexType.estimateMemoryConsumptionBytes(), trie.estimateMemoryConsumption()) {

        @Override
        public StringStore getType() {
            trie.compress();
            return super.getType();
        }
    };
}
Also used : IntegerStore(com.bakdata.conquery.models.events.stores.root.IntegerStore) StringTypeDictionary(com.bakdata.conquery.models.events.stores.specific.string.StringTypeDictionary) StringTypeEncoded(com.bakdata.conquery.models.events.stores.specific.string.StringTypeEncoded) SuccinctTrie(com.bakdata.conquery.util.dict.SuccinctTrie)

Aggregations

IntegerStore (com.bakdata.conquery.models.events.stores.root.IntegerStore)1 StringTypeDictionary (com.bakdata.conquery.models.events.stores.specific.string.StringTypeDictionary)1 StringTypeEncoded (com.bakdata.conquery.models.events.stores.specific.string.StringTypeEncoded)1 SuccinctTrie (com.bakdata.conquery.util.dict.SuccinctTrie)1