Merge "Remove change index schema versions <39"

This commit is contained in:
Dave Borowitz
2017-04-13 16:19:55 +00:00
committed by Gerrit Code Review
4 changed files with 40 additions and 74 deletions

View File

@@ -299,13 +299,8 @@ public class ChangeField {
return Sets.newHashSet(a.trackingFooters.extract(footers).values());
});
/** List of labels on the current patch set. */
@Deprecated
public static final FieldDef<ChangeData, Iterable<String>> LABEL =
exact(ChangeQueryBuilder.FIELD_LABEL).buildRepeatable(cd -> getLabels(cd, false));
/** List of labels on the current patch set including change owner votes. */
public static final FieldDef<ChangeData, Iterable<String>> LABEL2 =
public static final FieldDef<ChangeData, Iterable<String>> LABEL =
exact("label2").buildRepeatable(cd -> getLabels(cd, true));
private static Iterable<String> getLabels(ChangeData cd, boolean owners) throws OrmException {

View File

@@ -22,75 +22,53 @@ import com.google.gerrit.server.query.change.ChangeData;
public class ChangeSchemaDefinitions extends SchemaDefinitions<ChangeData> {
@Deprecated
static final Schema<ChangeData> V32 =
static final Schema<ChangeData> V39 =
schema(
ChangeField.LEGACY_ID,
ChangeField.ADDED,
ChangeField.APPROVAL,
ChangeField.ASSIGNEE,
ChangeField.AUTHOR,
ChangeField.CHANGE,
ChangeField.COMMENT,
ChangeField.COMMENTBY,
ChangeField.COMMIT,
ChangeField.COMMITTER,
ChangeField.COMMIT_MESSAGE,
ChangeField.DELETED,
ChangeField.DELTA,
ChangeField.DRAFTBY,
ChangeField.EDITBY,
ChangeField.EXACT_COMMIT,
ChangeField.EXACT_TOPIC,
ChangeField.FILE_PART,
ChangeField.FUZZY_TOPIC,
ChangeField.GROUP,
ChangeField.HASHTAG,
ChangeField.HASHTAG_CASE_AWARE,
ChangeField.ID,
ChangeField.STATUS,
ChangeField.LABEL,
ChangeField.LEGACY_ID,
ChangeField.MERGEABLE,
ChangeField.OWNER,
ChangeField.PATCH_SET,
ChangeField.PATH,
ChangeField.PROJECT,
ChangeField.PROJECTS,
ChangeField.REF,
ChangeField.EXACT_TOPIC,
ChangeField.FUZZY_TOPIC,
ChangeField.UPDATED,
ChangeField.FILE_PART,
ChangeField.PATH,
ChangeField.OWNER,
ChangeField.COMMIT,
ChangeField.TR,
ChangeField.LABEL,
ChangeField.COMMIT_MESSAGE,
ChangeField.COMMENT,
ChangeField.CHANGE,
ChangeField.APPROVAL,
ChangeField.MERGEABLE,
ChangeField.ADDED,
ChangeField.DELETED,
ChangeField.DELTA,
ChangeField.HASHTAG,
ChangeField.COMMENTBY,
ChangeField.PATCH_SET,
ChangeField.GROUP,
ChangeField.SUBMISSIONID,
ChangeField.EDITBY,
ChangeField.REF_STATE,
ChangeField.REF_STATE_PATTERN,
ChangeField.REVIEWEDBY,
ChangeField.EXACT_COMMIT,
ChangeField.AUTHOR,
ChangeField.COMMITTER,
ChangeField.DRAFTBY,
ChangeField.HASHTAG_CASE_AWARE,
ChangeField.REVIEWER,
ChangeField.STAR,
ChangeField.STARBY,
ChangeField.REVIEWER);
@Deprecated static final Schema<ChangeData> V33 = schema(V32, ChangeField.ASSIGNEE);
@Deprecated
static final Schema<ChangeData> V34 =
new Schema.Builder<ChangeData>()
.add(V33)
.remove(ChangeField.LABEL)
.add(ChangeField.LABEL2)
.build();
@Deprecated
static final Schema<ChangeData> V35 =
schema(
V34,
ChangeField.SUBMIT_RECORD,
ChangeField.STATUS,
ChangeField.STORED_SUBMIT_RECORD_LENIENT,
ChangeField.STORED_SUBMIT_RECORD_STRICT);
@Deprecated
static final Schema<ChangeData> V36 =
schema(V35, ChangeField.REF_STATE, ChangeField.REF_STATE_PATTERN);
@Deprecated static final Schema<ChangeData> V37 = schema(V36);
@Deprecated
static final Schema<ChangeData> V38 = schema(V37, ChangeField.UNRESOLVED_COMMENT_COUNT);
@Deprecated static final Schema<ChangeData> V39 = schema(V38);
ChangeField.STORED_SUBMIT_RECORD_STRICT,
ChangeField.SUBMISSIONID,
ChangeField.SUBMIT_RECORD,
ChangeField.TR,
ChangeField.UNRESOLVED_COMMENT_COUNT,
ChangeField.UPDATED);
@Deprecated static final Schema<ChangeData> V40 = schema(V39, ChangeField.PRIVATE);

View File

@@ -42,7 +42,7 @@ class EqualsLabelPredicate extends ChangeIndexPredicate {
private final AccountGroup.UUID group;
EqualsLabelPredicate(LabelPredicate.Args args, String label, int expVal, Account.Id account) {
super(args.field, ChangeField.formatLabel(label, expVal, account));
super(ChangeField.LABEL, ChangeField.formatLabel(label, expVal, account));
this.ccFactory = args.ccFactory;
this.projectCache = args.projectCache;
this.userFactory = args.userFactory;

View File

@@ -19,8 +19,6 @@ import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.index.FieldDef;
import com.google.gerrit.server.index.change.ChangeField;
import com.google.gerrit.server.project.ChangeControl;
import com.google.gerrit.server.project.ProjectCache;
import com.google.gerrit.server.query.OrPredicate;
@@ -37,7 +35,6 @@ public class LabelPredicate extends OrPredicate<ChangeData> {
private static final int MAX_LABEL_VALUE = 4;
static class Args {
final FieldDef<ChangeData, ?> field;
final ProjectCache projectCache;
final ChangeControl.GenericFactory ccFactory;
final IdentifiedUser.GenericFactory userFactory;
@@ -47,7 +44,6 @@ public class LabelPredicate extends OrPredicate<ChangeData> {
final AccountGroup.UUID group;
private Args(
FieldDef<ChangeData, ?> field,
ProjectCache projectCache,
ChangeControl.GenericFactory ccFactory,
IdentifiedUser.GenericFactory userFactory,
@@ -55,7 +51,6 @@ public class LabelPredicate extends OrPredicate<ChangeData> {
String value,
Set<Account.Id> accounts,
AccountGroup.UUID group) {
this.field = field;
this.projectCache = projectCache;
this.ccFactory = ccFactory;
this.userFactory = userFactory;
@@ -80,7 +75,6 @@ public class LabelPredicate extends OrPredicate<ChangeData> {
private final String value;
@SuppressWarnings("deprecation")
LabelPredicate(
ChangeQueryBuilder.Arguments a,
String value,
@@ -89,7 +83,6 @@ public class LabelPredicate extends OrPredicate<ChangeData> {
super(
predicates(
new Args(
a.getSchema().getField(ChangeField.LABEL2, ChangeField.LABEL).get(),
a.projectCache,
a.changeControlGenericFactory,
a.userFactory,