All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.deephaven.engine.table.impl.by.ssmcountdistinct.SsmDistinctContext Maven / Gradle / Ivy

There is a newer version: 0.37.1
Show newest version
/**
 * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
 */
package io.deephaven.engine.table.impl.by.ssmcountdistinct;

import io.deephaven.chunk.attributes.ChunkLengths;
import io.deephaven.chunk.attributes.Values;
import io.deephaven.configuration.Configuration;
import io.deephaven.engine.table.impl.by.IterativeChunkedAggregationOperator;
import io.deephaven.chunk.ChunkType;
import io.deephaven.chunk.WritableChunk;
import io.deephaven.chunk.WritableIntChunk;
import io.deephaven.engine.table.impl.ssms.SegmentedSortedMultiSet;

public class SsmDistinctContext implements IterativeChunkedAggregationOperator.SingletonContext {

    public static final int NODE_SIZE =
            Configuration.getInstance().getIntegerWithDefault("SsmDistinctContext.nodeSize", 4096);

    public final SegmentedSortedMultiSet.RemoveContext removeContext =
            SegmentedSortedMultiSet.makeRemoveContext(NODE_SIZE);
    public final WritableChunk valueCopy;
    public final WritableIntChunk counts;

    public SsmDistinctContext(ChunkType chunkType, int size) {
        valueCopy = chunkType.makeWritableChunk(size);
        counts = WritableIntChunk.makeWritableChunk(size);
    }

    @Override
    public void close() {
        valueCopy.close();
        counts.close();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy