bhattmanish98 commented on code in PR #7364:
URL: https://github.com/apache/hadoop/pull/7364#discussion_r1967099150
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/AbstractAbfsIntegrationTest.java:
##########
@@ -733,4 +737,53 @@ protected void checkFuturesForExceptions(List<Future<?>>
futures, int exceptionV
}
assertEquals(exceptionCaught, exceptionVal);
}
+
+ /**
+ * Assumes that recovery through client transaction ID is enabled.
+ * Namespace is enabled for the given AzureBlobFileSystem.
+ * Service type is DFS.
+ * Assumes that the client transaction ID is enabled in the configuration.
+ *
+ * @param fs the AzureBlobFileSystem instance to check
+ * @throws AzureBlobFileSystemException in case of an error
+ */
+ protected void assumeRecoveryThroughClientTransactionID(
+ AzureBlobFileSystem fs, boolean isCreate)
+ throws AzureBlobFileSystemException {
+ // Assumes that recovery through client transaction ID is enabled.
+ Assume.assumeTrue(getConfiguration().getIsClientTransactionIdEnabled());
+ // Assumes that service type is DFS.
+ assumeDfsServiceType();
+ // Assumes that namespace is enabled for the given AzureBlobFileSystem.
+ Assume.assumeTrue(
+ fs.getIsNamespaceEnabled(getTestTracingContext(fs, true)));
+ if (isCreate) {
+ // Assume that create client is DFS client.
+ Assume.assumeTrue(
+ AbfsServiceType.DFS.equals(
+
fs.getAbfsStore().getAbfsConfiguration().getIngressServiceType()));
+ // Assume that append blob is not enabled in DFS client.
+ Assume.assumeFalse(isAppendBlobEnabled());
+ }
+ }
+
+ /**
+ * Mocks the behavior of adding a client transaction ID to the request
headers
+ * for the given AzureBlobFileSystem. This method generates a random
transaction ID
+ * and adds it to the headers of the {@link AbfsDfsClient}.
+ *
+ * @param abfsDfsClient The {@link AbfsDfsClient} mocked AbfsDfsClient.
+ * @param clientTransactionId An array to hold the generated transaction ID.
+ */
+ protected void mockAddClientTransactionIdToHeader(AbfsDfsClient
abfsDfsClient,
Review Comment:
Moved to AbfsClientTestUtil class.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]