[jira] [Commented] (HADOOP-9094) Add interface audience and stability annotation to PathExceptions

2012-11-30 Thread Daryn Sharp (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13507354#comment-13507354
 ] 

Daryn Sharp commented on HADOOP-9094:
-

bq. I am leaning towards the second option.
Maybe I'm confused about what option #2 refers to.  Is it this:

bq.  Other alternative is to blow away the Path*Exception in above cases and 
use the super class I have propose.
If so, I'm unclear which super class that would be?  If you are referring to 
the standard FNF and ACE exceptions, won't you need a subclass which is option 
1?

 Add interface audience and stability annotation to PathExceptions
 -

 Key: HADOOP-9094
 URL: https://issues.apache.org/jira/browse/HADOOP-9094
 Project: Hadoop Common
  Issue Type: Bug
  Components: fs
Affects Versions: 3.0.0
Reporter: Suresh Srinivas
Assignee: Suresh Srinivas

 HADOOP-9093 moved path related exceptions to o.a.h.fs. This jira tracks 
 adding interface audience and stability to notation to those exceptions. It 
 also tracks the comment from HADOOP-9093:
 bq. I propose using FileNotFoundException instead of PathNotFoundException as 
 it is already extensively used. Similarly use AccessControlException instead 
 of PathAccessException. If folks agree, I will make that change in the next 
 patch. Alternatively we could at least make these exceptions subclasses of 
 the exception that I am proposing replacing them with.

--
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-9094) Add interface audience and stability annotation to PathExceptions

2012-11-30 Thread Suresh Srinivas (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13507383#comment-13507383
 ] 

Suresh Srinivas commented on HADOOP-9094:
-

bq. Maybe I'm confused about what option #2
Sorry my comment was not very clear. Here is another attempt to make it clear:

* Move formatting exception message into a static utility method
* Option 1: Subclass the well known java/hadoop exception
** PathNotFoundException subclasses FileNotFoundException. It formats the 
exception message using the utility.
** PathAccessException - rename to PathAccessControlException. Make it a 
subclass of AccessControlException. It also formats the exception message using 
the utility.
* Option 2: Just use the well known java/hadoop exception
** Remove PathNotFoundException. Use FileNotFoundException. Retain the format 
of the exception message.
** Remove PathAccessException. Use AccessControlException. Retain the format of 
the exception message.

I am leaning towards Option 2.

 Add interface audience and stability annotation to PathExceptions
 -

 Key: HADOOP-9094
 URL: https://issues.apache.org/jira/browse/HADOOP-9094
 Project: Hadoop Common
  Issue Type: Bug
  Components: fs
Affects Versions: 3.0.0
Reporter: Suresh Srinivas
Assignee: Suresh Srinivas

 HADOOP-9093 moved path related exceptions to o.a.h.fs. This jira tracks 
 adding interface audience and stability to notation to those exceptions. It 
 also tracks the comment from HADOOP-9093:
 bq. I propose using FileNotFoundException instead of PathNotFoundException as 
 it is already extensively used. Similarly use AccessControlException instead 
 of PathAccessException. If folks agree, I will make that change in the next 
 patch. Alternatively we could at least make these exceptions subclasses of 
 the exception that I am proposing replacing them with.

--
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-9094) Add interface audience and stability annotation to PathExceptions

2012-11-30 Thread Daryn Sharp (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13507437#comment-13507437
 ] 

Daryn Sharp commented on HADOOP-9094:
-

The downside to #2 is you cannot interrogate the exception for the path that 
had the problem.  You'd be forced to mince the message string which is one of 
the other reasons I made them subclasses of {{PathIOException}}.

I think Nicholas also pointed out in the related jira:
bq. I also have thought about changing the base class to interface. However, it 
may not be very useful since we cannot catch interface as it no longer extends 
Throwable.

So as it stands now, you can simply catch {{PathIOException}} for any path 
related exception.  #1 suffers from essentially the same ailment Nicholas 
points out.  Multiple catch clauses would be required to handle path 
exceptions, FNF, ACE, etc.  Any ideas on how to avoid this?



 Add interface audience and stability annotation to PathExceptions
 -

 Key: HADOOP-9094
 URL: https://issues.apache.org/jira/browse/HADOOP-9094
 Project: Hadoop Common
  Issue Type: Bug
  Components: fs
Affects Versions: 3.0.0
Reporter: Suresh Srinivas
Assignee: Suresh Srinivas

 HADOOP-9093 moved path related exceptions to o.a.h.fs. This jira tracks 
 adding interface audience and stability to notation to those exceptions. It 
 also tracks the comment from HADOOP-9093:
 bq. I propose using FileNotFoundException instead of PathNotFoundException as 
 it is already extensively used. Similarly use AccessControlException instead 
 of PathAccessException. If folks agree, I will make that change in the next 
 patch. Alternatively we could at least make these exceptions subclasses of 
 the exception that I am proposing replacing them with.

--
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-9094) Add interface audience and stability annotation to PathExceptions

2012-11-30 Thread Suresh Srinivas (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13507767#comment-13507767
 ] 

Suresh Srinivas commented on HADOOP-9094:
-

bq. The downside to #2 is you cannot interrogate the exception for the path 
that had the problem. You'd be forced to mince the message string which is one 
of the other reasons I made them subclasses of PathIOException.
Question is why is this necessary? This is an error condition and what can you 
programmatically do?

bq. Multiple catch clauses would be required to handle path exceptions, FNF, 
ACE, etc. Any ideas on how to avoid this?
One could then catch IOException, no?

I feel adding equivalent exceptions already available in java and used in 
hadoop code to me seems unnecessary, even at the expense of losing some 
grouping.

 Add interface audience and stability annotation to PathExceptions
 -

 Key: HADOOP-9094
 URL: https://issues.apache.org/jira/browse/HADOOP-9094
 Project: Hadoop Common
  Issue Type: Bug
  Components: fs
Affects Versions: 3.0.0
Reporter: Suresh Srinivas
Assignee: Suresh Srinivas

 HADOOP-9093 moved path related exceptions to o.a.h.fs. This jira tracks 
 adding interface audience and stability to notation to those exceptions. It 
 also tracks the comment from HADOOP-9093:
 bq. I propose using FileNotFoundException instead of PathNotFoundException as 
 it is already extensively used. Similarly use AccessControlException instead 
 of PathAccessException. If folks agree, I will make that change in the next 
 patch. Alternatively we could at least make these exceptions subclasses of 
 the exception that I am proposing replacing them with.

--
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-9094) Add interface audience and stability annotation to PathExceptions

2012-11-30 Thread Daryn Sharp (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13507796#comment-13507796
 ] 

Daryn Sharp commented on HADOOP-9094:
-

bq. Question is why is this necessary? This is an error condition and what can 
you programmatically do?

Mincing strings is always problematic and makes it difficult to enhance error 
messages w/o breaking compatibility.  Allowing an exception to be interrogated 
for information frees us to change the message string.

When performing an operation on multiple paths you have the ability to easily 
determine which failed and why, so perhaps corrective or cleanup action can be 
performed.  Awhile back I think pig requested this ability to avoid mincing 
strings.  Since they call into FsShell for some operations we'd need to ensure 
we don't break them if a change is deemed necessary.

bq. I feel adding equivalent exceptions already available in java and used in 
hadoop code to me seems unnecessary, even at the expense of losing some 
grouping.

I understand where you're coming from, and I pondered the same issues when 
initially creating the exceptions.  Since the exceptions were confined to 
FsShell, I favored consistent and easy manipulation of exceptions.  If we 
change the existing exceptions, I'd reluctantly (in the sense of more catch 
clauses) lean towards subclasses of FNF and ACE to maintain consistent 
manipulation of path based exceptions.  Those that don't care to interrogate 
path exceptions can catch the base FNF or ACE directly?

 Add interface audience and stability annotation to PathExceptions
 -

 Key: HADOOP-9094
 URL: https://issues.apache.org/jira/browse/HADOOP-9094
 Project: Hadoop Common
  Issue Type: Bug
  Components: fs
Affects Versions: 3.0.0
Reporter: Suresh Srinivas
Assignee: Suresh Srinivas

 HADOOP-9093 moved path related exceptions to o.a.h.fs. This jira tracks 
 adding interface audience and stability to notation to those exceptions. It 
 also tracks the comment from HADOOP-9093:
 bq. I propose using FileNotFoundException instead of PathNotFoundException as 
 it is already extensively used. Similarly use AccessControlException instead 
 of PathAccessException. If folks agree, I will make that change in the next 
 patch. Alternatively we could at least make these exceptions subclasses of 
 the exception that I am proposing replacing them with.

--
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-9094) Add interface audience and stability annotation to PathExceptions

2012-11-30 Thread Suresh Srinivas (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13507800#comment-13507800
 ] 

Suresh Srinivas commented on HADOOP-9094:
-

bq. lean towards subclasses of FNF and ACE to maintain consistent manipulation 
of path based exceptions
Daryn can you explain what you mean by this?

 Add interface audience and stability annotation to PathExceptions
 -

 Key: HADOOP-9094
 URL: https://issues.apache.org/jira/browse/HADOOP-9094
 Project: Hadoop Common
  Issue Type: Bug
  Components: fs
Affects Versions: 3.0.0
Reporter: Suresh Srinivas
Assignee: Suresh Srinivas

 HADOOP-9093 moved path related exceptions to o.a.h.fs. This jira tracks 
 adding interface audience and stability to notation to those exceptions. It 
 also tracks the comment from HADOOP-9093:
 bq. I propose using FileNotFoundException instead of PathNotFoundException as 
 it is already extensively used. Similarly use AccessControlException instead 
 of PathAccessException. If folks agree, I will make that change in the next 
 patch. Alternatively we could at least make these exceptions subclasses of 
 the exception that I am proposing replacing them with.

--
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-9094) Add interface audience and stability annotation to PathExceptions

2012-11-29 Thread Suresh Srinivas (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13506954#comment-13506954
 ] 

Suresh Srinivas commented on HADOOP-9094:
-

bq. I propose using FileNotFoundException instead of PathNotFoundException as 
it is already extensively used. Similarly use AccessControlException instead of 
PathAccessException. If folks agree, I will make that change in the next patch. 
Alternatively we could at least make these exceptions subclasses of the 
exception that I am proposing replacing them with.

Daryn's comment from HADOOP-9093:
bq. I had considered that when I created these exceptions, but wanted all path 
exceptions to derive from a common class. I suppose PathException could be an 
interface and we copy-n-paste the base code - which is the main factor I chose 
to derive from a base class.

 Add interface audience and stability annotation to PathExceptions
 -

 Key: HADOOP-9094
 URL: https://issues.apache.org/jira/browse/HADOOP-9094
 Project: Hadoop Common
  Issue Type: Bug
  Components: fs
Affects Versions: 3.0.0
Reporter: Suresh Srinivas
Assignee: Suresh Srinivas

 HADOOP-9093 moved path related exceptions to o.a.h.fs. This jira tracks 
 adding interface audience and stability to notation to those exceptions. It 
 also tracks the comment from HADOOP-9093:
 bq. I propose using FileNotFoundException instead of PathNotFoundException as 
 it is already extensively used. Similarly use AccessControlException instead 
 of PathAccessException. If folks agree, I will make that change in the next 
 patch. Alternatively we could at least make these exceptions subclasses of 
 the exception that I am proposing replacing them with.

--
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-9094) Add interface audience and stability annotation to PathExceptions

2012-11-29 Thread Suresh Srinivas (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-9094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13506957#comment-13506957
 ] 

Suresh Srinivas commented on HADOOP-9094:
-

bq. I had considered that when I created these exceptions, but wanted all path 
exceptions to derive from a common class. I suppose PathException could be an 
interface and we copy-n-paste the base code - which is the main factor I chose 
to derive from a base class.

Given that the new exceptions format the exception message in certain way, 
making the following change:
# Move the message formatting to a static method
# Have PathNotFoundException subclass FileNotFoundException. It formats the 
exception message using the utility.
# PathAccessException - rename it as PathAccessControlException. Make it a 
subclass of AccessControlException. It also formats the exception message using 
the utility.

Other alternative is to blow away the Path*Exception in above cases and use the 
super class I have propose. The message in the exception can still use the 
utility to format the message.

I am leaning towards the second option.

 Add interface audience and stability annotation to PathExceptions
 -

 Key: HADOOP-9094
 URL: https://issues.apache.org/jira/browse/HADOOP-9094
 Project: Hadoop Common
  Issue Type: Bug
  Components: fs
Affects Versions: 3.0.0
Reporter: Suresh Srinivas
Assignee: Suresh Srinivas

 HADOOP-9093 moved path related exceptions to o.a.h.fs. This jira tracks 
 adding interface audience and stability to notation to those exceptions. It 
 also tracks the comment from HADOOP-9093:
 bq. I propose using FileNotFoundException instead of PathNotFoundException as 
 it is already extensively used. Similarly use AccessControlException instead 
 of PathAccessException. If folks agree, I will make that change in the next 
 patch. Alternatively we could at least make these exceptions subclasses of 
 the exception that I am proposing replacing them with.

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