| 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<Instant> |
Schema.INSTANT
Instant 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<LocalDate> |
Schema.LOCAL_DATE
LocalDate Schema.
|
static Schema<LocalDateTime> |
Schema.LOCAL_DATE_TIME
LocalDateTime Schema.
|
static Schema<LocalTime> |
Schema.LOCAL_TIME
LocalTime 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 Schema<byte[]> |
Schema.NATIVE_AVRO(Object schema)
Create a schema instance that accepts a serialized Avro payload
without validating it against the schema specified.
|
static <T extends com.google.protobuf.GeneratedMessageV3> |
Schema.PROTOBUF_NATIVE(Class<T> clazz)
Create a Protobuf-Native schema type by extracting the fields of the specified class.
|
static <T extends com.google.protobuf.GeneratedMessageV3> |
Schema.PROTOBUF_NATIVE(SchemaDefinition<T> schemaDefinition)
Create a Protobuf-Native schema type with schema definition.
|
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 |
|---|---|
default Optional<Schema<?>> |
Message.getReaderSchema()
Get the schema associated to the message.
|
| Modifier and Type | Method and Description |
|---|---|
<T> Message<T> |
MessagePayloadContext.asSingleMessage(MessagePayload payload,
Schema<T> schema)
Convert the given payload to a single message if the entry is not a batch.
|
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.
|
<T> Message<T> |
MessagePayloadContext.getMessageAt(int index,
int numMessages,
MessagePayload payload,
boolean containMetadata,
Schema<T> schema)
Get the internal single message with a specific index from a payload if the payload is a batch.
|
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. |
<T> void |
MessagePayloadProcessor.process(MessagePayload payload,
MessagePayloadContext context,
Schema<T> schema,
Consumer<Message<T>> messageConsumer)
Process the message payload.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
GenericSchema<T extends GenericRecord>
A schema that serializes and deserializes between
GenericRecord and bytes. |
interface |
KeyValueSchema<K,V>
This interface models a Schema that is composed of two parts.
|
| Modifier and Type | Method and Description |
|---|---|
Schema<K> |
KeyValueSchema.getKeySchema()
Get the Schema of the Key.
|
Schema<V> |
KeyValueSchema.getValueSchema()
Get the Schema of the Value.
|
| Modifier and Type | Method and Description |
|---|---|
Schema<?> |
PulsarClientImplementationBinding.getSchema(SchemaInfo schemaInfo) |
Schema<GenericRecord> |
PulsarClientImplementationBinding.newAutoConsumeSchema() |
Schema<byte[]> |
PulsarClientImplementationBinding.newAutoProduceSchema() |
Schema<byte[]> |
PulsarClientImplementationBinding.newAutoProduceSchema(Schema<?> schema) |
Schema<byte[]> |
PulsarClientImplementationBinding.newAutoProduceValidatedAvroSchema(Object schema) |
<T> Schema<T> |
PulsarClientImplementationBinding.newAvroSchema(SchemaDefinition schemaDefinition) |
Schema<Boolean> |
PulsarClientImplementationBinding.newBooleanSchema() |
Schema<ByteBuffer> |
PulsarClientImplementationBinding.newByteBufferSchema() |
Schema<Byte> |
PulsarClientImplementationBinding.newByteSchema() |
Schema<byte[]> |
PulsarClientImplementationBinding.newBytesSchema() |
Schema<Date> |
PulsarClientImplementationBinding.newDateSchema() |
Schema<Double> |
PulsarClientImplementationBinding.newDoubleSchema() |
Schema<Float> |
PulsarClientImplementationBinding.newFloatSchema() |
Schema<Instant> |
PulsarClientImplementationBinding.newInstantSchema() |
Schema<Integer> |
PulsarClientImplementationBinding.newIntSchema() |
<T> Schema<T> |
PulsarClientImplementationBinding.newJSONSchema(SchemaDefinition schemaDefinition) |
Schema<KeyValue<byte[],byte[]>> |
PulsarClientImplementationBinding.newKeyValueBytesSchema() |
<K,V> Schema<KeyValue<K,V>> |
PulsarClientImplementationBinding.newKeyValueSchema(Class<K> key,
Class<V> value,
SchemaType type) |
<K,V> Schema<KeyValue<K,V>> |
PulsarClientImplementationBinding.newKeyValueSchema(Schema<K> keySchema,
Schema<V> valueSchema) |
<K,V> Schema<KeyValue<K,V>> |
PulsarClientImplementationBinding.newKeyValueSchema(Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType) |
Schema<LocalDate> |
PulsarClientImplementationBinding.newLocalDateSchema() |
Schema<LocalDateTime> |
PulsarClientImplementationBinding.newLocalDateTimeSchema() |
Schema<LocalTime> |
PulsarClientImplementationBinding.newLocalTimeSchema() |
Schema<Long> |
PulsarClientImplementationBinding.newLongSchema() |
<T extends com.google.protobuf.GeneratedMessageV3> |
PulsarClientImplementationBinding.newProtobufNativeSchema(SchemaDefinition schemaDefinition) |
<T extends com.google.protobuf.GeneratedMessageV3> |
PulsarClientImplementationBinding.newProtobufSchema(SchemaDefinition schemaDefinition) |
Schema<Short> |
PulsarClientImplementationBinding.newShortSchema() |
Schema<String> |
PulsarClientImplementationBinding.newStringSchema() |
Schema<String> |
PulsarClientImplementationBinding.newStringSchema(Charset charset) |
Schema<Time> |
PulsarClientImplementationBinding.newTimeSchema() |
Schema<Timestamp> |
PulsarClientImplementationBinding.newTimestampSchema() |
| Modifier and Type | Method and Description |
|---|---|
<K,V> SchemaInfo |
PulsarClientImplementationBinding.encodeKeyValueSchemaInfo(Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.
|
<K,V> SchemaInfo |
PulsarClientImplementationBinding.encodeKeyValueSchemaInfo(Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.
|
<K,V> SchemaInfo |
PulsarClientImplementationBinding.encodeKeyValueSchemaInfo(String schemaName,
Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.
|
<K,V> SchemaInfo |
PulsarClientImplementationBinding.encodeKeyValueSchemaInfo(String schemaName,
Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.
|
Schema<byte[]> |
PulsarClientImplementationBinding.newAutoProduceSchema(Schema<?> schema) |
<K,V> Schema<KeyValue<K,V>> |
PulsarClientImplementationBinding.newKeyValueSchema(Schema<K> keySchema,
Schema<V> valueSchema) |
<K,V> Schema<KeyValue<K,V>> |
PulsarClientImplementationBinding.newKeyValueSchema(Schema<K> keySchema,
Schema<V> valueSchema) |
<K,V> Schema<KeyValue<K,V>> |
PulsarClientImplementationBinding.newKeyValueSchema(Schema<K> keySchema,
Schema<V> valueSchema,
KeyValueEncodingType keyValueEncodingType) |
<K,V> Schema<KeyValue<K,V>> |
PulsarClientImplementationBinding.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–2021 Apache Software Foundation. All rights reserved.