Package org.apache.pulsar.client.impl
Class PulsarClientImplementationBindingImpl
java.lang.Object
org.apache.pulsar.client.impl.PulsarClientImplementationBindingImpl
- All Implemented Interfaces:
PulsarClientImplementationBinding
public final class PulsarClientImplementationBindingImpl
extends Object
implements PulsarClientImplementationBinding
Helper class for class instantiations and it also contains methods to work with schemas.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
convertKeyValueDataStringToSchemaInfoSchema
(byte[] keyValueSchemaInfoDataJsonBytes) Convert the key/value schema info data json bytes to key/value schema info data bytes.convertKeyValueSchemaInfoDataToString
(KeyValue<SchemaInfo, SchemaInfo> kvSchemaInfo) Convert the key/value schema data.createAuthentication
(String authPluginClassName, String authParamsString) createAuthentication
(String authPluginClassName, Map<String, String> authParams) decodeKeyValueEncodingType
(SchemaInfo schemaInfo) Decode the kv encoding type from the schema info.decodeKeyValueSchemaInfo
(SchemaInfo schemaInfo) Decode the key/value schema info to get key schema info and value schema info.<K,
V> SchemaInfo encodeKeyValueSchemaInfo
(String schemaName, Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) Encode key & value into schema into a KeyValue schema.<K,
V> SchemaInfo encodeKeyValueSchemaInfo
(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) Encode key & value into schema into a KeyValue schema.getGenericSchema
(SchemaInfo schemaInfo) Schema<?>
getSchema
(SchemaInfo schemaInfo) jsonifyKeyValueSchemaInfo
(KeyValue<SchemaInfo, SchemaInfo> kvSchemaInfo) Jsonify the key/value schema info.jsonifySchemaInfo
(SchemaInfo schemaInfo) Jsonify the schema info.jsonifySchemaInfoWithVersion
(SchemaInfoWithVersion schemaInfoWithVersion) Jsonify the schema info with version.newAuthenticationTLS
(String certFilePath, String keyFilePath) newAuthenticationToken
(String token) newAuthenticationToken
(Supplier<String> supplier) Schema<byte[]>
Schema<byte[]>
newAutoProduceSchema
(Schema<?> schema) Schema<byte[]>
<T> Schema<T>
newAvroSchema
(SchemaDefinition schemaDefinition) Schema<byte[]>
<T> Schema<T>
newJSONSchema
(SchemaDefinition schemaDefinition) newKeyValueSchema
(Class<K> key, Class<V> value, SchemaType type) newKeyValueSchema
(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) newMessageId
(long ledgerId, long entryId, int partitionIndex) newMessageIdFromByteArray
(byte[] data) newMessageIdFromByteArrayWithTopic
(byte[] data, String topicName) <T extends com.google.protobuf.GeneratedMessageV3>
Schema<T>newProtobufNativeSchema
(SchemaDefinition schemaDefinition) <T extends com.google.protobuf.GeneratedMessageV3>
Schema<T>newProtobufSchema
(SchemaDefinition schemaDefinition) newRecordSchemaBuilder
(String name) <T> SchemaDefinitionBuilder<T>
newSchemaInfoImpl
(String name, byte[] schema, SchemaType type, long timestamp, Map<String, String> propertiesValue) newStringSchema
(Charset charset) newTopicMessageId
(String topic, MessageId messageId)
-
Constructor Details
-
PulsarClientImplementationBindingImpl
public PulsarClientImplementationBindingImpl()
-
-
Method Details
-
newSchemaDefinitionBuilder
- Specified by:
newSchemaDefinitionBuilder
in interfacePulsarClientImplementationBinding
-
newClientBuilder
- Specified by:
newClientBuilder
in interfacePulsarClientImplementationBinding
-
newMessageId
- Specified by:
newMessageId
in interfacePulsarClientImplementationBinding
-
newMessageIdFromByteArray
- Specified by:
newMessageIdFromByteArray
in interfacePulsarClientImplementationBinding
- Throws:
IOException
-
newMessageIdFromByteArrayWithTopic
public MessageId newMessageIdFromByteArrayWithTopic(byte[] data, String topicName) throws IOException - Specified by:
newMessageIdFromByteArrayWithTopic
in interfacePulsarClientImplementationBinding
- Throws:
IOException
-
newAuthenticationToken
- Specified by:
newAuthenticationToken
in interfacePulsarClientImplementationBinding
-
newAuthenticationToken
- Specified by:
newAuthenticationToken
in interfacePulsarClientImplementationBinding
-
newAuthenticationTLS
- Specified by:
newAuthenticationTLS
in interfacePulsarClientImplementationBinding
-
createAuthentication
public Authentication createAuthentication(String authPluginClassName, String authParamsString) throws PulsarClientException.UnsupportedAuthenticationException - Specified by:
createAuthentication
in interfacePulsarClientImplementationBinding
- Throws:
PulsarClientException.UnsupportedAuthenticationException
-
createAuthentication
public Authentication createAuthentication(String authPluginClassName, Map<String, String> authParams) throws PulsarClientException.UnsupportedAuthenticationException- Specified by:
createAuthentication
in interfacePulsarClientImplementationBinding
- Throws:
PulsarClientException.UnsupportedAuthenticationException
-
newBytesSchema
- Specified by:
newBytesSchema
in interfacePulsarClientImplementationBinding
-
newStringSchema
- Specified by:
newStringSchema
in interfacePulsarClientImplementationBinding
-
newStringSchema
- Specified by:
newStringSchema
in interfacePulsarClientImplementationBinding
-
newByteSchema
- Specified by:
newByteSchema
in interfacePulsarClientImplementationBinding
-
newShortSchema
- Specified by:
newShortSchema
in interfacePulsarClientImplementationBinding
-
newIntSchema
- Specified by:
newIntSchema
in interfacePulsarClientImplementationBinding
-
newLongSchema
- Specified by:
newLongSchema
in interfacePulsarClientImplementationBinding
-
newBooleanSchema
- Specified by:
newBooleanSchema
in interfacePulsarClientImplementationBinding
-
newByteBufferSchema
- Specified by:
newByteBufferSchema
in interfacePulsarClientImplementationBinding
-
newFloatSchema
- Specified by:
newFloatSchema
in interfacePulsarClientImplementationBinding
-
newDoubleSchema
- Specified by:
newDoubleSchema
in interfacePulsarClientImplementationBinding
-
newDateSchema
- Specified by:
newDateSchema
in interfacePulsarClientImplementationBinding
-
newTimeSchema
- Specified by:
newTimeSchema
in interfacePulsarClientImplementationBinding
-
newTimestampSchema
- Specified by:
newTimestampSchema
in interfacePulsarClientImplementationBinding
-
newInstantSchema
- Specified by:
newInstantSchema
in interfacePulsarClientImplementationBinding
-
newLocalDateSchema
- Specified by:
newLocalDateSchema
in interfacePulsarClientImplementationBinding
-
newLocalTimeSchema
- Specified by:
newLocalTimeSchema
in interfacePulsarClientImplementationBinding
-
newLocalDateTimeSchema
- Specified by:
newLocalDateTimeSchema
in interfacePulsarClientImplementationBinding
-
newAvroSchema
- Specified by:
newAvroSchema
in interfacePulsarClientImplementationBinding
-
newProtobufSchema
public <T extends com.google.protobuf.GeneratedMessageV3> Schema<T> newProtobufSchema(SchemaDefinition schemaDefinition) - Specified by:
newProtobufSchema
in interfacePulsarClientImplementationBinding
-
newProtobufNativeSchema
public <T extends com.google.protobuf.GeneratedMessageV3> Schema<T> newProtobufNativeSchema(SchemaDefinition schemaDefinition) - Specified by:
newProtobufNativeSchema
in interfacePulsarClientImplementationBinding
-
newJSONSchema
- Specified by:
newJSONSchema
in interfacePulsarClientImplementationBinding
-
newAutoConsumeSchema
- Specified by:
newAutoConsumeSchema
in interfacePulsarClientImplementationBinding
-
newAutoProduceSchema
- Specified by:
newAutoProduceSchema
in interfacePulsarClientImplementationBinding
-
newAutoProduceSchema
- Specified by:
newAutoProduceSchema
in interfacePulsarClientImplementationBinding
-
newAutoProduceValidatedAvroSchema
- Specified by:
newAutoProduceValidatedAvroSchema
in interfacePulsarClientImplementationBinding
-
newKeyValueBytesSchema
- Specified by:
newKeyValueBytesSchema
in interfacePulsarClientImplementationBinding
-
newKeyValueSchema
public <K,V> Schema<KeyValue<K,V>> newKeyValueSchema(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) - Specified by:
newKeyValueSchema
in interfacePulsarClientImplementationBinding
-
newKeyValueSchema
public <K,V> Schema<KeyValue<K,V>> newKeyValueSchema(Class<K> key, Class<V> value, SchemaType type) - Specified by:
newKeyValueSchema
in interfacePulsarClientImplementationBinding
-
getSchema
- Specified by:
getSchema
in interfacePulsarClientImplementationBinding
-
getGenericSchema
- Specified by:
getGenericSchema
in interfacePulsarClientImplementationBinding
-
newRecordSchemaBuilder
- Specified by:
newRecordSchemaBuilder
in interfacePulsarClientImplementationBinding
-
decodeKeyValueEncodingType
Decode the kv encoding type from the schema info.- Specified by:
decodeKeyValueEncodingType
in interfacePulsarClientImplementationBinding
- Parameters:
schemaInfo
- the schema info- Returns:
- the kv encoding type
-
encodeKeyValueSchemaInfo
public <K,V> SchemaInfo encodeKeyValueSchemaInfo(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) Encode key & value into schema into a KeyValue schema.- Specified by:
encodeKeyValueSchemaInfo
in interfacePulsarClientImplementationBinding
- Parameters:
keySchema
- the key schemavalueSchema
- the value schemakeyValueEncodingType
- the encoding type to encode and decode key value pair- Returns:
- the final schema info
-
encodeKeyValueSchemaInfo
public <K,V> SchemaInfo encodeKeyValueSchemaInfo(String schemaName, Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) Encode key & value into schema into a KeyValue schema.- Specified by:
encodeKeyValueSchemaInfo
in interfacePulsarClientImplementationBinding
- Parameters:
schemaName
- the final schema namekeySchema
- the key schemavalueSchema
- the value schemakeyValueEncodingType
- the encoding type to encode and decode key value pair- Returns:
- the final schema info
-
decodeKeyValueSchemaInfo
Decode the key/value schema info to get key schema info and value schema info.- Specified by:
decodeKeyValueSchemaInfo
in interfacePulsarClientImplementationBinding
- Parameters:
schemaInfo
- key/value schema info.- Returns:
- the pair of key schema info and value schema info
-
jsonifySchemaInfo
Jsonify the schema info.- Specified by:
jsonifySchemaInfo
in interfacePulsarClientImplementationBinding
- Parameters:
schemaInfo
- the schema info- Returns:
- the jsonified schema info
-
jsonifySchemaInfoWithVersion
Jsonify the schema info with version.- Specified by:
jsonifySchemaInfoWithVersion
in interfacePulsarClientImplementationBinding
- Parameters:
schemaInfoWithVersion
- the schema info with version- Returns:
- the jsonified schema info with version
-
jsonifyKeyValueSchemaInfo
Jsonify the key/value schema info.- Specified by:
jsonifyKeyValueSchemaInfo
in interfacePulsarClientImplementationBinding
- Parameters:
kvSchemaInfo
- the key/value schema info- Returns:
- the jsonified schema info
-
convertKeyValueSchemaInfoDataToString
public String convertKeyValueSchemaInfoDataToString(KeyValue<SchemaInfo, SchemaInfo> kvSchemaInfo) throws IOExceptionConvert the key/value schema data.- Specified by:
convertKeyValueSchemaInfoDataToString
in interfacePulsarClientImplementationBinding
- Parameters:
kvSchemaInfo
- the key/value schema info- Returns:
- the convert key/value schema data string
- Throws:
IOException
-
convertKeyValueDataStringToSchemaInfoSchema
public byte[] convertKeyValueDataStringToSchemaInfoSchema(byte[] keyValueSchemaInfoDataJsonBytes) throws IOException Convert the key/value schema info data json bytes to key/value schema info data bytes.- Specified by:
convertKeyValueDataStringToSchemaInfoSchema
in interfacePulsarClientImplementationBinding
- Parameters:
keyValueSchemaInfoDataJsonBytes
- the key/value schema info data json bytes- Returns:
- the key/value schema info data bytes
- Throws:
IOException
-
newDefaultBatcherBuilder
- Specified by:
newDefaultBatcherBuilder
in interfacePulsarClientImplementationBinding
-
newKeyBasedBatcherBuilder
- Specified by:
newKeyBasedBatcherBuilder
in interfacePulsarClientImplementationBinding
-
newDefaultMessagePayloadFactory
- Specified by:
newDefaultMessagePayloadFactory
in interfacePulsarClientImplementationBinding
-
newSchemaInfoImpl
public SchemaInfo newSchemaInfoImpl(String name, byte[] schema, SchemaType type, long timestamp, Map<String, String> propertiesValue) - Specified by:
newSchemaInfoImpl
in interfacePulsarClientImplementationBinding
-
newTopicMessageId
- Specified by:
newTopicMessageId
in interfacePulsarClientImplementationBinding
-