use of org.apache.hudi.common.config.HoodieConfig in project hudi by apache.
the class TestHoodieAWSCredentialsProviderFactory method testGetAWSCredentials.
@Test
public void testGetAWSCredentials() {
HoodieConfig cfg = new HoodieConfig();
cfg.setValue(HoodieAWSConfig.AWS_ACCESS_KEY, "random-access-key");
cfg.setValue(HoodieAWSConfig.AWS_SECRET_KEY, "random-secret-key");
cfg.setValue(HoodieAWSConfig.AWS_SESSION_TOKEN, "random-session-token");
BasicSessionCredentials credentials = (BasicSessionCredentials) org.apache.hudi.aws.credentials.HoodieAWSCredentialsProviderFactory.getAwsCredentialsProvider(cfg.getProps()).getCredentials();
assertEquals("random-access-key", credentials.getAWSAccessKeyId());
assertEquals("random-secret-key", credentials.getAWSSecretKey());
assertEquals("random-session-token", credentials.getSessionToken());
}
use of org.apache.hudi.common.config.HoodieConfig in project hudi by apache.
the class TestUpgradeDowngrade method assertTableVersionFromPropertyFile.
private void assertTableVersionFromPropertyFile(HoodieTableVersion expectedVersion) throws IOException {
Path propertyFile = new Path(metaClient.getMetaPath() + "/" + HoodieTableConfig.HOODIE_PROPERTIES_FILE);
// Load the properties and verify
FSDataInputStream fsDataInputStream = metaClient.getFs().open(propertyFile);
HoodieConfig hoodieConfig = HoodieConfig.create(fsDataInputStream);
fsDataInputStream.close();
assertEquals(Integer.toString(expectedVersion.versionCode()), hoodieConfig.getString(HoodieTableConfig.VERSION));
}
use of org.apache.hudi.common.config.HoodieConfig in project hudi by apache.
the class TestUpgradeDowngradeCommand method assertTableVersionFromPropertyFile.
private void assertTableVersionFromPropertyFile() throws IOException {
Path propertyFile = new Path(metaClient.getMetaPath() + "/" + HoodieTableConfig.HOODIE_PROPERTIES_FILE);
// Load the properties and verify
FSDataInputStream fsDataInputStream = metaClient.getFs().open(propertyFile);
HoodieConfig hoodieConfig = HoodieConfig.create(fsDataInputStream);
fsDataInputStream.close();
assertEquals(Integer.toString(HoodieTableVersion.ZERO.versionCode()), hoodieConfig.getString(HoodieTableConfig.VERSION));
}
Aggregations