hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uma Maheswara Rao G (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HDFS-3301) Add public waitOnSafeMode API with HdfsUtils
Date Thu, 19 Apr 2012 10:50:44 GMT

     [ https://issues.apache.org/jira/browse/HDFS-3301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Uma Maheswara Rao G resolved HDFS-3301.
---------------------------------------

    Resolution: Duplicate
    
> Add public waitOnSafeMode API with HdfsUtils 
> ---------------------------------------------
>
>                 Key: HDFS-3301
>                 URL: https://issues.apache.org/jira/browse/HDFS-3301
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs client
>    Affects Versions: 3.0.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>
> Add public waitOnSafeMode API as HdfsUtils.
> I have seen this util api in Hbase and using FSCOnstants in it. Currently that is deprecated
and moved the SafeModeActions to HdfsConstants and also marked as private audience. So, it
wil help adding such api in HdfsUtils itself to avoid the need of accessing HdfsConstants.
> from Hbase FSUtils class.
> {code}
>  /**
>    * If DFS, check safe mode and if so, wait until we clear it.
>    * @param conf configuration
>    * @param wait Sleep between retries
>    * @throws IOException e
>    */
>   public static void waitOnSafeMode(final Configuration conf,
>     final long wait)
>   throws IOException {
>     FileSystem fs = FileSystem.get(conf);
>     if (!(fs instanceof DistributedFileSystem)) return;
>     DistributedFileSystem dfs = (DistributedFileSystem)fs;
>     // Make sure dfs is not in safe mode
>     while (dfs.setSafeMode(org.apache.hadoop.hdfs.protocol.FSConstants.SafeModeAction.SAFEMODE_GET))
{
>       LOG.info("Waiting for dfs to exit safe mode...");
>       try {
>         Thread.sleep(wait);
>       } catch (InterruptedException e) {
>         //continue
>       }
>     }
>   }
> {code}

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

        

Mime
View raw message