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

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

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

import tech.ytsaurus.core.cypress.YPath;
import tech.ytsaurus.rpcproxy.TReqReshardTableAutomatic;

public class ReshardTableAutomatic
        extends TableReq {
    private final boolean keepActions;

    public ReshardTableAutomatic(BuilderBase builder) {
        super(builder);
        this.keepActions = builder.keepActions;
    }

    public ReshardTableAutomatic(YPath path, boolean keepActions) {
        this(builder().setPath(path.justPath()).setKeepActions(keepActions));
    }

    public static Builder builder() {
        return new Builder();
    }

    public TReqReshardTableAutomatic.Builder writeTo(TReqReshardTableAutomatic.Builder builder) {
        super.writeTo(builder);
        builder.setKeepActions(keepActions);
        return builder;
    }

    @Override
    public Builder toBuilder() {
        return builder()
                .setKeepActions(keepActions)
                .setMutatingOptions(mutatingOptions)
                .setPath(path)
                .setTabletRangeOptions(tabletRangeOptions)
                .setTimeout(timeout)
                .setRequestId(requestId)
                .setUserAgent(userAgent)
                .setTraceId(traceId, traceSampled)
                .setAdditionalData(additionalData);
    }

    public static class Builder extends BuilderBase {
        @Override
        protected Builder self() {
            return this;
        }
    }

    public abstract static class BuilderBase<
            TBuilder extends BuilderBase>
            extends TableReq.Builder {
        private boolean keepActions = false;

        public TBuilder setKeepActions(boolean keepActions) {
            this.keepActions = keepActions;
            return self();
        }

        public TReqReshardTableAutomatic.Builder writeTo(TReqReshardTableAutomatic.Builder builder) {
            super.writeTo(builder);
            builder.setKeepActions(keepActions);
            return builder;
        }

        @Override
        public ReshardTableAutomatic build() {
            return new ReshardTableAutomatic(this);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy