forked from apache/hadoop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CDPD-25021. HADOOP-17166. ABFS: configure output stream thread pool (a…
…pache#2179) Adds the options to control the size of the per-output-stream threadpool when writing data through the abfs connector * fs.azure.write.max.concurrent.requests * fs.azure.write.max.requests.to.queue Contributed by Bilahari T H Conflicts: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsOutputStream.java Change-Id: Iab45ca33cf903dc834b6867ac10f7936637c2c8a
- Loading branch information
1 parent
a6e1bf3
commit 829184c
Showing
8 changed files
with
163 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
...oop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestAbfsOutputStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.hadoop.fs.azurebfs.services; | ||
|
||
import org.assertj.core.api.Assertions; | ||
import org.junit.Test; | ||
|
||
import org.apache.hadoop.conf.Configuration; | ||
import org.apache.hadoop.fs.FSDataOutputStream; | ||
import org.apache.hadoop.fs.Path; | ||
import org.apache.hadoop.fs.azurebfs.AbstractAbfsIntegrationTest; | ||
import org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem; | ||
import org.apache.hadoop.fs.azurebfs.constants.ConfigurationKeys; | ||
|
||
/** | ||
* Test create operation. | ||
*/ | ||
public class ITestAbfsOutputStream extends AbstractAbfsIntegrationTest { | ||
private static final Path TEST_FILE_PATH = new Path("testfile"); | ||
|
||
public ITestAbfsOutputStream() throws Exception { | ||
super(); | ||
} | ||
|
||
@Test | ||
public void testMaxRequestsAndQueueCapacityDefaults() throws Exception { | ||
Configuration conf = getRawConfiguration(); | ||
final AzureBlobFileSystem fs = getFileSystem(conf); | ||
try (FSDataOutputStream out = fs.create(TEST_FILE_PATH)) { | ||
AbfsOutputStream stream = (AbfsOutputStream) out.getWrappedStream(); | ||
Assertions.assertThat(stream.getMaxConcurrentRequestCount()).describedAs( | ||
"maxConcurrentRequests should be " + getConfiguration() | ||
.getWriteMaxConcurrentRequestCount()) | ||
.isEqualTo(getConfiguration().getWriteMaxConcurrentRequestCount()); | ||
Assertions.assertThat(stream.getMaxRequestsThatCanBeQueued()).describedAs( | ||
"maxRequestsToQueue should be " + getConfiguration() | ||
.getMaxWriteRequestsToQueue()) | ||
.isEqualTo(getConfiguration().getMaxWriteRequestsToQueue()); | ||
} | ||
} | ||
|
||
@Test | ||
public void testMaxRequestsAndQueueCapacity() throws Exception { | ||
Configuration conf = getRawConfiguration(); | ||
int maxConcurrentRequests = 6; | ||
int maxRequestsToQueue = 10; | ||
conf.set(ConfigurationKeys.AZURE_WRITE_MAX_CONCURRENT_REQUESTS, | ||
"" + maxConcurrentRequests); | ||
conf.set(ConfigurationKeys.AZURE_WRITE_MAX_REQUESTS_TO_QUEUE, | ||
"" + maxRequestsToQueue); | ||
final AzureBlobFileSystem fs = getFileSystem(conf); | ||
FSDataOutputStream out = fs.create(TEST_FILE_PATH); | ||
AbfsOutputStream stream = (AbfsOutputStream) out.getWrappedStream(); | ||
Assertions.assertThat(stream.getMaxConcurrentRequestCount()) | ||
.describedAs("maxConcurrentRequests should be " + maxConcurrentRequests) | ||
.isEqualTo(maxConcurrentRequests); | ||
Assertions.assertThat(stream.getMaxRequestsThatCanBeQueued()) | ||
.describedAs("maxRequestsToQueue should be " + maxRequestsToQueue) | ||
.isEqualTo(maxRequestsToQueue); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters