Class AbstractStructSchema<T>
java.lang.Object
org.apache.pulsar.client.impl.schema.AbstractSchema<T>
org.apache.pulsar.client.impl.schema.AbstractStructSchema<T>
- All Implemented Interfaces:
Cloneable,org.apache.pulsar.client.api.Schema<T>
- Direct Known Subclasses:
AvroBaseStructSchema,GenericProtobufNativeSchema,ProtobufNativeSchema,StructSchema
minimal abstract StructSchema.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerprotected org.apache.pulsar.client.api.schema.SchemaReader<T>protected final org.apache.pulsar.common.schema.SchemaInfoprotected org.apache.pulsar.client.api.schema.SchemaInfoProviderprotected org.apache.pulsar.client.api.schema.SchemaWriter<T>Fields inherited from interface org.apache.pulsar.client.api.Schema
BOOL, BYTEBUFFER, BYTES, DATE, DOUBLE, FLOAT, INSTANT, INT16, INT32, INT64, INT8, LOCAL_DATE, LOCAL_DATE_TIME, LOCAL_TIME, STRING, TIME, TIMESTAMP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.pulsar.client.api.Schema<T>atSchemaVersion(byte[] schemaVersion) Return an instance of this schema at the given version.decode(byte[] bytes) decode(byte[] bytes, byte[] schemaVersion) decode(io.netty.buffer.ByteBuf byteBuf) Decode a byteBuf into an object using the schema definition and deserializer implementationdecode(io.netty.buffer.ByteBuf byteBuf, byte[] schemaVersion) Decode a byteBuf into an object using a given version.decode(ByteBuffer buffer) decode(ByteBuffer buffer, byte[] schemaVersion) byte[]protected org.apache.pulsar.client.api.schema.SchemaReader<T>org.apache.pulsar.common.schema.SchemaInfoprotected voidvoidsetSchemaInfoProvider(org.apache.pulsar.client.api.schema.SchemaInfoProvider schemaInfoProvider) protected voidMethods inherited from class org.apache.pulsar.client.impl.schema.AbstractSchema
cloneMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.client.api.Schema
configureSchemaInfo, getNativeSchema, requireFetchingSchemaInfo, supportSchemaVersioning, validate
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
schemaInfo
protected final org.apache.pulsar.common.schema.SchemaInfo schemaInfo -
reader
-
writer
-
schemaInfoProvider
protected org.apache.pulsar.client.api.schema.SchemaInfoProvider schemaInfoProvider
-
-
Constructor Details
-
AbstractStructSchema
public AbstractStructSchema(org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
-
-
Method Details
-
encode
-
decode
-
decode
-
decode
-
decode
-
decode
Description copied from class:AbstractSchemaDecode a byteBuf into an object using the schema definition and deserializer implementationDo not modify reader/writer index of ByteBuf so, it can be reused to access correct data.
- Specified by:
decodein classAbstractSchema<T>- Parameters:
byteBuf- the byte buffer to decode- Returns:
- the deserialized object
-
decode
Description copied from class:AbstractSchemaDecode a byteBuf into an object using a given version.- Overrides:
decodein classAbstractSchema<T>- Parameters:
byteBuf- the byte array to decodeschemaVersion- the schema version to decode the object. null indicates using latest version.- Returns:
- the deserialized object
-
getSchemaInfo
public org.apache.pulsar.common.schema.SchemaInfo getSchemaInfo() -
setSchemaInfoProvider
public void setSchemaInfoProvider(org.apache.pulsar.client.api.schema.SchemaInfoProvider schemaInfoProvider) -
atSchemaVersion
public org.apache.pulsar.client.api.Schema<T> atSchemaVersion(byte[] schemaVersion) throws org.apache.pulsar.client.api.SchemaSerializationException Description copied from class:AbstractSchemaReturn an instance of this schema at the given version.- Overrides:
atSchemaVersionin classAbstractSchema<T>- Parameters:
schemaVersion- the version- Returns:
- the schema at that specific version
- Throws:
org.apache.pulsar.client.api.SchemaSerializationException- in case of unknown schema version
-
setWriter
-
setReader
-
getReader
-