コード例 #1
0
ファイル: MakeDirectory.cs プロジェクト: galakt/WebHDFS.Kitty
        public async Task CreateNewDir()
        {
            client = new WebHdfsClient(DataTestUtility.HdfsConnStr);
            var dirPath = $"{DataTestUtility.HdfsRootDir}/{nameof(CreateNewDir)}/MakeDirTest";

            var result = await client.MakeDirectory(dirPath, "770");

            Assert.True(result);
        }
コード例 #2
0
        public async Task RemoveDirectory()
        {
            client = new WebHdfsClient(DataTestUtility.HdfsConnStr);
            var filePath = $"{DataTestUtility.HdfsRootDir}/{nameof(RemoveDirectory)}/";
            await client.MakeDirectory(filePath, "770");

            await client.Delete(filePath, Recursive : true);

            await Assert.ThrowsAsync <System.InvalidOperationException>(() => client.GetFileStatus(filePath));
        }
コード例 #3
0
        public async Task GetStatusOfDirectory()
        {
            client = new WebHdfsClient(DataTestUtility.HdfsConnStr);
            var dirPath = $"{DataTestUtility.HdfsRootDir}/{nameof(GetStatusOfDirectory)}";
            await client.MakeDirectory(dirPath, "755");

            var fileStat = await client.GetFileStatus(dirPath);

            Assert.True(fileStat.Length == 0);
            Assert.True(fileStat.Type == "DIRECTORY");
            Assert.True(fileStat.Permission == "755");
        }
コード例 #4
0
ファイル: MakeDirectory.cs プロジェクト: galakt/WebHDFS.Kitty
        public async Task CreateNewDirWithControl()
        {
            client = new WebHdfsClient(DataTestUtility.HdfsConnStr);
            var dirPath = $"{DataTestUtility.HdfsRootDir}/{nameof(CreateNewDirWithControl)}/MakeDirTest";
            await client.Delete(dirPath, Recursive : true);

            var result = await client.MakeDirectory(dirPath, "770");

            var dirStatus = await client.GetFileStatus(dirPath);

            Assert.True(dirStatus.Type == "DIRECTORY" && dirStatus.Permission == "770");
            Assert.True(result);
        }
コード例 #5
0
ファイル: CrSnapshot.cs プロジェクト: galakt/WebHDFS.Kitty
        public async Task CreateSnapshot()
        {
            client = new WebHdfsClient(DataTestUtility.HdfsConnStr);
            var dirPath = $"{DataTestUtility.HdfsRootDir}/{nameof(CreateSnapshot)}/";
            await client.MakeDirectory(dirPath, "770");


            var result = await client.CreateSnapshot(dirPath);

            var fileStat = await client.GetFileStatus($"{dirPath}SNAPSHOT");

            Assert.True(false);
        }
コード例 #6
0
        public async Task SetPermissOfDirectory()
        {
            client = new WebHdfsClient(DataTestUtility.HdfsConnStr);
            var dirPath = $"{DataTestUtility.HdfsRootDir}/{nameof(SetPermissOfDirectory)}";
            await client.Delete(dirPath, Recursive : true);

            await client.MakeDirectory(dirPath, "750");

            await client.SetPermission(dirPath, 700);

            var fileStat = await client.GetFileStatus(dirPath);

            Assert.True(fileStat.Permission == "700");
        }