umamaheswararao commented on a change in pull request #2107:
URL: https://github.com/apache/hadoop/pull/2107#discussion_r449747710



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
##########
@@ -919,6 +921,42 @@ public FSDataOutputStream createInternal(final Path f,
         FileAlreadyExistsException, FileNotFoundException,
         ParentNotDirectoryException, UnsupportedFileSystemException,
         UnresolvedLinkException, IOException {
+      Preconditions.checkNotNull(f, "File cannot be null.");
+      // Just a sanity check. This should not happen.

Review comment:
       My comments seems to be too light. "//" will trigger this. But ideally 
that should not happen as users would not create files with /. However if 
somebody attempts we are ready to shoot. I have removed that comment, as it may 
be confusing.
   However, this will trigger mostly in ViewFs.java, but may not be in 
ViewFileSystem.java. In ViewFileSystem.java, getDefaultReplication API itself 
might shade this condition if parent is internal currently. Anyway the current 
condition should be good enough to handle if some one try with files as "//" etc
   Thanks for checking.




----------------------------------------------------------------
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]

Reply via email to