Partially revert GroupDetail to fix Admin > Groups issues
Loading Admin > Groups on a large server is horribly slow because someone thought it was a good idea to reuse GroupDetail infccf928042. That caused the entire group membership database to be downloaded to the browser when showing just the list of groups, only to have the data discarded and reloaded after selecting a specific group to view. If a server has 7k users and 17k groups, it could take ages to show the groups list. Strip out GroupDetail and switch back to the more lightweight AccountGroup type when showing the groups in a list format. Since there are only 3 SYSTEM groups using well known names, and everything else returned is of type INTERNAL because the LDAP type no longer exists, drop the type column from the table, it isn't really interesting anymore. This change does drop the Owner group name column header. Displaying it can really slow down on large servers when there are a lot of groups. So skip displaying the owner name. Its more important to me that the Admin > Groups table doesn't download the entire database than having the owner group resolved in the list view. If someone really cares enough, they can reattempt whatfccf928042was trying to accomplish, without downloading the entire membership database. Change-Id: I884a5129d238b7aaaf6db8a886e7c0a49f73cf74
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
package com.google.gerrit.sshd.commands;
|
||||
|
||||
import com.google.gerrit.common.data.GroupDetail;
|
||||
import com.google.gerrit.common.data.GroupList;
|
||||
import com.google.gerrit.common.errors.NoSuchGroupException;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
@@ -26,7 +25,6 @@ import com.google.gerrit.server.ioutil.ColumnFormatter;
|
||||
import com.google.gerrit.server.project.ProjectControl;
|
||||
import com.google.gerrit.sshd.SshCommand;
|
||||
import com.google.gwtorm.client.KeyUtil;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.kohsuke.args4j.Option;
|
||||
@@ -84,8 +82,7 @@ public class ListGroupsCommand extends SshCommand {
|
||||
}
|
||||
|
||||
final ColumnFormatter formatter = new ColumnFormatter(stdout, '\t');
|
||||
for (final GroupDetail groupDetail : groupList.getGroups()) {
|
||||
final AccountGroup g = groupDetail.group;
|
||||
for (final AccountGroup g : groupList.getGroups()) {
|
||||
formatter.addColumn(g.getName());
|
||||
if (verboseOutput) {
|
||||
formatter.addColumn(KeyUtil.decode(g.getGroupUUID().toString()));
|
||||
@@ -102,8 +99,6 @@ public class ListGroupsCommand extends SshCommand {
|
||||
formatter.nextLine();
|
||||
}
|
||||
formatter.finish();
|
||||
} catch (OrmException e) {
|
||||
throw die(e);
|
||||
} catch (NoSuchGroupException e) {
|
||||
throw die(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user