Skip to content

Commit

Permalink
Capping heap size used by StatefulIndexPrivileges
Browse files Browse the repository at this point in the history
Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
  • Loading branch information
nibix committed Aug 2, 2024
1 parent 2b4bc0e commit 78db68b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ dependencies {
implementation 'com.password4j:password4j:1.8.2'

// Action privileges: check tables and compact collections
implementation 'com.selectivem.collections:special-collections-complete:1.3.0'
implementation 'com.selectivem.collections:special-collections-complete:1.3.1'

//JWT
implementation "io.jsonwebtoken:jjwt-api:${jjwt_version}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -864,11 +864,11 @@ static class StatefulIndexPrivileges {
String,
CompactMapGroupBuilder.MapBuilder<String, DeduplicatingCompactSubSetBuilder.SubSetBuilder<String>>> actionToIndexToRoles =
new HashMap<>();
CompactMapGroupBuilder<String, DeduplicatingCompactSubSetBuilder.SubSetBuilder<String>> indexMapBuilder =
new CompactMapGroupBuilder<>(indices.keySet());
DeduplicatingCompactSubSetBuilder<String> roleSetBuilder = new DeduplicatingCompactSubSetBuilder<>(
roles.getCEntries().keySet()
);
CompactMapGroupBuilder<String, DeduplicatingCompactSubSetBuilder.SubSetBuilder<String>> indexMapBuilder =
new CompactMapGroupBuilder<>(indices.keySet(), (k2) -> roleSetBuilder.createSubSetBuilder());

top: for (Map.Entry<String, RoleV7> entry : roles.getCEntries().entrySet()) {
try {
Expand Down Expand Up @@ -907,7 +907,7 @@ static class StatefulIndexPrivileges {
DeduplicatingCompactSubSetBuilder.SubSetBuilder<String>> indexToRoles = actionToIndexToRoles
.computeIfAbsent(
action,
k -> indexMapBuilder.createMapBuilder((k2) -> roleSetBuilder.createSubSetBuilder())
k -> indexMapBuilder.createMapBuilder()
);

indexToRoles.get(indicesEntry.getKey()).add(roleName);
Expand Down

0 comments on commit 78db68b

Please sign in to comment.