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

The following examples show how to use com.facebook.presto.hive.s3.PrestoS3FileSystem. These examples are extracted from open source projects. 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 Project: Flink-CEPplus   Source File: PrestoS3FileSystemTest.java    License: 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 Project: Flink-CEPplus   Source File: PrestoS3FileSystemTest.java    License: 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 Project: flink   Source File: PrestoS3FileSystemTest.java    License: 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 Project: flink   Source File: PrestoS3FileSystemTest.java    License: 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 Project: flink   Source File: PrestoS3FileSystemTest.java    License: 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 Project: flink   Source File: PrestoS3FileSystemTest.java    License: 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 Project: Flink-CEPplus   Source File: S3FileSystemFactory.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected org.apache.hadoop.fs.FileSystem createHadoopFileSystem() {
	return new PrestoS3FileSystem();
}
 
Example 8
Source Project: flink   Source File: S3FileSystemFactory.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected org.apache.hadoop.fs.FileSystem createHadoopFileSystem() {
	return new PrestoS3FileSystem();
}
 
Example 9
Source Project: flink   Source File: S3FileSystemFactory.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected org.apache.hadoop.fs.FileSystem createHadoopFileSystem() {
	return new PrestoS3FileSystem();
}