From 86969968490abc43b8ffe72e52261d024709c81d Mon Sep 17 00:00:00 2001 From: Ben Manes Date: Sun, 25 Jun 2023 14:18:14 -0700 Subject: [PATCH] Add apache kafka as a library user (as of 3.6) https://issues.apache.org/jira/browse/KAFKA-15084 --- README.md | 2 ++ gradle/libs.versions.toml | 2 +- .../github/benmanes/caffeine/cache/simulator/Simulator.java | 2 +- .../caffeine/cache/simulator/policy/two_queue/QdlpPolicy.java | 3 +-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ea52135d04..7fd9827456 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ Powering infrastructure near you: * [Coherence][coherence]: Mission critical in-memory data grid * [Accumulo][accumulo]: A sorted, distributed key/value store * [HBase][hbase]: A distributed, scalable, big data store +* [Kafka][kafka]: A distributed event streaming platform * [Apache Solr][solr]: Blazingly fast enterprise search * [Infinispan][infinispan]: Distributed in-memory data grid * [Redisson][redisson]: Ultra-fast in-memory data grid @@ -139,6 +140,7 @@ Snapshots of the development version are available in [scala-cache]: https://github.com/cb372/scalacache [scaffeine]: https://github.com/blemale/scaffeine [hbase]: https://hbase.apache.org +[kafka]: https://kafka.apache.org [cassandra]: http://cassandra.apache.org [solr]: https://solr.apache.org/ [infinispan]: https://infinispan.org diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index eb5c1e7418..017052cb45 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,7 @@ bouncycastle = "1.70" cache2k = "2.6.1.Final" caffeine = "3.1.6" checker-framework = "3.35.0" -checkstyle = "10.12.0" +checkstyle = "10.12.1" coherence = "22.06.2" commons-collections4 = "4.4" commons-compress = "1.23.0" diff --git a/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/Simulator.java b/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/Simulator.java index 908998e837..620205dc58 100644 --- a/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/Simulator.java +++ b/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/Simulator.java @@ -137,7 +137,7 @@ private ImmutableList getPolicyActors(Set character } /** Throws the underlying cause for the simulation failure. */ - private void throwError(ImmutableList policies, RuntimeException e) { + private void throwError(Iterable policies, RuntimeException e) { if (!Thread.currentThread().isInterrupted()) { throw e; } diff --git a/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/two_queue/QdlpPolicy.java b/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/two_queue/QdlpPolicy.java index a7529d94f1..11eb3054e2 100644 --- a/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/two_queue/QdlpPolicy.java +++ b/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/two_queue/QdlpPolicy.java @@ -144,19 +144,18 @@ private void evict() { int freq = candidate.frequency; candidate.frequency = 0; candidate.remove(); + sizeFifo--; if (freq >= moveToMainThreshold) { evictFromMain(); candidate.appendToTail(headMain); candidate.type = QueueType.MAIN; sizeMain++; - sizeFifo--; } else { candidate.appendToTail(headGhost); candidate.type = QueueType.GHOST; candidate.frequency = 0; sizeGhost++; - sizeFifo--; if (sizeGhost > maxGhost) { var ghost = headGhost.next;