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 Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static PravegaConfig fromDefaults()
      Gets a configuration based on defaults obtained from the local environment.
      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.
      io.pravega.client.ClientConfig getClientConfig()
      Gets the ClientConfig to use with the Pravega client.
      java.lang.String getDefaultScope()
      Gets the default Pravega scope.
      io.pravega.client.stream.Stream resolve​(java.lang.String streamSpec)
      Resolves the given stream name.
      PravegaConfig withControllerURI​(java.net.URI controllerURI)
      Configures the Pravega controller RPC URI.
      PravegaConfig withCredentials​(io.pravega.client.stream.impl.Credentials credentials)
      Configures the Pravega credentials to use.
      PravegaConfig withDefaultScope​(java.lang.String scope)
      Configures the default Pravega scope, to resolve unqualified stream names and to support reader groups.
      PravegaConfig withHostnameValidation​(boolean validateHostname)
      Enables or disables TLS hostname validation (default: true).
      PravegaConfig withScope​(java.lang.String scope)
      Configures the self-defined Pravega scope.
      PravegaConfig withTrustStore​(java.lang.String trustStore)
      Configures truststore value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • fromDefaults

        public static PravegaConfig fromDefaults()
        Gets a configuration based on defaults obtained from the local environment.
      • 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.
      • getClientConfig

        public io.pravega.client.ClientConfig getClientConfig()
        Gets the ClientConfig to use with the Pravega client.
      • 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.
      • 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).
      • withScope

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

        @Nullable
        public java.lang.String getDefaultScope()
        Gets the default Pravega scope.
      • withCredentials

        public PravegaConfig withCredentials​(io.pravega.client.stream.impl.Credentials credentials)
        Configures the Pravega credentials to use.
        Parameters:
        credentials - a credentials object.
      • 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.