sheetalshah1007 commented on code in PR #304:
URL: https://github.com/apache/atlas/pull/304#discussion_r1998091418


##########
repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java:
##########
@@ -121,26 +121,56 @@ public static boolean isNameInvalid(String name) {
     public List<AtlasGlossary> getGlossaries(int limit, int offset, SortOrder 
sortOrder) throws AtlasBaseException {
         LOG.debug("==> GlossaryService.getGlossaries({}, {}, {})", limit, 
offset, sortOrder);
 
-        List<String>             glossaryGuids    = 
AtlasGraphUtilsV2.findEntityGUIDsByType(GlossaryUtils.ATLAS_GLOSSARY_TYPENAME, 
sortOrder);
-        PaginationHelper<String> paginationHelper = new 
PaginationHelper<>(glossaryGuids, offset, limit);
+        List<String> glossaryGuids = 
AtlasGraphUtilsV2.findEntityGUIDsByType(GlossaryUtils.ATLAS_GLOSSARY_TYPENAME, 
sortOrder);
+
+        if (CollectionUtils.isEmpty(glossaryGuids)) {
+            return Collections.emptyList();
+        }
+
+        List<AtlasGlossary> ret           = new ArrayList<>();
+        int                 currentOffset = offset;
+        int                 maxSize       = glossaryGuids.size();
+
+        // If limit is negative, use maxSize; otherwise, take the minimum of 
limit and maxSize
+        int adjustedLimit = (limit < 0) ? maxSize : Integer.min(maxSize, 
limit);
 
-        List<AtlasGlossary>                  ret;
-        List<String>                         guidsToLoad = 
paginationHelper.getPaginatedList();
-        AtlasEntity.AtlasEntitiesWithExtInfo glossaryEntities;
+        // Enable skipping failed entities during processing
+        RequestContext.get().setSkipFailedEntities(true);

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@atlas.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to