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:
newSchemaDefinitionBuilderin interfacePulsarClientImplementationBinding
-
newClientBuilder
- Specified by:
newClientBuilderin interfacePulsarClientImplementationBinding
-
newMessageId
- Specified by:
newMessageIdin interfacePulsarClientImplementationBinding
-
newMessageIdFromByteArray
- Specified by:
newMessageIdFromByteArrayin interfacePulsarClientImplementationBinding- Throws:
IOException
-
newMessageIdFromByteArrayWithTopic
public MessageId newMessageIdFromByteArrayWithTopic(byte[] data, String topicName) throws IOException - Specified by:
newMessageIdFromByteArrayWithTopicin interfacePulsarClientImplementationBinding- Throws:
IOException
-
newAuthenticationToken
- Specified by:
newAuthenticationTokenin interfacePulsarClientImplementationBinding
-
newAuthenticationToken
- Specified by:
newAuthenticationTokenin interfacePulsarClientImplementationBinding
-
newAuthenticationTLS
- Specified by:
newAuthenticationTLSin interfacePulsarClientImplementationBinding
-
createAuthentication
public Authentication createAuthentication(String authPluginClassName, String authParamsString) throws PulsarClientException.UnsupportedAuthenticationException - Specified by:
createAuthenticationin interfacePulsarClientImplementationBinding- Throws:
PulsarClientException.UnsupportedAuthenticationException
-
createAuthentication
public Authentication createAuthentication(String authPluginClassName, Map<String, String> authParams) throws PulsarClientException.UnsupportedAuthenticationException- Specified by:
createAuthenticationin interfacePulsarClientImplementationBinding- Throws:
PulsarClientException.UnsupportedAuthenticationException
-
newBytesSchema
- Specified by:
newBytesSchemain interfacePulsarClientImplementationBinding
-
newStringSchema
- Specified by:
newStringSchemain interfacePulsarClientImplementationBinding
-
newStringSchema
- Specified by:
newStringSchemain interfacePulsarClientImplementationBinding
-
newByteSchema
- Specified by:
newByteSchemain interfacePulsarClientImplementationBinding
-
newShortSchema
- Specified by:
newShortSchemain interfacePulsarClientImplementationBinding
-
newIntSchema
- Specified by:
newIntSchemain interfacePulsarClientImplementationBinding
-
newLongSchema
- Specified by:
newLongSchemain interfacePulsarClientImplementationBinding
-
newBooleanSchema
- Specified by:
newBooleanSchemain interfacePulsarClientImplementationBinding
-
newByteBufferSchema
- Specified by:
newByteBufferSchemain interfacePulsarClientImplementationBinding
-
newFloatSchema
- Specified by:
newFloatSchemain interfacePulsarClientImplementationBinding
-
newDoubleSchema
- Specified by:
newDoubleSchemain interfacePulsarClientImplementationBinding
-
newDateSchema
- Specified by:
newDateSchemain interfacePulsarClientImplementationBinding
-
newTimeSchema
- Specified by:
newTimeSchemain interfacePulsarClientImplementationBinding
-
newTimestampSchema
- Specified by:
newTimestampSchemain interfacePulsarClientImplementationBinding
-
newInstantSchema
- Specified by:
newInstantSchemain interfacePulsarClientImplementationBinding
-
newLocalDateSchema
- Specified by:
newLocalDateSchemain interfacePulsarClientImplementationBinding
-
newLocalTimeSchema
- Specified by:
newLocalTimeSchemain interfacePulsarClientImplementationBinding
-
newLocalDateTimeSchema
- Specified by:
newLocalDateTimeSchemain interfacePulsarClientImplementationBinding
-
newAvroSchema
- Specified by:
newAvroSchemain interfacePulsarClientImplementationBinding
-
newProtobufSchema
public <T extends com.google.protobuf.GeneratedMessageV3> Schema<T> newProtobufSchema(SchemaDefinition schemaDefinition) - Specified by:
newProtobufSchemain interfacePulsarClientImplementationBinding
-
newProtobufNativeSchema
public <T extends com.google.protobuf.GeneratedMessageV3> Schema<T> newProtobufNativeSchema(SchemaDefinition schemaDefinition) - Specified by:
newProtobufNativeSchemain interfacePulsarClientImplementationBinding
-
newJSONSchema
- Specified by:
newJSONSchemain interfacePulsarClientImplementationBinding
-
newAutoConsumeSchema
- Specified by:
newAutoConsumeSchemain interfacePulsarClientImplementationBinding
-
newAutoProduceSchema
- Specified by:
newAutoProduceSchemain interfacePulsarClientImplementationBinding
-
newAutoProduceSchema
- Specified by:
newAutoProduceSchemain interfacePulsarClientImplementationBinding
-
newAutoProduceValidatedAvroSchema
- Specified by:
newAutoProduceValidatedAvroSchemain interfacePulsarClientImplementationBinding
-
newKeyValueBytesSchema
- Specified by:
newKeyValueBytesSchemain interfacePulsarClientImplementationBinding
-
newKeyValueSchema
public <K,V> Schema<KeyValue<K,V>> newKeyValueSchema(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) - Specified by:
newKeyValueSchemain interfacePulsarClientImplementationBinding
-
newKeyValueSchema
public <K,V> Schema<KeyValue<K,V>> newKeyValueSchema(Class<K> key, Class<V> value, SchemaType type) - Specified by:
newKeyValueSchemain interfacePulsarClientImplementationBinding
-
getSchema
- Specified by:
getSchemain interfacePulsarClientImplementationBinding
-
getGenericSchema
- Specified by:
getGenericSchemain interfacePulsarClientImplementationBinding
-
newRecordSchemaBuilder
- Specified by:
newRecordSchemaBuilderin interfacePulsarClientImplementationBinding
-
decodeKeyValueEncodingType
Decode the kv encoding type from the schema info.- Specified by:
decodeKeyValueEncodingTypein 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:
encodeKeyValueSchemaInfoin 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:
encodeKeyValueSchemaInfoin 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:
decodeKeyValueSchemaInfoin 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:
jsonifySchemaInfoin interfacePulsarClientImplementationBinding- Parameters:
schemaInfo- the schema info- Returns:
- the jsonified schema info
-
jsonifySchemaInfoWithVersion
Jsonify the schema info with version.- Specified by:
jsonifySchemaInfoWithVersionin interfacePulsarClientImplementationBinding- Parameters:
schemaInfoWithVersion- the schema info with version- Returns:
- the jsonified schema info with version
-
jsonifyKeyValueSchemaInfo
Jsonify the key/value schema info.- Specified by:
jsonifyKeyValueSchemaInfoin 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:
convertKeyValueSchemaInfoDataToStringin 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:
convertKeyValueDataStringToSchemaInfoSchemain interfacePulsarClientImplementationBinding- Parameters:
keyValueSchemaInfoDataJsonBytes- the key/value schema info data json bytes- Returns:
- the key/value schema info data bytes
- Throws:
IOException
-
newDefaultBatcherBuilder
- Specified by:
newDefaultBatcherBuilderin interfacePulsarClientImplementationBinding
-
newKeyBasedBatcherBuilder
- Specified by:
newKeyBasedBatcherBuilderin interfacePulsarClientImplementationBinding
-
newDefaultMessagePayloadFactory
- Specified by:
newDefaultMessagePayloadFactoryin interfacePulsarClientImplementationBinding
-
newSchemaInfoImpl
public SchemaInfo newSchemaInfoImpl(String name, byte[] schema, SchemaType type, long timestamp, Map<String, String> propertiesValue) - Specified by:
newSchemaInfoImplin interfacePulsarClientImplementationBinding
-
newTopicMessageId
- Specified by:
newTopicMessageIdin interfacePulsarClientImplementationBinding
-