Interface Schemas


public interface Schemas
Admin interface on interacting with schemas.
  • Method Details

    • getSchemaInfo

      org.apache.pulsar.common.schema.SchemaInfo getSchemaInfo(String topic) throws PulsarAdminException
      Retrieve the latest schema of a topic.
      Parameters:
      topic - topic name, in fully qualified format
      Returns:
      latest schema
      Throws:
      PulsarAdminException
    • getSchemaInfoAsync

      CompletableFuture<org.apache.pulsar.common.schema.SchemaInfo> getSchemaInfoAsync(String topic)
      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 format
      version - 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 format
      version - schema version
      Returns:
      the schema info at a given version
    • deleteSchema

      void deleteSchema(String topic) throws PulsarAdminException
      Delete the schema associated with a given topic.
      Parameters:
      topic - topic name, in fully qualified format
      Throws:
      PulsarAdminException
    • deleteSchemaAsync

      CompletableFuture<Void> deleteSchemaAsync(String topic)
      Delete the schema associated with a given topic asynchronously.
      Parameters:
      topic - topic name, in fully qualified format
    • deleteSchema

      void deleteSchema(String topic, boolean force) throws PulsarAdminException
      Delete the schema associated with a given topic.
      Parameters:
      topic - topic name, in fully qualified format
      force - 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

      CompletableFuture<Void> deleteSchemaAsync(String topic, boolean force)
      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 fomrat
      schemaInfo - 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 fomrat
      schemaInfo - schema info
    • createSchema

      void createSchema(String topic, PostSchemaPayload schemaPayload) throws PulsarAdminException
      Create a schema for a given topic.
      Parameters:
      topic - topic name, in fully qualified format
      schemaPayload - schema payload
      Throws:
      PulsarAdminException
    • createSchemaAsync

      CompletableFuture<Void> createSchemaAsync(String topic, PostSchemaPayload schemaPayload)
      Create a schema for a given topic asynchronously.
      Parameters:
      topic - topic name, in fully qualified format
      schemaPayload - schema payload
    • testCompatibility

      IsCompatibilityResponse testCompatibility(String topic, PostSchemaPayload schemaPayload) throws PulsarAdminException
      Judge schema compatibility topic.
      Parameters:
      topic - topic name, in fully qualified format
      schemaPayload - schema payload
      Throws:
      PulsarAdminException
    • testCompatibilityAsync

      CompletableFuture<IsCompatibilityResponse> testCompatibilityAsync(String topic, PostSchemaPayload schemaPayload)
      Judge schema compatibility topic asynchronously.
      Parameters:
      topic - topic name, in fully qualified format
      schemaPayload - schema payload
    • getVersionBySchema

      Long getVersionBySchema(String topic, PostSchemaPayload schemaPayload) throws PulsarAdminException
      Find schema version topic.
      Parameters:
      topic - topic name, in fully qualified format
      schemaPayload - schema payload
      Throws:
      PulsarAdminException
    • getVersionBySchemaAsync

      CompletableFuture<Long> getVersionBySchemaAsync(String topic, PostSchemaPayload schemaPayload)
      Find schema version topic asynchronously.
      Parameters:
      topic - topic name, in fully qualified format
      schemaPayload - 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 format
      schemaInfo - 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 format
      schemaInfo - 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 format
      schemaInfo - 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 format
      schemaInfo - 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