Class AbstractMultiVersionReader<T>
java.lang.Object
org.apache.pulsar.client.impl.schema.reader.AbstractMultiVersionReader<T>
- All Implemented Interfaces:
SchemaReader<T>
- Direct Known Subclasses:
AbstractMultiVersionAvroBaseReader
,MultiVersionGenericProtobufNativeReader
The multi version reader abstract class, implement it will handle the multi version schema.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Logger
protected final SchemaReader<T>
protected SchemaInfoProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SchemaInfo
getSchemaInfoByVersion
(byte[] schemaVersion) TODO: think about how to make this async.getSchemaReader
(byte[] schemaVersion) protected abstract SchemaReader<T>
loadReader
(BytesSchemaVersion schemaVersion) Load the schema reader for reading messages encoded by the given schema version.read
(byte[] bytes, byte[] schemaVersion) read
(byte[] bytes, int offset, int length) read
(InputStream inputStream) read
(InputStream inputStream, byte[] schemaVersion) void
setSchemaInfoProvider
(SchemaInfoProvider schemaInfoProvider) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.pulsar.client.api.schema.SchemaReader
getNativeSchema, read
-
Field Details
-
providerSchemaReader
-
schemaInfoProvider
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
AbstractMultiVersionReader
-
-
Method Details
-
read
- Specified by:
read
in interfaceSchemaReader<T>
-
read
- Specified by:
read
in interfaceSchemaReader<T>
-
read
- Specified by:
read
in interfaceSchemaReader<T>
-
getSchemaReader
- Throws:
ExecutionException
-
read
- Specified by:
read
in interfaceSchemaReader<T>
-
setSchemaInfoProvider
- Specified by:
setSchemaInfoProvider
in interfaceSchemaReader<T>
-
loadReader
Load the schema reader for reading messages encoded by the given schema version.- Parameters:
schemaVersion
- the provided schema version- Returns:
- the schema reader for decoding messages encoded by the provided schema version.
-
getSchemaInfoByVersion
TODO: think about how to make this async.
-