Interface Schemas


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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void createSchema​(java.lang.String topic, PostSchemaPayload schemaPayload)
      Create a schema for a given topic.
      void createSchema​(java.lang.String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
      Create a schema for a given topic with the provided schema info.
      java.util.concurrent.CompletableFuture<java.lang.Void> createSchemaAsync​(java.lang.String topic, PostSchemaPayload schemaPayload)
      Create a schema for a given topic asynchronously.
      java.util.concurrent.CompletableFuture<java.lang.Void> createSchemaAsync​(java.lang.String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
      Create a schema for a given topic with the provided schema info asynchronously.
      void deleteSchema​(java.lang.String topic)
      Delete the schema associated with a given topic.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteSchemaAsync​(java.lang.String topic)
      Delete the schema associated with a given topic asynchronously.
      java.util.List<org.apache.pulsar.common.schema.SchemaInfo> getAllSchemas​(java.lang.String topic)
      Get all version schemas topic.
      java.util.concurrent.CompletableFuture<java.util.List<org.apache.pulsar.common.schema.SchemaInfo>> getAllSchemasAsync​(java.lang.String topic)
      Get all version schemas topic asynchronously.
      org.apache.pulsar.common.schema.SchemaInfo getSchemaInfo​(java.lang.String topic)
      Retrieve the latest schema of a topic.
      org.apache.pulsar.common.schema.SchemaInfo getSchemaInfo​(java.lang.String topic, long version)
      Retrieve the schema of a topic at a given version.
      java.util.concurrent.CompletableFuture<org.apache.pulsar.common.schema.SchemaInfo> getSchemaInfoAsync​(java.lang.String topic)
      Retrieve the latest schema of a topic asynchronously.
      java.util.concurrent.CompletableFuture<org.apache.pulsar.common.schema.SchemaInfo> getSchemaInfoAsync​(java.lang.String topic, long version)
      Retrieve the schema of a topic at a given version asynchronously.
      org.apache.pulsar.common.schema.SchemaInfoWithVersion getSchemaInfoWithVersion​(java.lang.String topic)
      Retrieve the latest schema with verison of a topic.
      java.util.concurrent.CompletableFuture<org.apache.pulsar.common.schema.SchemaInfoWithVersion> getSchemaInfoWithVersionAsync​(java.lang.String topic)
      Retrieve the latest schema with verison of a topic asynchronously.
      java.lang.Long getVersionBySchema​(java.lang.String topic, PostSchemaPayload schemaPayload)
      Find schema version topic.
      java.lang.Long getVersionBySchema​(java.lang.String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
      Find schema version topic.
      java.util.concurrent.CompletableFuture<java.lang.Long> getVersionBySchemaAsync​(java.lang.String topic, PostSchemaPayload schemaPayload)
      Find schema version topic asynchronously.
      java.util.concurrent.CompletableFuture<java.lang.Long> getVersionBySchemaAsync​(java.lang.String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
      Find schema version topic asynchronously.
      IsCompatibilityResponse testCompatibility​(java.lang.String topic, PostSchemaPayload schemaPayload)
      Judge schema compatibility topic.
      IsCompatibilityResponse testCompatibility​(java.lang.String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
      Judge schema compatibility topic.
      java.util.concurrent.CompletableFuture<IsCompatibilityResponse> testCompatibilityAsync​(java.lang.String topic, PostSchemaPayload schemaPayload)
      Judge schema compatibility topic asynchronously.
      java.util.concurrent.CompletableFuture<IsCompatibilityResponse> testCompatibilityAsync​(java.lang.String topic, org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
      Judge schema compatibility topic asynchronously.
    • Method Detail

      • getSchemaInfo

        org.apache.pulsar.common.schema.SchemaInfo getSchemaInfo​(java.lang.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

        java.util.concurrent.CompletableFuture<org.apache.pulsar.common.schema.SchemaInfo> getSchemaInfoAsync​(java.lang.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​(java.lang.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

        java.util.concurrent.CompletableFuture<org.apache.pulsar.common.schema.SchemaInfoWithVersion> getSchemaInfoWithVersionAsync​(java.lang.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​(java.lang.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

        java.util.concurrent.CompletableFuture<org.apache.pulsar.common.schema.SchemaInfo> getSchemaInfoAsync​(java.lang.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​(java.lang.String topic)
                   throws PulsarAdminException
        Delete the schema associated with a given topic.
        Parameters:
        topic - topic name, in fully qualified format
        Throws:
        PulsarAdminException
      • deleteSchemaAsync

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

        void createSchema​(java.lang.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

        java.util.concurrent.CompletableFuture<java.lang.Void> createSchemaAsync​(java.lang.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
      • createSchemaAsync

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

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

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

        java.util.concurrent.CompletableFuture<java.lang.Long> getVersionBySchemaAsync​(java.lang.String topic,
                                                                                       PostSchemaPayload schemaPayload)
        Find schema version topic asynchronously.
        Parameters:
        topic - topic name, in fully qualified format
        schemaPayload - schema payload
      • testCompatibility

        IsCompatibilityResponse testCompatibility​(java.lang.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

        java.util.concurrent.CompletableFuture<IsCompatibilityResponse> testCompatibilityAsync​(java.lang.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

        java.lang.Long getVersionBySchema​(java.lang.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

        java.util.concurrent.CompletableFuture<java.lang.Long> getVersionBySchemaAsync​(java.lang.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

        java.util.List<org.apache.pulsar.common.schema.SchemaInfo> getAllSchemas​(java.lang.String topic)
                                                                          throws PulsarAdminException
        Get all version schemas topic.
        Parameters:
        topic - topic name, in fully qualified format
        Throws:
        PulsarAdminException
      • getAllSchemasAsync

        java.util.concurrent.CompletableFuture<java.util.List<org.apache.pulsar.common.schema.SchemaInfo>> getAllSchemasAsync​(java.lang.String topic)
        Get all version schemas topic asynchronously.
        Parameters:
        topic - topic name, in fully qualified format