Skip to content

Commit 6651d38

Browse files
committed
comment suggestions
1 parent a01beb7 commit 6651d38

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

hadoop-tools/hadoop-azure/src/site/markdown/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,9 @@ To know more about how SAS Authentication works refer to
652652

653653
There are three types of SAS supported by Azure Storage:
654654
- [User Delegation SAS](https://learn.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas):
655-
Recommended for use with ABFS Driver with HNS Enabled ADLS Gen2 accounts. It
656-
is Identity based SAS that works at blob/directory level)
655+
SAS-based authentication works with HNS-enabled ADLS Gen2 accounts
656+
(recommended for use with ABFS) and is also supported with non-HNS (FNS) Blob
657+
accounts. However, it is **NOT SUPPORTED** with FNS-DFS accounts.
657658
- [Service SAS](https://learn.microsoft.com/en-us/rest/api/storageservices/create-service-sas): Global and works at container level.
658659
- [Account SAS](https://learn.microsoft.com/en-us/rest/api/storageservices/create-account-sas): Global and works at account level.
659660

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemDelegationSAS.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public ITestAzureBlobFileSystemDelegationSAS() throws Exception {
9797
public void setup() throws Exception {
9898
isHNSEnabled = this.getConfiguration().getBoolean(
9999
TestConfigurationKeys.FS_AZURE_TEST_NAMESPACE_ENABLED_ACCOUNT, false);
100-
if(!isHNSEnabled){
100+
if (!isHNSEnabled) {
101101
assumeBlobServiceType();
102102
}
103103
createFilesystemForSASTests();
@@ -308,6 +308,7 @@ public void testList() throws Exception {
308308
final AzureBlobFileSystem fs = getFileSystem();
309309
Path dirPath = new Path(UUID.randomUUID().toString());
310310
Path filePath = new Path(dirPath, UUID.randomUUID().toString());
311+
Path filePath2 = new Path(dirPath, UUID.randomUUID().toString());
311312

312313
fs.mkdirs(dirPath);
313314

@@ -316,6 +317,11 @@ public void testList() throws Exception {
316317
stream.writeBytes("hello");
317318
}
318319

320+
// create file with content "bye"
321+
try (FSDataOutputStream stream = fs.create(filePath2)) {
322+
stream.writeBytes("bye");
323+
}
324+
319325
fs.listStatus(filePath);
320326
fs.listStatus(dirPath);
321327
fs.listStatus(new Path("/"));

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/utils/DelegationSASGenerator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.apache.hadoop.fs.azurebfs.extensions.SASTokenProvider;
2525
import org.apache.hadoop.fs.azurebfs.services.AbfsUriQueryBuilder;
2626

27+
import static org.apache.hadoop.fs.azurebfs.constants.AbfsHttpConstants.ROOT_PATH;
2728

2829
/**
2930
* Test Delegation SAS generator.
@@ -70,7 +71,7 @@ public String getDelegationSAS(String accountName, String containerName, String
7071
case SASTokenProvider.DELETE_RECURSIVE_OPERATION:
7172
sp = "d";
7273
sr = "d";
73-
sdd = path.equals("/")? "0": Integer.toString(StringUtils.countMatches(path, "/"));
74+
sdd = path.equals(ROOT_PATH)? "0": Integer.toString(StringUtils.countMatches(path, "/"));
7475
break;
7576
case SASTokenProvider.CHECK_ACCESS_OPERATION:
7677
case SASTokenProvider.GET_ACL_OPERATION:
@@ -84,7 +85,7 @@ public String getDelegationSAS(String accountName, String containerName, String
8485
case SASTokenProvider.LIST_OPERATION:
8586
sp = "l";
8687
sr = "d";
87-
sdd = path.equals("/")? "0": Integer.toString(StringUtils.countMatches(path, "/"));
88+
sdd = path.equals(ROOT_PATH)? "0": Integer.toString(StringUtils.countMatches(path, "/"));
8889
break;
8990
case SASTokenProvider.GET_PROPERTIES_OPERATION:
9091
case SASTokenProvider.READ_OPERATION:

0 commit comments

Comments
 (0)