You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org> on 2011/08/10 05:25:27 UTC
[jira] [Commented] (HDFS-2241) Remove implementing FSConstants
interface just to access the constants defined in the interface
[ https://issues.apache.org/jira/browse/HDFS-2241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13082118#comment-13082118 ]
Tsz Wo (Nicholas), SZE commented on HDFS-2241:
----------------------------------------------
Thanks for fixing this. Some comments
- Change FSConstants interface to a final class.
- Remove FSConstants.DEFAULT_REPLICATION_FACTOR.
- Do you know why the following code does not use the defaults in DFSConfigKeys?
{code}
+ this.blockReportInterval = conf.getLong(DFS_BLOCKREPORT_INTERVAL_MSEC_KEY,
+ FSConstants.BLOCKREPORT_INTERVAL);
+ this.initialBlockReportDelay = conf.getLong(
+ DFS_BLOCKREPORT_INITIAL_DELAY_KEY,
+ FSConstants.BLOCKREPORT_INITIAL_DELAY) * 1000L;
if (this.initialBlockReportDelay >= blockReportInterval) {
this.initialBlockReportDelay = 0;
LOG.info("dfs.blockreport.initialDelay is greater than " +
"dfs.blockreport.intervalMsec." + " Setting initial delay to 0 msec:");
}
- this.heartBeatInterval = conf.getLong(DFS_HEARTBEAT_INTERVAL_KEY, HEARTBEAT_INTERVAL) * 1000L;
+ this.heartBeatInterval = conf.getLong(DFS_HEARTBEAT_INTERVAL_KEY,
+ FSConstants.HEARTBEAT_INTERVAL) * 1000L;
{code}
- Change DFSConfigKeys.DFS_NAMENODE_SAFEMODE_EXTENSION_DEFAULT to 0 and use it below.
{code}
+ this.extension = conf.getInt(DFS_NAMENODE_SAFEMODE_EXTENSION_KEY, 0);
{code}
Some other suggestions:
- Define a conf key for "io.file.buffer.size".
- Rename BUFFER_SIZE to IO_FILE_BUFFER_SIZE in FSConstants.
- rename SIZE_OF_INTEGER to NUM_BYTES_OF_INTEGER in FSConstants.
- Move everything in FSConstants to HdfsConstatns. (BTW, we also has another FsConstants in common; see HDFS-1620.)
- Change HdfsConstatns interface to a final class.
> Remove implementing FSConstants interface just to access the constants defined in the interface
> -----------------------------------------------------------------------------------------------
>
> Key: HDFS-2241
> URL: https://issues.apache.org/jira/browse/HDFS-2241
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: Suresh Srinivas
> Assignee: Suresh Srinivas
> Fix For: 0.23.0
>
> Attachments: HDFS-2241.patch
>
>
> Currently many classes implement FSConstants.java interface just for the convenience of accessing the constants defined in it. This could be done by using static imports or in some cases using FSConstants.<CONSTANT_NAME>, with no need for implementing the interface.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira