You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Suresh Srinivas (Created) (JIRA)" <ji...@apache.org> on 2012/03/15 19:09:37 UTC
[jira] [Created] (HADOOP-8174) Remove confusing comment in
Path#isAbsolute()
Remove confusing comment in Path#isAbsolute()
---------------------------------------------
Key: HADOOP-8174
URL: https://issues.apache.org/jira/browse/HADOOP-8174
Project: Hadoop Common
Issue Type: Improvement
Components: fs
Affects Versions: 0.23.0
Reporter: Suresh Srinivas
Assignee: Sanjay Radia
Fix For: 0.24.0
The method is checking for absolute path correctly. When scheme and authority are present, the path is absolute. So the following comment needs to be removed.
{noformat}
/**
* There is some ambiguity here. An absolute path is a slash
* relative name without a scheme or an authority.
* So either this method was incorrectly named or its
* implementation is incorrect. This method returns true
* even if there is a scheme and authority.
*/
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HADOOP-8174) Remove confusing comment in
Path#isAbsolute()
Posted by "Harsh J (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-8174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Harsh J updated HADOOP-8174:
----------------------------
Attachment: HADOOP-8174.patch
Rebased Suresh's patch for trunk with Eli's second comment addressed.
> Remove confusing comment in Path#isAbsolute()
> ---------------------------------------------
>
> Key: HADOOP-8174
> URL: https://issues.apache.org/jira/browse/HADOOP-8174
> Project: Hadoop Common
> Issue Type: Improvement
> Components: fs
> Affects Versions: 0.23.0
> Reporter: Suresh Srinivas
> Assignee: Suresh Srinivas
> Attachments: HADOOP-8174.patch, HADOOP-8174.txt
>
>
> The method is checking for absolute path correctly. When scheme and authority are present, the path is absolute. So the following comment needs to be removed.
> {noformat}
> /**
> * There is some ambiguity here. An absolute path is a slash
> * relative name without a scheme or an authority.
> * So either this method was incorrectly named or its
> * implementation is incorrect. This method returns true
> * even if there is a scheme and authority.
> */
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HADOOP-8174) Remove confusing comment in
Path#isAbsolute()
Posted by "Suresh Srinivas (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-8174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Suresh Srinivas updated HADOOP-8174:
------------------------------------
Attachment: HADOOP-8174.txt
> Remove confusing comment in Path#isAbsolute()
> ---------------------------------------------
>
> Key: HADOOP-8174
> URL: https://issues.apache.org/jira/browse/HADOOP-8174
> Project: Hadoop Common
> Issue Type: Improvement
> Components: fs
> Affects Versions: 0.23.0
> Reporter: Suresh Srinivas
> Assignee: Sanjay Radia
> Fix For: 0.24.0
>
> Attachments: HADOOP-8174.txt
>
>
> The method is checking for absolute path correctly. When scheme and authority are present, the path is absolute. So the following comment needs to be removed.
> {noformat}
> /**
> * There is some ambiguity here. An absolute path is a slash
> * relative name without a scheme or an authority.
> * So either this method was incorrectly named or its
> * implementation is incorrect. This method returns true
> * even if there is a scheme and authority.
> */
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-8174) Remove confusing comment in
Path#isAbsolute()
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-8174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13461102#comment-13461102 ]
Hadoop QA commented on HADOOP-8174:
-----------------------------------
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12546157/HADOOP-8174.patch
against trunk revision .
+1 @author. The patch does not contain any @author tags.
-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no new tests are needed for this patch.
Also please list what manual steps were performed to verify this patch.
+1 javac. The applied patch does not increase the total number of javac compiler warnings.
+1 javadoc. The javadoc tool did not generate any warning messages.
+1 eclipse:eclipse. The patch built with eclipse:eclipse.
+1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.
+1 release audit. The applied patch does not increase the total number of release audit warnings.
-1 core tests. The patch failed these unit tests in hadoop-common-project/hadoop-common:
org.apache.hadoop.ha.TestZKFailoverController
org.apache.hadoop.metrics2.impl.TestMetricsSystemImpl
+1 contrib tests. The patch passed contrib unit tests.
Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/1496//testReport/
Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/1496//console
This message is automatically generated.
> Remove confusing comment in Path#isAbsolute()
> ---------------------------------------------
>
> Key: HADOOP-8174
> URL: https://issues.apache.org/jira/browse/HADOOP-8174
> Project: Hadoop Common
> Issue Type: Improvement
> Components: fs
> Affects Versions: 0.23.0
> Reporter: Suresh Srinivas
> Assignee: Suresh Srinivas
> Attachments: HADOOP-8174.patch, HADOOP-8174.txt
>
>
> The method is checking for absolute path correctly. When scheme and authority are present, the path is absolute. So the following comment needs to be removed.
> {noformat}
> /**
> * There is some ambiguity here. An absolute path is a slash
> * relative name without a scheme or an authority.
> * So either this method was incorrectly named or its
> * implementation is incorrect. This method returns true
> * even if there is a scheme and authority.
> */
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (HADOOP-8174) Remove confusing comment in
Path#isAbsolute()
Posted by "Suresh Srinivas (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-8174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Suresh Srinivas reassigned HADOOP-8174:
---------------------------------------
Assignee: Suresh Srinivas (was: Sanjay Radia)
> Remove confusing comment in Path#isAbsolute()
> ---------------------------------------------
>
> Key: HADOOP-8174
> URL: https://issues.apache.org/jira/browse/HADOOP-8174
> Project: Hadoop Common
> Issue Type: Improvement
> Components: fs
> Affects Versions: 0.23.0
> Reporter: Suresh Srinivas
> Assignee: Suresh Srinivas
> Fix For: 0.24.0
>
> Attachments: HADOOP-8174.txt
>
>
> The method is checking for absolute path correctly. When scheme and authority are present, the path is absolute. So the following comment needs to be removed.
> {noformat}
> /**
> * There is some ambiguity here. An absolute path is a slash
> * relative name without a scheme or an authority.
> * So either this method was incorrectly named or its
> * implementation is incorrect. This method returns true
> * even if there is a scheme and authority.
> */
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-8174) Remove confusing comment in
Path#isAbsolute()
Posted by "Eli Collins (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-8174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230745#comment-13230745 ]
Eli Collins commented on HADOOP-8174:
-------------------------------------
@Suresh, looks good. How about removing the comment "A path string is absolute if it begins with a slash" at the top of the file so we just have one place that defines what absolute means.
@Sanjay, unfortunately URI is not an implementation detail of Path, the Path constructor takes a java.net.URI object, has a toUri method that returns one that is used extensively. The code uses Paths and URIs interchangably so the URI semantics are leaked all over the Hadoop code base.
> Remove confusing comment in Path#isAbsolute()
> ---------------------------------------------
>
> Key: HADOOP-8174
> URL: https://issues.apache.org/jira/browse/HADOOP-8174
> Project: Hadoop Common
> Issue Type: Improvement
> Components: fs
> Affects Versions: 0.23.0
> Reporter: Suresh Srinivas
> Assignee: Suresh Srinivas
> Fix For: 0.24.0
>
> Attachments: HADOOP-8174.txt
>
>
> The method is checking for absolute path correctly. When scheme and authority are present, the path is absolute. So the following comment needs to be removed.
> {noformat}
> /**
> * There is some ambiguity here. An absolute path is a slash
> * relative name without a scheme or an authority.
> * So either this method was incorrectly named or its
> * implementation is incorrect. This method returns true
> * even if there is a scheme and authority.
> */
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-8174) Remove confusing comment in
Path#isAbsolute()
Posted by "Eli Collins (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-8174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230481#comment-13230481 ]
Eli Collins commented on HADOOP-8174:
-------------------------------------
The confusion is because there are two separate perspectives:
# Whether a *path* is absolute (ie the reference is non-relative, starts with the root). Ie /foo is an absolute path.
# Whether a *URI* is absolute (ie [URI#isAbsolute|http://docs.oracle.com/javase/6/docs/api/java/net/URI.html#isAbsolute()] where "A URI is absolute if, and only if, it has a scheme component"). Ie "/foo" is not absolute URI, but file:///foo is.
Because Hadoop Paths are represented by, and are just thin wrappers around, URIs (which is goofy!) there is some ambiguity.
Given that the intent of Path#isAbsolute is #1 (the class-level javadoc states "A path string is absolute if it begins with a slash.") I think we should update the Path#isAbsolute javadoc to indicate this. It's also worth putting the above discussion in a class-level comment since it's not clear that we intend Path to be a file system path in most cases.
> Remove confusing comment in Path#isAbsolute()
> ---------------------------------------------
>
> Key: HADOOP-8174
> URL: https://issues.apache.org/jira/browse/HADOOP-8174
> Project: Hadoop Common
> Issue Type: Improvement
> Components: fs
> Affects Versions: 0.23.0
> Reporter: Suresh Srinivas
> Assignee: Sanjay Radia
> Fix For: 0.24.0
>
>
> The method is checking for absolute path correctly. When scheme and authority are present, the path is absolute. So the following comment needs to be removed.
> {noformat}
> /**
> * There is some ambiguity here. An absolute path is a slash
> * relative name without a scheme or an authority.
> * So either this method was incorrectly named or its
> * implementation is incorrect. This method returns true
> * even if there is a scheme and authority.
> */
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HADOOP-8174) Remove confusing comment in
Path#isAbsolute()
Posted by "Harsh J (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-8174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Harsh J updated HADOOP-8174:
----------------------------
Status: Patch Available (was: Open)
> Remove confusing comment in Path#isAbsolute()
> ---------------------------------------------
>
> Key: HADOOP-8174
> URL: https://issues.apache.org/jira/browse/HADOOP-8174
> Project: Hadoop Common
> Issue Type: Improvement
> Components: fs
> Affects Versions: 0.23.0
> Reporter: Suresh Srinivas
> Assignee: Suresh Srinivas
> Attachments: HADOOP-8174.patch, HADOOP-8174.txt
>
>
> The method is checking for absolute path correctly. When scheme and authority are present, the path is absolute. So the following comment needs to be removed.
> {noformat}
> /**
> * There is some ambiguity here. An absolute path is a slash
> * relative name without a scheme or an authority.
> * So either this method was incorrectly named or its
> * implementation is incorrect. This method returns true
> * even if there is a scheme and authority.
> */
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-8174) Remove confusing comment in
Path#isAbsolute()
Posted by "Suresh Srinivas (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-8174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230507#comment-13230507 ]
Suresh Srinivas commented on HADOOP-8174:
-----------------------------------------
isAbsolute() is a method on Path and so the method should not be attributed to URI, even if Path wraps URI, which is implementation detail.
Now I get what the problem is, there is a comment:
{format}
/** True if the path component of this URI is absolute. */
{format}
Hence the comment following it. I will fix the comment.
> Remove confusing comment in Path#isAbsolute()
> ---------------------------------------------
>
> Key: HADOOP-8174
> URL: https://issues.apache.org/jira/browse/HADOOP-8174
> Project: Hadoop Common
> Issue Type: Improvement
> Components: fs
> Affects Versions: 0.23.0
> Reporter: Suresh Srinivas
> Assignee: Sanjay Radia
> Fix For: 0.24.0
>
> Attachments: HADOOP-8174.txt
>
>
> The method is checking for absolute path correctly. When scheme and authority are present, the path is absolute. So the following comment needs to be removed.
> {noformat}
> /**
> * There is some ambiguity here. An absolute path is a slash
> * relative name without a scheme or an authority.
> * So either this method was incorrectly named or its
> * implementation is incorrect. This method returns true
> * even if there is a scheme and authority.
> */
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HADOOP-8174) Remove confusing comment in
Path#isAbsolute()
Posted by "Harsh J (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-8174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Harsh J updated HADOOP-8174:
----------------------------
Fix Version/s: (was: 0.24.0)
> Remove confusing comment in Path#isAbsolute()
> ---------------------------------------------
>
> Key: HADOOP-8174
> URL: https://issues.apache.org/jira/browse/HADOOP-8174
> Project: Hadoop Common
> Issue Type: Improvement
> Components: fs
> Affects Versions: 0.23.0
> Reporter: Suresh Srinivas
> Assignee: Suresh Srinivas
> Attachments: HADOOP-8174.patch, HADOOP-8174.txt
>
>
> The method is checking for absolute path correctly. When scheme and authority are present, the path is absolute. So the following comment needs to be removed.
> {noformat}
> /**
> * There is some ambiguity here. An absolute path is a slash
> * relative name without a scheme or an authority.
> * So either this method was incorrectly named or its
> * implementation is incorrect. This method returns true
> * even if there is a scheme and authority.
> */
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira