提交 1106aae2 authored 作者: andrei's avatar andrei

another merge hiccup

上级 192076c4
...@@ -471,7 +471,6 @@ public final class MVStore { ...@@ -471,7 +471,6 @@ public final class MVStore {
* @param builder the map builder * @param builder the map builder
* @return the map * @return the map
*/ */
@SuppressWarnings({ "unchecked", "rawtypes" })
public synchronized <M extends MVMap<K, V>, K, V> M openMap( public synchronized <M extends MVMap<K, V>, K, V> M openMap(
String name, MVMap.MapBuilder<M, K, V> builder) { String name, MVMap.MapBuilder<M, K, V> builder) {
int id = getMapId(name); int id = getMapId(name);
...@@ -1887,30 +1886,8 @@ public final class MVStore { ...@@ -1887,30 +1886,8 @@ public final class MVStore {
// nothing to do // nothing to do
return null; return null;
} }
// calculate the fill rate
long maxLengthSum = 0;
long maxLengthLiveSum = 0;
long time = getTimeSinceCreation(); long time = getTimeSinceCreation();
int fillRate = getCurrentFillRate();
for (Chunk c : chunks.values()) {
// ignore young chunks, because we don't optimize those
if (c.time + retentionTime <= time) {
maxLengthSum += c.maxLen;
maxLengthLiveSum += c.maxLenLive;
}
}
if (maxLengthLiveSum < 0) {
// no old data
return null;
}
// the fill rate of all chunks combined
if (maxLengthSum <= 0) {
// avoid division by 0
maxLengthSum = 1;
}
int fillRate = (int) (100 * maxLengthLiveSum / maxLengthSum);
if (fillRate >= targetFillRate) { if (fillRate >= targetFillRate) {
return null; return null;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论