コード例 #1
0
        public virtual void TestGetBlockLocations()
        {
            Path targetFilePath = new Path(targetTestRoot, "data/largeFile");

            FileContextTestHelper.CreateFile(fcTarget, targetFilePath, 10, 1024);
            Path viewFilePath = new Path("/data/largeFile");

            FileContextTestHelper.CheckFileStatus(fcView, viewFilePath.ToString(), FileContextTestHelper.FileType
                                                  .isFile);
            BlockLocation[] viewBL = fcView.GetFileBlockLocations(viewFilePath, 0, 10240 + 100
                                                                  );
            Assert.Equal(SupportsBlocks ? 10 : 1, viewBL.Length);
            BlockLocation[] targetBL = fcTarget.GetFileBlockLocations(targetFilePath, 0, 10240
                                                                      + 100);
            CompareBLs(viewBL, targetBL);
            // Same test but now get it via the FileStatus Parameter
            fcView.GetFileBlockLocations(viewFilePath, 0, 10240 + 100);
            targetBL = fcTarget.GetFileBlockLocations(targetFilePath, 0, 10240 + 100);
            CompareBLs(viewBL, targetBL);
        }
コード例 #2
0
 /// <exception cref="Org.Apache.Hadoop.Security.AccessControlException"/>
 /// <exception cref="System.IO.FileNotFoundException"/>
 /// <exception cref="Org.Apache.Hadoop.FS.UnsupportedFileSystemException"/>
 /// <exception cref="System.IO.IOException"/>
 public override BlockLocation[] GetFileBlockLocations(Path f, long start, long len
                                                       )
 {
     return(fc.GetFileBlockLocations(f, start, len));
 }