/** * Waits for the file to complete before opening it. * * @param uri the file path to check * @return whether the file is completed or not */ private boolean waitForFileCompleted(AlluxioURI uri) { try { CommonUtils.waitFor("file completed", () -> { try { return mFileSystem.getStatus(uri).isCompleted(); } catch (Exception e) { throw new RuntimeException(e); } }, WaitForOptions.defaults().setTimeoutMs(MAX_OPEN_WAITTIME_MS)); return true; } catch (InterruptedException ie) { Thread.currentThread().interrupt(); return false; } catch (TimeoutException te) { return false; } }
+ "created.", uri); } else { completed = fs.getStatus(uri).isCompleted();
if (!status.isCompleted() && !waitForFileCompleted(uri)) { LOG.error("Cannot open incomplete folder {}", path); return -ErrorCodes.EFAULT();
try { URIStatus status = mFileSystem.getStatus(turi); if (!status.isCompleted()) {
String fileData; URIStatus status = fs.getStatus(absolutePath); if (status.isCompleted()) { OpenFilePOptions options = OpenFilePOptions.newBuilder().setReadType(ReadPType.NO_CACHE).build();
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());
+ "created.", uri); } else { completed = fs.getStatus(uri).isCompleted();
String fileData; URIStatus status = fs.getStatus(path); if (status.isCompleted()) { OpenFileOptions options = OpenFileOptions.defaults().setReadType(ReadType.NO_CACHE); try (FileInStream is = fs.openFile(path, options)) {