Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Public Interfaces


Introduce twoPhaseCreateTable API for Cataloginterface SupportsStaged , which provided getStagedTable API. If DynamicTableSink implements the interface SupportsStaged, it indicates that it supports atomic operations.

Code Block
languagejava
@PublicEvolving
public interface CatalogSupportsStaged {

    /**
     * Create a {@link TwoPhaseCatalogTableStagedTable} that provided transaction abstraction.
     * TwoPhaseCatalogTableStagedTable will be combined with {@link JobStatusHook} to achieve atomicity
     * support in the Flink framework. Default
 returns empty, indicating that atomic operations are*
     * not<p>The supported,framework thenwill usingmake non-atomic implementations.
     *
     * <p>The framework will make sure to call this method with fully validated sure to call this method with fully validated {@link
     * ResolvedCatalogTable}.
     *
     * @param tablePath path of the table to be created
     * @param table the table definition
     * @param ignoreIfExistsSupportsStagedContext flagSections tobeyond specifybasic behaviorinformation, whenexpandable
 a table or view already* exists@return at the
     *     given path: if set to false, it throws a TableAlreadyExistException, if set to true, do
     *{@link StagedTable} that can be serialized and provides atomic operations
     */
    StagedTable getStagedTable(
            ObjectPath tablePath,
      nothing.
     * @paramCatalogBaseTable isStreamingModetable,
 A flag that tells if the current table is in stream mode, DifferentSupportsStagedContext context);

     /**
     modes* canExtended haveinformation differentfor implementations of atomicity support{@link StagedTable}.
     */
 @return {@link TwoPhaseCatalogTable} thatpublic canstatic beclass serialized and provides atomicSupportsStagedContext {

     *   private boolean operationsignoreIfExists;
     * @throws TableAlreadyExistException ifprivate table already exists and ignoreIfExists is falseboolean managedTable;

     * @throws DatabaseNotExistException ifpublic the database in tablePath doesn't exist
SupportsStagedContext(boolean ignoreIfExists, boolean managedTable) {
      * @throws CatalogException in case of any runti
me exception
  this.ignoreIfExists = ignoreIfExists;
   */
    default Optional<TwoPhaseCatalogTable> twoPhaseCreateTable(
   this.managedTable = managedTable;
       ObjectPath tablePath,}

        public boolean   CatalogBaseTable table,isIgnoreIfExists() {
            booleanreturn ignoreIfExists,;
        }

        public boolean isStreamingModeisManagedTable() {
            throws TableAlreadyExistException, DatabaseNotExistException, CatalogException {return managedTable;
        return Optional.empty();}
    }

}


Introduce TwoPhaseCatalogTable interface that support atomic operations.

...