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

tech.ytsaurus.client.request.QueryTrackerReq Maven / Gradle / Ivy

The newest version!
package tech.ytsaurus.client.request;

import java.util.function.Consumer;

abstract class QueryTrackerReq<
        TBuilder extends QueryTrackerReq.Builder,
        TRequest extends QueryTrackerReq>
        extends RequestBase {
    protected final String queryTrackerStage;

    protected QueryTrackerReq(Builder builder) {
        super(builder);
        this.queryTrackerStage = builder.queryTrackerStage;
    }

    protected void writeQueryTrackerDescriptionToProto(Consumer queryTrackerStageSetter) {
        queryTrackerStageSetter.accept(queryTrackerStage);
    }

    @Override
    protected void writeArgumentsLogString(StringBuilder sb) {
        sb.append("QueryTrackerStage: ").append(queryTrackerStage).append("; ");
    }

    public abstract static class Builder<
            TBuilder extends Builder,
            TRequest extends RequestBase>
            extends RequestBase.Builder {
        protected String queryTrackerStage = "production";

        Builder() {
        }

        /**
         * Set Query tracker's stage in which queries will be run.
         * Default value is production.
         * @see QueryEngine
         * @return self
         */
        public TBuilder setQueryTrackerStage(String queryTrackerStage) {
            this.queryTrackerStage = queryTrackerStage;
            return self();
        }

        @Override
        protected void writeArgumentsLogString(StringBuilder sb) {
            sb.append("QueryTrackerStage: ").append(queryTrackerStage).append("; ");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy