[ 
https://issues.apache.org/jira/browse/HDFS-13578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16489908#comment-16489908
 ] 

Íñigo Goiri commented on HDFS-13578:
------------------------------------

You are currently doing:
{code}
69        @Test
70        public void testReadOnly() {
71          for (String methodName : READONLY_METHOD_NAMES) {
72            checkIsReadOnly(methodName, true);
73          }
74          for (Method m : ALL_METHODS) {
75            if (!READONLY_METHOD_NAMES.contains(m.getName())) {
76              checkIsReadOnly(m.getName(), false);
77            }
78          }
79        }
{code}
You have all the methods being set A, then this is split into two subsets RO 
and RW.
In 71-73 you call the method with true for RO.
In 74-75 you call the method with false for A-RO.
You could just do what I proposed and it would be the same, you cal true for RO 
and false for !RO (which is RW).

For the getBlockLocations(), I was talking about something like:
{code}
@ReadOnly(XXXX = true)
LocatedBlocks getBlockLocations(String src, long offset, long length);
{code}
Not sure of the wording of XXX but it should be something that conveys that it 
sometimes is not read only and possibly something to do with atimes..

> Add ReadOnly annotation to methods in ClientProtocol
> ----------------------------------------------------
>
>                 Key: HDFS-13578
>                 URL: https://issues.apache.org/jira/browse/HDFS-13578
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Chao Sun
>            Assignee: Chao Sun
>            Priority: Major
>         Attachments: HDFS-13578-HDFS-12943.000.patch, 
> HDFS-13578-HDFS-12943.001.patch, HDFS-13578-HDFS-12943.002.patch
>
>
> For those read-only methods in {{ClientProtocol}}, we may want to use a 
> {{@ReadOnly}} annotation to mark them, and then check in the proxy provider 
> for observer.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to