Class NativeAvroBytesSchema<T>
java.lang.Object
org.apache.pulsar.client.impl.schema.NativeAvroBytesSchema<T>
Schema from a native Apache Avro schema.
This class is supposed to be used on the producer side for working with existing data serialized in Avro,
possibly stored in another system like Kafka.
For this reason, it will not perform bytes validation against the schema in encoding and decoding,
which are just identify functions.
This class also makes it possible for users to bring in their own Avro serialization method.
-
Field Summary
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
ConstructorsConstructorDescriptionNativeAvroBytesSchema(Object schema) NativeAvroBytesSchema(org.apache.avro.Schema schema) -
Method Summary
Methods 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, decode, decode, decode, requireFetchingSchemaInfo, setSchemaInfoProvider, supportSchemaVersioning, validate
-
Constructor Details
-
NativeAvroBytesSchema
public NativeAvroBytesSchema(org.apache.avro.Schema schema) -
NativeAvroBytesSchema
-
-
Method Details
-
encode
public byte[] encode(byte[] message) -
decode
public byte[] decode(byte[] bytes, byte[] schemaVersion) -
getSchemaInfo
- Specified by:
getSchemaInfoin interfaceSchema<T>
-
getNativeSchema
- Specified by:
getNativeSchemain interfaceSchema<T>
-
clone
-