private UiFileInfo(ClientFileInfo fileInfo) {
   ID = fileInfo.getId();
   NAME = fileInfo.getName();
   ABSOLUATE_PATH = fileInfo.getPath();
   CHECKPOINT_PATH = fileInfo.getCheckpointPath();
   SIZE = fileInfo.getSizeBytes();
   CREATION_TIME_MS = fileInfo.getCreationTimeMs();
   IN_MEMORY = fileInfo.isInMemory();
   IS_DIRECTORY = fileInfo.isFolder();
   mFileLocations = new ArrayList<String>();
 }
 @Test
 public void clientFileInfoEmptyFileTest()
     throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException,
         BlockInfoException, TachyonException {
   int fileId = mMasterInfo.createFile("/testFile", Constants.DEFAULT_BLOCK_SIZE_BYTE);
   ClientFileInfo fileInfo = mMasterInfo.getClientFileInfo("/testFile");
   Assert.assertEquals("testFile", fileInfo.getName());
   Assert.assertEquals(fileId, fileInfo.getId());
   Assert.assertEquals(0, fileInfo.getLength());
   Assert.assertEquals("", fileInfo.getUfsPath());
   Assert.assertFalse(fileInfo.isFolder);
   Assert.assertFalse(fileInfo.isPinned);
   Assert.assertTrue(fileInfo.isCache);
   Assert.assertFalse(fileInfo.isComplete);
 }
 @Test
 public void clientFileInfoDirectoryTest()
     throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException,
         TachyonException {
   Assert.assertTrue(mMasterInfo.mkdirs("/testFolder", true));
   ClientFileInfo fileInfo = mMasterInfo.getClientFileInfo("/testFolder");
   Assert.assertEquals("testFolder", fileInfo.getName());
   Assert.assertEquals(2, fileInfo.getId());
   Assert.assertEquals(0, fileInfo.getLength());
   Assert.assertEquals("", fileInfo.getUfsPath());
   Assert.assertTrue(fileInfo.isFolder);
   Assert.assertFalse(fileInfo.isPinned);
   Assert.assertFalse(fileInfo.isCache);
   Assert.assertTrue(fileInfo.isComplete);
 }
示例#4
0
 public UiFileInfo(ClientFileInfo fileInfo) {
   mId = fileInfo.getId();
   mDependencyId = fileInfo.getDependencyId();
   mName = fileInfo.getName();
   mAbsolutePath = fileInfo.getPath();
   mCheckpointPath = fileInfo.getUfsPath();
   mBlockSizeBytes = fileInfo.getBlockSizeByte();
   mSize = fileInfo.getLength();
   mCreationTimeMs = fileInfo.getCreationTimeMs();
   mLastModificationTimeMs = fileInfo.getLastModificationTimeMs();
   mInMemory = (100 == fileInfo.inMemoryPercentage);
   mInMemoryPercent = fileInfo.getInMemoryPercentage();
   mIsDirectory = fileInfo.isFolder;
   mIsPinned = fileInfo.isPinned;
   mFileLocations = new ArrayList<String>();
 }