Cleanup formatting

This commit is contained in:
Jason Tedor 2015-10-01 00:37:18 +02:00
parent 11d75226a9
commit 30bfea741e
2 changed files with 36 additions and 33 deletions

View File

@ -52,7 +52,7 @@ import java.util.function.ToLongBiFunction;
* <li>Promotions could be deferred for entries that were "recently" promoted.</li> * <li>Promotions could be deferred for entries that were "recently" promoted.</li>
* <li>Locks on the list could be taken per node being modified instead of globally.</li> * <li>Locks on the list could be taken per node being modified instead of globally.</li>
* </ol> * </ol>
* * <p>
* Evictions only occur after a mutation to the cache (meaning an entry promotion, a cache insertion, or a manual * Evictions only occur after a mutation to the cache (meaning an entry promotion, a cache insertion, or a manual
* invalidation) or an explicit call to {@link #refresh()}. * invalidation) or an explicit call to {@link #refresh()}.
* *
@ -124,7 +124,9 @@ public class Cache<K, V> {
} }
// the state of an entry in the LRU list // the state of an entry in the LRU list
enum State {NEW, EXISTING, DELETED} enum State {
NEW, EXISTING, DELETED
}
static class Entry<K, V> { static class Entry<K, V> {
final K key; final K key;
@ -144,7 +146,7 @@ public class Cache<K, V> {
/** /**
* A cache segment. * A cache segment.
* * <p>
* A CacheSegment is backed by a HashMap and is protected by a read/write lock. * A CacheSegment is backed by a HashMap and is protected by a read/write lock.
* *
* @param <K> the type of the keys * @param <K> the type of the keys

View File

@ -22,13 +22,14 @@ package org.elasticsearch.common.cache;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.junit.Before; import org.junit.Before;
import java.util.*; import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReferenceArray; import java.util.concurrent.atomic.AtomicReferenceArray;
import static org.hamcrest.Matchers.not;
public class CacheTests extends ESTestCase { public class CacheTests extends ESTestCase {
private int numberOfEntries; private int numberOfEntries;