rakeshadr commented on a change in pull request #1679:
URL: https://github.com/apache/ozone/pull/1679#discussion_r546517985
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java
##########
@@ -556,9 +560,10 @@ public static OmKeyInfo getOmKeyInfoFromFileTable(boolean
openFileTable,
// For example, the user given key path is '/a/b/c/d/e/file1', then in DB
// keyName field stores only the leaf node name, which is 'file1'.
if (dbOmKeyInfo != null) {
- dbOmKeyInfo.setKeyName(keyName);
Review comment:
Agreed, Done the changes!
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java
##########
@@ -851,4 +856,72 @@ private static boolean checkSubFileExists(OmKeyInfo
omKeyInfo,
public static boolean isImmediateChild(long parentId, long ancestorId) {
return parentId == ancestorId;
}
+
+
+ /**
+ * Check for directory exists with same name, if it exists throw error.
+ *
+ * @param keyName key name
+ * @param ozoneManager Ozone Manager
+ * @param reachedLastPathComponent true if the path component is a fileName
+ * @throws IOException if directory exists with same name
+ */
+ private static void checkDirectoryAlreadyExists(String keyName,
+ OzoneManager ozoneManager, boolean reachedLastPathComponent)
+ throws IOException {
+ // Reached last component, which would be a file. Returns its parentID.
Review comment:
Agreed, Done the changes!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]