sumangala-patki commented on a change in pull request #2975:
URL: https://github.com/apache/hadoop/pull/2975#discussion_r669171596
##########
File path:
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java
##########
@@ -669,44 +672,51 @@ public void createDirectory(final Path path, final
FsPermission permission,
public AbfsInputStream openFileForRead(final Path path,
final FileSystem.Statistics statistics, TracingContext tracingContext)
- throws AzureBlobFileSystemException {
- return openFileForRead(path, Optional.empty(), statistics, tracingContext);
+ throws IOException {
+ return openFileForRead(path, new OpenFileParameters(), statistics,
+ tracingContext);
}
public AbfsInputStream openFileForRead(final Path path,
- final Optional<Configuration> options,
+ final OpenFileParameters parameters,
final FileSystem.Statistics statistics, TracingContext tracingContext)
- throws AzureBlobFileSystemException {
- try (AbfsPerfInfo perfInfo = startTracking("openFileForRead",
"getPathStatus")) {
+ throws IOException {
+ try (AbfsPerfInfo perfInfo = startTracking("openFileForRead",
+ "getPathStatus")) {
LOG.debug("openFileForRead filesystem: {} path: {}",
- client.getFileSystem(),
- path);
+ client.getFileSystem(), path);
- String relativePath = getRelativePath(path);
+ Optional<Configuration> options = Optional.empty();
- final AbfsRestOperation op = client
- .getPathStatus(relativePath, false, tracingContext);
- perfInfo.registerResult(op.getResult());
+ FileStatus fileStatus = null;
+ if (parameters != null) {
+ options = Optional.ofNullable(parameters.getOptions());
+ fileStatus = parameters.getStatus();
+ }
- final String resourceType =
op.getResult().getResponseHeader(HttpHeaderConfigurations.X_MS_RESOURCE_TYPE);
- final long contentLength =
Long.parseLong(op.getResult().getResponseHeader(HttpHeaderConfigurations.CONTENT_LENGTH));
- final String eTag =
op.getResult().getResponseHeader(HttpHeaderConfigurations.ETAG);
+ String relativePath = getRelativePath(path);
+ if (fileStatus == null) {
+ fileStatus = getFileStatus(new Path(relativePath), tracingContext);
Review comment:
done
--
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]