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

io.deephaven.engine.table.impl.ZeroKeyCrossJoinShiftState Maven / Gradle / Ivy

There is a newer version: 0.37.1
Show newest version
package io.deephaven.engine.table.impl;

import io.deephaven.base.verify.Assert;
import io.deephaven.engine.context.ExecutionContext;

public class ZeroKeyCrossJoinShiftState extends CrossJoinShiftState {
    private boolean rightEmpty;
    private volatile boolean prevRightEmpty;
    private volatile long emptyChangeStep = -1;
    private boolean isTrackingPrev = false;

    public ZeroKeyCrossJoinShiftState(int numInitialShiftBits, boolean allowRightSideNulls) {
        super(numInitialShiftBits, allowRightSideNulls);
    }

    void startTrackingPrevious() {
        isTrackingPrev = true;
    }

    void setRightEmpty(boolean rightEmpty) {
        if (isTrackingPrev) {
            this.prevRightEmpty = this.rightEmpty;
            final long currentStep = ExecutionContext.getContext().getUpdateGraph().clock().currentStep();
            Assert.lt(emptyChangeStep, "emptyChangeStep", currentStep, "currentStep");
            this.emptyChangeStep = currentStep;
        }
        this.rightEmpty = rightEmpty;
    }

    public boolean rightEmpty() {
        return rightEmpty;
    }

    public boolean rightEmptyPrev() {
        if (emptyChangeStep != -1
                && emptyChangeStep == ExecutionContext.getContext().getUpdateGraph().clock().currentStep()) {
            return prevRightEmpty;
        }
        return rightEmpty;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy