Merge branch 'stable-5.12'
* stable-5.12: LockFile: create OutputStream only when needed Remove ReftableNumbersNotIncreasingException Change-Id: I9d85187d00771beef908f1136015d059024f4118
This commit is contained in:
commit
cf76a92e04
|
@ -131,33 +131,6 @@ CompactionStats getStats() {
|
|||
return stats;
|
||||
}
|
||||
|
||||
/** Thrown if the update indices in the stack are not monotonic */
|
||||
public static class ReftableNumbersNotIncreasingException
|
||||
extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
String name;
|
||||
|
||||
long lastMax;
|
||||
|
||||
long min;
|
||||
|
||||
ReftableNumbersNotIncreasingException(String name, long lastMax,
|
||||
long min) {
|
||||
this.name = name;
|
||||
this.lastMax = lastMax;
|
||||
this.min = min;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "nls", "boxing" })
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(
|
||||
"ReftableNumbersNotIncreasingException %s: min %d, lastMax %d",
|
||||
name, min, lastMax);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads the stack, potentially reusing opened reftableReaders.
|
||||
*
|
||||
|
@ -176,7 +149,6 @@ private void reloadOnce(List<String> names)
|
|||
List<ReftableReader> newTables = new ArrayList<>();
|
||||
List<StackEntry> newStack = new ArrayList<>(stack.size() + 1);
|
||||
try {
|
||||
ReftableReader last = null;
|
||||
for (String name : names) {
|
||||
StackEntry entry = new StackEntry();
|
||||
entry.name = name;
|
||||
|
@ -194,15 +166,6 @@ private void reloadOnce(List<String> names)
|
|||
newTables.add(t);
|
||||
}
|
||||
|
||||
if (last != null) {
|
||||
// TODO: move this to MergedReftable
|
||||
if (last.maxUpdateIndex() >= t.minUpdateIndex()) {
|
||||
throw new ReftableNumbersNotIncreasingException(name,
|
||||
last.maxUpdateIndex(), t.minUpdateIndex());
|
||||
}
|
||||
}
|
||||
last = t;
|
||||
|
||||
entry.reftableReader = t;
|
||||
newStack.add(entry);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue