com.facebook.presto.hive.s3.PrestoS3FileSystem Java Examples

The following examples show how to use com.facebook.presto.hive.s3.PrestoS3FileSystem. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PrestoS3FileSystemTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private static void validateBasicCredentials(FileSystem fs) throws Exception {
	assertTrue(fs instanceof FlinkS3FileSystem);

	org.apache.hadoop.fs.FileSystem hadoopFs = ((FlinkS3FileSystem) fs).getHadoopFileSystem();
	assertTrue(hadoopFs instanceof PrestoS3FileSystem);

	try (PrestoS3FileSystem prestoFs = (PrestoS3FileSystem) hadoopFs) {
		AWSCredentialsProvider provider = getAwsCredentialsProvider(prestoFs);
		assertTrue(provider instanceof AWSStaticCredentialsProvider);
	}
}
 
Example #2
Source File: PrestoS3FileSystemTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private static AWSCredentialsProvider getAwsCredentialsProvider(PrestoS3FileSystem fs) throws Exception {
	Field amazonS3field = PrestoS3FileSystem.class.getDeclaredField("s3");
	amazonS3field.setAccessible(true);
	AmazonS3Client amazonS3 = (AmazonS3Client) amazonS3field.get(fs);

	Field providerField = AmazonS3Client.class.getDeclaredField("awsCredentialsProvider");
	providerField.setAccessible(true);
	return (AWSCredentialsProvider) providerField.get(amazonS3);
}
 
Example #3
Source File: PrestoS3FileSystemTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private static void validateBasicCredentials(FileSystem fs) throws Exception {
	assertTrue(fs instanceof FlinkS3FileSystem);

	org.apache.hadoop.fs.FileSystem hadoopFs = ((FlinkS3FileSystem) fs).getHadoopFileSystem();
	assertTrue(hadoopFs instanceof PrestoS3FileSystem);

	try (PrestoS3FileSystem prestoFs = (PrestoS3FileSystem) hadoopFs) {
		AWSCredentialsProvider provider = getAwsCredentialsProvider(prestoFs);
		assertTrue(provider instanceof AWSStaticCredentialsProvider);
	}
}
 
Example #4
Source File: PrestoS3FileSystemTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private static AWSCredentialsProvider getAwsCredentialsProvider(PrestoS3FileSystem fs) throws Exception {
	Field amazonS3field = PrestoS3FileSystem.class.getDeclaredField("s3");
	amazonS3field.setAccessible(true);
	AmazonS3Client amazonS3 = (AmazonS3Client) amazonS3field.get(fs);

	Field providerField = AmazonS3Client.class.getDeclaredField("awsCredentialsProvider");
	providerField.setAccessible(true);
	return (AWSCredentialsProvider) providerField.get(amazonS3);
}
 
Example #5
Source File: PrestoS3FileSystemTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private static void validateBasicCredentials(FileSystem fs) throws Exception {
	assertTrue(fs instanceof FlinkS3FileSystem);

	org.apache.hadoop.fs.FileSystem hadoopFs = ((FlinkS3FileSystem) fs).getHadoopFileSystem();
	assertTrue(hadoopFs instanceof PrestoS3FileSystem);

	try (PrestoS3FileSystem prestoFs = (PrestoS3FileSystem) hadoopFs) {
		AWSCredentialsProvider provider = getAwsCredentialsProvider(prestoFs);
		assertTrue(provider instanceof AWSStaticCredentialsProvider);
	}
}
 
Example #6
Source File: PrestoS3FileSystemTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private static AWSCredentialsProvider getAwsCredentialsProvider(PrestoS3FileSystem fs) throws Exception {
	Field amazonS3field = PrestoS3FileSystem.class.getDeclaredField("s3");
	amazonS3field.setAccessible(true);
	AmazonS3Client amazonS3 = (AmazonS3Client) amazonS3field.get(fs);

	Field providerField = AmazonS3Client.class.getDeclaredField("awsCredentialsProvider");
	providerField.setAccessible(true);
	return (AWSCredentialsProvider) providerField.get(amazonS3);
}
 
Example #7
Source File: S3FileSystemFactory.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
protected org.apache.hadoop.fs.FileSystem createHadoopFileSystem() {
	return new PrestoS3FileSystem();
}
 
Example #8
Source File: S3FileSystemFactory.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected org.apache.hadoop.fs.FileSystem createHadoopFileSystem() {
	return new PrestoS3FileSystem();
}
 
Example #9
Source File: S3FileSystemFactory.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected org.apache.hadoop.fs.FileSystem createHadoopFileSystem() {
	return new PrestoS3FileSystem();
}