/** * @return whether the entity referenced by this uri has been marked as completed, immutable */ public boolean isCompleted() { return mInfo.isCompleted(); }
try { FileInfo fileInfo = mFileSystemMasterView.getFileInfo(fileId); if (fileInfo.isCompleted()) { fileIdsToPersist.add(fileId); List<Long> blockIds = new ArrayList<>();
.setUfsPath(fileInfo.getUfsPath()).setLength(fileInfo.getLength()) .setBlockSizeBytes(fileInfo.getBlockSizeBytes()) .setCreationTimeMs(fileInfo.getCreationTimeMs()).setCompleted(fileInfo.isCompleted()) .setFolder(fileInfo.isFolder()).setPinned(fileInfo.isPinned()) .setCacheable(fileInfo.isCacheable()).setPersisted(fileInfo.isPersisted())
/** * 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 whether the entity referenced by this uri has been marked as completed, immutable */ public boolean isCompleted() { return mInfo.isCompleted(); }
/** * @return whether the entity referenced by this uri has been marked as completed, immutable */ public boolean isCompleted() { return mInfo.isCompleted(); }
Assert.assertEquals(a.getUfsPath(), b.getUfsPath()); Assert.assertEquals(a.isCacheable(), b.isCacheable()); Assert.assertEquals(a.isCompleted(), b.isCompleted()); Assert.assertEquals(a.isFolder(), b.isFolder()); Assert.assertEquals(a.isMountPoint(), b.isMountPoint());
Assert.assertEquals(uriStatus.getOwner(), fileInfo.getOwner()); Assert.assertEquals(uriStatus.isCacheable(), fileInfo.isCacheable()); Assert.assertEquals(uriStatus.isCompleted(), fileInfo.isCompleted()); Assert.assertEquals(uriStatus.isFolder(), fileInfo.isFolder()); Assert.assertEquals(uriStatus.isPersisted(), fileInfo.isPersisted());
/** * Checks if all the output files of the given lineage are completed. * * @param lineage the lineage to check * @param fileSystemMasterView the view of the file system master where the output file lies * @return true if all the output files of the given lineage are completed, false otherwise * @throws FileDoesNotExistException if the file does not exist * @throws AccessControlException if permission denied */ public static boolean isCompleted(Lineage lineage, FileSystemMasterView fileSystemMasterView) throws FileDoesNotExistException, AccessControlException, UnavailableException { for (long outputFile : lineage.getOutputFiles()) { FileInfo fileInfo = fileSystemMasterView.getFileInfo(outputFile); if (!fileInfo.isCompleted()) { return false; } } return true; }
for (long fileId : scheduledFiles) { FileInfo fileInfo = mFileSystemMasterView.getFileInfo(fileId); if (fileInfo.isCompleted()) { fileIdsToPersist.add(fileId); List<Long> blockIds = new ArrayList<>();
@Override public synchronized long reinitializeFile(String path, long blockSizeBytes, long ttl, TtlAction ttlAction) throws InvalidPathException, LineageDoesNotExistException, AccessControlException, FileDoesNotExistException, UnavailableException { long fileId = mFileSystemMaster.getFileId(new AlluxioURI(path)); FileInfo fileInfo; try { fileInfo = mFileSystemMaster.getFileInfo(fileId); if (!fileInfo.isCompleted() || mFileSystemMaster.getLostFiles().contains(fileId)) { LOG.info("Recreate the file {} with block size of {} bytes", path, blockSizeBytes); return mFileSystemMaster.reinitializeFile(new AlluxioURI(path), blockSizeBytes, ttl, ttlAction); } } catch (FileDoesNotExistException e) { throw new LineageDoesNotExistException( ExceptionMessage.MISSING_REINITIALIZE_FILE.getMessage(path)); } return -1; }