Source:
public void activeSyncMetadata(AlluxioURI path, Collection<AlluxioURI> changedFiles, ExecutorService executorService) throws IOException { if (changedFiles == null) { LOG.info("Start an active full sync of {}", path.toString()); } else { LOG.info("Start an active incremental sync of files", changedFiles.size()); } if (changedFiles != null && changedFiles.isEmpty()) { return; } Map<AlluxioURI, UfsStatus> statusCache; try (RpcContext rpcContext = createRpcContext()) { if (changedFiles == null) { statusCache = populateStatusCache(path, DescendantType.ALL); } else { statusCache = populateStatusCache(PathUtils.findLowestCommonAncestor(changedFiles), DescendantType.ALL); } if (changedFiles == null) { LockingScheme lockingScheme = new LockingScheme(path, LockPattern.READ, true); try (LockedInodePath inodePath = mInodeTree.lockInodePath(lockingScheme.getPath(), lockingScheme.getPattern())) { syncMetadataInternal(rpcContext, inodePath, lockingScheme, DescendantType.ALL, statusCache); } LOG.info("Ended an active full sync of {}", path.toString()); return; } else { Set<Callable<Void>> callables = new HashSet<>(); for (AlluxioURI changedFile : changedFiles) { callables.add(() -> { LockingScheme lockingScheme = new LockingScheme(path, LockPattern.READ, true); try (LockedInodePath changedFilePath = mInodeTree.lockInodePath(changedFile, lockingScheme.getPattern())) { syncMetadataInternal(rpcContext, changedFilePath, lockingScheme, DescendantType.NONE, statusCache); } catch (InvalidPathException e) { LOG.info("forceSyncMetadata processed an invalid path {}", changedFile.getPath()); } return null; }); } executorService.invokeAll(callables); } } catch (InvalidPathException e) { LOG.warn("InvalidPathException during active sync: {}", e.toString()); } catch (InterruptedException e) { LOG.warn("InterruptedException during active sync: {}", e.toString()); Thread.currentThread().interrupt(); return; } LOG.info("Ended an active incremental sync of files", changedFiles.size()); }

Target:
public void activeSyncMetadata(AlluxioURI path, Collection<AlluxioURI> changedFiles, ExecutorService executorService) throws IOException { if (changedFiles == null) { LOG.info("Start an active full sync of {}", path.toString()); } else { LOG.info("Start an active incremental sync of files", changedFiles.size()); } if (changedFiles != null && changedFiles.isEmpty()) { return; } try (RpcContext rpcContext = createRpcContext()) { if (changedFiles == null) { LockingScheme lockingScheme = new LockingScheme(path, LockPattern.READ, true); try (LockedInodePath inodePath = mInodeTree.lockInodePath(lockingScheme.getPath(), lockingScheme.getPattern())) { syncMetadataInternal(rpcContext, inodePath, lockingScheme, DescendantType.ALL, populateStatusCache(path, DescendantType.ALL)); } LOG.info("Ended an active full sync of {}", path.toString()); return; } else { Map<AlluxioURI, UfsStatus> statusCache = populateStatusCache( PathUtils.findLowestCommonAncestor(changedFiles), DescendantType.ALL); Set<Callable<Void>> callables = new HashSet<>(); for (AlluxioURI changedFile : changedFiles) { callables.add(() -> { LockingScheme lockingScheme = new LockingScheme(path, LockPattern.READ, true); try (LockedInodePath changedFilePath = mInodeTree.lockInodePath(changedFile, lockingScheme.getPattern())) { syncMetadataInternal(rpcContext, changedFilePath, lockingScheme, DescendantType.NONE, statusCache); } catch (InvalidPathException e) { LOG.info("forceSyncMetadata processed an invalid path {}", changedFile.getPath()); } return null; }); } executorService.invokeAll(callables); } } catch (InvalidPathException e) { LOG.warn("InvalidPathException during active sync: {}", e.toString()); } catch (InterruptedException e) { LOG.warn("InterruptedException during active sync: {}", e.toString()); Thread.currentThread().interrupt(); return; } LOG.info("Ended an active incremental sync of files", changedFiles.size()); }