Class ChangeField
- java.lang.Object
-
- com.google.gerrit.server.index.change.ChangeField
-
public class ChangeField extends Object
Fields indexed on change documents.Each field corresponds to both a field name supported by
ChangeQueryBuilder
for querying that field, and a method onChangeData
used for populating the corresponding document fields in the secondary index.Field names are all lowercase alphanumeric plus underscore; index implementations may create unambiguous derived field names containing other characters.
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.gerrit.index.FieldDef<ChangeData,Integer>
ADDED
The number of inserted lines in this change.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>>
APPROVAL
Serialized approvals for the current patch set, used for pre-populating results.static com.google.gwtorm.protobuf.ProtobufCodec<PatchSetApproval>
APPROVAL_CODEC
static com.google.gerrit.index.FieldDef<ChangeData,Integer>
ASSIGNEE
The user assigned to the change.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
AUTHOR
The exact email address, or any part of the author name or email address, in the current patch set.static com.google.gerrit.index.FieldDef<ChangeData,byte[]>
CHANGE
Serialized change object, used for pre-populating results.static com.google.gwtorm.protobuf.ProtobufCodec<Change>
CHANGE_CODEC
static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
COMMENT
Summary or inline comment.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<Integer>>
COMMENTBY
Users who have commented on this change.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
COMMIT
Commit ID of any patch set on the change, using prefix match.static com.google.gerrit.index.FieldDef<ChangeData,String>
COMMIT_MESSAGE
Commit message of the current patch set.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
COMMITTER
The exact email address, or any part of the committer name or email address, in the current patch set.static com.google.gerrit.index.FieldDef<ChangeData,Integer>
DELETED
The number of deleted lines in this change.static com.google.gerrit.index.FieldDef<ChangeData,Integer>
DELTA
The total number of modified lines in this change.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<Integer>>
DRAFTBY
Users who have draft comments on this change.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<Integer>>
EDITBY
Users who have edits on this change.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
EXACT_AUTHOR
The exact name, email address and NameEmail of the author.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
EXACT_COMMIT
Commit ID of any patch set on the change, using exact match.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
EXACT_COMMITTER
The exact name, email address, and NameEmail of the committer.static com.google.gerrit.index.FieldDef<ChangeData,String>
EXACT_TOPIC
Topic, a short annotation on the branch.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
FILE_PART
Components of each file path modified in the current patch set.static com.google.gerrit.index.FieldDef<ChangeData,String>
FUZZY_TOPIC
Topic, a short annotation on the branch.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
GROUP
Opaque group identifiers for this change's patch sets.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
HASHTAG
Hashtags tied to a changestatic com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>>
HASHTAG_CASE_AWARE
Hashtags with original case.static com.google.gerrit.index.FieldDef<ChangeData,String>
ID
Newer style Change-Id key.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
LABEL
List of labels on the current patch set including change owner votes.static com.google.gerrit.index.FieldDef<ChangeData,Integer>
LEGACY_ID
Legacy change ID.static com.google.gerrit.index.FieldDef<ChangeData,String>
MERGEABLE
Whether the change is mergeable.static int
NO_ASSIGNEE
static Integer
NOT_REVIEWED
static com.google.gerrit.index.FieldDef<ChangeData,Integer>
OWNER
Owner/creator of the change.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>>
PATCH_SET
Serialized patch set object, used for pre-populating results.static com.google.gwtorm.protobuf.ProtobufCodec<PatchSet>
PATCH_SET_CODEC
static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
PATH
List of full file paths modified in the current patch set.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
PENDING_REVIEWER
Reviewer(s) modified during change's current WIP phase.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
PENDING_REVIEWER_BY_EMAIL
Reviewer(s) by email modified during change's current WIP phase.static com.google.gerrit.index.FieldDef<ChangeData,String>
PRIVATE
Determines if this change is private.static com.google.gerrit.index.FieldDef<ChangeData,String>
PROJECT
Project containing the change.static com.google.gerrit.index.FieldDef<ChangeData,String>
PROJECTS
Project containing the change, as a prefix field.static com.google.gerrit.index.FieldDef<ChangeData,String>
REF
Reference (aka branch) the change will submit onto.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>>
REF_STATE
All values of all refs that were used in the course of indexing this document.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>>
REF_STATE_PATTERN
All ref wildcard patterns that were used in the course of indexing this document.static com.google.gerrit.index.FieldDef<ChangeData,Integer>
REVERT_OF
References a change that this change reverts.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<Integer>>
REVIEWEDBY
Users the change was reviewed by since the last author update.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
REVIEWER
Reviewer(s) associated with the change.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
REVIEWER_BY_EMAIL
Reviewer(s) associated with the change that do not have a gerrit account.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
STAR
Star labels on this change in the format: <account-id>:<label>static com.google.gerrit.index.FieldDef<ChangeData,Iterable<Integer>>
STARBY
Users that have starred the change with any label.static com.google.gerrit.index.FieldDef<ChangeData,String>
STARTED
Determines if this change has started review.static com.google.gerrit.index.FieldDef<ChangeData,String>
STATUS
Change status string, in the same format asstatus:
.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>>
STORED_SUBMIT_RECORD_LENIENT
static com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>>
STORED_SUBMIT_RECORD_STRICT
static com.google.gerrit.index.FieldDef<ChangeData,String>
SUBMISSIONID
Submission id assigned by MergeOp.static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
SUBMIT_RECORD
static SubmitRuleOptions
SUBMIT_RULE_OPTIONS_LENIENT
static SubmitRuleOptions
SUBMIT_RULE_OPTIONS_STRICT
static com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>>
TR
Tracking id extracted from a footer.static com.google.gerrit.index.FieldDef<ChangeData,Integer>
UNRESOLVED_COMMENT_COUNT
Number of unresolved comments of the change.static com.google.gerrit.index.FieldDef<ChangeData,Timestamp>
UPDATED
Last update time since January 1, 1970.static com.google.gerrit.index.FieldDef<ChangeData,String>
WIP
Determines if this change is work in progress.
-
Constructor Summary
Constructors Constructor Description ChangeField()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
formatLabel(String label, int value)
static String
formatLabel(String label, int value, Account.Id accountId)
static List<String>
formatSubmitRecordValues(ChangeData cd)
static Set<String>
getAuthorNameAndEmail(ChangeData cd)
static Set<String>
getAuthorParts(ChangeData cd)
static Set<String>
getCommitterNameAndEmail(ChangeData cd)
static Set<String>
getCommitterParts(ChangeData cd)
static Set<String>
getFileParts(ChangeData cd)
static String
getReviewerByEmailFieldValue(ReviewerStateInternal state, Address adr)
static String
getReviewerFieldValue(ReviewerStateInternal state, Account.Id id)
static ReviewerByEmailSet
parseReviewerByEmailFieldValues(Iterable<String> values)
static ReviewerSet
parseReviewerFieldValues(Iterable<String> values)
static void
parseSubmitRecords(Collection<String> values, SubmitRuleOptions opts, ChangeData out)
-
-
-
Field Detail
-
NO_ASSIGNEE
public static final int NO_ASSIGNEE
- See Also:
- Constant Field Values
-
LEGACY_ID
public static final com.google.gerrit.index.FieldDef<ChangeData,Integer> LEGACY_ID
Legacy change ID.
-
ID
public static final com.google.gerrit.index.FieldDef<ChangeData,String> ID
Newer style Change-Id key.
-
STATUS
public static final com.google.gerrit.index.FieldDef<ChangeData,String> STATUS
Change status string, in the same format asstatus:
.
-
PROJECT
public static final com.google.gerrit.index.FieldDef<ChangeData,String> PROJECT
Project containing the change.
-
PROJECTS
public static final com.google.gerrit.index.FieldDef<ChangeData,String> PROJECTS
Project containing the change, as a prefix field.
-
REF
public static final com.google.gerrit.index.FieldDef<ChangeData,String> REF
Reference (aka branch) the change will submit onto.
-
EXACT_TOPIC
public static final com.google.gerrit.index.FieldDef<ChangeData,String> EXACT_TOPIC
Topic, a short annotation on the branch.
-
FUZZY_TOPIC
public static final com.google.gerrit.index.FieldDef<ChangeData,String> FUZZY_TOPIC
Topic, a short annotation on the branch.
-
SUBMISSIONID
public static final com.google.gerrit.index.FieldDef<ChangeData,String> SUBMISSIONID
Submission id assigned by MergeOp.
-
UPDATED
public static final com.google.gerrit.index.FieldDef<ChangeData,Timestamp> UPDATED
Last update time since January 1, 1970.
-
PATH
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> PATH
List of full file paths modified in the current patch set.
-
HASHTAG
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> HASHTAG
Hashtags tied to a change
-
HASHTAG_CASE_AWARE
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>> HASHTAG_CASE_AWARE
Hashtags with original case.
-
FILE_PART
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> FILE_PART
Components of each file path modified in the current patch set.
-
OWNER
public static final com.google.gerrit.index.FieldDef<ChangeData,Integer> OWNER
Owner/creator of the change.
-
ASSIGNEE
public static final com.google.gerrit.index.FieldDef<ChangeData,Integer> ASSIGNEE
The user assigned to the change.
-
REVIEWER
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> REVIEWER
Reviewer(s) associated with the change.
-
REVIEWER_BY_EMAIL
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> REVIEWER_BY_EMAIL
Reviewer(s) associated with the change that do not have a gerrit account.
-
PENDING_REVIEWER
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> PENDING_REVIEWER
Reviewer(s) modified during change's current WIP phase.
-
PENDING_REVIEWER_BY_EMAIL
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> PENDING_REVIEWER_BY_EMAIL
Reviewer(s) by email modified during change's current WIP phase.
-
REVERT_OF
public static final com.google.gerrit.index.FieldDef<ChangeData,Integer> REVERT_OF
References a change that this change reverts.
-
COMMIT
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> COMMIT
Commit ID of any patch set on the change, using prefix match.
-
EXACT_COMMIT
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> EXACT_COMMIT
Commit ID of any patch set on the change, using exact match.
-
TR
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> TR
Tracking id extracted from a footer.
-
LABEL
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> LABEL
List of labels on the current patch set including change owner votes.
-
AUTHOR
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> AUTHOR
The exact email address, or any part of the author name or email address, in the current patch set.
-
EXACT_AUTHOR
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> EXACT_AUTHOR
The exact name, email address and NameEmail of the author.
-
COMMITTER
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> COMMITTER
The exact email address, or any part of the committer name or email address, in the current patch set.
-
EXACT_COMMITTER
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> EXACT_COMMITTER
The exact name, email address, and NameEmail of the committer.
-
CHANGE_CODEC
public static final com.google.gwtorm.protobuf.ProtobufCodec<Change> CHANGE_CODEC
-
CHANGE
public static final com.google.gerrit.index.FieldDef<ChangeData,byte[]> CHANGE
Serialized change object, used for pre-populating results.
-
APPROVAL_CODEC
public static final com.google.gwtorm.protobuf.ProtobufCodec<PatchSetApproval> APPROVAL_CODEC
-
APPROVAL
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>> APPROVAL
Serialized approvals for the current patch set, used for pre-populating results.
-
COMMIT_MESSAGE
public static final com.google.gerrit.index.FieldDef<ChangeData,String> COMMIT_MESSAGE
Commit message of the current patch set.
-
COMMENT
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> COMMENT
Summary or inline comment.
-
UNRESOLVED_COMMENT_COUNT
public static final com.google.gerrit.index.FieldDef<ChangeData,Integer> UNRESOLVED_COMMENT_COUNT
Number of unresolved comments of the change.
-
MERGEABLE
public static final com.google.gerrit.index.FieldDef<ChangeData,String> MERGEABLE
Whether the change is mergeable.
-
ADDED
public static final com.google.gerrit.index.FieldDef<ChangeData,Integer> ADDED
The number of inserted lines in this change.
-
DELETED
public static final com.google.gerrit.index.FieldDef<ChangeData,Integer> DELETED
The number of deleted lines in this change.
-
DELTA
public static final com.google.gerrit.index.FieldDef<ChangeData,Integer> DELTA
The total number of modified lines in this change.
-
PRIVATE
public static final com.google.gerrit.index.FieldDef<ChangeData,String> PRIVATE
Determines if this change is private.
-
WIP
public static final com.google.gerrit.index.FieldDef<ChangeData,String> WIP
Determines if this change is work in progress.
-
STARTED
public static final com.google.gerrit.index.FieldDef<ChangeData,String> STARTED
Determines if this change has started review.
-
COMMENTBY
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<Integer>> COMMENTBY
Users who have commented on this change.
-
STAR
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> STAR
Star labels on this change in the format: <account-id>:<label>
-
STARBY
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<Integer>> STARBY
Users that have starred the change with any label.
-
GROUP
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> GROUP
Opaque group identifiers for this change's patch sets.
-
PATCH_SET_CODEC
public static final com.google.gwtorm.protobuf.ProtobufCodec<PatchSet> PATCH_SET_CODEC
-
PATCH_SET
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>> PATCH_SET
Serialized patch set object, used for pre-populating results.
-
EDITBY
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<Integer>> EDITBY
Users who have edits on this change.
-
DRAFTBY
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<Integer>> DRAFTBY
Users who have draft comments on this change.
-
NOT_REVIEWED
public static final Integer NOT_REVIEWED
-
REVIEWEDBY
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<Integer>> REVIEWEDBY
Users the change was reviewed by since the last author update.A change is considered reviewed by a user if the latest update by that user is newer than the latest update by the change author. Both top-level change messages and new patch sets are considered to be updates.
If the latest update is by the change owner, then the special value
NOT_REVIEWED
is emitted.
-
SUBMIT_RULE_OPTIONS_LENIENT
public static final SubmitRuleOptions SUBMIT_RULE_OPTIONS_LENIENT
-
SUBMIT_RULE_OPTIONS_STRICT
public static final SubmitRuleOptions SUBMIT_RULE_OPTIONS_STRICT
-
SUBMIT_RECORD
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<String>> SUBMIT_RECORD
-
STORED_SUBMIT_RECORD_STRICT
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>> STORED_SUBMIT_RECORD_STRICT
-
STORED_SUBMIT_RECORD_LENIENT
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>> STORED_SUBMIT_RECORD_LENIENT
-
REF_STATE
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>> REF_STATE
All values of all refs that were used in the course of indexing this document.Emitted as UTF-8 encoded strings of the form
project:ref/name:[hex sha]
.
-
REF_STATE_PATTERN
public static final com.google.gerrit.index.FieldDef<ChangeData,Iterable<byte[]>> REF_STATE_PATTERN
All ref wildcard patterns that were used in the course of indexing this document.Emitted as UTF-8 encoded strings of the form
project:ref/name/*
. SeeStalenessChecker.RefStatePattern
for the pattern format.
-
-
Method Detail
-
getFileParts
public static Set<String> getFileParts(ChangeData cd) throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
getReviewerFieldValue
public static String getReviewerFieldValue(ReviewerStateInternal state, Account.Id id)
-
getReviewerByEmailFieldValue
public static String getReviewerByEmailFieldValue(ReviewerStateInternal state, Address adr)
-
parseReviewerFieldValues
public static ReviewerSet parseReviewerFieldValues(Iterable<String> values)
-
parseReviewerByEmailFieldValues
public static ReviewerByEmailSet parseReviewerByEmailFieldValues(Iterable<String> values)
-
getAuthorParts
public static Set<String> getAuthorParts(ChangeData cd) throws com.google.gwtorm.server.OrmException, IOException
- Throws:
com.google.gwtorm.server.OrmException
IOException
-
getAuthorNameAndEmail
public static Set<String> getAuthorNameAndEmail(ChangeData cd) throws com.google.gwtorm.server.OrmException, IOException
- Throws:
com.google.gwtorm.server.OrmException
IOException
-
getCommitterParts
public static Set<String> getCommitterParts(ChangeData cd) throws com.google.gwtorm.server.OrmException, IOException
- Throws:
com.google.gwtorm.server.OrmException
IOException
-
getCommitterNameAndEmail
public static Set<String> getCommitterNameAndEmail(ChangeData cd) throws com.google.gwtorm.server.OrmException, IOException
- Throws:
com.google.gwtorm.server.OrmException
IOException
-
formatLabel
public static String formatLabel(String label, int value, Account.Id accountId)
-
parseSubmitRecords
public static void parseSubmitRecords(Collection<String> values, SubmitRuleOptions opts, ChangeData out)
-
formatSubmitRecordValues
public static List<String> formatSubmitRecordValues(ChangeData cd) throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
-