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

io.deephaven.engine.table.impl.replay.ReplayTableBase Maven / Gradle / Ivy

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

import io.deephaven.engine.rowset.TrackingRowSet;
import io.deephaven.engine.table.ColumnSource;
import io.deephaven.engine.table.impl.InstrumentedTableUpdateSource;
import io.deephaven.engine.table.impl.QueryTable;
import org.jetbrains.annotations.NotNull;

import java.util.Map;

public abstract class ReplayTableBase extends QueryTable implements Runnable {

    private final SourceRefresher sourceRefresher;

    public ReplayTableBase(
            @NotNull final String description,
            @NotNull final TrackingRowSet rowSet,
            @NotNull final Map> columns) {
        super(rowSet, columns);
        setRefreshing(true);
        sourceRefresher = new SourceRefresher(description);
    }

    public void start() {
        updateGraph.addSource(sourceRefresher);
    }

    public void stop() {
        updateGraph.removeSource(sourceRefresher);
    }

    private class SourceRefresher extends InstrumentedTableUpdateSource {
        SourceRefresher(final String description) {
            super(ReplayTableBase.this, description);
        }

        @Override
        protected void instrumentedRefresh() {
            ReplayTableBase.this.run();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy