Remove ChangeAccess.byKey and byKeyRange

All callers of byKeyRange passed key.max() as the right endpoint, so
this can be safely replaced with a prefix query against the secondary
index. The number of callers notwithstanding, this was pretty
straightforward, although it does lead to the almost-recursive state
of calling InternalChangeQuery from ChangeQueryBuilder when expanding
the conflicts predicate.

Change-Id: I073d6ab179d3d5a5d8f0157aa3594fd3ea2cc81c
This commit is contained in:
Dave Borowitz
2015-01-13 17:43:06 -08:00
parent dfc07f63bb
commit f9c88308de
19 changed files with 100 additions and 107 deletions

View File

@@ -526,12 +526,7 @@ public class ChangeUtil {
// Try isolated changeId
if (!id.contains("~")) {
Change.Key key = new Change.Key(id);
if (key.get().length() == 41) {
return db.get().changes().byKey(key).toList();
} else {
return db.get().changes().byKeyRange(key, key.max()).toList();
}
return asChanges(queryProvider.get().byKeyPrefix(id));
}
// Try change triplet