Enum Operation

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Operation>

    @EvolvingApi
    public enum Operation
    extends java.lang.Enum<Operation>
    Describes the nature of a CDC event, mainly the type of action performed on a database record: insertion, update and deletion. There are also some special values: "sync", which has the same effect as an insert, but originates from the initial database snapshot (as opposed to the database changelog), and "unspecified", used for a few special CDC events (like heartbeats).
    Since:
    Jet 4.2
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DELETE
      Record deletion, sourced from the DB changelog.
      INSERT
      Record insertion, sourced from the DB changelog.
      SYNC
      Just like INSERT, but coming from the initial DB snapshot (as opposed to the change log).
      UNSPECIFIED
      ChangeRecord doesn't have an operation field, for example heartbeats.
      UPDATE
      Record update, sourced from the DB changelog.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String code()
      Returns the Debezium operation code as String.
      static Operation get​(java.lang.String opcode)
      Parses the string present in a CDC message into the corresponding Operation enum member.
      static Operation valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Operation[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • UNSPECIFIED

        public static final Operation UNSPECIFIED
        ChangeRecord doesn't have an operation field, for example heartbeats.
      • SYNC

        public static final Operation SYNC
        Just like INSERT, but coming from the initial DB snapshot (as opposed to the change log).
      • INSERT

        public static final Operation INSERT
        Record insertion, sourced from the DB changelog.
      • UPDATE

        public static final Operation UPDATE
        Record update, sourced from the DB changelog.
      • DELETE

        public static final Operation DELETE
        Record deletion, sourced from the DB changelog.
    • Method Detail

      • values

        public static Operation[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Operation c : Operation.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Operation valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • code

        public java.lang.String code()
        Returns the Debezium operation code as String.
      • get

        public static Operation get​(@Nullable
                                    java.lang.String opcode)
                             throws ParsingException
        Parses the string present in a CDC message into the corresponding Operation enum member.

        If the argument is null, it returns UNSPECIFIED.

        Throws:
        ParsingException - if the input string doesn't represent an expected value