Class AbstractMultiVersionReader<T>
java.lang.Object
org.apache.pulsar.client.impl.schema.reader.AbstractMultiVersionReader<T>
- All Implemented Interfaces:
org.apache.pulsar.client.api.schema.SchemaReader<T>
- Direct Known Subclasses:
AbstractMultiVersionAvroBaseReader,MultiVersionGenericProtobufNativeReader
public abstract class AbstractMultiVersionReader<T>
extends Object
implements org.apache.pulsar.client.api.schema.SchemaReader<T>
The multi version reader abstract class, implement it will handle the multi version schema.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerprotected final org.apache.pulsar.client.api.schema.SchemaReader<T>protected org.apache.pulsar.client.api.schema.SchemaInfoProvider -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMultiVersionReader(org.apache.pulsar.client.api.schema.SchemaReader<T> providerSchemaReader) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.pulsar.common.schema.SchemaInfogetSchemaInfoByVersion(byte[] schemaVersion) TODO: think about how to make this async.org.apache.pulsar.client.api.schema.SchemaReader<T>getSchemaReader(byte[] schemaVersion) protected abstract org.apache.pulsar.client.api.schema.SchemaReader<T>loadReader(org.apache.pulsar.common.protocol.schema.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) voidsetSchemaInfoProvider(org.apache.pulsar.client.api.schema.SchemaInfoProvider schemaInfoProvider) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.client.api.schema.SchemaReader
getNativeSchema, read
-
Field Details
-
providerSchemaReader
-
schemaInfoProvider
protected org.apache.pulsar.client.api.schema.SchemaInfoProvider schemaInfoProvider -
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
AbstractMultiVersionReader
public AbstractMultiVersionReader(org.apache.pulsar.client.api.schema.SchemaReader<T> providerSchemaReader)
-
-
Method Details
-
read
- Specified by:
readin interfaceorg.apache.pulsar.client.api.schema.SchemaReader<T>
-
read
- Specified by:
readin interfaceorg.apache.pulsar.client.api.schema.SchemaReader<T>
-
read
- Specified by:
readin interfaceorg.apache.pulsar.client.api.schema.SchemaReader<T>
-
getSchemaReader
public org.apache.pulsar.client.api.schema.SchemaReader<T> getSchemaReader(byte[] schemaVersion) throws ExecutionException - Throws:
ExecutionException
-
read
- Specified by:
readin interfaceorg.apache.pulsar.client.api.schema.SchemaReader<T>
-
setSchemaInfoProvider
public void setSchemaInfoProvider(org.apache.pulsar.client.api.schema.SchemaInfoProvider schemaInfoProvider) - Specified by:
setSchemaInfoProviderin interfaceorg.apache.pulsar.client.api.schema.SchemaReader<T>
-
loadReader
protected abstract org.apache.pulsar.client.api.schema.SchemaReader<T> loadReader(org.apache.pulsar.common.protocol.schema.BytesSchemaVersion schemaVersion) 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
protected org.apache.pulsar.common.schema.SchemaInfo getSchemaInfoByVersion(byte[] schemaVersion) TODO: think about how to make this async.
-