Package | Description |
---|---|
org.apache.pulsar.client.api |
Pulsar Client API.
|
org.apache.pulsar.client.api.schema |
Schema definitions for Pulsar Client API.
|
org.apache.pulsar.client.internal |
Helpers which provide useful functionality for the implementation of Pulsar Client API.
|
org.apache.pulsar.common.schema |
This package contains data structures for schema definitions used in the Pulsar Client API.
|
Modifier and Type | Field and Description |
---|---|
static Schema<Boolean> |
Schema.BOOL
Boolean Schema.
|
static Schema<ByteBuffer> |
Schema.BYTEBUFFER
ByteBuffer Schema.
|
static Schema<byte[]> |
Schema.BYTES
Schema that doesn't perform any encoding on the message payloads.
|
static Schema<Date> |
Schema.DATE
Date Schema.
|
static Schema<Double> |
Schema.DOUBLE
Double Schema.
|
static Schema<Float> |
Schema.FLOAT
Float Schema.
|
static Schema<Short> |
Schema.INT16
INT16 Schema.
|
static Schema<Integer> |
Schema.INT32
INT32 Schema.
|
static Schema<Long> |
Schema.INT64
INT64 Schema.
|
static Schema<Byte> |
Schema.INT8
INT8 Schema.
|
static Schema<String> |
Schema.STRING
Schema that can be used to encode/decode messages whose values are String.
|
static Schema<Time> |
Schema.TIME
Time Schema.
|
static Schema<Timestamp> |
Schema.TIMESTAMP
Timestamp Schema.
|
Modifier and Type | Method and Description |
---|---|
static Schema<GenericRecord> |
Schema.AUTO_CONSUME()
Create a schema instance that automatically deserialize messages
based on the current topic schema.
|
static Schema<byte[]> |
Schema.AUTO_PRODUCE_BYTES()
Create a schema instance that accepts a serialized payload
and validates it against the topic schema.
|
static Schema<byte[]> |
Schema.AUTO_PRODUCE_BYTES(Schema<?> schema)
Create a schema instance that accepts a serialized payload
and validates it against the schema specified.
|
static Schema<GenericRecord> |
Schema.AUTO()
Deprecated.
|
static <T> Schema<T> |
Schema.AVRO(Class<T> pojo)
Create a Avro schema type by default configuration of the class.
|
static <T> Schema<T> |
Schema.AVRO(SchemaDefinition<T> schemaDefinition)
Create a Avro schema type with schema definition.
|
Schema<T> |
Schema.clone()
Duplicates the schema.
|
static Schema<?> |
Schema.getSchema(SchemaInfo schemaInfo) |
static <T> Schema<T> |
Schema.JSON(Class<T> pojo)
Create a JSON schema type by extracting the fields of the specified class.
|
static <T> Schema<T> |
Schema.JSON(SchemaDefinition schemaDefinition)
Create a JSON schema type with schema definition.
|
static <K,V> Schema<KeyValue<K,V>> |
Schema.KeyValue(Class<K> key,
Class<V> value)
Key Value Schema whose underneath key and value schemas are JSONSchema.
|
static <K,V> Schema<KeyValue<K,V>> |
Schema.KeyValue(Class<K> key,
Class<V> value,
SchemaType type)
Key Value Schema using passed in schema type, support JSON and AVRO currently.
|
static <K,V> Schema<KeyValue<K,V>> |
Schema.KeyValue(Schema<K> key,
Schema<V> value)
Key Value Schema using passed in key and value schemas.
|
static <K,V> Schema<KeyValue<K,V>> |
Schema.KeyValue(Schema<K> key,
Schema<V> value,
KeyValueEncodingType keyValueEncodingType)
Key Value Schema using passed in key, value and encoding type schemas.
|
static Schema<KeyValue<byte[],byte[]>> |
Schema.KV_BYTES()
Schema that can be used to encode/decode KeyValue.
|
static <T extends com.google.protobuf.GeneratedMessageV3> |
Schema.PROTOBUF(Class<T> clazz)
Create a Protobuf schema type by extracting the fields of the specified class.
|
static <T extends com.google.protobuf.GeneratedMessageV3> |
Schema.PROTOBUF(SchemaDefinition<T> schemaDefinition)
Create a Protobuf schema type with schema definition.
|
Modifier and Type | Method and Description |
---|---|
static Schema<byte[]> |
Schema.AUTO_PRODUCE_BYTES(Schema<?> schema)
Create a schema instance that accepts a serialized payload
and validates it against the schema specified.
|
static <K,V> Schema<KeyValue<K,V>> |
Schema.KeyValue(Schema<K> key,
Schema<V> value)
Key Value Schema using passed in key and value schemas.
|
static <K,V> Schema<KeyValue<K,V>> |
Schema.KeyValue(Schema<K> key,
Schema<V> value)
Key Value Schema using passed in key and value schemas.
|
static <K,V> Schema<KeyValue<K,V>> |
Schema.KeyValue(Schema<K> key,
Schema<V> value,
KeyValueEncodingType keyValueEncodingType)
Key Value Schema using passed in key, value and encoding type schemas.
|
static <K,V> Schema<KeyValue<K,V>> |
Schema.KeyValue(Schema<K> key,
Schema<V> value,
KeyValueEncodingType keyValueEncodingType)
Key Value Schema using passed in key, value and encoding type schemas.
|
<T> ConsumerBuilder<T> |
PulsarClient.newConsumer(Schema<T> schema)
Create a consumer builder with a specific schema for subscribing on a specific topic
|
<V> TypedMessageBuilder<V> |
Producer.newMessage(Schema<V> schema)
Create a new message builder with schema, not required same parameterized type with the producer.
|
<T> ProducerBuilder<T> |
PulsarClient.newProducer(Schema<T> schema)
Create a producer builder that can be used to configure
and construct a producer with the specified schema.
|
<T> ReaderBuilder<T> |
PulsarClient.newReader(Schema<T> schema)
Create a topic reader builder with a specific
Schema ) to read from the specified topic. |
Modifier and Type | Interface and Description |
---|---|
interface |
GenericSchema<T extends GenericRecord>
A schema that serializes and deserializes between
GenericRecord and bytes. |
Modifier and Type | Method and Description |
---|---|
static Schema<?> |
DefaultImplementation.getSchema(SchemaInfo schemaInfo) |
static Schema<GenericRecord> |
DefaultImplementation.newAutoConsumeSchema() |
static Schema<byte[]> |
DefaultImplementation.newAutoProduceSchema() |
static Schema<byte[]> |
DefaultImplementation.newAutoProduceSchema(Schema<?> schema) |
static <T> Schema<T> |
DefaultImplementation.newAvroSchema(SchemaDefinition schemaDefinition) |
static Schema<Boolean> |
DefaultImplementation.newBooleanSchema() |
static Schema<ByteBuffer> |
DefaultImplementation.newByteBufferSchema() |
static Schema<Byte> |
DefaultImplementation.newByteSchema() |
static Schema<byte[]> |
DefaultImplementation.newBytesSchema() |
static Schema<Date> |
DefaultImplementation.newDateSchema() |
static Schema<Double> |
DefaultImplementation.newDoubleSchema() |
static Schema<Float> |
DefaultImplementation.newFloatSchema() |
static Schema<Integer> |
DefaultImplementation.newIntSchema() |
static <T> Schema<T> |
DefaultImplementation.newJSONSchema(SchemaDefinition schemaDefinition) |
static Schema<KeyValue<byte[],byte[]>> |
DefaultImplementation.newKeyValueBytesSchema() |
static <K,V> Schema<KeyValue<K,V>> |
DefaultImplementation.newKeyValueSchema(Class<K> key,
Class<V> value,
SchemaType type) |
static <K,V> Schema<KeyValue<K,V>> |
DefaultImplementation.newKeyValueSchema(Schema<K> keySchema,
Schema<V> valueSchema) |
static <K,V> Schema<KeyValue<K,V>> |
DefaultImplementation.newKeyValueSchema(Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType) |
static Schema<Long> |
DefaultImplementation.newLongSchema() |
static <T extends com.google.protobuf.GeneratedMessageV3> |
DefaultImplementation.newProtobufSchema(SchemaDefinition schemaDefinition) |
static Schema<Short> |
DefaultImplementation.newShortSchema() |
static Schema<String> |
DefaultImplementation.newStringSchema() |
static Schema<String> |
DefaultImplementation.newStringSchema(Charset charset) |
static Schema<Time> |
DefaultImplementation.newTimeSchema() |
static Schema<Timestamp> |
DefaultImplementation.newTimestampSchema() |
Modifier and Type | Method and Description |
---|---|
static <K,V> SchemaInfo |
DefaultImplementation.encodeKeyValueSchemaInfo(Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.
|
static <K,V> SchemaInfo |
DefaultImplementation.encodeKeyValueSchemaInfo(Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.
|
static <K,V> SchemaInfo |
DefaultImplementation.encodeKeyValueSchemaInfo(String schemaName,
Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.
|
static <K,V> SchemaInfo |
DefaultImplementation.encodeKeyValueSchemaInfo(String schemaName,
Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.
|
static Schema<byte[]> |
DefaultImplementation.newAutoProduceSchema(Schema<?> schema) |
static <K,V> Schema<KeyValue<K,V>> |
DefaultImplementation.newKeyValueSchema(Schema<K> keySchema,
Schema<V> valueSchema) |
static <K,V> Schema<KeyValue<K,V>> |
DefaultImplementation.newKeyValueSchema(Schema<K> keySchema,
Schema<V> valueSchema) |
static <K,V> Schema<KeyValue<K,V>> |
DefaultImplementation.newKeyValueSchema(Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType) |
static <K,V> Schema<KeyValue<K,V>> |
DefaultImplementation.newKeyValueSchema(Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType) |
Modifier and Type | Method and Description |
---|---|
static <K,V> byte[] |
KeyValue.encode(K key,
Schema<K> keyWriter,
V value,
Schema<V> valueWriter)
Encode a key and value pair into a bytes array.
|
static <K,V> byte[] |
KeyValue.encode(K key,
Schema<K> keyWriter,
V value,
Schema<V> valueWriter)
Encode a key and value pair into a bytes array.
|
Copyright © 2017–2020 Apache Software Foundation. All rights reserved.