HADOOP-18408. ABFS: ITestAbfsManifestCommitProtocol fails on nonHNS configuration (#4758)

ITestAbfsManifestCommitProtocol  to set requireRenameResilience to false for nonHNS configuration

Contributed by Sree Bhattacharyya
This commit is contained in:
sreeb-msft 2022-09-02 17:03:12 +05:30 committed by Steve Loughran
parent 9dffa65021
commit 5f3bc4340e
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
3 changed files with 22 additions and 5 deletions

View File

@ -115,7 +115,7 @@ public class TestRenameStageFailure extends AbstractManifestCommitterTest {
* Does this test suite require rename resilience in the store/FS?
* @return true if the store operations are resilient.
*/
protected boolean requireRenameResilience() {
protected boolean requireRenameResilience() throws IOException {
return false;
}

View File

@ -149,6 +149,17 @@ public abstract class AbstractAbfsIntegrationTest extends
return fs.getIsNamespaceEnabled(getTestTracingContext(fs, false));
}
public static TracingContext getSampleTracingContext(AzureBlobFileSystem fs,
boolean needsPrimaryReqId) {
String correlationId, fsId;
TracingHeaderFormat format;
correlationId = "test-corr-id";
fsId = "test-filesystem-id";
format = TracingHeaderFormat.ALL_ID_FORMAT;
return new TracingContext(correlationId, fsId,
FSOperationType.TEST_OP, needsPrimaryReqId, format, null);
}
public TracingContext getTestTracingContext(AzureBlobFileSystem fs,
boolean needsPrimaryReqId) {
String correlationId, fsId;
@ -167,7 +178,6 @@ public abstract class AbstractAbfsIntegrationTest extends
FSOperationType.TEST_OP, needsPrimaryReqId, format, null);
}
@Before
public void setup() throws Exception {
//Create filesystem first to make sure getWasbFileSystem() can return an existing filesystem.

View File

@ -19,11 +19,13 @@
package org.apache.hadoop.fs.azurebfs.commit;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.azurebfs.AbstractAbfsIntegrationTest;
import org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem;
import org.apache.hadoop.fs.azurebfs.contract.ABFSContractTestBinding;
import org.apache.hadoop.fs.azurebfs.contract.AbfsFileSystemContract;
import org.apache.hadoop.fs.azurebfs.contracts.exceptions.AzureBlobFileSystemException;
import org.apache.hadoop.fs.contract.AbstractFSContract;
import org.apache.hadoop.mapreduce.lib.output.committer.manifest.TestRenameStageFailure;
/**
* Rename failure logic on ABFS.
* This will go through the resilient rename operation.
@ -41,6 +43,11 @@ public class ITestAbfsRenameStageFailure extends TestRenameStageFailure {
binding = new ABFSContractTestBinding();
}
protected boolean isNamespaceEnabled() throws AzureBlobFileSystemException {
AzureBlobFileSystem fs = (AzureBlobFileSystem) getFileSystem();
return fs.getAbfsStore().getIsNamespaceEnabled(AbstractAbfsIntegrationTest.getSampleTracingContext(fs, false));
}
@Override
public void setup() throws Exception {
binding.setup();
@ -58,8 +65,8 @@ public class ITestAbfsRenameStageFailure extends TestRenameStageFailure {
}
@Override
protected boolean requireRenameResilience() {
return true;
protected boolean requireRenameResilience() throws AzureBlobFileSystemException {
return isNamespaceEnabled();
}
@Override