类 SchemaUtils
java.lang.Object
org.apache.pulsar.client.impl.schema.SchemaUtils
Utils for schemas.
-
方法概要
修饰符和类型方法说明static byte[]convertKeyValueDataStringToSchemaInfoSchema(byte[] keyValueSchemaInfoDataJsonBytes) Convert the key/value schema info data json bytes to key/value schema info data bytes.static StringconvertKeyValueSchemaInfoDataToString(KeyValue<SchemaInfo, SchemaInfo> kvSchemaInfo) Convert the key/value schema info data to string.deserializeSchemaProperties(String serializedProperties) Deserialize schema properties from a serialized schema properties.static StringgetStringSchemaVersion(byte[] schemaVersionBytes) static StringjsonifyKeyValueSchemaInfo(KeyValue<SchemaInfo, SchemaInfo> kvSchemaInfo) Jsonify the key/value schema info.static StringjsonifySchemaInfo(SchemaInfo schemaInfo) Jsonify the schema info.static StringjsonifySchemaInfoWithVersion(SchemaInfoWithVersion schemaInfoWithVersion) Jsonify the schema info with version.static StringserializeSchemaProperties(Map<String, String> properties) Serialize schema properties.static ObjecttoAvroObject(Object value) static com.google.gson.JsonElementtoJsonElement(String str) static voidvalidateFieldSchema(String name, SchemaType type, Object val)
-
方法详细资料
-
validateFieldSchema
-
toAvroObject
-
getStringSchemaVersion
-
jsonifySchemaInfo
Jsonify the schema info.- 参数:
schemaInfo- the schema info- 返回:
- the jsonified schema info
-
jsonifySchemaInfoWithVersion
Jsonify the schema info with version.- 参数:
schemaInfoWithVersion- the schema info- 返回:
- the jsonified schema info with version
-
toJsonElement
-
jsonifyKeyValueSchemaInfo
Jsonify the key/value schema info.- 参数:
kvSchemaInfo- the key/value schema info- 返回:
- the jsonified schema info
-
convertKeyValueSchemaInfoDataToString
public static String convertKeyValueSchemaInfoDataToString(KeyValue<SchemaInfo, SchemaInfo> kvSchemaInfo) throws IOExceptionConvert the key/value schema info data to string.- 参数:
kvSchemaInfo- the key/value schema info- 返回:
- the convert schema info data string
- 抛出:
IOException
-
convertKeyValueDataStringToSchemaInfoSchema
public static byte[] convertKeyValueDataStringToSchemaInfoSchema(byte[] keyValueSchemaInfoDataJsonBytes) Convert the key/value schema info data json bytes to key/value schema info data bytes.- 参数:
keyValueSchemaInfoDataJsonBytes- the key/value schema info data json bytes- 返回:
- the key/value schema info data bytes
-
serializeSchemaProperties
Serialize schema properties.- 参数:
properties- schema properties- 返回:
- the serialized schema properties
-
deserializeSchemaProperties
Deserialize schema properties from a serialized schema properties.- 参数:
serializedProperties- serialized properties- 返回:
- the deserialized properties
-