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

tech.ydb.yoj.databind.schema.Changefeed Maven / Gradle / Ivy

Go to download

Core data-binding logic used by YOJ (YDB ORM for Java) to convert between Java objects and database rows (or anything representable by a Java Map, really).

The newest version!
package tech.ydb.yoj.databind.schema;

import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @see CDC Concepts
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(Changefeeds.class)
public @interface Changefeed {
    String name();

    /**
     * Mode specifies the information that will be written to the feed
     */
    Mode mode() default Mode.NEW_IMAGE;

    /**
     * Format of the data
     */
    Format format() default Format.JSON;

    /**
     * Virtual timestamps
     */
    boolean virtualTimestamps() default false;

    /**
     * Retention period for data in feed, in {@link java.time.Duration} ISO format.
     * E.g., {@code PT1M}
     */
    String retentionPeriod() default "PT24H";

    /**
     * Initial table scan
     */
    boolean initialScan() default false;

    enum Mode {
        /**
         * Only the key component of the modified row
         */
        KEYS_ONLY,

        /**
         * Updated columns
         */
        UPDATES,

        /**
         * The entire row, as it appears after it was modified
         */
        NEW_IMAGE,

        /**
         * The entire row, as it appeared before it was modified
         */
        OLD_IMAGE,

        /**
         * Both new and old images of the row
         */
        NEW_AND_OLD_IMAGES
    }

    enum Format {
        JSON
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy