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

gobblin.service.JobState Maven / Gradle / Ivy

The newest version!

package gobblin.service;

import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import com.linkedin.data.DataMap;
import com.linkedin.data.schema.PathSpec;
import com.linkedin.data.schema.RecordDataSchema;
import com.linkedin.data.template.DataTemplateUtil;
import com.linkedin.data.template.GetMode;
import com.linkedin.data.template.RecordTemplate;
import com.linkedin.data.template.SetMode;


/**
 * Job state that is updated at the end of an execution
 * 
 */
@Generated(value = "com.linkedin.pegasus.generator.JavaCodeUtil", comments = "Rest.li Data Template. Generated from /Users/ibuenros/repos/gobblin/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-api/src/main/pegasus/gobblin/service/JobState.pdsc.", date = "Fri Jul 21 13:35:27 PDT 2017")
public class JobState
    extends RecordTemplate
{

    private final static JobState.Fields _fields = new JobState.Fields();
    private final static RecordDataSchema SCHEMA = ((RecordDataSchema) DataTemplateUtil.parseSchema("{\"type\":\"record\",\"name\":\"JobState\",\"namespace\":\"gobblin.service\",\"doc\":\"Job state that is updated at the end of an execution\",\"fields\":[{\"name\":\"lowWatermark\",\"type\":\"string\",\"doc\":\"Low watermark after last execution\"},{\"name\":\"highWatermark\",\"type\":\"string\",\"doc\":\"High watermark after last execution\"}]}"));
    private final static RecordDataSchema.Field FIELD_LowWatermark = SCHEMA.getField("lowWatermark");
    private final static RecordDataSchema.Field FIELD_HighWatermark = SCHEMA.getField("highWatermark");

    public JobState() {
        super(new DataMap(), SCHEMA);
    }

    public JobState(DataMap data) {
        super(data, SCHEMA);
    }

    public static JobState.Fields fields() {
        return _fields;
    }

    /**
     * Existence checker for lowWatermark
     * 
     * @see JobState.Fields#lowWatermark
     */
    public boolean hasLowWatermark() {
        return contains(FIELD_LowWatermark);
    }

    /**
     * Remover for lowWatermark
     * 
     * @see JobState.Fields#lowWatermark
     */
    public void removeLowWatermark() {
        remove(FIELD_LowWatermark);
    }

    /**
     * Getter for lowWatermark
     * 
     * @see JobState.Fields#lowWatermark
     */
    public String getLowWatermark(GetMode mode) {
        return obtainDirect(FIELD_LowWatermark, String.class, mode);
    }

    /**
     * Getter for lowWatermark
     * 
     * @return
     *     Required field. Could be null for partial record.
     * @see JobState.Fields#lowWatermark
     */
    @Nonnull
    public String getLowWatermark() {
        return obtainDirect(FIELD_LowWatermark, String.class, GetMode.STRICT);
    }

    /**
     * Setter for lowWatermark
     * 
     * @see JobState.Fields#lowWatermark
     */
    public JobState setLowWatermark(String value, SetMode mode) {
        putDirect(FIELD_LowWatermark, String.class, String.class, value, mode);
        return this;
    }

    /**
     * Setter for lowWatermark
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see JobState.Fields#lowWatermark
     */
    public JobState setLowWatermark(
        @Nonnull
        String value) {
        putDirect(FIELD_LowWatermark, String.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    /**
     * Existence checker for highWatermark
     * 
     * @see JobState.Fields#highWatermark
     */
    public boolean hasHighWatermark() {
        return contains(FIELD_HighWatermark);
    }

    /**
     * Remover for highWatermark
     * 
     * @see JobState.Fields#highWatermark
     */
    public void removeHighWatermark() {
        remove(FIELD_HighWatermark);
    }

    /**
     * Getter for highWatermark
     * 
     * @see JobState.Fields#highWatermark
     */
    public String getHighWatermark(GetMode mode) {
        return obtainDirect(FIELD_HighWatermark, String.class, mode);
    }

    /**
     * Getter for highWatermark
     * 
     * @return
     *     Required field. Could be null for partial record.
     * @see JobState.Fields#highWatermark
     */
    @Nonnull
    public String getHighWatermark() {
        return obtainDirect(FIELD_HighWatermark, String.class, GetMode.STRICT);
    }

    /**
     * Setter for highWatermark
     * 
     * @see JobState.Fields#highWatermark
     */
    public JobState setHighWatermark(String value, SetMode mode) {
        putDirect(FIELD_HighWatermark, String.class, String.class, value, mode);
        return this;
    }

    /**
     * Setter for highWatermark
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see JobState.Fields#highWatermark
     */
    public JobState setHighWatermark(
        @Nonnull
        String value) {
        putDirect(FIELD_HighWatermark, String.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    @Override
    public JobState clone()
        throws CloneNotSupportedException
    {
        return ((JobState) super.clone());
    }

    @Override
    public JobState copy()
        throws CloneNotSupportedException
    {
        return ((JobState) super.copy());
    }

    public static class Fields
        extends PathSpec
    {


        public Fields(List path, String name) {
            super(path, name);
        }

        public Fields() {
            super();
        }

        /**
         * Low watermark after last execution
         * 
         */
        public PathSpec lowWatermark() {
            return new PathSpec(getPathComponents(), "lowWatermark");
        }

        /**
         * High watermark after last execution
         * 
         */
        public PathSpec highWatermark() {
            return new PathSpec(getPathComponents(), "highWatermark");
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy