From 4fddf2a3048cd4fdc0758daf920d5da0958e1d03 Mon Sep 17 00:00:00 2001 From: Suman Das <59254445+sumandas0@users.noreply.github.com> Date: Fri, 1 Dec 2023 10:47:09 +0530 Subject: [PATCH] feat: make pagination size configurable --- .../java/org/apache/atlas/plugin/util/KeycloakUserStore.java | 4 +++- intg/src/main/java/org/apache/atlas/AtlasConfiguration.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/auth-agents-common/src/main/java/org/apache/atlas/plugin/util/KeycloakUserStore.java b/auth-agents-common/src/main/java/org/apache/atlas/plugin/util/KeycloakUserStore.java index a02cffb10e..53b9dadeeb 100644 --- a/auth-agents-common/src/main/java/org/apache/atlas/plugin/util/KeycloakUserStore.java +++ b/auth-agents-common/src/main/java/org/apache/atlas/plugin/util/KeycloakUserStore.java @@ -20,6 +20,7 @@ package org.apache.atlas.plugin.util; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import org.apache.atlas.AtlasConfiguration; import org.apache.atlas.RequestContext; import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.plugin.model.RangerRole; @@ -30,6 +31,7 @@ import org.keycloak.representations.idm.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.apache.commons.configuration.Configuration; import java.util.*; import java.util.concurrent.Callable; @@ -388,7 +390,7 @@ public RangerRole call() throws Exception { //get all groups for Roles Thread groupsFetcher = new Thread(() -> { int start = 0; - int size = 500; + int size = AtlasConfiguration.KEYCLOAK_ADMIN_API_RESOURCE_PAGINATION_SIZE.getInt(); boolean found = true; Set ret = new HashSet<>(); diff --git a/intg/src/main/java/org/apache/atlas/AtlasConfiguration.java b/intg/src/main/java/org/apache/atlas/AtlasConfiguration.java index 8c019d16d9..783c7ed177 100644 --- a/intg/src/main/java/org/apache/atlas/AtlasConfiguration.java +++ b/intg/src/main/java/org/apache/atlas/AtlasConfiguration.java @@ -107,7 +107,8 @@ public enum AtlasConfiguration { SEARCH_LOGGER_MAX_THREADS("atlas.enable.search.logger.max.threads", 20), PERSONA_POLICY_ASSET_MAX_LIMIT("atlas.persona.policy.asset.maxlimit", 1000), - ENABLE_KEYCLOAK_TOKEN_INTROSPECTION("atlas.canary.keycloak.token-introspection", false); + ENABLE_KEYCLOAK_TOKEN_INTROSPECTION("atlas.canary.keycloak.token-introspection", false), + KEYCLOAK_ADMIN_API_RESOURCE_PAGINATION_SIZE("atlas.keycloak.admin.resource-pagination-size", 500); private static final Configuration APPLICATION_PROPERTIES;