Skip to content

Conversation

@saxenapranav
Copy link

@saxenapranav saxenapranav commented Nov 14, 2022

  1. Resolutions to the comments on HADOOP-17912. ABFS: Support for Encryption Context apache/hadoop#3440
  2. Created a utility class NamespaceUtil class which has method isNamespaceEnabled for getting if the account is HNS or non-HNS. Has been moved out from https://github.com/apache/hadoop/blob/trunk/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java#L360-L377. Done so that utility method can be used by AbfsClient while deciding to attach CPK headers or not.

DelegatingSSLSocketFactory.SSLChannelMode. The default value will be
DelegatingSSLSocketFactory.SSLChannelMode.Default.

### <a name="encryptionconfigoptions"></a> Encryption Options
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the documentation added for 'Customer-Provided Global Key', 'Encryption Context Provider'.

Comment on lines -363 to -381
LOG.debug("Get root ACL status");
try (AbfsPerfInfo perfInfo = startTracking("getIsNamespaceEnabled",
"getAclStatus")) {
AbfsRestOperation op = client
.getAclStatus(AbfsHttpConstants.ROOT_PATH, tracingContext);
perfInfo.registerResult(op.getResult());
isNamespaceEnabled = Trilean.getTrilean(true);
perfInfo.registerSuccess(true);
} catch (AbfsRestOperationException ex) {
// Get ACL status is a HEAD request, its response doesn't contain
// errorCode
// So can only rely on its status code to determine its account type.
if (HttpURLConnection.HTTP_BAD_REQUEST != ex.getStatusCode()) {
throw ex;
}

isNamespaceEnabled = Trilean.getTrilean(false);
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tracingContext);
final AbfsRestOperation op = client
.getPathStatus(getRelativePath(path), true, tracingContext);
.getPathStatus(relativePath, true, tracingContext, encryptionAdapter);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

final AbfsRestOperation op = client
.setPathProperties(getRelativePath(path), commaSeparatedProperties,
tracingContext);
tracingContext, encryptionAdapter);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* have encryptionContext field when client's encryptionType is
* ENCRYPTION_CONTEXT.
* */
if ((fileStatus instanceof VersionedFileStatus) && (
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In-line with apache#3440 (comment). Here the expectation is that the:

  1. Fetch List of VersionFileStatus objects by listStatus API of the AzureBlobFileSystem.
  2. Use the fetchedStatus to be sent as an option while doing openWithOptions().

Tested in https://github.com/pranavsaxena-microsoft/hadoop/blob/HADOOP-17912-PR-Review-2/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsCustomEncryption.java#L273-L297.

eTag);
eTag,
encryptionContext);
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline with apache#3440 (comment). Need to have encryptionContext in VersionedFileStatus object.

entryPath,
entry.eTag()));
entry.eTag(),
encryptionContext));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline with apache#3440 (comment). Need to have encryptionContext in VersionedFileStatus object.

hasAcl, false, false);

this.version = version;
this.encryptionContext = encryptionContext;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline with apache#3440 (comment). Need to have encryptionContext in the VersionedFileStatus object.

List<AbfsHttpHeader> requestHeaders, boolean isCreateFileRequest,
EncryptionAdapter encryptionAdapter, TracingContext tracingContext)
throws IOException {
if(!getIsNamespaceEnabled(tracingContext)) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only to work with HNS account.

Comment on lines -251 to -270
} else if (encryptionAdapter == null) {
// get encryption context from GetPathStatus response header
byte[] encryptionContext;
try {
encryptionContext = getPathStatus(path, false, tracingContext)
.getResult().getResponseHeader(X_MS_ENCRYPTION_CONTEXT)
.getBytes(StandardCharsets.UTF_8);
} catch (NullPointerException e) {
LOG.debug("EncryptionContext not present in GetPathStatus response.");
throw new IOException(
"EncryptionContext not present in GetPathStatus response", e);
}
try {
encryptionAdapter = new EncryptionAdapter(encryptionContextProvider,
new Path(path).toUri().getPath(), encryptionContext);
encryptionAdapterCreated = true;
} catch (IOException e) {
LOG.debug("Could not initialize EncryptionAdapter");
throw e;
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline with apache#3440 (review). AbfsClient to not have heuristic to create encryptionAdapter.

final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders();
addEncryptionKeyRequestHeaders(path, requestHeaders, false,
null, tracingContext);
encryptionAdapter, tracingContext);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline with apache#3440 (review).

operation = SASTokenProvider.GET_STATUS_OPERATION;
} else {
addEncryptionKeyRequestHeaders(path, requestHeaders, false, null,
addEncryptionKeyRequestHeaders(path, requestHeaders, false, encryptionAdapter,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline with apache#3440 (review). AbfsClient to not heuristic on creating encryptionAdapter.

public Boolean isCpkResponseKeyExpected = false;

@Parameterized.Parameter(8)
public Boolean fileSystemListStatusResultToBeUsedForOpeningFile = false;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To test the integration where azureBlobFileSystem.listStatus api response is used as an option for openToReadWithOptions.

Inline with apache#3440 (comment)

{GLOBAL_KEY, NONE, FSOperationType.DELETE, false, false, false, false},
{GLOBAL_KEY, NONE, FSOperationType.SET_PERMISSION, false, false, false, false},
{ENCRYPTION_CONTEXT, ENCRYPTION_CONTEXT, FSOperationType.READ, true, false, false, true, false, false},
{ENCRYPTION_CONTEXT, ENCRYPTION_CONTEXT, FSOperationType.READ, true, false, false, true, false, true},
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using fileSystemListStatusResultToBeUsedForOpeningFile as true.

{ENCRYPTION_CONTEXT, ENCRYPTION_CONTEXT, FSOperationType.SET_ACL, false, false, false, false, false, false},
{ENCRYPTION_CONTEXT, ENCRYPTION_CONTEXT, FSOperationType.GET_ATTR, true, false, false, true, false, false},
{ENCRYPTION_CONTEXT, ENCRYPTION_CONTEXT, FSOperationType.SET_ATTR, false, true, false, true, false, false},
{ENCRYPTION_CONTEXT, ENCRYPTION_CONTEXT, FSOperationType.LISTSTATUS, false, false, false, false, true, false},
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having isCpkResponseKeyExpected as true.

public boolean isCpkResponseHdrExpected;

@Parameterized.Parameter(7)
public Boolean isCpkResponseKeyExpected = false;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if response is going to have cpk related values. Will be used in case of listsStatus. Ref: learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/list#pathlist

@saxenapranav
Copy link
Author


:::: AGGREGATED TEST RESULT ::::

HNS-OAuth

[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] TestAccountConfiguration.testConfigPropNotFound:386->testMissingConfigKey:399 Expected a org.apache.hadoop.fs.azurebfs.contracts.exceptions.TokenAccessProviderException to be thrown, but got the result: : "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider"
[INFO]
[ERROR] Tests run: 107, Failures: 1, Errors: 0, Skipped: 1
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITestAzureBlobFileSystemRandomRead.testSkipBounds:218->Assert.assertTrue:42->Assert.fail:89 There should not be any network I/O (elapsedTimeMs=124).
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:329 » TestTimedOut test timed o...
[ERROR] ITestAzureBlobFileSystemOauth.testBlobDataContributor:84 » AccessDenied Operat...
[ERROR] ITestAzureBlobFileSystemOauth.testBlobDataReader:143 » AccessDenied Operation ...
[INFO]
[ERROR] Tests run: 575, Failures: 1, Errors: 3, Skipped: 70
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITestReadBufferManager.testPurgeBufferManagerForParallelStreams:85 [After closing all streams free list contents should match with [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]]
Expected size:<16> but was:<9> in:
<[7, 8, 6, 4, 3, 5, 2, 1, 0]>
[ERROR] Errors:
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[INFO]
[ERROR] Tests run: 332, Failures: 1, Errors: 7, Skipped: 53

HNS-SharedKey

[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] TestAccountConfiguration.testConfigPropNotFound:386->testMissingConfigKey:399 Expected a org.apache.hadoop.fs.azurebfs.contracts.exceptions.TokenAccessProviderException to be thrown, but got the result: : "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider"
[INFO]
[ERROR] Tests run: 107, Failures: 1, Errors: 0, Skipped: 2
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITestAbfsRestOperationException.testCustomTokenFetchRetryCount:94->testWithDifferentCustomTokenFetchRetry:123->Assert.assertTrue:42->Assert.fail:89 Number of token fetch retries (4) done, does not match with fs.azure.custom.token.fetch.retry.count configured (0)
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:329 » TestTimedOut test timed o...
[INFO]
[ERROR] Tests run: 575, Failures: 1, Errors: 1, Skipped: 26
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITestReadBufferManager.testPurgeBufferManagerForParallelStreams:85 [After closing all streams free list contents should match with [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]]
Expected size:<16> but was:<14> in:
<[7, 15, 14, 13, 12, 11, 1, 2, 9, 4, 5, 8, 3, 10]>
[ERROR] Errors:
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[INFO]
[ERROR] Tests run: 332, Failures: 1, Errors: 7, Skipped: 41

NonHNS-SharedKey

[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] TestAccountConfiguration.testConfigPropNotFound:386->testMissingConfigKey:399 Expected a org.apache.hadoop.fs.azurebfs.contracts.exceptions.TokenAccessProviderException to be thrown, but got the result: : "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider"
[INFO]
[ERROR] Tests run: 107, Failures: 1, Errors: 0, Skipped: 2
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:336 » TestTimedOut test timed o...
[INFO]
[ERROR] Tests run: 559, Failures: 0, Errors: 1, Skipped: 268
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITestAbfsRenameStageFailure>TestRenameStageFailure.testResilienceAsExpected:126 [resilient commit support] expected:<[tru]e> but was:<[fals]e>
[ERROR] ITestReadBufferManager.testPurgeBufferManagerForParallelStreams:81->assertListEmpty:93 [After closing all streams InProgressList should be empty]
Expected size:<0> but was:<6> in:
<[org.apache.hadoop.fs.azurebfs.services.ReadBuffer@3c90b9de,
org.apache.hadoop.fs.azurebfs.services.ReadBuffer@377bbfe,
org.apache.hadoop.fs.azurebfs.services.ReadBuffer@347a2717,
org.apache.hadoop.fs.azurebfs.services.ReadBuffer@4efe3ac3,
org.apache.hadoop.fs.azurebfs.services.ReadBuffer@7719248b,
org.apache.hadoop.fs.azurebfs.services.ReadBuffer@490fd9dd]>
[ERROR] Errors:
[ERROR] ITestAbfsJobThroughManifestCommitter.test_0420_validateJob » OutputValidation ...
[ERROR] ITestAbfsManifestCommitProtocol.testCommitLifecycle » OutputValidation abfs:/... [ERROR] ITestAbfsManifestCommitProtocol.testCommitterWithDuplicatedCommit » OutputValidation [ERROR] ITestAbfsManifestCommitProtocol.testConcurrentCommitTaskWithSubDir » OutputValidation [ERROR] ITestAbfsManifestCommitProtocol.testMapFileOutputCommitter » OutputValidation ... [ERROR] ITestAbfsManifestCommitProtocol.testOutputFormatIntegration » OutputValidation [ERROR] ITestAbfsManifestCommitProtocol.testParallelJobsToAdjacentPaths » OutputValidation [ERROR] ITestAbfsManifestCommitProtocol.testTwoTaskAttemptsCommit » OutputValidation ...
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[INFO]
[ERROR] Tests run: 332, Failures: 2, Errors: 15, Skipped: 44

AppendBlob-HNS-OAuth

[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] TestAccountConfiguration.testConfigPropNotFound:386->testMissingConfigKey:399 Expected a org.apache.hadoop.fs.azurebfs.contracts.exceptions.TokenAccessProviderException to be thrown, but got the result: : "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider"
[INFO]
[ERROR] Tests run: 107, Failures: 1, Errors: 0, Skipped: 1
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITestAzureBlobFileSystemRandomRead.testSkipBounds:218->Assert.assertTrue:42->Assert.fail:89 There should not be any network I/O (elapsedTimeMs=31).
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:329 » TestTimedOut test timed o...
[ERROR] ITestAzureBlobFileSystemOauth.testBlobDataContributor:84 » AccessDenied Operat...
[ERROR] ITestAzureBlobFileSystemOauth.testBlobDataReader:143 » AccessDenied Operation ...
[INFO]
[ERROR] Tests run: 575, Failures: 1, Errors: 3, Skipped: 70
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITestAbfsFileSystemContractRename>AbstractContractRenameTest.testRenamePopulatesFileAncestors:278->AbstractContractRenameTest.validateAncestorsMoved:291->AbstractFSContractTestBase.assertPathDoesNotExist:330->Assert.fail:89 src path should not exist: unexpectedly found abfss://[email protected]/fork-0006/test/testRenamePopulatesFileAncestors/source/dir1/dir2/dir3/file4 as VersionedFileStatus{VersionedFileStatus{path=abfss://[email protected]/fork-0006/test/testRenamePopulatesFileAncestors/source/dir1/dir2/dir3/file4; isDirectory=false; length=256; replication=1; blocksize=268435456; modification_time=1670908761000; access_time=0; owner=c4ed67a7-0f07-4f6d-bab0-ee764f3ef296; group=azureuser; permission=rw-r--r--; isSymlink=false; hasAcl=false; isEncrypted=false; isErasureCoded=false}; version='0x8DADCC997529B98'}
[ERROR] ITestAzureBlobFileSystemBasics>FileSystemContractBaseTest.testRenameDirectoryMoveToExistingDirectory:521 Nested file2 exists
[ERROR] ITestReadBufferManager.testPurgeBufferManagerForParallelStreams:85 [After closing all streams free list contents should match with [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]]
Expected size:<16> but was:<10> in:
<[0, 15, 14, 13, 12, 11, 10, 9, 8, 7]>
[ERROR] Errors:
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[ERROR] ITestAbfsTerasort.setup:117->AbstractAbfsClusterITest.setup:83->AbstractAbfsClusterITest.demandCreateClusterBinding:215->AbstractAbfsClusterITest.createCluster:172 » YarnRuntime
[INFO]
[ERROR] Tests run: 332, Failures: 3, Errors: 7, Skipped: 53

import org.apache.hadoop.fs.azurebfs.contracts.exceptions.AzureBlobFileSystemException;
import org.apache.hadoop.fs.azurebfs.services.AbfsClient;

public class NamespaceUtil {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Javadocs for class and function.

}
}

private EncryptionAdapter createEncryptionAdapterFromServerStoreContext(final String path,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Javadoc for function utlity.


private EncryptionAdapter createEncryptionAdapterFromServerStoreContext(final String path,
final TracingContext tracingContext) throws IOException {
if(client.getEncryptionType() != EncryptionType.ENCRYPTION_CONTEXT) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space after if

.getPathStatus(getRelativePath(path), true, tracingContext);
.getPathStatus(relativePath, true, tracingContext, encryptionAdapter);
perfInfo.registerResult(op.getResult());
if(encryptionAdapter != null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space after if

EncryptionAdapter encryptionAdapter = new EncryptionAdapter(
client.getEncryptionContextProvider(), getRelativePath(path));
EncryptionAdapter encryptionAdapter = null;
if(client.getEncryptionType() == EncryptionType.ENCRYPTION_CONTEXT) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space after if

public String getCustomerProvidedKeySha256() {
return customerProvidedKeySha256;
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a line at the end of file.

List<AbfsHttpHeader> requestHeaders, boolean isCreateFileRequest,
EncryptionAdapter encryptionAdapter, TracingContext tracingContext)
throws IOException {
if(!getIsNamespaceEnabled(tracingContext)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space after if


/**
* Enum EncryptionType to represent the level of encryption applied
* Enum EncryptionType to represent the level of encryption applied.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add . at the end of each sentence.

public boolean isCpkResponseHdrExpected;

@Parameterized.Parameter(7)
public Boolean isCpkResponseKeyExpected = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add javadocs for use case of params

import org.apache.hadoop.fs.azurebfs.security.EncryptionAdapter;
import org.apache.hadoop.fs.azurebfs.utils.EncryptionType;
import org.apache.hadoop.classification.VisibleForTesting;
import org.apache.hadoop.fs.azurebfs.utils.NamespaceUtil;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is import order alright? org.apache.hadoop.classification should go before fs.

* The etag is included in the java serialization.
*/
private static final class VersionedFileStatus extends FileStatus
static final class VersionedFileStatus extends FileStatus

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we removing the access modifier?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class is still package-protected. Have removed private as there is an addition of assertion on the values of VersionedFileStatus objects in ITestAbfsCustomEncryption. The constructor to this class is still private -> so only AzureBlobFileSystemStore(parent class of VersionedFileStatus) can create object of this class.

@sumangala-patki sumangala-patki merged commit f9658e0 into sumangala17:HADOOP-17912 Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants