Package org.apache.beam.sdk.io.snowflake
Class SnowflakeIO.DataSourceConfiguration
java.lang.Object
org.apache.beam.sdk.io.snowflake.SnowflakeIO.DataSourceConfiguration
- All Implemented Interfaces:
Serializable
- Enclosing class:
SnowflakeIO
public abstract static class SnowflakeIO.DataSourceConfiguration
extends Object
implements Serializable
A POJO describing a
DataSource
, providing all properties allowing to create a DataSource
.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuildsSnowflakeBasicDataSource
based on the current configuration.create()
create
(DataSource dataSource) CreatesSnowflakeIO.DataSourceConfiguration
from existing instance ofDataSource
.abstract String
abstract ValueProvider
<String> abstract DataSource
abstract Integer
abstract ValueProvider
<String> abstract ValueProvider
<String> abstract Integer
abstract PrivateKey
abstract ValueProvider
<String> abstract ValueProvider
<String> abstract ValueProvider
<String> getRole()
abstract ValueProvider
<String> abstract ValueProvider
<String> abstract Boolean
getSsl()
abstract String
getUrl()
abstract ValueProvider
<String> abstract ValueProvider
<String> withAuthenticator
(String authenticator) Sets authenticator for Snowflake.withDatabase
(String database) Sets database to use.withDatabase
(ValueProvider<String> database) withKeyPairAuth
(String username, PrivateKey privateKey) Sets key pair authentication.withKeyPairPathAuth
(String username, String privateKeyPath) Sets key pair authentication.withKeyPairPathAuth
(String username, String privateKeyPath, String privateKeyPassphrase) Sets key pair authentication.withKeyPairPathAuth
(ValueProvider<String> username, String privateKeyPath) Sets key pair authentication.withKeyPairPathAuth
(ValueProvider<String> username, String privateKeyPath, ValueProvider<String> privateKeyPassphrase) Sets key pair authentication.withKeyPairRawAuth
(String username, String rawPrivateKey) Sets key pair authentication.withKeyPairRawAuth
(String username, String rawPrivateKey, String privateKeyPassphrase) Sets key pair authentication.withKeyPairRawAuth
(ValueProvider<String> username, ValueProvider<String> rawPrivateKey) Sets key pair authentication.withKeyPairRawAuth
(ValueProvider<String> username, ValueProvider<String> rawPrivateKey, ValueProvider<String> privateKeyPassphrase) Sets key pair authentication.withLoginTimeout
(Integer loginTimeout) Sets loginTimeout that will be used inSnowflakeBasicDataSource.setLoginTimeout(int)
.Sets OAuth authentication.withOAuth
(ValueProvider<String> token) Sets OAuth authentication.withPortNumber
(Integer portNumber) Sets port number to use to connect to Snowflake.Sets user's role to be used when running queries on Snowflake.withRole
(ValueProvider<String> role) Sets user's role to be used when running queries on Snowflake.withSchema
(String schema) Sets schema to use when connecting to Snowflake.withSchema
(ValueProvider<String> schema) withServerName
(String serverName) Sets the name of the Snowflake server.withServerName
(ValueProvider<String> serverName) Sets URL of Snowflake server in following format: jdbc:snowflake://.snowflakecomputing.com withUsernamePasswordAuth
(String username, String password) Sets username/password authentication.withUsernamePasswordAuth
(ValueProvider<String> username, ValueProvider<String> password) Sets username/password authentication.withWarehouse
(String warehouse) Sets Snowflake Warehouse to use.withWarehouse
(ValueProvider<String> warehouse) Sets Snowflake Warehouse to use.
-
Constructor Details
-
DataSourceConfiguration
public DataSourceConfiguration()
-
-
Method Details
-
getUrl
-
getUsername
-
getPassword
-
getPrivateKey
-
getRawPrivateKey
-
getPrivateKeyPassphrase
-
getOauthToken
-
getDatabase
-
getWarehouse
-
getSchema
-
getServerName
-
getPortNumber
-
getRole
-
getAuthenticator
-
getLoginTimeout
-
getSsl
-
getDataSource
-
create
-
create
CreatesSnowflakeIO.DataSourceConfiguration
from existing instance ofDataSource
.- Parameters:
dataSource
- - an instance ofDataSource
.
-
withUsernamePasswordAuth
public SnowflakeIO.DataSourceConfiguration withUsernamePasswordAuth(String username, String password) Sets username/password authentication.- Parameters:
username
- - Snowflake username.password
- - Password for provided Snowflake username.
-
withUsernamePasswordAuth
public SnowflakeIO.DataSourceConfiguration withUsernamePasswordAuth(ValueProvider<String> username, ValueProvider<String> password) Sets username/password authentication.- Parameters:
username
- - Snowflake username.password
- - Password for provided Snowflake username.
-
withOAuth
Sets OAuth authentication.- Parameters:
token
- - OAuth token.
-
withOAuth
Sets OAuth authentication.- Parameters:
token
- - OAuth token.
-
withKeyPairAuth
Sets key pair authentication.- Parameters:
username
- - Snowflake username.privateKey
- - Private key.
-
withKeyPairPathAuth
public SnowflakeIO.DataSourceConfiguration withKeyPairPathAuth(ValueProvider<String> username, String privateKeyPath, ValueProvider<String> privateKeyPassphrase) Sets key pair authentication.- Parameters:
username
- - Snowflake username.privateKeyPath
- - Private key path.privateKeyPassphrase
- - Passphrase for provided private key.
-
withKeyPairPathAuth
public SnowflakeIO.DataSourceConfiguration withKeyPairPathAuth(ValueProvider<String> username, String privateKeyPath) Sets key pair authentication.- Parameters:
username
- - Snowflake username.privateKeyPath
- - Private key path.
-
withKeyPairPathAuth
public SnowflakeIO.DataSourceConfiguration withKeyPairPathAuth(String username, String privateKeyPath, String privateKeyPassphrase) Sets key pair authentication.- Parameters:
username
- - Snowflake username.privateKeyPath
- - Private key path.privateKeyPassphrase
- - Passphrase for provided private key.
-
withKeyPairPathAuth
public SnowflakeIO.DataSourceConfiguration withKeyPairPathAuth(String username, String privateKeyPath) Sets key pair authentication.- Parameters:
username
- - Snowflake username.privateKeyPath
- - Private key path.
-
withKeyPairRawAuth
public SnowflakeIO.DataSourceConfiguration withKeyPairRawAuth(ValueProvider<String> username, ValueProvider<String> rawPrivateKey, ValueProvider<String> privateKeyPassphrase) Sets key pair authentication.- Parameters:
username
- - Snowflake username.rawPrivateKey
- - Raw private key.privateKeyPassphrase
- - Passphrase for provided private key.
-
withKeyPairRawAuth
public SnowflakeIO.DataSourceConfiguration withKeyPairRawAuth(ValueProvider<String> username, ValueProvider<String> rawPrivateKey) Sets key pair authentication.- Parameters:
username
- - Snowflake username.rawPrivateKey
- - Raw private key.
-
withKeyPairRawAuth
public SnowflakeIO.DataSourceConfiguration withKeyPairRawAuth(String username, String rawPrivateKey, String privateKeyPassphrase) Sets key pair authentication.- Parameters:
username
- - Snowflake username.rawPrivateKey
- - Raw private key.privateKeyPassphrase
- - Passphrase for provided private key.
-
withKeyPairRawAuth
public SnowflakeIO.DataSourceConfiguration withKeyPairRawAuth(String username, String rawPrivateKey) Sets key pair authentication.- Parameters:
username
- - Snowflake username.rawPrivateKey
- - Raw private key.
-
withUrl
Sets URL of Snowflake server in following format: jdbc:snowflake://.snowflakecomputing.com Either withUrl or withServerName is required.
- Parameters:
url
- String with URL of the Snowflake server.
-
withDatabase
Sets database to use.- Parameters:
database
- String with database name.
-
withDatabase
-
withWarehouse
Sets Snowflake Warehouse to use.- Parameters:
warehouse
- ValueProvider with warehouse name.
-
withWarehouse
Sets Snowflake Warehouse to use.- Parameters:
warehouse
- String with warehouse name.
-
withSchema
Sets schema to use when connecting to Snowflake.- Parameters:
schema
- String with schema name.
-
withSchema
-
withServerName
Sets the name of the Snowflake server. Following format is required:.snowflakecomputing.com Either withServerName or withUrl is required.
- Parameters:
serverName
- String with server name.
-
withServerName
-
withPortNumber
Sets port number to use to connect to Snowflake.- Parameters:
portNumber
- Integer with port number.
-
withRole
Sets user's role to be used when running queries on Snowflake.- Parameters:
role
- ValueProvider with role name.
-
withRole
Sets user's role to be used when running queries on Snowflake.- Parameters:
role
- String with role name.
-
withAuthenticator
Sets authenticator for Snowflake.- Parameters:
authenticator
- String with authenticator name.
-
withLoginTimeout
Sets loginTimeout that will be used inSnowflakeBasicDataSource.setLoginTimeout(int)
.- Parameters:
loginTimeout
- Integer with timeout value.
-
buildDatasource
BuildsSnowflakeBasicDataSource
based on the current configuration.
-