Package io.pravega.connectors.flink
Class PravegaConfig
- java.lang.Object
-
- io.pravega.connectors.flink.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 boolean
equals(java.lang.Object o)
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 theClientConfig
to use with the Pravega client.io.pravega.shared.security.auth.Credentials
getCredentials()
Gets the Pravega schema registry URI.java.lang.String
getDefaultScope()
Gets the default Pravega scope.java.net.URI
getSchemaRegistryUri()
Gets the Pravega schema registry URI.int
hashCode()
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.shared.security.auth.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
withSchemaRegistryURI(java.net.URI schemaRegistryURI)
Configures the Pravega schema registry URI.PravegaConfig
withScope(java.lang.String scope)
Configures the self-defined Pravega scope.PravegaConfig
withTrustStore(java.lang.String trustStore)
Configures truststore value.
-
-
-
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 theClientConfig
to use with the Pravega client.- Returns:
- The Pravega
ClientConfig
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.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 thePravegaConfig
) 3. from the system propertypravega.scope
4. from the system environment variablePRAVEGA_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.
-
-