[
https://issues.apache.org/jira/browse/HADOOP-13972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16363858#comment-16363858
]
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_r168154574
--- Diff:
hadoop-tools/hadoop-azure-datalake/src/main/java/org/apache/hadoop/fs/adl/AdlFileSystem.java
---
@@ -985,4 +995,65 @@ public void setUserGroupRepresentationAsUPN(boolean
enableUPN) {
oidOrUpn = enableUPN ? UserGroupRepresentation.UPN :
UserGroupRepresentation.OID;
}
+
+ /**
+ * Gets ADL account name from ADL FQDN
+ * @param accountFQDN ADL account fqdn
+ * @return ADL account name
+ */
+ public static String getAccountNameFromFQDN(String accountFQDN) {
+ return accountFQDN.contains(".")
+ ? accountFQDN.substring(0, accountFQDN.indexOf("."))
+ : accountFQDN;
+ }
+
+ /**
+ * Propagates account-specific settings into generic ADL configuration
keys.
+ * This is done by propagating the values of the form
+ * {@code fs.adl.account.${account_name}.key} to
+ * {@code fs.adl.key}, for all values of "key"
+ *
+ * The source of the updated property is set to the key name of the
account
+ * property, to aid in diagnostics of where things came from.
+ *
+ * Returns a new configuration. Why the clone?
+ * You can use the same conf for different filesystems, and the original
+ * values are not updated.
+ *
+ *
+ * @param source Source Configuration object
+ * @param accountName account name. Must not be empty
+ * @return a (potentially) patched clone of the original
+ * @throws IOException
+ */
+ public static Configuration propagateAccountOptions(
+ Configuration source, String accountName) throws IOException {
+ if (StringUtils.isEmpty(accountName)) {
+ throw new IOException("Account name cannot be empty");
--- End diff --
We're generally happy with {{Precondition.checkArgument()}} here, which
raises IllegalArgumentException. Best just to use that, unless you have tests
which look for the specific exception
> 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
> Assignee: Sharad Sonker
> 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]