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

io.deephaven.engine.table.impl.ssa.ChunkSsaStamp 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.ssa;

import io.deephaven.chunk.*;
import io.deephaven.engine.rowset.chunkattributes.RowKeys;
import io.deephaven.chunk.attributes.Values;
import io.deephaven.engine.table.impl.util.WritableRowRedirection;
import io.deephaven.engine.table.impl.util.RowRedirection;
import io.deephaven.engine.rowset.RowSetBuilderRandom;

public interface ChunkSsaStamp {
    static ChunkSsaStamp make(ChunkType type, boolean reverse) {
        if (reverse) {
            switch (type) {
                case Char:
                    return NullAwareCharReverseChunkSsaStamp.INSTANCE;
                case Byte:
                    return ByteReverseChunkSsaStamp.INSTANCE;
                case Short:
                    return ShortReverseChunkSsaStamp.INSTANCE;
                case Int:
                    return IntReverseChunkSsaStamp.INSTANCE;
                case Long:
                    return LongReverseChunkSsaStamp.INSTANCE;
                case Float:
                    return FloatReverseChunkSsaStamp.INSTANCE;
                case Double:
                    return DoubleReverseChunkSsaStamp.INSTANCE;
                case Object:
                    return ObjectReverseChunkSsaStamp.INSTANCE;
                default:
                case Boolean:
                    throw new UnsupportedOperationException();
            }
        } else {
            switch (type) {
                case Char:
                    return NullAwareCharChunkSsaStamp.INSTANCE;
                case Byte:
                    return ByteChunkSsaStamp.INSTANCE;
                case Short:
                    return ShortChunkSsaStamp.INSTANCE;
                case Int:
                    return IntChunkSsaStamp.INSTANCE;
                case Long:
                    return LongChunkSsaStamp.INSTANCE;
                case Float:
                    return FloatChunkSsaStamp.INSTANCE;
                case Double:
                    return DoubleChunkSsaStamp.INSTANCE;
                case Object:
                    return ObjectChunkSsaStamp.INSTANCE;
                default:
                case Boolean:
                    throw new UnsupportedOperationException();
            }
        }
    }

    void processEntry(Chunk leftStampValues, Chunk leftStampKeys, SegmentedSortedArray ssa,
            WritableLongChunk rightKeysForLeft, boolean disallowExactMatch);

    void processRemovals(Chunk leftStampValues, LongChunk leftStampKeys,
            Chunk rightStampChunk, LongChunk rightKeys,
            WritableLongChunk priorRedirections, WritableRowRedirection rowRedirection,
            RowSetBuilderRandom modifiedBuilder, boolean disallowExactMatch);

    void processInsertion(Chunk leftStampValues, LongChunk leftStampKeys,
            Chunk rightStampChunk, LongChunk rightKeys, Chunk nextRightValue,
            WritableRowRedirection rowRedirection, RowSetBuilderRandom modifiedBuilder, boolean endsWithLastValue,
            boolean disallowExactMatch);

    int findModified(int first, Chunk leftStampValues, LongChunk leftStampKeys,
            RowRedirection rowRedirection, Chunk rightStampChunk,
            LongChunk rightStampIndices, RowSetBuilderRandom modifiedBuilder, boolean disallowExactMatch);

    void applyShift(Chunk leftStampValues, LongChunk leftStampKeys,
            Chunk rightStampChunk, LongChunk rightStampKeys, long shiftDelta,
            WritableRowRedirection rowRedirection, boolean disallowExactMatch);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy