Remove noteDb.groups.readSequenceFromNoteDb property

The sequences on googlesource.com were flipped.

Change-Id: I61a74c25c127874864a2eab7521db063fc316c24
This commit is contained in:
Han-Wen Nienhuys
2017-11-21 17:23:01 +01:00
parent 4310ae0d24
commit c505ef35a9

View File

@@ -60,7 +60,6 @@ public class Sequences {
private final RepoSequence accountSeq;
private final RepoSequence changeSeq;
private final RepoSequence groupSeq;
private final boolean readGroupSeqFromNoteDb;
private final Timer2<SequenceType, Boolean> nextIdLatency;
@Inject
@@ -99,7 +98,6 @@ public class Sequences {
groupSeq =
new RepoSequence(
repoManager, gitRefUpdated, allUsers, NAME_GROUPS, groupSeed, groupBatchSize);
readGroupSeqFromNoteDb = readGroupFromNoteDbSetting(cfg);
nextIdLatency =
metrics.newTimer(
@@ -111,10 +109,6 @@ public class Sequences {
Field.ofBoolean("multiple"));
}
public static boolean readGroupFromNoteDbSetting(Config cfg) {
return cfg.getBoolean("noteDb", "groups", "readSequenceFromNoteDb", false);
}
public int nextAccountId() throws OrmException {
try (Timer2.Context timer = nextIdLatency.start(SequenceType.ACCOUNTS, false)) {
return accountSeq.next();
@@ -150,14 +144,9 @@ public class Sequences {
}
public int nextGroupId() throws OrmException {
if (readGroupSeqFromNoteDb) {
try (Timer2.Context timer = nextIdLatency.start(SequenceType.GROUPS, false)) {
return groupSeq.next();
}
try (Timer2.Context timer = nextIdLatency.start(SequenceType.GROUPS, false)) {
return groupSeq.next();
}
int groupId = nextGroupId(db.get());
groupSeq.increaseTo(groupId + 1); // NoteDb stores next available group ID.
return groupId;
}
@VisibleForTesting