diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java index 5c3410927e..99b39f3f5b 100755 --- a/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java +++ b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java @@ -494,8 +494,9 @@ private void resolveIndexFieldName(AtlasGraphManagement managementSystem, AtlasA } typeRegistry.addIndexFieldName(attribute.getVertexPropertyName(), indexFieldName); - - LOG.info("Property {} is mapped to index field name {}", attribute.getQualifiedName(), attribute.getIndexFieldName()); + if (LOG.isDebugEnabled()){ + LOG.info("Property {} is mapped to index field name {}", attribute.getQualifiedName(), attribute.getIndexFieldName()); + } } else { LOG.warn("resolveIndexFieldName(attribute={}): propertyKey is null for vertextPropertyName={}", attribute.getQualifiedName(), attribute.getVertexPropertyName()); } 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 9b1327ba1f..64b8df815c 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 @@ -42,7 +42,11 @@ import java.io.File; import java.nio.charset.StandardCharsets; import java.nio.file.Files; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.stream.Collectors; @Component @Order(9) @@ -101,6 +105,8 @@ private void loadPoliciesInFolder (File folder) { String policiesDirName = folder.getName(); File[] policyFiles = folder.exists() ? folder.listFiles() : null; + List fileList= new ArrayList<>(0); + if (ArrayUtils.isNotEmpty(policyFiles)) { Arrays.sort(policyFiles); @@ -109,9 +115,17 @@ private void loadPoliciesInFolder (File folder) { if (!item.isFile()) { loadPoliciesInFolder(item); } else { - loadPoliciesInFile(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(); } else { LOG.warn("No policies for Bootstrapping in directory {}..", policiesDirName); }