Class PravegaConfig

  • All Implemented Interfaces:
    java.io.Serializable

    public class PravegaConfig
    extends java.lang.Object
    implements java.io.Serializable
    The Pravega client configuration.
    See Also:
    Serialized Form
    • Method Detail

      • fromDefaults

        public static PravegaConfig fromDefaults()
        Gets a configuration based on defaults obtained from the local environment.
        Returns:
        A default instance of PravegaConfig
      • fromParams

        public static PravegaConfig fromParams​(org.apache.flink.api.java.utils.ParameterTool params)
        Gets a configuration based on defaults obtained from the local environment plus the given program parameters.
        Parameters:
        params - the parameters to use.
        Returns:
        An instance of PravegaConfig
      • getClientConfig

        public io.pravega.client.ClientConfig getClientConfig()
        Gets the ClientConfig to use with the Pravega client.
        Returns:
        The Pravega ClientConfig
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • resolve

        public io.pravega.client.stream.Stream resolve​(java.lang.String streamSpec)
        Resolves the given stream name. The scope name is resolved in the following order: 1. from the stream name (if fully-qualified) 2. from the program argument --scope (if program arguments were provided to the PravegaConfig) 3. from the system property pravega.scope 4. from the system environment variable PRAVEGA_SCOPE
        Parameters:
        streamSpec - a qualified or unqualified stream name
        Returns:
        a fully-qualified stream name
        Throws:
        java.lang.IllegalStateException - if an unqualified stream name is supplied but the scope is not configured.
      • withControllerURI

        public PravegaConfig withControllerURI​(java.net.URI controllerURI)
        Configures the Pravega controller RPC URI.
        Parameters:
        controllerURI - The URI.
        Returns:
        current instance of PravegaConfig.
      • withSchemaRegistryURI

        public PravegaConfig withSchemaRegistryURI​(java.net.URI schemaRegistryURI)
        Configures the Pravega schema registry URI.
        Parameters:
        schemaRegistryURI - The URI.
        Returns:
        current instance of PravegaConfig.
      • withTrustStore

        public PravegaConfig withTrustStore​(java.lang.String trustStore)
        Configures truststore value.
        Parameters:
        trustStore - truststore name.
        Returns:
        current instance of PravegaConfig.
      • withDefaultScope

        public PravegaConfig withDefaultScope​(java.lang.String scope)
        Configures the default Pravega scope, to resolve unqualified stream names and to support reader groups.
        Parameters:
        scope - The scope to use (with lowest priority).
        Returns:
        current instance of PravegaConfig.
      • withScope

        public PravegaConfig withScope​(java.lang.String scope)
        Configures the self-defined Pravega scope.
        Parameters:
        scope - The scope to use (with highest priority).
        Returns:
        current instance of PravegaConfig.
      • getDefaultScope

        @Nullable
        public java.lang.String getDefaultScope()
        Gets the default Pravega scope.
        Returns:
        current default scope name.
      • getSchemaRegistryUri

        @Nullable
        public java.net.URI getSchemaRegistryUri()
        Gets the Pravega schema registry URI.
        Returns:
        Pravega schema registry URI.
      • withCredentials

        public PravegaConfig withCredentials​(io.pravega.shared.security.auth.Credentials credentials)
        Configures the Pravega credentials to use.
        Parameters:
        credentials - a credentials object.
        Returns:
        current instance of PravegaConfig.
      • getCredentials

        @Nullable
        public io.pravega.shared.security.auth.Credentials getCredentials()
        Gets the Pravega schema registry URI.
        Returns:
        Pravega schema registry URI.
      • withHostnameValidation

        public PravegaConfig withHostnameValidation​(boolean validateHostname)
        Enables or disables TLS hostname validation (default: true).
        Parameters:
        validateHostname - a boolean indicating whether to validate the hostname on incoming requests.
        Returns:
        current instance of PravegaConfig.