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

Fix formatting

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