[ 
https://issues.apache.org/jira/browse/FLINK-25173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jingsong Lee updated FLINK-25173:
---------------------------------
    Description: 
Currently, only HiveCatalog can provide this catalog lock.
{code:java}
/**
 * An interface that allows source and sink to use global lock to some 
transaction-related things.
 */
@Internal
public interface CatalogLock extends Closeable {
 
    /** Run with catalog lock. The caller should tell catalog the database and 
table name. */
    <T> T runWithLock(String database, String table, Callable<T> callable) 
throws Exception;
 
    /** Factory to create {@link CatalogLock}. */
    interface Factory extends Serializable {
        CatalogLock create();
    }
} {code}
And we need a interface to set lock to source&sink by catalog:
{code:java}
/**
 * Source and sink implement this interface if they require {@link 
CatalogLock}. This is marked as
 * internal. If we need lock to be more general, we can put lock factory into 
{@link
 * DynamicTableFactory.Context}.
 */
@Internal
public interface RequireCatalogLock {
 
    void setLockFactory(CatalogLock.Factory lockFactory);
} {code}
{{}}

  was:
{panel}
{panel}
|{{/**}}
{{ }}{{* An interface that allows source and sink to use global lock to some 
transaction-related things.}}
{{ }}{{*/}}
{{@Internal}}
{{public}} {{interface}} {{CatalogLock }}{{extends}} {{Closeable {}}
 
{{    }}{{/** Run with catalog lock. The caller should tell catalog the 
database and table name. */}}
{{    }}{{<T> T runWithLock(String database, String table, Callable<T> 
callable) }}{{throws}} {{Exception;}}
 
{{    }}{{/** Factory to create \{@link CatalogLock}. */}}
{{    }}{{interface}} {{Factory }}{{extends}} {{Serializable {}}
{{        }}{{CatalogLock create();}}
{{    }}{{}}}
{{}}}|

Currently, only HiveCatalog can provide this catalog lock.


> Introduce CatalogLock
> ---------------------
>
>                 Key: FLINK-25173
>                 URL: https://issues.apache.org/jira/browse/FLINK-25173
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Connectors / Hive, Table SQL / API
>            Reporter: Jingsong Lee
>            Priority: Major
>             Fix For: 1.15.0
>
>
> Currently, only HiveCatalog can provide this catalog lock.
> {code:java}
> /**
>  * An interface that allows source and sink to use global lock to some 
> transaction-related things.
>  */
> @Internal
> public interface CatalogLock extends Closeable {
>  
>     /** Run with catalog lock. The caller should tell catalog the database 
> and table name. */
>     <T> T runWithLock(String database, String table, Callable<T> callable) 
> throws Exception;
>  
>     /** Factory to create {@link CatalogLock}. */
>     interface Factory extends Serializable {
>         CatalogLock create();
>     }
> } {code}
> And we need a interface to set lock to source&sink by catalog:
> {code:java}
> /**
>  * Source and sink implement this interface if they require {@link 
> CatalogLock}. This is marked as
>  * internal. If we need lock to be more general, we can put lock factory into 
> {@link
>  * DynamicTableFactory.Context}.
>  */
> @Internal
> public interface RequireCatalogLock {
>  
>     void setLockFactory(CatalogLock.Factory lockFactory);
> } {code}
> {{}}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to