Search in sources :

Example 1 with Int2IntAVLTreeMap

use of it.unimi.dsi.fastutil.ints.Int2IntAVLTreeMap in project conquery by bakdata.

the class Preprocessed method write.

public void write(File file) throws IOException {
    Int2IntMap entityStart = new Int2IntAVLTreeMap();
    Int2IntMap entityLength = new Int2IntAVLTreeMap();
    calculateEntitySpans(entityStart, entityLength);
    final IntSummaryStatistics statistics = entityLength.values().intStream().summaryStatistics();
    log.info("Statistics = {}", statistics);
    Map<String, ColumnStore> columnStores = combineStores(entityStart);
    Dictionary primaryDictionary = encodePrimaryDictionary();
    Map<String, Dictionary> dicts = collectDictionaries(columnStores);
    log.debug("Writing Headers");
    int hash = descriptor.calculateValidityHash(job.getCsvDirectory(), job.getTag());
    PreprocessedHeader header = new PreprocessedHeader(descriptor.getName(), descriptor.getTable(), rows, columns, hash);
    final PreprocessedDictionaries dictionaries = new PreprocessedDictionaries(primaryDictionary, dicts);
    final PreprocessedData data = new PreprocessedData(entityStart, entityLength, columnStores);
    writePreprocessed(file, header, dictionaries, data);
}
Also used : Dictionary(com.bakdata.conquery.models.dictionary.Dictionary) ColumnStore(com.bakdata.conquery.models.events.stores.root.ColumnStore) IntSummaryStatistics(java.util.IntSummaryStatistics) Int2IntMap(it.unimi.dsi.fastutil.ints.Int2IntMap) Int2IntAVLTreeMap(it.unimi.dsi.fastutil.ints.Int2IntAVLTreeMap)

Aggregations

Dictionary (com.bakdata.conquery.models.dictionary.Dictionary)1 ColumnStore (com.bakdata.conquery.models.events.stores.root.ColumnStore)1 Int2IntAVLTreeMap (it.unimi.dsi.fastutil.ints.Int2IntAVLTreeMap)1 Int2IntMap (it.unimi.dsi.fastutil.ints.Int2IntMap)1 IntSummaryStatistics (java.util.IntSummaryStatistics)1