in flink-connector-pulsar/src/main/java/org/apache/flink/connector/pulsar/common/schema/PulsarSchemaUtils.java [91:131]
static {
// Initialize protobuf message class.
Class<Message> messageClass;
try {
messageClass = (Class<Message>) Class.forName("com.google.protobuf.Message");
} catch (ClassNotFoundException e) {
messageClass = null;
}
PROTOBUF_MESSAGE_CLASS = messageClass;
// Struct schemas
registerSchemaFactory(new AvroSchemaFactory<>());
registerSchemaFactory(new JSONSchemaFactory<>());
registerSchemaFactory(new KeyValueSchemaFactory<>());
if (haveProtobuf()) {
// Protobuf type should be supported only when we have protobuf-java.
registerSchemaFactory(new ProtobufNativeSchemaFactory<>());
registerSchemaFactory(new ProtobufSchemaFactory<>());
}
// Primitive schemas
registerSchemaFactory(new StringSchemaFactory());
registerSchemaFactory(
new PrimitiveSchemaFactory<>(
SchemaType.NONE, BytesSchema.of(), BYTE_PRIMITIVE_ARRAY_TYPE_INFO));
registerPrimitiveFactory(BooleanSchema.of(), BOOLEAN);
registerPrimitiveFactory(ByteSchema.of(), BYTE);
registerPrimitiveFactory(BytesSchema.of(), BYTE_PRIMITIVE_ARRAY_TYPE_INFO);
registerPrimitiveFactory(DateSchema.of(), DATE_TYPE_INFO);
registerPrimitiveFactory(DoubleSchema.of(), DOUBLE);
registerPrimitiveFactory(FloatSchema.of(), FLOAT);
registerPrimitiveFactory(InstantSchema.of(), INSTANT);
registerPrimitiveFactory(IntSchema.of(), INT);
registerPrimitiveFactory(LocalDateSchema.of(), LOCAL_DATE);
registerPrimitiveFactory(LocalDateTimeSchema.of(), LOCAL_DATE_TIME);
registerPrimitiveFactory(LocalTimeSchema.of(), LOCAL_TIME);
registerPrimitiveFactory(LongSchema.of(), LONG);
registerPrimitiveFactory(ShortSchema.of(), SHORT);
registerPrimitiveFactory(TimeSchema.of(), SQL_TIME);
registerPrimitiveFactory(TimestampSchema.of(), SQL_TIMESTAMP);
}