Skip to content

Commit

Permalink
make lookupKey work for directory path.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharatviswa504 committed Aug 13, 2020
1 parent bf4456b commit 3cecfc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.apache.hadoop.ozone.om.OMConfigKeys;
import org.apache.hadoop.ozone.om.helpers.OmKeyArgs;
import org.apache.hadoop.ozone.om.helpers.OpenKeySession;
import org.apache.hadoop.ozone.om.helpers.OzoneFileStatus;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.test.GenericTestUtils;

Expand Down Expand Up @@ -320,9 +321,11 @@ private void testDeleteCreatesFakeParentDir() throws Exception {

// Deleting the only child should create the parent dir key if it does
// not exist
String parentKey = o3fs.pathToKey(parent) + "/";
OzoneKeyDetails parentKeyInfo = getKey(parent, true);
assertEquals(parentKey, parentKeyInfo.getName());
String parentKey = o3fs.pathToKey(parent);
OzoneFileStatus fileStatus =
cluster.getClient().getObjectStore().getVolume(volumeName)
.getBucket(bucketName).getFileStatus(parentKey);
assertEquals(parent.toString(), fileStatus.getPath());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ public OmKeyInfo lookupKey(OmKeyArgs args, String clientAddress)
String keyName = OMClientRequest.validateAndNormalizeKey(
enableFileSystemPaths, args.getKeyName());


metadataManager.getLock().acquireReadLock(BUCKET_LOCK, volumeName,
bucketName);
OmKeyInfo value = null;
Expand Down

0 comments on commit 3cecfc1

Please sign in to comment.