예제 #1
0
        public virtual void TestDeprecatedKeys()
        {
            NfsConfiguration conf = new NfsConfiguration();

            conf.SetInt("nfs3.server.port", 998);
            NUnit.Framework.Assert.IsTrue(conf.GetInt(NfsConfigKeys.DfsNfsServerPortKey, 0) ==
                                          998);
            conf.SetInt("nfs3.mountd.port", 999);
            NUnit.Framework.Assert.IsTrue(conf.GetInt(NfsConfigKeys.DfsNfsMountdPortKey, 0) ==
                                          999);
            conf.Set("dfs.nfs.exports.allowed.hosts", "host1");
            NUnit.Framework.Assert.IsTrue(conf.Get(CommonConfigurationKeys.NfsExportsAllowedHostsKey
                                                   ).Equals("host1"));
            conf.SetInt("dfs.nfs.exports.cache.expirytime.millis", 1000);
            NUnit.Framework.Assert.IsTrue(conf.GetInt(Nfs3Constant.NfsExportsCacheExpirytimeMillisKey
                                                      , 0) == 1000);
            conf.SetInt("hadoop.nfs.userupdate.milly", 10);
            NUnit.Framework.Assert.IsTrue(conf.GetInt(IdMappingConstant.UsergroupidUpdateMillisKey
                                                      , 0) == 10);
            conf.Set("dfs.nfs3.dump.dir", "/nfs/tmp");
            NUnit.Framework.Assert.IsTrue(conf.Get(NfsConfigKeys.DfsNfsFileDumpDirKey).Equals
                                              ("/nfs/tmp"));
            conf.SetBoolean("dfs.nfs3.enableDump", false);
            NUnit.Framework.Assert.IsTrue(conf.GetBoolean(NfsConfigKeys.DfsNfsFileDumpKey, true
                                                          ) == false);
            conf.SetInt("dfs.nfs3.max.open.files", 500);
            NUnit.Framework.Assert.IsTrue(conf.GetInt(NfsConfigKeys.DfsNfsMaxOpenFilesKey, 0)
                                          == 500);
            conf.SetInt("dfs.nfs3.stream.timeout", 6000);
            NUnit.Framework.Assert.IsTrue(conf.GetInt(NfsConfigKeys.DfsNfsStreamTimeoutKey, 0
                                                      ) == 6000);
            conf.Set("dfs.nfs3.export.point", "/dir1");
            NUnit.Framework.Assert.IsTrue(conf.Get(NfsConfigKeys.DfsNfsExportPointKey).Equals
                                              ("/dir1"));
        }
예제 #2
0
        /// <exception cref="System.IO.IOException"/>
        internal static void StartService(string[] args, DatagramSocket registrationSocket
                                          )
        {
            StringUtils.StartupShutdownMessage(typeof(Org.Apache.Hadoop.Hdfs.Nfs.Nfs3.Nfs3),
                                               args, Log);
            NfsConfiguration conf = new NfsConfiguration();
            bool             allowInsecurePorts = conf.GetBoolean(NfsConfigKeys.DfsNfsPortMonitoringDisabledKey
                                                                  , NfsConfigKeys.DfsNfsPortMonitoringDisabledDefault);

            Org.Apache.Hadoop.Hdfs.Nfs.Nfs3.Nfs3 nfsServer = new Org.Apache.Hadoop.Hdfs.Nfs.Nfs3.Nfs3
                                                                 (conf, registrationSocket, allowInsecurePorts);
            nfsServer.StartServiceInternal(true);
        }