提交 ba44962f authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting

上级 cdbb19b0
......@@ -60,7 +60,7 @@ public class TestTransactionStore extends TestBase {
testSingleConnection();
testCompareWithPostgreSQL();
}
private void testConcurrentAdd() {
MVStore s;
s = MVStore.open(null);
......
......@@ -36,7 +36,7 @@ public class TestStringCache extends TestBase {
TestBase.createCaller().init().test();
new TestStringCache().runBenchmark();
}
@Override
public void test() throws InterruptedException {
testToUpperToLower();
......@@ -49,7 +49,7 @@ public class TestStringCache extends TestBase {
testSingleThread(getSize(5000, 20000));
testMultiThreads();
}
private void testToUpperCache() {
Random r = new Random();
String[] test = new String[50];
......@@ -83,7 +83,7 @@ public class TestStringCache extends TestBase {
System.out.println("toUpperCase " + time);
assertEquals(0, testLen);
}
private void testToUpperToLower() {
Random r = new Random();
for (int i = 0; i < 1000; i++) {
......
......@@ -38,7 +38,7 @@ import java.util.Set;
* of other entries have been moved to the front (8 per segment by default).
* Write access and moving entries to the top of the stack is synchronized per
* segment.
*
*
* @author Thomas Mueller
* @param <K> the key type
* @param <V> the value type
......@@ -158,7 +158,7 @@ public class CacheLIRS<K, V> extends AbstractMap<K, V> {
return s.put(key, hash, value, memory);
}
}
private Segment<K, V> resizeIfNeeded(Segment<K, V> s, int segmentIndex) {
int newLen = s.getNewMapLen();
if (newLen == 0) {
......@@ -425,7 +425,7 @@ public class CacheLIRS<K, V> extends AbstractMap<K, V> {
* @param <V> the value type
*/
private static class Segment<K, V> {
/**
* The number of (hot, cold, and non-resident) entries in the map.
*/
......@@ -573,11 +573,11 @@ public class CacheLIRS<K, V> extends AbstractMap<K, V> {
s = s.queuePrev;
}
}
/**
* Calculate the new number of hash table buckets if the internal map
* should be re-sized.
*
*
* @return 0 if no resizing is needed, or the new length
*/
int getNewMapLen() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论