risingwave_connector::parser::avro::glue_resolver

Trait GlueSchemaCache

source
pub trait GlueSchemaCache {
    // Required methods
    async fn get_by_id(
        &self,
        schema_version_id: Uuid,
    ) -> ConnectorResult<Arc<Schema>>;
    async fn get_by_name(
        &self,
        schema_arn: &str,
    ) -> ConnectorResult<Arc<Schema>>;
}
Expand description

Fetch schemas from AWS Glue schema registry and cache them.

Background: This is mainly used for Avro writer schema (during schema evolution): When decoding an Avro message, we must get the message’s schema id, and use the exactly same schema to decode the message, and then convert it with the reader schema. (This is also why Avro has to be used with a schema registry instead of a static schema file.)

TODO: support protobuf (not sure if it’s needed)

Required Methods§

source

async fn get_by_id( &self, schema_version_id: Uuid, ) -> ConnectorResult<Arc<Schema>>

Gets the a specific schema by id, which is used as writer schema.

source

async fn get_by_name(&self, schema_arn: &str) -> ConnectorResult<Arc<Schema>>

Gets the latest schema by arn, which is used as reader schema.

Object Safety§

This trait is not object safe.

Implementors§