Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.apache.hadoop.fs.azurebfs.contracts.exceptions.InvalidConfigurationValueException;
import org.apache.hadoop.fs.azurebfs.services.BlobProperty;
import org.apache.hadoop.classification.VisibleForTesting;
import org.apache.hadoop.fs.azurebfs.services.OperativeEndpoint;
import org.apache.hadoop.fs.azurebfs.services.PathInformation;
import org.apache.hadoop.fs.azurebfs.services.PrefixMode;
import org.apache.hadoop.fs.azurebfs.services.RenameAtomicityUtils;
Expand Down Expand Up @@ -1002,25 +1003,23 @@ private FileStatus getFileStatus(final Path path,
statIncrement(CALL_GET_FILE_STATUS);
Path qualifiedPath = makeQualified(path);
FileStatus fileStatus;
PrefixMode prefixMode = getAbfsStore().getPrefixMode();
AbfsConfiguration abfsConfiguration = getAbfsStore().getAbfsConfiguration();

boolean useBlobEndpoint = !(OperativeEndpoint.isIngressEnabledOnDFS(prefixMode, abfsConfiguration) ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

As discussed, let operativeEndpoint by the single point with the unified logic.

OperativeEndpoint.isMkdirEnabledOnDFS(prefixMode, abfsConfiguration) ||
OperativeEndpoint.isReadEnabledOnDFS(prefixMode, abfsConfiguration));
try {
Comment on lines +1009 to 1012
Copy link
Collaborator

Choose a reason for hiding this comment

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

why does redirect to dfs on mkdir/ingress/readEnabled matter here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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

if (abfsStore.getPrefixMode() == PrefixMode.BLOB) {
/**
* Get File Status over Blob Endpoint will Have an additional call
* to check if directory is implicit.
*/
fileStatus = abfsStore.getFileStatusOverBlob(qualifiedPath,
tracingContext);
}
else {
fileStatus = abfsStore.getFileStatus(qualifiedPath,
tracingContext);
}
if (getAbfsStore().getAbfsConfiguration().getPrefixMode()
== PrefixMode.BLOB && fileStatus != null && fileStatus.isDirectory()
&&
abfsStore.isAtomicRenameKey(fileStatus.getPath().toUri().getPath()) &&
abfsStore.getRenamePendingFileStatusInDirectory(fileStatus,
tracingContext, useBlobEndpoint);
if (getAbfsStore().getPrefixMode() == PrefixMode.BLOB
&& fileStatus != null && fileStatus.isDirectory()
&& abfsStore.isAtomicRenameKey(fileStatus.getPath().toUri().getPath())
&& abfsStore.getRenamePendingFileStatusInDirectory(fileStatus,
tracingContext)) {
RenameAtomicityUtils renameAtomicityUtils = new RenameAtomicityUtils(
this,
Expand Down
Loading