mirror of https://github.com/apache/lucene.git
SOLR-2410: add test that normally hits phase3 cleaning w/ PQ
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1079827 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
907d4c708f
commit
bcc16311a1
solr/src/test/org/apache/solr/search
|
@ -254,6 +254,18 @@ public class TestFastLRUCache extends LuceneTestCase {
|
||||||
cache.destroy();
|
cache.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// enough randomness to exercise all of the different cache purging phases
|
||||||
|
public void testRandom() {
|
||||||
|
int sz = random.nextInt(100)+5;
|
||||||
|
int lowWaterMark = random.nextInt(sz-3)+1;
|
||||||
|
int keyrange = random.nextInt(sz*3)+1;
|
||||||
|
ConcurrentLRUCache<Integer, String> cache = new ConcurrentLRUCache<Integer, String>(sz, lowWaterMark);
|
||||||
|
for (int i=0; i<10000; i++) {
|
||||||
|
cache.put(random.nextInt(keyrange), "");
|
||||||
|
cache.get(random.nextInt(keyrange));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void doPerfTest(int iter, int cacheSize, int maxKey) {
|
void doPerfTest(int iter, int cacheSize, int maxKey) {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue