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

Formatting

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