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

Fix formatting

上级 c399aa1c
...@@ -92,8 +92,8 @@ public abstract class Command implements CommandInterface { ...@@ -92,8 +92,8 @@ public abstract class Command implements CommandInterface {
public abstract ResultInterface queryMeta(); public abstract ResultInterface queryMeta();
/** /**
* Execute an updating statement (for example an insert, a delete, or an update), * Execute an updating statement (for example insert, delete, or update), if
* if this is possible. * this is possible.
* *
* @return the update count * @return the update count
* @throws DbException if the command is not an updating statement * @throws DbException if the command is not an updating statement
......
...@@ -108,7 +108,7 @@ public class CacheLongKeyLIRS<V> { ...@@ -108,7 +108,7 @@ public class CacheLongKeyLIRS<V> {
max, segmentLen, stackMoveDistance); max, segmentLen, stackMoveDistance);
} }
} }
private int getSegmentLen(long max) { private int getSegmentLen(long max) {
// calculate the size of the map array // calculate the size of the map array
// assume a fill factor of at most 75% // assume a fill factor of at most 75%
...@@ -243,7 +243,7 @@ public class CacheLongKeyLIRS<V> { ...@@ -243,7 +243,7 @@ public class CacheLongKeyLIRS<V> {
private Segment<V> getSegment(int hash) { private Segment<V> getSegment(int hash) {
return segments[getSegmentIndex(hash)]; return segments[getSegmentIndex(hash)];
} }
private int getSegmentIndex(int hash) { private int getSegmentIndex(int hash) {
return (hash >>> segmentShift) & segmentMask; return (hash >>> segmentShift) & segmentMask;
} }
...@@ -599,19 +599,19 @@ public class CacheLongKeyLIRS<V> { ...@@ -599,19 +599,19 @@ public class CacheLongKeyLIRS<V> {
usedMemory = 0; usedMemory = 0;
stackSize = queueSize = queue2Size = 0; stackSize = queueSize = queue2Size = 0;
} }
/** /**
* Create a new, larger cache segment from an existing one. * Create a new, larger cache segment from an existing one.
* The caller must synchronize on the old segment, to avoid * The caller must synchronize on the old segment, to avoid
* concurrent modifications. * concurrent modifications.
* *
* @param old the old segment * @param old the old segment
* @param resizeFactor the factor to use to calculate the number of hash * @param resizeFactor the factor to use to calculate the number of hash
* table buckets (must be a power of 2) * table buckets (must be a power of 2)
*/ */
Segment(Segment<V> old, int resizeFactor) { Segment(Segment<V> old, int resizeFactor) {
this(old.maxMemory, this(old.maxMemory,
old.entries.length * resizeFactor, old.entries.length * resizeFactor,
old.stackMoveDistance); old.stackMoveDistance);
Entry<V> s = old.stack.stackPrev; Entry<V> s = old.stack.stackPrev;
while (s != old.stack) { while (s != old.stack) {
...@@ -641,7 +641,7 @@ public class CacheLongKeyLIRS<V> { ...@@ -641,7 +641,7 @@ public class CacheLongKeyLIRS<V> {
s = s.queuePrev; s = s.queuePrev;
} }
} }
private void addToMap(Entry<V> e) { private void addToMap(Entry<V> e) {
int index = getHash(e.key) & mask; int index = getHash(e.key) & mask;
e.mapNext = entries[index]; e.mapNext = entries[index];
...@@ -649,7 +649,7 @@ public class CacheLongKeyLIRS<V> { ...@@ -649,7 +649,7 @@ public class CacheLongKeyLIRS<V> {
usedMemory += e.memory; usedMemory += e.memory;
mapSize++; mapSize++;
} }
private static <V> Entry<V> copy(Entry<V> old) { private static <V> Entry<V> copy(Entry<V> old) {
Entry<V> e = new Entry<V>(); Entry<V> e = new Entry<V>();
e.key = old.key; e.key = old.key;
...@@ -661,7 +661,7 @@ public class CacheLongKeyLIRS<V> { ...@@ -661,7 +661,7 @@ public class CacheLongKeyLIRS<V> {
/** /**
* Check whether the cache segment is full. * Check whether the cache segment is full.
* *
* @return true if it contains more entries than hash table buckets. * @return true if it contains more entries than hash table buckets.
*/ */
public boolean isFull() { public boolean isFull() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论