public class SnowflakeS3Client extends Object
| Constructor and Description |
|---|
SnowflakeS3Client(com.amazonaws.auth.AWSCredentials awsCredentials,
com.amazonaws.ClientConfiguration clientConfig,
net.snowflake.common.core.S3FileEncryptionMaterial encMat,
String stageRegion) |
| Modifier and Type | Method and Description |
|---|---|
static void |
download(SnowflakeS3Client client,
SFSession connection,
String command,
String localLocation,
String destFileName,
int parallelism,
String bucketName,
String stageFilePath,
String stageRegion)
Download a file from S3.
|
int |
getEncryptionKeySize() |
com.amazonaws.services.s3.model.ObjectMetadata |
getObjectMetadata(String bucketName,
String prefix) |
boolean |
isEncrypting() |
com.amazonaws.services.s3.model.ObjectListing |
listObjects(String bucketName,
String prefix) |
void |
shutdown() |
static void |
upload(SnowflakeS3Client client,
SFSession connection,
String command,
int parallelism,
int maxRetries,
boolean uploadFromStream,
String bucketName,
File srcFile,
String destFileName,
InputStream inputStream,
FileBackedOutputStream fileBackedOutputStream,
com.amazonaws.services.s3.model.ObjectMetadata meta,
String stageRegion)
Upload a file (-stream) to S3.
|
public SnowflakeS3Client(com.amazonaws.auth.AWSCredentials awsCredentials,
com.amazonaws.ClientConfiguration clientConfig,
net.snowflake.common.core.S3FileEncryptionMaterial encMat,
String stageRegion)
throws SnowflakeSQLException
SnowflakeSQLExceptionpublic boolean isEncrypting()
public int getEncryptionKeySize()
public void shutdown()
public com.amazonaws.services.s3.model.ObjectListing listObjects(String bucketName, String prefix) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
com.amazonaws.AmazonClientExceptioncom.amazonaws.AmazonServiceExceptionpublic com.amazonaws.services.s3.model.ObjectMetadata getObjectMetadata(String bucketName, String prefix) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
com.amazonaws.AmazonClientExceptioncom.amazonaws.AmazonServiceExceptionpublic static void download(SnowflakeS3Client client, SFSession connection, String command, String localLocation, String destFileName, int parallelism, String bucketName, String stageFilePath, String stageRegion) throws SnowflakeSQLException
client - s3 client instanceconnection - connection objectcommand - command to download filelocalLocation - local file pathdestFileName - destination file nameparallelism - number of threads for parallel downloadingbucketName - s3 bucket namestageFilePath - stage file pathstageRegion - region name where the stage persistsSnowflakeSQLException - if download failed without an exceptionSnowflakeSQLException - if failed to decrypt downloaded fileSnowflakeSQLException - if file metadata is incompletepublic static void upload(SnowflakeS3Client client, SFSession connection, String command, int parallelism, int maxRetries, boolean uploadFromStream, String bucketName, File srcFile, String destFileName, InputStream inputStream, FileBackedOutputStream fileBackedOutputStream, com.amazonaws.services.s3.model.ObjectMetadata meta, String stageRegion) throws SnowflakeSQLException
client - client object used to communicate with s3connection - connection objectcommand - upload commandparallelism - number of threads do parallel uploadingmaxRetries - max number of retries if upload faileduploadFromStream - true if upload source is streambucketName - s3 bucket namesrcFile - source file if not uploading from a streamdestFileName - file name on s3 after uploadinputStream - stream used for uploading if fileBackedOutputStream is nullfileBackedOutputStream - stream used for uploading if not nullmeta - object meta datastageRegion - region name where the stage persistsSnowflakeSQLException - if upload failed even after retryCopyright © 2017. All rights reserved.