anujmodi2021 commented on code in PR #7421:
URL: https://github.com/apache/hadoop/pull/7421#discussion_r2013939076
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java:
##########
@@ -1753,4 +1772,87 @@ protected AbfsRestOperation getSuccessOp(final
AbfsRestOperationType operationTy
successOp.hardSetResult(HttpURLConnection.HTTP_OK);
return successOp;
}
+
+ private String getPrimaryUserGroup() throws AzureBlobFileSystemException {
+ String primaryUserGroup;
+ if
(!getAbfsConfiguration().getSkipUserGroupMetadataDuringInitialization()) {
+ try {
+ primaryUserGroup =
UserGroupInformation.getCurrentUser().getPrimaryGroupName();
+ } catch (IOException ex) {
+ LOG.error("Failed to get primary group for {}, using user name as
primary group name",
+ getPrimaryUser());
+ primaryUserGroup = getPrimaryUser();
+ }
+ } else {
+ //Provide a default group name
+ primaryUserGroup = getPrimaryUser();
+ }
+ return primaryUserGroup;
+ }
+
+ private String getPrimaryUser() throws AzureBlobFileSystemException {
+ try {
+ return UserGroupInformation.getCurrentUser().getUserName();
+ } catch (IOException ex) {
+ throw new AbfsDriverException(ex);
+ }
+ }
+
+ /**
+ * Creates a VersionedFileStatus object from the ListResultEntrySchema.
+ * @param entry ListResultEntrySchema object.
+ * @param uri to be used for the path conversion.
+ * @return VersionedFileStatus object.
+ * @throws AzureBlobFileSystemException if transformation fails.
+ */
+ protected VersionedFileStatus getVersionedFileStatusFromEntry(
+ ListResultEntrySchema entry, URI uri) throws
AzureBlobFileSystemException {
+ long blockSize = abfsConfiguration.getAzureBlockSize();
+ final String owner, group;
+ try{
+ if (identityTransformer != null) {
+ owner = identityTransformer.transformIdentityForGetRequest(
+ entry.owner(), true, getPrimaryUser());
+ group = identityTransformer.transformIdentityForGetRequest(
+ entry.group(), false, getPrimaryUserGroup());
+ } else {
+ owner = null;
Review Comment:
Makes sense.
Removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]