提交 ab5883c5 authored 作者: andrei's avatar andrei

code review 3

上级 55b07c4c
......@@ -941,7 +941,7 @@ public final class DataUtils {
* @return the parsed value
* @throws IllegalStateException if parsing fails
*/
public static long readHexLong(Map<String,?> map, String key, long defaultValue) {
public static long readHexLong(Map<String, ?> map, String key, long defaultValue) {
Object v = map.get(key);
if (v == null) {
return defaultValue;
......@@ -1005,7 +1005,7 @@ public final class DataUtils {
* @return the parsed value
* @throws IllegalStateException if parsing fails
*/
public static int readHexInt(Map<String,?> map, String key, int defaultValue) {
public static int readHexInt(Map<String, ?> map, String key, int defaultValue) {
Object v = map.get(key);
if (v == null) {
return defaultValue;
......
......@@ -172,7 +172,7 @@ public class FreeSpaceBitSet {
if (cardinality == 0) {
return 0;
}
return (int)(100L * cardinality / set.length());
return Math.max(1, (int)(100L * cardinality / set.length()));
}
/**
......
......@@ -72,7 +72,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
}
// constructor for cloneIt()
protected MVMap(MVMap<K,V> source) {
protected MVMap(MVMap<K, V> source) {
this(source.store, source.keyType, source.valueType, source.id, source.createVersion,
new AtomicReference<>(source.root.get()));
}
......@@ -93,7 +93,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
this.root = root;
}
protected MVMap<K,V> cloneIt() {
protected MVMap<K, V> cloneIt() {
return new MVMap<>(this);
}
......@@ -1356,7 +1356,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
}
@Override
public Builder<K,V> valueType(DataType dataType) {
public Builder<K, V> valueType(DataType dataType) {
setValueType(dataType);
return this;
}
......
......@@ -197,7 +197,7 @@ public final class MVStore {
* The map of temporarily freed storage space caused by freed pages.
* It contains the number of freed entries per chunk.
*/
private final Map<Integer,Chunk> freedPageSpace = new HashMap<>();
private final Map<Integer, Chunk> freedPageSpace = new HashMap<>();
/**
* The metadata map. Write access to this map needs to be synchronized on
......@@ -524,10 +524,10 @@ public final class MVStore {
return map;
}
public <K,V> MVMap<K,V> getMap(int id) {
public <K, V> MVMap<K,V> getMap(int id) {
checkOpen();
@SuppressWarnings("unchecked")
MVMap<K,V> map = (MVMap<K, V>) maps.get(id);
MVMap<K, V> map = (MVMap<K, V>) maps.get(id);
return map;
}
......
......@@ -736,7 +736,7 @@ public class TestMVTableEngine extends TestBase {
conn.close();
long sizeNew = FileUtils.size(getBaseDir() + "/" + getTestName()
+ Constants.SUFFIX_MV_FILE);
System.out.println("new: " + sizeNew + " old: " + sizeOld);
println("new: " + sizeNew + " old: " + sizeOld);
// assertTrue("new: " + sizeNew + " old: " + sizeOld, sizeNew < sizeOld);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论