Exemple #1
0
 public static void BeforeClassSetUp()
 {
     conf.SetBoolean(DFSConfigKeys.DfsPermissionsEnabledKey, true);
     conf.SetBoolean(DFSConfigKeys.DfsNamenodeAclsEnabledKey, true);
     conf.Set(FsPermission.UmaskLabel, "000");
     cluster = new MiniDFSCluster.Builder(conf).NumDataNodes(3).Build();
     cluster.WaitActive();
     fs      = cluster.GetFileSystem();
     wrapper = new FileSystemTestWrapper(fs);
 }
Exemple #2
0
        public virtual void Setup()
        {
            conf     = new HdfsConfiguration();
            fsHelper = new FileSystemTestHelper();
            // Set up java key store
            string   testRoot    = fsHelper.GetTestRootDir();
            FilePath testRootDir = new FilePath(testRoot).GetAbsoluteFile();
            Path     jksPath     = new Path(testRootDir.ToString(), "test.jks");

            conf.Set(DFSConfigKeys.DfsEncryptionKeyProviderUri, JavaKeyStoreProvider.SchemeName
                     + "://file" + jksPath.ToUri());
            cluster = new MiniDFSCluster.Builder(conf).NumDataNodes(1).Build();
            Logger.GetLogger(typeof(EncryptionZoneManager)).SetLevel(Level.Trace);
            fs        = cluster.GetFileSystem();
            fsWrapper = new FileSystemTestWrapper(cluster.GetFileSystem());
            fcWrapper = new FileContextTestWrapper(FileContext.GetFileContext(cluster.GetURI(
                                                                                  ), conf));
            dfsAdmin = new HdfsAdmin(cluster.GetURI(), conf);
            // Need to set the client's KeyProvider to the NN's for JKS,
            // else the updates do not get flushed properly
            fs.GetClient().SetKeyProvider(cluster.GetNameNode().GetNamesystem().GetProvider()
                                          );
            DFSTestUtil.CreateKey(TestKey, cluster, conf);
        }