Permalink
Browse files

add invalidate all

  • Loading branch information...
spullara committed May 11, 2011
1 parent 3152117 commit 36b8df226d9d3bbcb31ef031f44254fdaabecdf7
@@ -160,4 +160,8 @@ public String toString() {
sb.append("{\"hits\":").append(hit).append(",\"miss\":").append(miss).append(",\"inv\":").append(inv).append("}");
return sb.toString();
}
+
+ public void invalidate() {
+ cache.clear();
+ }
}
@@ -29,8 +29,6 @@
@Test
public void cachingtest() {
-
-
FAB<Beacon, byte[]> beaconFAB = new FAB<Beacon, byte[]>("/tmp/cachingtest/beacons", "/tmp/cachingtest/schemas", new Supplier<byte[]>() {
@Override
public byte[] get() {
@@ -82,7 +80,7 @@ public Object make(final byte[] key) {
}
{
long start = System.currentTimeMillis();
- for (int i = 0; i < 10000; i++) {
+ for (int i = 0; i < 100000; i++) {
beaconCacher.get(Longs.toByteArray(r.nextLong() % 100000));
}
long end = System.currentTimeMillis();

0 comments on commit 36b8df2

Please sign in to comment.