Search in sources :

Example 1 with SchemaDefinition

use of org.apache.pulsar.client.api.schema.SchemaDefinition in project incubator-pulsar by apache.

the class NativeAvroBytesSchema method setSchema.

public void setSchema(org.apache.avro.Schema schema) {
    SchemaDefinition schemaDefinition = SchemaDefinition.builder().withJsonDef(schema.toString(false)).build();
    this.nativeSchema = schema;
    this.schema = AvroSchema.of(schemaDefinition);
}
Also used : SchemaDefinition(org.apache.pulsar.client.api.schema.SchemaDefinition)

Example 2 with SchemaDefinition

use of org.apache.pulsar.client.api.schema.SchemaDefinition in project pulsar by yahoo.

the class NativeAvroBytesSchema method setSchema.

public void setSchema(org.apache.avro.Schema schema) {
    SchemaDefinition schemaDefinition = SchemaDefinition.builder().withJsonDef(schema.toString(false)).build();
    this.nativeSchema = schema;
    this.schema = AvroSchema.of(schemaDefinition);
}
Also used : SchemaDefinition(org.apache.pulsar.client.api.schema.SchemaDefinition)

Example 3 with SchemaDefinition

use of org.apache.pulsar.client.api.schema.SchemaDefinition in project pulsar by apache.

the class NativeAvroBytesSchema method setSchema.

public void setSchema(org.apache.avro.Schema schema) {
    SchemaDefinition schemaDefinition = SchemaDefinition.builder().withJsonDef(schema.toString(false)).build();
    this.nativeSchema = schema;
    this.schema = AvroSchema.of(schemaDefinition);
}
Also used : SchemaDefinition(org.apache.pulsar.client.api.schema.SchemaDefinition)

Aggregations

SchemaDefinition (org.apache.pulsar.client.api.schema.SchemaDefinition)3