Versions Compared

Key

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

...

RefreshHandler

We introduce the class interface RefreshHandler which records the meta information of the current materialized table background refresh job.

Code Block
languagejava
/**
 * This interface represents the meta information of current materialized table background refresh
 * pipeline. The refresh mode maybe continuous or full. The format of, the meta information in the
 * two modes is not
 * consistent, so user need to implementation this interface according to .
 *
 * <p>This meta information will be serialized to bytes by {@link RefreshHandlerSerializer}, then
 * store to Catalog for suspend or drop {@link CatalogMaterializedTable}business scenario.
 *
 * <p>In continuous mode, the format of the meta information maybe contains { "clusterType": "yarn",
 * "clusterId":
 * "xxx", "jobId": "yyyy" }.
 *
 * <p>In full mode, the meta information formatmaybe maybecontains { "endpoint": "xxx", "workflowId": "yyy" }.
 * Due to youuser may use different workflow scheduler plugin in this mode, youuser should implement this
 * interface according to yourtheir plugin.
 */
@PublicEvolving
public
 * <p>This interface RefreshHandler {

    will be serialized to bytes by {@link RefreshHandlerSerializer}, then store to
 * Catalog for further operation.
 */ 
@PublicEvolving
public interface RefreshHandler {

    /** Returns a string that summarizes this refresh handler meta information for printing to a console or log. */
    String asSummaryString();
}

RefreshHandlerSerializer

Introduce the interface RefreshHandlerSerializer which is used to serialize and deserialize RefreshHandler. The serialized bytes will be persisted to CatalogMaterializedTable for further operation.

Code Block
languagejava
/** This interface is used to serialize and deserialize the {@link RefreshHandler}. */
@PublicEvolving
public interface RefreshHandlerSerializer<T extends RefreshHandler> {

    /** Serialize the {@link RefreshHandler} to bytes. */
    byte[] serialize(T refreshHandler) throws IOException;

    /** Deserialize the bytes to a {@link RefreshHandler} instance. */
    T deserialize(byte[] serializedBytes, ClassLoader cl)
            throws IOException, ClassNotFoundException;
}

ResolvedCatalogMaterializedTable

...