Package org.apache.pulsar.client.admin
Interface Schemas
public interface Schemas
Admin interface on interacting with schemas.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createSchema
(String topic, PostSchemaPayload schemaPayload) Create a schema for a given topic.void
createSchema
(String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Create a schema for a given topic with the provided schema info.createSchemaAsync
(String topic, PostSchemaPayload schemaPayload) Create a schema for a given topic asynchronously.createSchemaAsync
(String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Create a schema for a given topic with the provided schema info asynchronously.void
deleteSchema
(String topic) Delete the schema associated with a given topic.void
deleteSchema
(String topic, boolean force) Delete the schema associated with a given topic.deleteSchemaAsync
(String topic) Delete the schema associated with a given topic asynchronously.deleteSchemaAsync
(String topic, boolean force) Delete the schema associated with a given topic asynchronously.List<org.apache.pulsar.common.schema.SchemaInfo>
getAllSchemas
(String topic) Get all version schemas topic.CompletableFuture<List<org.apache.pulsar.common.schema.SchemaInfo>>
getAllSchemasAsync
(String topic) Get all version schemas topic asynchronously.org.apache.pulsar.common.schema.SchemaInfo
getSchemaInfo
(String topic) Retrieve the latest schema of a topic.org.apache.pulsar.common.schema.SchemaInfo
getSchemaInfo
(String topic, long version) Retrieve the schema of a topic at a given version.CompletableFuture<org.apache.pulsar.common.schema.SchemaInfo>
getSchemaInfoAsync
(String topic) Retrieve the latest schema of a topic asynchronously.CompletableFuture<org.apache.pulsar.common.schema.SchemaInfo>
getSchemaInfoAsync
(String topic, long version) Retrieve the schema of a topic at a given version asynchronously.org.apache.pulsar.common.schema.SchemaInfoWithVersion
getSchemaInfoWithVersion
(String topic) Retrieve the latest schema with verison of a topic.CompletableFuture<org.apache.pulsar.common.schema.SchemaInfoWithVersion>
Retrieve the latest schema with verison of a topic asynchronously.getVersionBySchema
(String topic, PostSchemaPayload schemaPayload) Find schema version topic.getVersionBySchema
(String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Find schema version topic.getVersionBySchemaAsync
(String topic, PostSchemaPayload schemaPayload) Find schema version topic asynchronously.getVersionBySchemaAsync
(String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Find schema version topic asynchronously.testCompatibility
(String topic, PostSchemaPayload schemaPayload) Judge schema compatibility topic.testCompatibility
(String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Judge schema compatibility topic.testCompatibilityAsync
(String topic, PostSchemaPayload schemaPayload) Judge schema compatibility topic asynchronously.testCompatibilityAsync
(String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Judge schema compatibility topic asynchronously.
-
Method Details
-
getSchemaInfo
Retrieve the latest schema of a topic.- Parameters:
topic
- topic name, in fully qualified format- Returns:
- latest schema
- Throws:
PulsarAdminException
-
getSchemaInfoAsync
Retrieve the latest schema of a topic asynchronously.- Parameters:
topic
- topic name, in fully qualified format- Returns:
- latest schema
-
getSchemaInfoWithVersion
org.apache.pulsar.common.schema.SchemaInfoWithVersion getSchemaInfoWithVersion(String topic) throws PulsarAdminException Retrieve the latest schema with verison of a topic.- Parameters:
topic
- topic name, in fully qualified format- Returns:
- latest schema with version
- Throws:
PulsarAdminException
-
getSchemaInfoWithVersionAsync
CompletableFuture<org.apache.pulsar.common.schema.SchemaInfoWithVersion> getSchemaInfoWithVersionAsync(String topic) Retrieve the latest schema with verison of a topic asynchronously.- Parameters:
topic
- topic name, in fully qualified format- Returns:
- latest schema with version
-
getSchemaInfo
org.apache.pulsar.common.schema.SchemaInfo getSchemaInfo(String topic, long version) throws PulsarAdminException Retrieve the schema of a topic at a given version.- Parameters:
topic
- topic name, in fully qualified formatversion
- schema version- Returns:
- the schema info at a given version
- Throws:
PulsarAdminException
-
getSchemaInfoAsync
CompletableFuture<org.apache.pulsar.common.schema.SchemaInfo> getSchemaInfoAsync(String topic, long version) Retrieve the schema of a topic at a given version asynchronously.- Parameters:
topic
- topic name, in fully qualified formatversion
- schema version- Returns:
- the schema info at a given version
-
deleteSchema
Delete the schema associated with a given topic.- Parameters:
topic
- topic name, in fully qualified format- Throws:
PulsarAdminException
-
deleteSchemaAsync
Delete the schema associated with a given topic asynchronously.- Parameters:
topic
- topic name, in fully qualified format
-
deleteSchema
Delete the schema associated with a given topic.- Parameters:
topic
- topic name, in fully qualified formatforce
- whether to delete schema completely. If true, delete all resources (including metastore and ledger), otherwise only do a mark deletion and not remove any resources indeed- Throws:
PulsarAdminException
-
deleteSchemaAsync
Delete the schema associated with a given topic asynchronously.- Parameters:
topic
- topic name, in fully qualified format
-
createSchema
void createSchema(String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo) throws PulsarAdminException Create a schema for a given topic with the provided schema info.- Parameters:
topic
- topic name, in fully qualified fomratschemaInfo
- schema info- Throws:
PulsarAdminException
-
createSchemaAsync
CompletableFuture<Void> createSchemaAsync(String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Create a schema for a given topic with the provided schema info asynchronously.- Parameters:
topic
- topic name, in fully qualified fomratschemaInfo
- schema info
-
createSchema
Create a schema for a given topic.- Parameters:
topic
- topic name, in fully qualified formatschemaPayload
- schema payload- Throws:
PulsarAdminException
-
createSchemaAsync
Create a schema for a given topic asynchronously.- Parameters:
topic
- topic name, in fully qualified formatschemaPayload
- schema payload
-
testCompatibility
IsCompatibilityResponse testCompatibility(String topic, PostSchemaPayload schemaPayload) throws PulsarAdminException Judge schema compatibility topic.- Parameters:
topic
- topic name, in fully qualified formatschemaPayload
- schema payload- Throws:
PulsarAdminException
-
testCompatibilityAsync
CompletableFuture<IsCompatibilityResponse> testCompatibilityAsync(String topic, PostSchemaPayload schemaPayload) Judge schema compatibility topic asynchronously.- Parameters:
topic
- topic name, in fully qualified formatschemaPayload
- schema payload
-
getVersionBySchema
Find schema version topic.- Parameters:
topic
- topic name, in fully qualified formatschemaPayload
- schema payload- Throws:
PulsarAdminException
-
getVersionBySchemaAsync
Find schema version topic asynchronously.- Parameters:
topic
- topic name, in fully qualified formatschemaPayload
- schema payload
-
testCompatibility
IsCompatibilityResponse testCompatibility(String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo) throws PulsarAdminException Judge schema compatibility topic.- Parameters:
topic
- topic name, in fully qualified formatschemaInfo
- schema info- Throws:
PulsarAdminException
-
testCompatibilityAsync
CompletableFuture<IsCompatibilityResponse> testCompatibilityAsync(String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Judge schema compatibility topic asynchronously.- Parameters:
topic
- topic name, in fully qualified formatschemaInfo
- schema info
-
getVersionBySchema
Long getVersionBySchema(String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo) throws PulsarAdminException Find schema version topic.- Parameters:
topic
- topic name, in fully qualified formatschemaInfo
- schema info- Throws:
PulsarAdminException
-
getVersionBySchemaAsync
CompletableFuture<Long> getVersionBySchemaAsync(String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Find schema version topic asynchronously.- Parameters:
topic
- topic name, in fully qualified formatschemaInfo
- schema info
-
getAllSchemas
List<org.apache.pulsar.common.schema.SchemaInfo> getAllSchemas(String topic) throws PulsarAdminException Get all version schemas topic.- Parameters:
topic
- topic name, in fully qualified format- Throws:
PulsarAdminException
-
getAllSchemasAsync
CompletableFuture<List<org.apache.pulsar.common.schema.SchemaInfo>> getAllSchemasAsync(String topic) Get all version schemas topic asynchronously.- Parameters:
topic
- topic name, in fully qualified format
-