/** * @return the length in bytes of the file, 0 for directories, mutable */ public long getLength() { return mInfo.getLength(); }
long fileId = mFileSystemMasterView.getFileId(path); try { if (mFileSystemMasterView.getFileInfo(fileId).getLength() == 0) {
offset = relativeOffset; } else { offset = fileInfo.getLength() - relativeOffset; } else if (offset > fileInfo.getLength()) { offset = fileInfo.getLength(); UIFileInfo toAdd = new UIFileInfo(fileInfo); try { if (!toAdd.getIsDirectory() && fileInfo.getLength() > 0) { FileBlockInfo blockInfo = mFileSystemMaster.getFileBlockInfoList(new AlluxioURI(toAdd.getAbsolutePath()))
.setUfsPath(fileInfo.getUfsPath()).setLength(fileInfo.getLength()) .setBlockSizeBytes(fileInfo.getBlockSizeBytes()) .setCreationTimeMs(fileInfo.getCreationTimeMs()).setCompleted(fileInfo.isCompleted())
/** * Tests the {@link MutableInodeDirectory#generateClientFileInfo(String)} method. */ @Test public void generateClientFileInfo() { MutableInodeDirectory inodeDirectory = createInodeDirectory(); String path = "/test/path"; FileInfo info = inodeDirectory.generateClientFileInfo(path); Assert.assertEquals(inodeDirectory.getId(), info.getFileId()); Assert.assertEquals(inodeDirectory.getName(), info.getName()); Assert.assertEquals(path, info.getPath()); Assert.assertEquals("", info.getUfsPath()); Assert.assertEquals(0, info.getLength()); Assert.assertEquals(0, info.getBlockSizeBytes()); Assert.assertEquals(inodeDirectory.getCreationTimeMs(), info.getCreationTimeMs()); Assert.assertTrue(info.isCompleted()); Assert.assertTrue(info.isFolder()); Assert.assertEquals(inodeDirectory.isPinned(), info.isPinned()); Assert.assertFalse(info.isCacheable()); Assert.assertNotNull(info.getBlockIds()); Assert.assertEquals(inodeDirectory.getLastModificationTimeMs(), info.getLastModificationTimeMs()); } }
/** * @return the length in bytes of the file, 0 for directories, mutable */ public long getLength() { return mInfo.getLength(); }
/** * @return the length in bytes of the file, 0 for directories, mutable */ public long getLength() { return mInfo.getLength(); }
Assert.assertEquals(uriStatus.getLastModificationTimeMs(), fileInfo.getLastModificationTimeMs()); Assert.assertEquals(uriStatus.getLength(), fileInfo.getLength()); Assert.assertEquals(uriStatus.getName(), fileInfo.getName()); Assert.assertEquals(uriStatus.getPath(), fileInfo.getPath());
long fileId = mFileSystemMasterView.getFileId(path); try { if (mFileSystemMasterView.getFileInfo(fileId).getLength() == 0) {
offset = relativeOffset; } else { offset = fileInfo.getLength() - relativeOffset; } else if (offset > fileInfo.getLength()) { offset = fileInfo.getLength(); UIFileInfo toAdd = new UIFileInfo(fileInfo); try { if (!toAdd.getIsDirectory() && fileInfo.getLength() > 0) { FileBlockInfo blockInfo = fileSystemMaster.getFileBlockInfoList(new AlluxioURI(toAdd.getAbsolutePath())).get(0);