hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chao Sun (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HDFS-13578) Add ReadOnly annotation to methods in ClientProtocol
Date Fri, 25 May 2018 20:51:00 GMT

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

Chao Sun edited comment on HDFS-13578 at 5/25/18 8:50 PM:
----------------------------------------------------------

Thanks [~xkrogen]!


 1. Regarding methods need ReadOnly, you're right, I think I missed a few: {{getStats()}},
{{getReplicatedBlockStats()}}, {{getECBlockGroupStats()}}, {{getDataEncryptionKey()}}, {{getCurrentEditLogTxid()}},
{{getEditsFromTxid()}} can be marked as ReadOnly too. For {{getDatanodeReport()}} and {{getDatanodeStorageReport()}},
seems they are already unchecked so no need to do that. For {{getQuotaUsage()}}, the SBN doesn't
keep up-to-date quota info due to HDFS-6763, so I didn't mark it.
 2. For {{listOpenFiles()}}, I think NameNode will emit {{AddCloseOp}} to JN? SBN [will load
it|https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java#L373] from
there. Let me know if my understanding is correct.

3. Will fix the nits.

 

One thing I'm thinking is whether we should have tests for these methods on Observer NN (once
we completed other tasks). Perhaps it's worth a separate JIRA?


was (Author: csun):
Thanks [~xkrogen]!
 1. Regarding methods need ReadOnly, you're right, I think I missed a few: {{getStats()}},
{{getReplicatedBlockStats()}}, {{getECBlockGroupStats()}}, {{getDataEncryptionKey()}}, {{getCurrentEditLogTxid()}},
{{getEditsFromTxid()}} can be marked as ReadOnly too. For {{getDatanodeReport()}} and {{getDatanodeStorageReport()}},
seems they are already unchecked so no need to do that. For {{getQuotaUsage()}}, the SBN doesn't
keep up-to-date quota info due to HDFS-6763, so I didn't mark it.
 2. For {{listOpenFiles()}}, I think NameNode will emit {{AddCloseOp}} to JN? SBN [will load
it|https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java#L373] from
there. Let me know if my understanding is correct.

3. Will fix the nits.

 

One thing I'm thinking is whether we should have tests for these methods on Observer NN (once
we completed other tasks). Perhaps it's worth a separate JIRA?

> 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, HDFS-13578-HDFS-12943.004.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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message