Unify fallback dependent api#69
Conversation
|
:::: AGGREGATED TEST RESULT :::: HNS-OAuth[INFO] Results: HNS-SharedKey[INFO] Results: NonHNS-SharedKey[INFO] Results: NonHNS-OAuth[INFO] Results: AppendBlob-HNS-OAuth[INFO] Results: |
anujmodi2021
left a comment
There was a problem hiding this comment.
Added a small comment. Rest LGTM
| } | ||
| if (getAbfsStore().getAbfsConfiguration().getPrefixMode() | ||
| tracingContext, useBlobEndpoint); | ||
| if (getAbfsStore().getAbfsConfiguration().getPrefixMode() |
There was a problem hiding this comment.
Should be changed to getAbfsStore().getPrefixMode()
saxenapranav
left a comment
There was a problem hiding this comment.
Mostly look amazing. Two comments.
| boolean useBlobEndpoint = !(OperativeEndpoint.isIngressEnabledOnDFS(prefixMode, abfsConfiguration) || | ||
| OperativeEndpoint.isMkdirEnabledOnDFS(prefixMode, abfsConfiguration) || | ||
| OperativeEndpoint.isReadEnabledOnDFS(prefixMode, abfsConfiguration)); | ||
| try { |
There was a problem hiding this comment.
why does redirect to dfs on mkdir/ingress/readEnabled matter here?
There was a problem hiding this comment.
We want the getFileStatus call to go to dfs in all cases where either of the configs is enabled, though this doesn't come as part of fallback but helps to maintain consistency in the logic
| } catch (AbfsRestOperationException ex) { | ||
| if (ex.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { | ||
| fileStatus = (VersionedFileStatus) getFileStatus(new Path(relativePath), tracingContext, useBlobEndpoint); | ||
| } catch (IOException ex) { |
There was a problem hiding this comment.
if we keep it as AbfsRestOperationException, the behavior should be same?
There was a problem hiding this comment.
getFileStatus throws IOException and hence we would need to change the exception type here. It will catch AbfsRestOperationException as well as that extends from IOException
| if (ex.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { | ||
| fileStatus = (VersionedFileStatus) getFileStatus(new Path(relativePath), tracingContext, useBlobEndpoint); | ||
| } catch (IOException ex) { | ||
| AbfsRestOperationException ex1 = (AbfsRestOperationException) ex; |
There was a problem hiding this comment.
It will lead to cast issue. Since all IOException may not be AbfsRestOperationException.
| } catch (AbfsRestOperationException ex) { | ||
| if (ex.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { | ||
| fileStatus = (VersionedFileStatus) getFileStatus(new Path(relativePath), tracingContext, useBlobEndpoint); | ||
| } catch (IOException ex) { |
| + "to honor single writer semantics"); | ||
| fileStatus = (VersionedFileStatus) getFileStatus(new Path(relativePath), tracingContext, useBlobEndpoint); | ||
| } catch (IOException ex) { | ||
| if (ex instanceof AbfsRestOperationException) { |
There was a problem hiding this comment.
since we are still throwing IOexception if not abfsRestOperationException. Lets catch AbfsRestOperationException only?
There was a problem hiding this comment.
Makes sense
saxenapranav
left a comment
There was a problem hiding this comment.
LGTM! Thanks for taking all the comments.
| PrefixMode prefixMode = getAbfsStore().getPrefixMode(); | ||
| AbfsConfiguration abfsConfiguration = getAbfsStore().getAbfsConfiguration(); | ||
|
|
||
| boolean useBlobEndpoint = !(OperativeEndpoint.isIngressEnabledOnDFS(prefixMode, abfsConfiguration) || |
There was a problem hiding this comment.
As discussed, let operativeEndpoint by the single point with the unified logic.
PR to make sure that if any API fallbacks to DFS endpoint, the dependent getFileStatus call should also go to DFS endpoint. Also refactored the code for openFileForRead and openFileForWrite to depend only on getFileStatus call.