From 8b3286b155e8a5c0d740777e57d91870e403aa10 Mon Sep 17 00:00:00 2001 From: aarshi Date: Wed, 31 Jan 2024 21:06:44 +0530 Subject: [PATCH] undo async code --- .../bootstrap/AuthPoliciesBootstrapper.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AuthPoliciesBootstrapper.java b/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AuthPoliciesBootstrapper.java index 64b8df815c..310f9720e8 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AuthPoliciesBootstrapper.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AuthPoliciesBootstrapper.java @@ -105,7 +105,7 @@ private void loadPoliciesInFolder (File folder) { String policiesDirName = folder.getName(); File[] policyFiles = folder.exists() ? folder.listFiles() : null; - List fileList= new ArrayList<>(0); + // List fileList= new ArrayList<>(0); if (ArrayUtils.isNotEmpty(policyFiles)) { @@ -115,17 +115,17 @@ private void loadPoliciesInFolder (File folder) { if (!item.isFile()) { loadPoliciesInFolder(item); } else { - //loadPoliciesInFile(item); - fileList.add(item); + loadPoliciesInFile(item); + //fileList.add(item); } } // loadPoliciesInFile in async - List> futures = fileList.stream() - .map(file -> CompletableFuture.runAsync(() -> loadPoliciesInFile(file))) - .collect(Collectors.toList()); - - CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join(); +// List> futures = fileList.stream() +// .map(file -> CompletableFuture.runAsync(() -> loadPoliciesInFile(file))) +// .collect(Collectors.toList()); +// +// CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join(); } else { LOG.warn("No policies for Bootstrapping in directory {}..", policiesDirName); }