Skip to content

Commit a35fc38

Browse files
sumangala17ThomasMarquardt
authored andcommitted
HADOOP-17422: ABFS: Set default ListMaxResults to max server limit (#2535)
Contributed by Sumangala Patki TEST RESULTS: namespace.enabled=true auth.type=SharedKey ------------------- $mvn -T 1C -Dparallel-tests=abfs -Dscale -DtestsThreadCount=8 clean verify Tests run: 90, Failures: 0, Errors: 0, Skipped: 0 Tests run: 462, Failures: 0, Errors: 0, Skipped: 24 Tests run: 208, Failures: 0, Errors: 0, Skipped: 24 namespace.enabled=true auth.type=OAuth ------------------- $mvn -T 1C -Dparallel-tests=abfs -Dscale -DtestsThreadCount=8 clean verify Tests run: 90, Failures: 0, Errors: 0, Skipped: 0 Tests run: 462, Failures: 0, Errors: 0, Skipped: 70 Tests run: 208, Failures: 0, Errors: 0, Skipped: 141
1 parent 5ab1db9 commit a35fc38

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/constants/FileSystemConfigurations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public final class FileSystemConfigurations {
6363
public static final int MAX_BUFFER_SIZE = 100 * ONE_MB; // 100 MB
6464
public static final long MAX_AZURE_BLOCK_SIZE = 256 * 1024 * 1024L; // changing default abfs blocksize to 256MB
6565
public static final String AZURE_BLOCK_LOCATION_HOST_DEFAULT = "localhost";
66-
public static final int DEFAULT_AZURE_LIST_MAX_RESULTS = 500;
66+
public static final int DEFAULT_AZURE_LIST_MAX_RESULTS = 5000;
6767

6868
public static final int MAX_CONCURRENT_READ_THREADS = 12;
6969
public static final int MAX_CONCURRENT_WRITE_THREADS = 8;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ Please refer the following links for further information.
848848
listStatus API fetches the FileStatus information from server in a page by page
849849
manner. The config `fs.azure.list.max.results` used to set the maxResults URI
850850
param which sets the pagesize(maximum results per call). The value should
851-
be > 0. By default this will be 500. Server has a maximum value for this
851+
be > 0. By default this will be 5000. Server has a maximum value for this
852852
parameter as 5000. So even if the config is above 5000 the response will only
853853
contain 5000 entries. Please refer the following link for further information.
854854
https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/list

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@
2929

3030
import org.junit.Test;
3131

32+
import org.apache.hadoop.conf.Configuration;
33+
import org.apache.hadoop.fs.FileSystem;
3234
import org.apache.hadoop.fs.FSDataOutputStream;
3335
import org.apache.hadoop.fs.FileStatus;
3436
import org.apache.hadoop.fs.LocatedFileStatus;
3537
import org.apache.hadoop.fs.Path;
3638
import org.apache.hadoop.fs.contract.ContractTestUtils;
3739

40+
import static org.apache.hadoop.fs.azurebfs.constants.ConfigurationKeys.AZURE_LIST_MAX_RESULTS;
3841
import static org.apache.hadoop.fs.contract.ContractTestUtils.assertMkdirs;
3942
import static org.apache.hadoop.fs.contract.ContractTestUtils.createFile;
4043
import static org.apache.hadoop.fs.contract.ContractTestUtils.assertPathExists;
@@ -55,7 +58,10 @@ public ITestAzureBlobFileSystemListStatus() throws Exception {
5558

5659
@Test
5760
public void testListPath() throws Exception {
58-
final AzureBlobFileSystem fs = getFileSystem();
61+
Configuration config = new Configuration(this.getRawConfiguration());
62+
config.set(AZURE_LIST_MAX_RESULTS, "5000");
63+
final AzureBlobFileSystem fs = (AzureBlobFileSystem) FileSystem
64+
.newInstance(getFileSystem().getUri(), config);
5965
final List<Future<Void>> tasks = new ArrayList<>();
6066

6167
ExecutorService es = Executors.newFixedThreadPool(10);

0 commit comments

Comments
 (0)