类 AutoConsumeSchema
java.lang.Object
org.apache.pulsar.client.impl.schema.AutoConsumeSchema
- 所有已实现的接口:
Cloneable,Schema<GenericRecord>
Auto detect schema, returns only GenericRecord instances.
-
字段概要
字段从接口继承的字段 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 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected GenericRecordSchema<?>atSchemaVersion(byte[] schemaVersion) clone()voidconfigureSchemaInfo(String topicName, String componentName, SchemaInfo schemaInfo) decode(byte[] bytes, byte[] schemaVersion) decode(ByteBuffer buffer, byte[] schemaVersion) byte[]encode(GenericRecord message) voidfetchSchemaIfNeeded(SchemaVersion schemaVersion) It may happen that the schema is not loaded but we need it, for instance in order to call getSchemaInfo() We cannot call this method in getSchemaInfo, because getSchemaInfo is called in many places and we will introduce lots of deadlocks.Schema<?>Schema<?>getInternalSchema(byte[] schemaVersion) static Schema<?>getSchema(SchemaInfo schemaInfo) getSchemaInfo(byte[] schemaVersion) booleanvoidvoidsetSchema(SchemaVersion schemaVersion, Schema<?> schema) voidsetSchemaInfoProvider(SchemaInfoProvider schemaInfoProvider) booleantoString()Schema<?>unwrapInternalSchema(byte[] schemaVersion) Get a specific schema version, fetching from the Registry if it is not loaded yet.voidvalidate(byte[] message) voidvalidate(byte[] message, byte[] schemaVersion) static GenericRecordwrapPrimitiveObject(Object value, SchemaType type, byte[] schemaVersion)
-
字段详细资料
-
SCHEMA_INFO
-
-
构造器详细资料
-
AutoConsumeSchema
public AutoConsumeSchema()
-
-
方法详细资料
-
setSchema
-
setSchema
-
validate
public void validate(byte[] message) - 指定者:
validate在接口中Schema<GenericRecord>
-
validate
public void validate(byte[] message, byte[] schemaVersion) -
encode
- 指定者:
encode在接口中Schema<GenericRecord>
-
supportSchemaVersioning
public boolean supportSchemaVersioning()- 指定者:
supportSchemaVersioning在接口中Schema<GenericRecord>
-
atSchemaVersion
-
decode
- 指定者:
decode在接口中Schema<GenericRecord>
-
decode
- 指定者:
decode在接口中Schema<GenericRecord>
-
setSchemaInfoProvider
- 指定者:
setSchemaInfoProvider在接口中Schema<GenericRecord>
-
getSchemaInfo
- 指定者:
getSchemaInfo在接口中Schema<GenericRecord>
-
getSchemaInfo
-
configureSchemaInfo
- 指定者:
configureSchemaInfo在接口中Schema<GenericRecord>
-
getNativeSchema
- 指定者:
getNativeSchema在接口中Schema<GenericRecord>
-
getSchema
-
clone
- 指定者:
clone在接口中Schema<GenericRecord>- 覆盖:
clone在类中Object
-
requireFetchingSchemaInfo
public boolean requireFetchingSchemaInfo()- 指定者:
requireFetchingSchemaInfo在接口中Schema<GenericRecord>
-
adapt
-
wrapPrimitiveObject
public static GenericRecord wrapPrimitiveObject(Object value, SchemaType type, byte[] schemaVersion) -
getInternalSchema
-
getInternalSchema
-
unwrapInternalSchema
Get a specific schema version, fetching from the Registry if it is not loaded yet. This method is not intended to be used by applications.- 参数:
schemaVersion- the version- 返回:
- the Schema at the specific version
- 另请参阅:
-
fetchSchemaIfNeeded
It may happen that the schema is not loaded but we need it, for instance in order to call getSchemaInfo() We cannot call this method in getSchemaInfo, because getSchemaInfo is called in many places and we will introduce lots of deadlocks. -
toString
-