[
https://issues.apache.org/jira/browse/HADOOP-13972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16362307#comment-16362307
]
ASF GitHub Bot commented on HADOOP-13972:
-----------------------------------------
Github user steveloughran commented on a diff in the pull request:
https://github.com/apache/hadoop/pull/339#discussion_r167862195
--- Diff:
hadoop-tools/hadoop-azure-datalake/src/test/java/org/apache/hadoop/fs/adl/TestValidateConfiguration.java
---
@@ -152,6 +152,95 @@ public void testLoadDeprecatedKeys()
assertDeprecatedKeys(conf);
}
+ @Test
+ public void testGetAccountNameFromFQDN() {
+ Assert.assertEquals("dummy", AdlFileSystem.
+ getAccountNameFromFQDN("dummy.azuredatalakestore.net"));
+ Assert.assertEquals("localhost", AdlFileSystem.
+ getAccountNameFromFQDN("localhost"));
+ }
+
+ @Test
+ public void testPropagateAccountOptionsDefault() throws IOException {
+ Configuration conf = new Configuration(false);
+ conf.set("fs.adl.oauth2.client.id", "defaultClientId");
+ conf.set("fs.adl.oauth2.credential", "defaultCredential");
+ conf.set("some.other.config", "someValue");
+ Configuration propagatedConf =
+ AdlFileSystem.propagateAccountOptions(conf, "dummy");
+ Assert.assertEquals("defaultClientId",
+ propagatedConf.get(AZURE_AD_CLIENT_ID_KEY));
+ Assert.assertEquals("defaultCredential",
+ propagatedConf.get(AZURE_AD_CLIENT_SECRET_KEY));
+ Assert.assertEquals("someValue",
+ propagatedConf.get("some.other.config"));
+ }
+
+ @Test
+ public void testPropagateAccountOptionsSpecified() throws IOException {
+ Configuration conf = new Configuration(false);
+ conf.set("fs.adl.account.dummy.oauth2.client.id", "dummyClientId");
+ conf.set("fs.adl.account.dummy.oauth2.credential", "dummyCredential");
+ conf.set("some.other.config", "someValue");
+
+ Configuration propagatedConf =
+ AdlFileSystem.propagateAccountOptions(conf, "dummy");
+ Assert.assertEquals("dummyClientId",
--- End diff --
just statically import Assert, or have the test case extend Assert
> ADLS to support per-store configuration
> ---------------------------------------
>
> Key: HADOOP-13972
> URL: https://issues.apache.org/jira/browse/HADOOP-13972
> Project: Hadoop Common
> Issue Type: Improvement
> Components: fs/adl
> Affects Versions: 3.0.0-alpha2
> Reporter: John Zhuge
> Priority: Major
>
> Useful when distcp needs to access 2 Data Lake stores with different SPIs.
> Of course, a workaround is to grant the same SPI access permission to both
> stores, but sometimes it might not be feasible.
> One idea is to embed the store name in the configuration property names,
> e.g., {{dfs.adls.oauth2.<store>.client.id}}. Per-store keys will be consulted
> first, then fall back to the global keys.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]