HADOOP-18408. ABFS: ITestAbfsManifestCommitProtocol fails on nonHNS configuration (#4758)
ITestAbfsManifestCommitProtocol to set requireRenameResilience to false for nonHNS configuration (#4758) Contributed by Sree Bhattacharyya
This commit is contained in:
parent
37e213c3fc
commit
c48ed3e96c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue