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§
sourceasync fn get_by_id(
&self,
schema_version_id: Uuid,
) -> ConnectorResult<Arc<Schema>>
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.
sourceasync fn get_by_name(&self, schema_arn: &str) -> ConnectorResult<Arc<Schema>>
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.