Skip to content

Commit

Permalink
122485: Temporary disable ancestor discovery to test the impact on pe…
Browse files Browse the repository at this point in the history
…rformance
  • Loading branch information
Jens Vannerum committed Dec 30, 2024
1 parent 22c6fcd commit 3477b0c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ public void additionalIndex(Context context, IndexableObject idxObj, SolrInputDo
// Community.
// TODO: Strictly speaking we should also check for epersons who received admin rights directly,
// without being part of the admin group. Finding them may be a lot slower though.
for (Collection collection : item.getCollections()) {
for (UUID unprefixedId : findTransitiveAdminGroupIds(context, collection)) {
document.addField("edit", "g" + unprefixedId);
}
}
//
// FIXME: Temporary disable ancestor discovery to test the impact on performance.
// for (Collection collection : item.getCollections()) {
// for (UUID unprefixedId : findTransitiveAdminGroupIds(context, collection)) {
// document.addField("edit", "g" + unprefixedId);
// }
// }

// Index groups and epersons with WRITE or direct ADMIN rights on the Item.
List<String> prefixedIds = findDirectlyAuthorizedGroupAndEPersonPrefixedIds(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ public void additionalIndex(Context context, IndexableObject idxObj, SolrInputDo
context.uncacheEntity(resourcePolicy);
}
}
dso = ContentServiceFactory.getInstance().getDSpaceObjectService(dso).getParentObject(context, dso);
// FIXME: Temporary disable ancestor discovery to test the impact on performance.
dso = null;
}
} catch (SQLException e) {
log.error(LogHelper.getHeader(context, "Error while indexing resource policies",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,25 +645,26 @@ public void writeDocument(Context context, IndexableItem indexableObject, SolrIn
@Override
public List<String> getLocations(Context context, IndexableItem indexableDSpaceObject)
throws SQLException {
final Item item = indexableDSpaceObject.getIndexedObject();
// FIXME: Temporary disable ancestor discovery to test the impact on performance.
List<String> locations = new ArrayList<>();

// build list of community ids
List<Community> communities = itemService.getCommunities(context, item);

// build list of collection ids
List<Collection> collections = item.getCollections();

// now put those into strings
int i = 0;

for (i = 0; i < communities.size(); i++) {
locations.add("m" + communities.get(i).getID());
}

for (i = 0; i < collections.size(); i++) {
locations.add("l" + collections.get(i).getID());
}
// final Item item = indexableDSpaceObject.getIndexedObject();
//
// // build list of community ids
// List<Community> communities = itemService.getCommunities(context, item);
//
// // build list of collection ids
// List<Collection> collections = item.getCollections();
//
// // now put those into strings
// int i = 0;
//
// for (i = 0; i < communities.size(); i++) {
// locations.add("m" + communities.get(i).getID());
// }
//
// for (i = 0; i < collections.size(); i++) {
// locations.add("l" + collections.get(i).getID());
// }

return locations;
}
Expand Down

0 comments on commit 3477b0c

Please sign in to comment.