vyommani commented on code in PR #748:
URL: https://github.com/apache/ranger/pull/748#discussion_r2572830432
##########
security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java:
##########
@@ -4298,6 +4308,45 @@ private RangerPolicyList
toRangerPolicyList(List<RangerPolicy> policyList, Searc
return ret;
}
+ private List<RangerPolicy> getRangerPoliciesInRange(List<RangerPolicy>
policyList, SearchFilter filter) {
+ List<RangerPolicy> retList = null;
+ if (CollectionUtils.isNotEmpty(policyList)) {
+ int totalCount = policyList.size();
+ int startIndex = filter.getBeginIndex();
+ int pageSize = filter.getOffset();
+ int toIndex = Math.min(startIndex + pageSize, totalCount);
+ LOG.info("==>totalCount: {}, startIndex:{}, pageSize: {}, toIndex:
{}" , totalCount, startIndex, pageSize, toIndex);
+ String sortType = filter.getSortType();
+ String sortBy = filter.getSortBy();
+
+ if (StringUtils.isNotEmpty(sortBy) &&
StringUtils.isNotEmpty(sortType)) {
Review Comment:
The sorting conditions for POLICY_NAME can be simplified since both ASC and
DESC call the same comparator method
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]