From 5f2d07af1bdfe4a482d98af1504008e0ae9408be Mon Sep 17 00:00:00 2001 From: Arun Singh Date: Fri, 19 Jul 2019 20:21:28 -0700 Subject: [PATCH] HADOOP-16404. ABFS default blocksize change(256MB from 512MB) Contributed by: Arun Singh --- .../fs/azurebfs/constants/FileSystemConfigurations.java | 2 +- .../fs/azurebfs/TestAbfsConfigurationFieldsValidation.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/constants/FileSystemConfigurations.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/constants/FileSystemConfigurations.java index 97443079b1b..a2a0064e799 100644 --- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/constants/FileSystemConfigurations.java +++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/constants/FileSystemConfigurations.java @@ -44,7 +44,7 @@ public final class FileSystemConfigurations { public static final int DEFAULT_READ_BUFFER_SIZE = 4 * ONE_MB; // 4 MB public static final int MIN_BUFFER_SIZE = 16 * ONE_KB; // 16 KB public static final int MAX_BUFFER_SIZE = 100 * ONE_MB; // 100 MB - public static final long MAX_AZURE_BLOCK_SIZE = 512 * 1024 * 1024L; + public static final long MAX_AZURE_BLOCK_SIZE = 256 * 1024 * 1024L; // changing default abfs blocksize to 256MB public static final String AZURE_BLOCK_LOCATION_HOST_DEFAULT = "localhost"; public static final int MAX_CONCURRENT_READ_THREADS = 12; diff --git a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/TestAbfsConfigurationFieldsValidation.java b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/TestAbfsConfigurationFieldsValidation.java index eeed6cec872..9848228f0d5 100644 --- a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/TestAbfsConfigurationFieldsValidation.java +++ b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/TestAbfsConfigurationFieldsValidation.java @@ -143,6 +143,12 @@ public class TestAbfsConfigurationFieldsValidation { assertEquals(AZURE_BLOCK_LOCATION_HOST_DEFAULT, abfsConfiguration.getAzureBlockLocationHost()); } + @Test + public void testConfigBlockSizeInitialized() throws Exception { + // test the block size annotated field has been initialized in the constructor + assertEquals(MAX_AZURE_BLOCK_SIZE, abfsConfiguration.getAzureBlockSize()); + } + @Test public void testGetAccountKey() throws Exception { String accountKey = abfsConfiguration.getStorageAccountKey();