Class KeyValueSchemaInfo


  • public final class KeyValueSchemaInfo
    extends java.lang.Object
    Util class for processing key/value schema info.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.pulsar.common.schema.KeyValueEncodingType decodeKeyValueEncodingType​(org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
      Decode the kv encoding type from the schema info.
      static org.apache.pulsar.common.schema.KeyValue<org.apache.pulsar.common.schema.SchemaInfo,​org.apache.pulsar.common.schema.SchemaInfo> decodeKeyValueSchemaInfo​(org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
      Decode the key/value schema info to get key schema info and value schema info.
      static <K,​V>
      org.apache.pulsar.common.schema.SchemaInfo
      encodeKeyValueSchemaInfo​(java.lang.String schemaName, org.apache.pulsar.client.api.Schema<K> keySchema, org.apache.pulsar.client.api.Schema<V> valueSchema, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType)
      Encode key & value into schema into a KeyValue schema.
      static org.apache.pulsar.common.schema.SchemaInfo encodeKeyValueSchemaInfo​(java.lang.String schemaName, org.apache.pulsar.common.schema.SchemaInfo keySchemaInfo, org.apache.pulsar.common.schema.SchemaInfo valueSchemaInfo, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType)
      Encode key & value into schema into a KeyValue schema.
      static <K,​V>
      org.apache.pulsar.common.schema.SchemaInfo
      encodeKeyValueSchemaInfo​(org.apache.pulsar.client.api.Schema<K> keySchema, org.apache.pulsar.client.api.Schema<V> valueSchema, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType)
      Encode key & value into schema into a KeyValue schema.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • decodeKeyValueEncodingType

        public static org.apache.pulsar.common.schema.KeyValueEncodingType decodeKeyValueEncodingType​(org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
        Decode the kv encoding type from the schema info.
        Parameters:
        schemaInfo - the schema info
        Returns:
        the kv encoding type
      • encodeKeyValueSchemaInfo

        public static <K,​V> org.apache.pulsar.common.schema.SchemaInfo encodeKeyValueSchemaInfo​(org.apache.pulsar.client.api.Schema<K> keySchema,
                                                                                                      org.apache.pulsar.client.api.Schema<V> valueSchema,
                                                                                                      org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType)
        Encode key & value into schema into a KeyValue schema.
        Parameters:
        keySchema - the key schema
        valueSchema - the value schema
        keyValueEncodingType - the encoding type to encode and decode key value pair
        Returns:
        the final schema info
      • encodeKeyValueSchemaInfo

        public static <K,​V> org.apache.pulsar.common.schema.SchemaInfo encodeKeyValueSchemaInfo​(java.lang.String schemaName,
                                                                                                      org.apache.pulsar.client.api.Schema<K> keySchema,
                                                                                                      org.apache.pulsar.client.api.Schema<V> valueSchema,
                                                                                                      org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType)
        Encode key & value into schema into a KeyValue schema.
        Parameters:
        schemaName - the final schema name
        keySchema - the key schema
        valueSchema - the value schema
        keyValueEncodingType - the encoding type to encode and decode key value pair
        Returns:
        the final schema info
      • encodeKeyValueSchemaInfo

        public static org.apache.pulsar.common.schema.SchemaInfo encodeKeyValueSchemaInfo​(java.lang.String schemaName,
                                                                                          org.apache.pulsar.common.schema.SchemaInfo keySchemaInfo,
                                                                                          org.apache.pulsar.common.schema.SchemaInfo valueSchemaInfo,
                                                                                          org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType)
        Encode key & value into schema into a KeyValue schema.
        Parameters:
        schemaName - the final schema name
        keySchemaInfo - the key schema info
        valueSchemaInfo - the value schema info
        keyValueEncodingType - the encoding type to encode and decode key value pair
        Returns:
        the final schema info
      • decodeKeyValueSchemaInfo

        public static org.apache.pulsar.common.schema.KeyValue<org.apache.pulsar.common.schema.SchemaInfo,​org.apache.pulsar.common.schema.SchemaInfo> decodeKeyValueSchemaInfo​(org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
        Decode the key/value schema info to get key schema info and value schema info.
        Parameters:
        schemaInfo - key/value schema info.
        Returns:
        the pair of key schema info and value schema info