类 DefaultImplementation
- java.lang.Object
-
- org.apache.pulsar.client.internal.DefaultImplementation
-
public class DefaultImplementation extends java.lang.Object
Helper class for class instantiations and it also contains methods to work with schemas.
-
-
构造器概要
构造器 构造器 说明 DefaultImplementation()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static byte[]
convertKeyValueDataStringToSchemaInfoSchema(byte[] keyValueSchemaInfoDataJsonBytes)
Convert the key/value schema info data json bytes to key/value schema info data bytes.static java.lang.String
convertKeyValueSchemaInfoDataToString(KeyValue<SchemaInfo,SchemaInfo> kvSchemaInfo)
Convert the key/value schema data.static Authentication
createAuthentication(java.lang.String authPluginClassName, java.lang.String authParamsString)
static Authentication
createAuthentication(java.lang.String authPluginClassName, java.util.Map<java.lang.String,java.lang.String> authParams)
static KeyValueEncodingType
decodeKeyValueEncodingType(SchemaInfo schemaInfo)
Decode the kv encoding type from the schema info.static KeyValue<SchemaInfo,SchemaInfo>
decodeKeyValueSchemaInfo(SchemaInfo schemaInfo)
Decode the key/value schema info to get key schema info and value schema info.static <K,V>
SchemaInfoencodeKeyValueSchemaInfo(java.lang.String schemaName, Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.static <K,V>
SchemaInfoencodeKeyValueSchemaInfo(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.static byte[]
getBytes(java.nio.ByteBuffer byteBuffer)
Retrieves ByteBuffer data into byte[].static GenericSchema<GenericRecord>
getGenericSchema(SchemaInfo schemaInfo)
static Schema<?>
getSchema(SchemaInfo schemaInfo)
static java.lang.String
jsonifyKeyValueSchemaInfo(KeyValue<SchemaInfo,SchemaInfo> kvSchemaInfo)
Jsonify the key/value schema info.static java.lang.String
jsonifySchemaInfo(SchemaInfo schemaInfo)
Jsonify the schema info.static java.lang.String
jsonifySchemaInfoWithVersion(SchemaInfoWithVersion schemaInfoWithVersion)
Jsonify the schema info with version.static Authentication
newAuthenticationTLS(java.lang.String certFilePath, java.lang.String keyFilePath)
static Authentication
newAuthenticationToken(java.lang.String token)
static Authentication
newAuthenticationToken(java.util.function.Supplier<java.lang.String> supplier)
static Schema<GenericRecord>
newAutoConsumeSchema()
static Schema<byte[]>
newAutoProduceSchema()
static Schema<byte[]>
newAutoProduceSchema(Schema<?> schema)
static <T> Schema<T>
newAvroSchema(SchemaDefinition schemaDefinition)
static Schema<java.lang.Boolean>
newBooleanSchema()
static Schema<java.nio.ByteBuffer>
newByteBufferSchema()
static Schema<java.lang.Byte>
newByteSchema()
static Schema<byte[]>
newBytesSchema()
static ClientBuilder
newClientBuilder()
static Schema<java.util.Date>
newDateSchema()
static BatcherBuilder
newDefaultBatcherBuilder()
static Schema<java.lang.Double>
newDoubleSchema()
static Schema<java.lang.Float>
newFloatSchema()
static Schema<java.time.Instant>
newInstantSchema()
static Schema<java.lang.Integer>
newIntSchema()
static <T> Schema<T>
newJSONSchema(SchemaDefinition schemaDefinition)
static BatcherBuilder
newKeyBasedBatcherBuilder()
static Schema<KeyValue<byte[],byte[]>>
newKeyValueBytesSchema()
static <K,V>
Schema<KeyValue<K,V>>newKeyValueSchema(java.lang.Class<K> key, java.lang.Class<V> value, SchemaType type)
static <K,V>
Schema<KeyValue<K,V>>newKeyValueSchema(Schema<K> keySchema, Schema<V> valueSchema)
static <K,V>
Schema<KeyValue<K,V>>newKeyValueSchema(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType)
static Schema<java.time.LocalDate>
newLocalDateSchema()
static Schema<java.time.LocalDateTime>
newLocalDateTimeSchema()
static Schema<java.time.LocalTime>
newLocalTimeSchema()
static Schema<java.lang.Long>
newLongSchema()
static MessageId
newMessageId(long ledgerId, long entryId, int partitionIndex)
static MessageId
newMessageIdFromByteArray(byte[] data)
static MessageId
newMessageIdFromByteArrayWithTopic(byte[] data, java.lang.String topicName)
static <T extends com.google.protobuf.GeneratedMessageV3>
Schema<T>newProtobufNativeSchema(SchemaDefinition schemaDefinition)
static <T extends com.google.protobuf.GeneratedMessageV3>
Schema<T>newProtobufSchema(SchemaDefinition schemaDefinition)
static RecordSchemaBuilder
newRecordSchemaBuilder(java.lang.String name)
static <T> SchemaDefinitionBuilder<T>
newSchemaDefinitionBuilder()
SchemaInfo
newSchemaInfoImpl(java.lang.String name, byte[] schema, SchemaType type, java.util.Map<java.lang.String,java.lang.String> propertiesValue)
static Schema<java.lang.Short>
newShortSchema()
static Schema<java.lang.String>
newStringSchema()
static Schema<java.lang.String>
newStringSchema(java.nio.charset.Charset charset)
static Schema<java.sql.Time>
newTimeSchema()
static Schema<java.sql.Timestamp>
newTimestampSchema()
-
-
-
方法详细资料
-
newSchemaDefinitionBuilder
public static <T> SchemaDefinitionBuilder<T> newSchemaDefinitionBuilder()
-
newClientBuilder
public static ClientBuilder newClientBuilder()
-
newMessageId
public static MessageId newMessageId(long ledgerId, long entryId, int partitionIndex)
-
newMessageIdFromByteArray
public static MessageId newMessageIdFromByteArray(byte[] data)
-
newMessageIdFromByteArrayWithTopic
public static MessageId newMessageIdFromByteArrayWithTopic(byte[] data, java.lang.String topicName)
-
newAuthenticationToken
public static Authentication newAuthenticationToken(java.lang.String token)
-
newAuthenticationToken
public static Authentication newAuthenticationToken(java.util.function.Supplier<java.lang.String> supplier)
-
newAuthenticationTLS
public static Authentication newAuthenticationTLS(java.lang.String certFilePath, java.lang.String keyFilePath)
-
createAuthentication
public static Authentication createAuthentication(java.lang.String authPluginClassName, java.lang.String authParamsString) throws PulsarClientException.UnsupportedAuthenticationException
-
createAuthentication
public static Authentication createAuthentication(java.lang.String authPluginClassName, java.util.Map<java.lang.String,java.lang.String> authParams) throws PulsarClientException.UnsupportedAuthenticationException
-
newBytesSchema
public static Schema<byte[]> newBytesSchema()
-
newStringSchema
public static Schema<java.lang.String> newStringSchema()
-
newStringSchema
public static Schema<java.lang.String> newStringSchema(java.nio.charset.Charset charset)
-
newByteSchema
public static Schema<java.lang.Byte> newByteSchema()
-
newShortSchema
public static Schema<java.lang.Short> newShortSchema()
-
newIntSchema
public static Schema<java.lang.Integer> newIntSchema()
-
newLongSchema
public static Schema<java.lang.Long> newLongSchema()
-
newBooleanSchema
public static Schema<java.lang.Boolean> newBooleanSchema()
-
newByteBufferSchema
public static Schema<java.nio.ByteBuffer> newByteBufferSchema()
-
newFloatSchema
public static Schema<java.lang.Float> newFloatSchema()
-
newDoubleSchema
public static Schema<java.lang.Double> newDoubleSchema()
-
newDateSchema
public static Schema<java.util.Date> newDateSchema()
-
newTimeSchema
public static Schema<java.sql.Time> newTimeSchema()
-
newTimestampSchema
public static Schema<java.sql.Timestamp> newTimestampSchema()
-
newInstantSchema
public static Schema<java.time.Instant> newInstantSchema()
-
newLocalDateSchema
public static Schema<java.time.LocalDate> newLocalDateSchema()
-
newLocalTimeSchema
public static Schema<java.time.LocalTime> newLocalTimeSchema()
-
newLocalDateTimeSchema
public static Schema<java.time.LocalDateTime> newLocalDateTimeSchema()
-
newAvroSchema
public static <T> Schema<T> newAvroSchema(SchemaDefinition schemaDefinition)
-
newProtobufSchema
public static <T extends com.google.protobuf.GeneratedMessageV3> Schema<T> newProtobufSchema(SchemaDefinition schemaDefinition)
-
newProtobufNativeSchema
public static <T extends com.google.protobuf.GeneratedMessageV3> Schema<T> newProtobufNativeSchema(SchemaDefinition schemaDefinition)
-
newJSONSchema
public static <T> Schema<T> newJSONSchema(SchemaDefinition schemaDefinition)
-
newAutoConsumeSchema
public static Schema<GenericRecord> newAutoConsumeSchema()
-
newAutoProduceSchema
public static Schema<byte[]> newAutoProduceSchema()
-
newKeyValueSchema
public static <K,V> Schema<KeyValue<K,V>> newKeyValueSchema(Schema<K> keySchema, Schema<V> valueSchema)
-
newKeyValueSchema
public static <K,V> Schema<KeyValue<K,V>> newKeyValueSchema(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType)
-
newKeyValueSchema
public static <K,V> Schema<KeyValue<K,V>> newKeyValueSchema(java.lang.Class<K> key, java.lang.Class<V> value, SchemaType type)
-
getSchema
public static Schema<?> getSchema(SchemaInfo schemaInfo)
-
getGenericSchema
public static GenericSchema<GenericRecord> getGenericSchema(SchemaInfo schemaInfo)
-
newRecordSchemaBuilder
public static RecordSchemaBuilder newRecordSchemaBuilder(java.lang.String name)
-
decodeKeyValueEncodingType
public static KeyValueEncodingType decodeKeyValueEncodingType(SchemaInfo schemaInfo)
Decode the kv encoding type from the schema info.- 参数:
schemaInfo
- the schema info- 返回:
- the kv encoding type
-
encodeKeyValueSchemaInfo
public static <K,V> SchemaInfo encodeKeyValueSchemaInfo(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.- 参数:
keySchema
- the key schemavalueSchema
- the value schemakeyValueEncodingType
- the encoding type to encode and decode key value pair- 返回:
- the final schema info
-
encodeKeyValueSchemaInfo
public static <K,V> SchemaInfo encodeKeyValueSchemaInfo(java.lang.String schemaName, Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.- 参数:
schemaName
- the final schema namekeySchema
- the key schemavalueSchema
- the value schemakeyValueEncodingType
- the encoding type to encode and decode key value pair- 返回:
- the final schema info
-
decodeKeyValueSchemaInfo
public static KeyValue<SchemaInfo,SchemaInfo> decodeKeyValueSchemaInfo(SchemaInfo schemaInfo)
Decode the key/value schema info to get key schema info and value schema info.- 参数:
schemaInfo
- key/value schema info.- 返回:
- the pair of key schema info and value schema info
-
jsonifySchemaInfo
public static java.lang.String jsonifySchemaInfo(SchemaInfo schemaInfo)
Jsonify the schema info.- 参数:
schemaInfo
- the schema info- 返回:
- the jsonified schema info
-
jsonifySchemaInfoWithVersion
public static java.lang.String jsonifySchemaInfoWithVersion(SchemaInfoWithVersion schemaInfoWithVersion)
Jsonify the schema info with version.- 参数:
schemaInfoWithVersion
- the schema info with version- 返回:
- the jsonified schema info with version
-
jsonifyKeyValueSchemaInfo
public static java.lang.String jsonifyKeyValueSchemaInfo(KeyValue<SchemaInfo,SchemaInfo> kvSchemaInfo)
Jsonify the key/value schema info.- 参数:
kvSchemaInfo
- the key/value schema info- 返回:
- the jsonified schema info
-
convertKeyValueSchemaInfoDataToString
public static java.lang.String convertKeyValueSchemaInfoDataToString(KeyValue<SchemaInfo,SchemaInfo> kvSchemaInfo)
Convert the key/value schema data.- 参数:
kvSchemaInfo
- the key/value schema info- 返回:
- the convert key/value schema data string
-
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
-
newDefaultBatcherBuilder
public static BatcherBuilder newDefaultBatcherBuilder()
-
newKeyBasedBatcherBuilder
public static BatcherBuilder newKeyBasedBatcherBuilder()
-
getBytes
public static byte[] getBytes(java.nio.ByteBuffer byteBuffer)
Retrieves ByteBuffer data into byte[].- 参数:
byteBuffer
-- 返回:
-
newSchemaInfoImpl
public SchemaInfo newSchemaInfoImpl(java.lang.String name, byte[] schema, SchemaType type, java.util.Map<java.lang.String,java.lang.String> propertiesValue)
-
-