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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChangeField.StoredSubmitRecord
JSON type for storing SubmitRecords.
-
Field Summary
Fields Modifier and Type Field Description static FieldDef<ChangeData,Integer>
ADDED
The number of inserted lines in this change.static FieldDef<ChangeData,Iterable<byte[]>>
APPROVAL
Serialized approvals for the current patch set, used for pre-populating results.static FieldDef<ChangeData,Integer>
ASSIGNEE
The user assigned to the change.static FieldDef<ChangeData,Iterable<byte[]>>
ATTENTION_SET_FULL
The full attention set data including timestamp, reason and possible future fields.static FieldDef<ChangeData,Iterable<Integer>>
ATTENTION_SET_USERS
Users included in the attention set of the change.static FieldDef<ChangeData,Integer>
ATTENTION_SET_USERS_COUNT
Number of changes that contain attention set.static 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 FieldDef<ChangeData,byte[]>
CHANGE
Serialized change object, used for pre-populating results.static FieldDef<ChangeData,String>
CHERRY_PICK
Whether the change is a cherry pick of another change.static FieldDef<ChangeData,Integer>
CHERRY_PICK_OF_CHANGE
References the source change number that this change was cherry-picked from.static FieldDef<ChangeData,Integer>
CHERRY_PICK_OF_PATCHSET
References the source change patch-set that this change was cherry-picked from.static FieldDef<ChangeData,Iterable<String>>
COMMENT
Summary or inline comment.static FieldDef<ChangeData,Iterable<Integer>>
COMMENTBY
Users who have commented on this change.static FieldDef<ChangeData,Iterable<String>>
COMMIT
Commit ID of any patch set on the change, using prefix match.static FieldDef<ChangeData,String>
COMMIT_MESSAGE
Commit message of the current patch set.static 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 FieldDef<ChangeData,Integer>
DELETED
The number of deleted lines in this change.static FieldDef<ChangeData,Integer>
DELTA
The total number of modified lines in this change.static FieldDef<ChangeData,Iterable<String>>
DIRECTORY
Folders that are touched by the current patch set.static FieldDef<ChangeData,Iterable<Integer>>
DRAFTBY
Users who have draft comments on this change.static FieldDef<ChangeData,Iterable<Integer>>
EDITBY
Users who have edits on this change.static FieldDef<ChangeData,Iterable<String>>
EXACT_AUTHOR
The exact name, email address and NameEmail of the author.static FieldDef<ChangeData,Iterable<String>>
EXACT_COMMIT
Commit ID of any patch set on the change, using exact match.static FieldDef<ChangeData,Iterable<String>>
EXACT_COMMITTER
The exact name, email address, and NameEmail of the committer.static FieldDef<ChangeData,String>
EXACT_TOPIC
Topic, a short annotation on the branch.static FieldDef<ChangeData,Iterable<String>>
EXTENSION
File extensions of each file modified in the current patch set.static FieldDef<ChangeData,Iterable<String>>
FILE_PART
Components of each file path modified in the current patch set.static FieldDef<ChangeData,Iterable<String>>
FOOTER
Footers from the commit message of the current patch set.static FieldDef<ChangeData,Iterable<String>>
FUZZY_HASHTAG
Hashtags as fulltext field for in-string search.static FieldDef<ChangeData,String>
FUZZY_TOPIC
Topic, a short annotation on the branch.static FieldDef<ChangeData,Iterable<String>>
GROUP
Opaque group identifiers for this change's patch sets.static FieldDef<ChangeData,Iterable<String>>
HASHTAG
Hashtags tied to a changestatic FieldDef<ChangeData,Iterable<byte[]>>
HASHTAG_CASE_AWARE
Hashtags with original case.static FieldDef<ChangeData,String>
ID
Newer style Change-Id key.static FieldDef<ChangeData,Iterable<String>>
LABEL
List of labels on the current patch set including change owner votes.static FieldDef<ChangeData,Integer>
LEGACY_ID
Legacy change ID.static FieldDef<ChangeData,String>
LEGACY_ID_STR
static FieldDef<ChangeData,String>
MERGE
Whether the change is a merge commit.static FieldDef<ChangeData,String>
MERGEABLE
Whether the change is mergeable.static FieldDef<ChangeData,Timestamp>
MERGED_ON
When this change was merged, time since January 1, 1970.static int
NO_ASSIGNEE
static Integer
NOT_REVIEWED
static FieldDef<ChangeData,String>
ONLY_EXTENSIONS
File extensions of each file modified in the current patch set as a sorted list.static FieldDef<ChangeData,Integer>
OWNER
Owner/creator of the change.static FieldDef<ChangeData,Iterable<byte[]>>
PATCH_SET
Serialized patch set object, used for pre-populating results.static FieldDef<ChangeData,Iterable<String>>
PATH
List of full file paths modified in the current patch set.static FieldDef<ChangeData,Iterable<String>>
PENDING_REVIEWER
Reviewer(s) modified during change's current WIP phase.static FieldDef<ChangeData,Iterable<String>>
PENDING_REVIEWER_BY_EMAIL
Reviewer(s) by email modified during change's current WIP phase.static FieldDef<ChangeData,String>
PRIVATE
Determines if this change is private.static FieldDef<ChangeData,String>
PROJECT
Project containing the change.static FieldDef<ChangeData,String>
PROJECTS
Project containing the change, as a prefix field.static FieldDef<ChangeData,String>
REF
Reference (aka branch) the change will submit onto.static FieldDef<ChangeData,Iterable<byte[]>>
REF_STATE
All values of all refs that were used in the course of indexing this document.static FieldDef<ChangeData,Iterable<byte[]>>
REF_STATE_PATTERN
All ref wildcard patterns that were used in the course of indexing this document.static FieldDef<ChangeData,Integer>
REVERT_OF
References a change that this change reverts.static FieldDef<ChangeData,Iterable<Integer>>
REVIEWEDBY
Users the change was reviewed by since the last author update.static FieldDef<ChangeData,Iterable<String>>
REVIEWER
Reviewer(s) associated with the change.static FieldDef<ChangeData,Iterable<String>>
REVIEWER_BY_EMAIL
Reviewer(s) associated with the change that do not have a gerrit account.static FieldDef<ChangeData,Iterable<String>>
STAR
Star labels on this change in the format: <account-id>:<label>static FieldDef<ChangeData,Iterable<Integer>>
STARBY
Users that have starred the change with any label.static FieldDef<ChangeData,String>
STARTED
Determines if this change has started review.static FieldDef<ChangeData,String>
STATUS
Change status string, in the same format asstatus:
.static FieldDef<ChangeData,Iterable<byte[]>>
STORED_SUBMIT_RECORD_LENIENT
static FieldDef<ChangeData,Iterable<byte[]>>
STORED_SUBMIT_RECORD_STRICT
static FieldDef<ChangeData,Iterable<byte[]>>
STORED_SUBMIT_REQUIREMENTS
Serialized submit requirements, used for pre-populating results.static FieldDef<ChangeData,String>
SUBMISSIONID
Submission id assigned by MergeOp.static FieldDef<ChangeData,Iterable<String>>
SUBMIT_RECORD
static SubmitRuleOptions
SUBMIT_RULE_OPTIONS_LENIENT
static SubmitRuleOptions
SUBMIT_RULE_OPTIONS_STRICT
static FieldDef<ChangeData,Iterable<String>>
SUBMIT_RULE_RESULT
All submit rules results in the form of "$ruleName,$status".static FieldDef<ChangeData,Integer>
TOTAL_COMMENT_COUNT
Total number of published inline comments of the change, including robot comments.static FieldDef<ChangeData,Iterable<String>>
TR
Tracking id extracted from a footer.static FieldDef<ChangeData,Integer>
UNRESOLVED_COMMENT_COUNT
Number of unresolved comment threads of the change, including robot comments.static FieldDef<ChangeData,Timestamp>
UPDATED
Last update time since January 1, 1970.static FieldDef<ChangeData,Integer>
UPLOADER
Uploader of the latest patch set.static FieldDef<ChangeData,String>
WIP
Determines if this change is work in progress.
-
Constructor Summary
Constructors Constructor Description ChangeField()
-
Method Summary
-
-
-
Field Detail
-
NO_ASSIGNEE
public static final int NO_ASSIGNEE
- See Also:
- Constant Field Values
-
LEGACY_ID
public static final FieldDef<ChangeData,Integer> LEGACY_ID
Legacy change ID.
-
LEGACY_ID_STR
public static final FieldDef<ChangeData,String> LEGACY_ID_STR
-
ID
public static final FieldDef<ChangeData,String> ID
Newer style Change-Id key.
-
STATUS
public static final FieldDef<ChangeData,String> STATUS
Change status string, in the same format asstatus:
.
-
PROJECT
public static final FieldDef<ChangeData,String> PROJECT
Project containing the change.
-
PROJECTS
public static final FieldDef<ChangeData,String> PROJECTS
Project containing the change, as a prefix field.
-
REF
public static final FieldDef<ChangeData,String> REF
Reference (aka branch) the change will submit onto.
-
EXACT_TOPIC
public static final FieldDef<ChangeData,String> EXACT_TOPIC
Topic, a short annotation on the branch.
-
FUZZY_TOPIC
public static final FieldDef<ChangeData,String> FUZZY_TOPIC
Topic, a short annotation on the branch.
-
SUBMISSIONID
public static final FieldDef<ChangeData,String> SUBMISSIONID
Submission id assigned by MergeOp.
-
UPDATED
public static final FieldDef<ChangeData,Timestamp> UPDATED
Last update time since January 1, 1970.
-
MERGED_ON
public static final FieldDef<ChangeData,Timestamp> MERGED_ON
When this change was merged, time since January 1, 1970.
-
PATH
public static final FieldDef<ChangeData,Iterable<String>> PATH
List of full file paths modified in the current patch set.
-
HASHTAG
public static final FieldDef<ChangeData,Iterable<String>> HASHTAG
Hashtags tied to a change
-
FUZZY_HASHTAG
public static final FieldDef<ChangeData,Iterable<String>> FUZZY_HASHTAG
Hashtags as fulltext field for in-string search.
-
HASHTAG_CASE_AWARE
public static final FieldDef<ChangeData,Iterable<byte[]>> HASHTAG_CASE_AWARE
Hashtags with original case.
-
FILE_PART
public static final FieldDef<ChangeData,Iterable<String>> FILE_PART
Components of each file path modified in the current patch set.
-
EXTENSION
public static final FieldDef<ChangeData,Iterable<String>> EXTENSION
File extensions of each file modified in the current patch set.
-
ONLY_EXTENSIONS
public static final FieldDef<ChangeData,String> ONLY_EXTENSIONS
File extensions of each file modified in the current patch set as a sorted list. The purpose of this field is to allow matching changes that only touch files with certain file extensions.
-
FOOTER
public static final FieldDef<ChangeData,Iterable<String>> FOOTER
Footers from the commit message of the current patch set.
-
DIRECTORY
public static final FieldDef<ChangeData,Iterable<String>> DIRECTORY
Folders that are touched by the current patch set.
-
OWNER
public static final FieldDef<ChangeData,Integer> OWNER
Owner/creator of the change.
-
UPLOADER
public static final FieldDef<ChangeData,Integer> UPLOADER
Uploader of the latest patch set.
-
CHERRY_PICK_OF_CHANGE
public static final FieldDef<ChangeData,Integer> CHERRY_PICK_OF_CHANGE
References the source change number that this change was cherry-picked from.
-
CHERRY_PICK_OF_PATCHSET
public static final FieldDef<ChangeData,Integer> CHERRY_PICK_OF_PATCHSET
References the source change patch-set that this change was cherry-picked from.
-
ATTENTION_SET_USERS
public static final FieldDef<ChangeData,Iterable<Integer>> ATTENTION_SET_USERS
Users included in the attention set of the change. This omits timestamp, reason and possible future fields.- See Also:
ATTENTION_SET_FULL
-
ATTENTION_SET_USERS_COUNT
public static final FieldDef<ChangeData,Integer> ATTENTION_SET_USERS_COUNT
Number of changes that contain attention set.
-
ATTENTION_SET_FULL
public static final FieldDef<ChangeData,Iterable<byte[]>> ATTENTION_SET_FULL
The full attention set data including timestamp, reason and possible future fields.- See Also:
ATTENTION_SET_USERS
-
ASSIGNEE
public static final FieldDef<ChangeData,Integer> ASSIGNEE
The user assigned to the change.
-
REVIEWER
public static final FieldDef<ChangeData,Iterable<String>> REVIEWER
Reviewer(s) associated with the change.
-
REVIEWER_BY_EMAIL
public static final 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 FieldDef<ChangeData,Iterable<String>> PENDING_REVIEWER
Reviewer(s) modified during change's current WIP phase.
-
PENDING_REVIEWER_BY_EMAIL
public static final FieldDef<ChangeData,Iterable<String>> PENDING_REVIEWER_BY_EMAIL
Reviewer(s) by email modified during change's current WIP phase.
-
REVERT_OF
public static final FieldDef<ChangeData,Integer> REVERT_OF
References a change that this change reverts.
-
COMMIT
public static final FieldDef<ChangeData,Iterable<String>> COMMIT
Commit ID of any patch set on the change, using prefix match.
-
EXACT_COMMIT
public static final FieldDef<ChangeData,Iterable<String>> EXACT_COMMIT
Commit ID of any patch set on the change, using exact match.
-
TR
public static final FieldDef<ChangeData,Iterable<String>> TR
Tracking id extracted from a footer.
-
LABEL
public static final FieldDef<ChangeData,Iterable<String>> LABEL
List of labels on the current patch set including change owner votes.
-
AUTHOR
public static final 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 FieldDef<ChangeData,Iterable<String>> EXACT_AUTHOR
The exact name, email address and NameEmail of the author.
-
COMMITTER
public static final 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 FieldDef<ChangeData,Iterable<String>> EXACT_COMMITTER
The exact name, email address, and NameEmail of the committer.
-
CHANGE
public static final FieldDef<ChangeData,byte[]> CHANGE
Serialized change object, used for pre-populating results.
-
APPROVAL
public static final FieldDef<ChangeData,Iterable<byte[]>> APPROVAL
Serialized approvals for the current patch set, used for pre-populating results.
-
COMMIT_MESSAGE
public static final FieldDef<ChangeData,String> COMMIT_MESSAGE
Commit message of the current patch set.
-
COMMENT
public static final FieldDef<ChangeData,Iterable<String>> COMMENT
Summary or inline comment.
-
UNRESOLVED_COMMENT_COUNT
public static final FieldDef<ChangeData,Integer> UNRESOLVED_COMMENT_COUNT
Number of unresolved comment threads of the change, including robot comments.
-
TOTAL_COMMENT_COUNT
public static final FieldDef<ChangeData,Integer> TOTAL_COMMENT_COUNT
Total number of published inline comments of the change, including robot comments.
-
MERGEABLE
public static final FieldDef<ChangeData,String> MERGEABLE
Whether the change is mergeable.
-
MERGE
public static final FieldDef<ChangeData,String> MERGE
Whether the change is a merge commit.
-
CHERRY_PICK
public static final FieldDef<ChangeData,String> CHERRY_PICK
Whether the change is a cherry pick of another change.
-
ADDED
public static final FieldDef<ChangeData,Integer> ADDED
The number of inserted lines in this change.
-
DELETED
public static final FieldDef<ChangeData,Integer> DELETED
The number of deleted lines in this change.
-
DELTA
public static final FieldDef<ChangeData,Integer> DELTA
The total number of modified lines in this change.
-
PRIVATE
public static final FieldDef<ChangeData,String> PRIVATE
Determines if this change is private.
-
WIP
public static final FieldDef<ChangeData,String> WIP
Determines if this change is work in progress.
-
STARTED
public static final FieldDef<ChangeData,String> STARTED
Determines if this change has started review.
-
COMMENTBY
public static final FieldDef<ChangeData,Iterable<Integer>> COMMENTBY
Users who have commented on this change.
-
STAR
public static final FieldDef<ChangeData,Iterable<String>> STAR
Star labels on this change in the format: <account-id>:<label>
-
STARBY
public static final FieldDef<ChangeData,Iterable<Integer>> STARBY
Users that have starred the change with any label.
-
GROUP
public static final FieldDef<ChangeData,Iterable<String>> GROUP
Opaque group identifiers for this change's patch sets.
-
PATCH_SET
public static final FieldDef<ChangeData,Iterable<byte[]>> PATCH_SET
Serialized patch set object, used for pre-populating results.
-
EDITBY
public static final FieldDef<ChangeData,Iterable<Integer>> EDITBY
Users who have edits on this change.
-
DRAFTBY
public static final 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 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_RULE_RESULT
public static final FieldDef<ChangeData,Iterable<String>> SUBMIT_RULE_RESULT
All submit rules results in the form of "$ruleName,$status".
-
SUBMIT_RECORD
public static final FieldDef<ChangeData,Iterable<String>> SUBMIT_RECORD
-
STORED_SUBMIT_RECORD_STRICT
public static final FieldDef<ChangeData,Iterable<byte[]>> STORED_SUBMIT_RECORD_STRICT
-
STORED_SUBMIT_RECORD_LENIENT
public static final FieldDef<ChangeData,Iterable<byte[]>> STORED_SUBMIT_RECORD_LENIENT
-
STORED_SUBMIT_REQUIREMENTS
public static final FieldDef<ChangeData,Iterable<byte[]>> STORED_SUBMIT_REQUIREMENTS
Serialized submit requirements, used for pre-populating results.
-
REF_STATE
public static final 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 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)
-
getExtensions
public static Set<String> getExtensions(ChangeData cd)
-
getAllExtensionsAsList
public static String getAllExtensionsAsList(ChangeData cd)
-
getFooters
public static Set<String> getFooters(ChangeData cd)
-
getDirectories
public static Set<String> getDirectories(ChangeData cd)
-
getReviewerFieldValue
public static String getReviewerFieldValue(ReviewerStateInternal state, Account.Id id)
-
getReviewerByEmailFieldValue
public static String getReviewerByEmailFieldValue(ReviewerStateInternal state, Address adr)
-
parseReviewerFieldValues
public static ReviewerSet parseReviewerFieldValues(Change.Id changeId, Iterable<String> values)
-
parseReviewerByEmailFieldValues
public static ReviewerByEmailSet parseReviewerByEmailFieldValues(Change.Id changeId, Iterable<String> values)
-
parseAttentionSet
public static void parseAttentionSet(Collection<String> storedAttentionSetEntriesJson, ChangeData changeData)
Deserializes the specified attention set entries from JSON and stores them in the specified change.
-
getAuthorParts
public static Set<String> getAuthorParts(ChangeData cd)
-
getAuthorNameAndEmail
public static Set<String> getAuthorNameAndEmail(ChangeData cd)
-
getCommitterParts
public static Set<String> getCommitterParts(ChangeData cd)
-
getCommitterNameAndEmail
public static Set<String> getCommitterNameAndEmail(ChangeData cd)
-
formatLabel
public static String formatLabel(String label, int value, Account.Id accountId)
-
formatLabel
public static String formatLabel(String label, String value, Account.Id accountId)
-
parseSubmitRecords
public static void parseSubmitRecords(Collection<String> values, SubmitRuleOptions opts, ChangeData out)
-
formatSubmitRecordValues
public static List<String> formatSubmitRecordValues(ChangeData cd)
-
-