commit | 8702a885235aa50b603feb8b1d8d491741b4e693 | [log] [tgz] |
---|---|---|
author | Shawn Pearce <sop@google.com> | Sun May 15 21:28:58 2016 -0700 |
committer | Shawn Pearce <sop@google.com> | Sun May 15 22:21:36 2016 -0700 |
tree | 0a4aa4db6d1ec5f4da5eca2499b215a52c30b145 | |
parent | c48cdc8a2a57e63c115cc6038da6770fe4a83d68 [diff] |
CurrentUser.PropertyKey<T>: allow plugins to cache data on users This new map inside of both IdentifiedUser and AccountState allows plugins to store their own information within a single user instance, or the cached AccountState. A property cache is primarily useful for an expensive AvatarProvider that may need to lookup data based on AccountExternalIds on the AccountState or the IdentifiedUser and reuse this for multiple getUrl() invocations of varying image sizes. Plugins can use it like this: private static final CurrentUser.PropertyKey<String> imageUrl = CurrentUser.PropertyKey.create(); public String getUrl(IdentifiedUser user, int size) { String url = user.get(imageUrl); if (url == null) { url = "http://image.host/" + userId + "?size="; user.set(imageUrl, url); } return url + size; } Begin using this for the notification filters, which are only used inside of IsWatchedByPredicate, a non-common predicate. This gets the database code out of IdentifiedUser and isolates it down to the sole user in the query system. Change-Id: Ica7409411eaf60af8d554c33b873c930b9abea6f
Gerrit is a code review and project management tool for Git based projects.
Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.
Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.
For information about how to install and use Gerrit, refer to the documentation.
Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.
Please report bugs on the issue tracker.
Gerrit is the work of hundreds of contributors. We appreciate your help!
Please read the contribution guidelines.
Note that we do not accept Pull Requests via the Github mirror.
The IRC channel on freenode is #gerrit. An archive is available at: echelog.com.
The Developer Mailing list is repo-discuss on Google Groups.
Gerrit is provided under the Apache License 2.0.
Install Buck and run the following:
git clone --recursive https://gerrit.googlesource.com/gerrit cd gerrit && buck build release
The instruction how to configure GerritForge/BinTray repositories is here
On Debian/Ubuntu run:
apt-get update & apt-get install gerrit=<version>-<release>
NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.
On CentOS/RedHat run:
yum clean all && yum install gerrit-<version>[-<release>]
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.