You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "anmolanmol1234 (via GitHub)" <gi...@apache.org> on 2023/09/28 10:03:51 UTC

[GitHub] [hadoop] anmolanmol1234 commented on a diff in pull request #6069: HADOOP-18910: [ABFS] Adding Support for MD5 Hash based integrity verification of the request content during transport

anmolanmol1234 commented on code in PR #6069:
URL: https://github.com/apache/hadoop/pull/6069#discussion_r1339863566


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java:
##########
@@ -875,10 +873,15 @@ private boolean checkUserError(int responseStatusCode) {
         && responseStatusCode < HttpURLConnection.HTTP_INTERNAL_ERROR);
   }
 
-  private boolean isMd5ChecksumError(final AzureBlobFileSystemException e) {
+  /**
+   * To check if the failure exception returned by server is due to MD5 Mismatch
+   * @param e Exception returned by AbfsRestOperation
+   * @return boolean whether exception is due to MD5Mismatch or not
+   */
+  protected boolean isMd5ChecksumError(final AzureBlobFileSystemException e) {
     return ((AbfsRestOperationException) e).getStatusCode()
         == HttpURLConnection.HTTP_BAD_REQUEST
-        && ((AbfsRestOperationException) e).getErrorMessage().contains(MD5_ERROR);
+        && e.getMessage().contains(MD5_ERROR_SERVER_MESSAGE);

Review Comment:
   does it not require type casting here ?



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org