Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,8 @@ public OzoneMultipartUploadList listMultipartUploads(String volumeName,
@Override
public OzoneFileStatus getOzoneFileStatus(String volumeName,
String bucketName, String keyName) throws IOException {
verifyVolumeName(volumeName);
verifyBucketName(bucketName);
OmKeyArgs keyArgs = new OmKeyArgs.Builder()
.setVolumeName(volumeName)
.setBucketName(bucketName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,20 +659,19 @@ public FileStatusAdapter getFileStatus(String path, URI uri,
* valid bucket path or valid snapshot path.
* Throws exception in case of failure.
*/
private FileStatusAdapter getFileStatusForKeyOrSnapshot(
OFSPath ofsPath, URI uri, Path qualifiedPath, String userName)
private FileStatusAdapter getFileStatusForKeyOrSnapshot(OFSPath ofsPath, URI uri, Path qualifiedPath, String userName)
throws IOException {
String volumeName = ofsPath.getVolumeName();
String bucketName = ofsPath.getBucketName();
String key = ofsPath.getKeyName();
try {
OzoneBucket bucket = getBucket(ofsPath, false);
if (ofsPath.isSnapshotPath()) {
OzoneVolume volume = objectStore.getVolume(ofsPath.getVolumeName());
return getFileStatusAdapterWithSnapshotIndicator(
volume, bucket, uri);
OzoneVolume volume = objectStore.getVolume(volumeName);
OzoneBucket bucket = getBucket(volumeName, bucketName, false);
return getFileStatusAdapterWithSnapshotIndicator(volume, bucket, uri);
} else {
OzoneFileStatus status = bucket.getFileStatus(key);
return toFileStatusAdapter(status, userName, uri, qualifiedPath,
ofsPath.getNonKeyPath());
OzoneFileStatus status = proxy.getOzoneFileStatus(volumeName, bucketName, key);
return toFileStatusAdapter(status, userName, uri, qualifiedPath, ofsPath.getNonKeyPath());
}
} catch (OMException e) {
if (e.getResult() == OMException.ResultCodes.FILE_NOT_FOUND) {
Expand Down