Cleanup formatting
This commit is contained in:
parent
11d75226a9
commit
30bfea741e
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue