diff --git a/README.md b/README.md index 93521152d4..d1e0d3cb3b 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,6 @@ Use Caffeine in a community provided integration: * [ScalaCache][scala-cache]: Simple caching in Scala * [Camel][camel]: Routing and mediation engine * [JHipster][jhipster]: Generate, develop, deploy - * [Druid][druid]: Real-time analytics Powering infrastructure near you: * [Dropwizard][dropwizard]: Ops-friendly, high-performance, RESTful APIs @@ -62,11 +61,12 @@ Powering infrastructure near you: * [HBase][hbase]: A distributed, scalable, big data store * [Apache Solr][solr]: Blazingly fast enterprise search * [Infinispan][infinispan]: Distributed in-memory data grid + * [OpenWhisk][open-whisk]: Serverless cloud platform * [Corfu][corfu]: A cluster consistency platform * [Grails][grails]: Groovy-based web framework - * [Orbit][orbit]: Virtual actors on the JVM * [Finagle][finagle]: Extensible RPC system * [Neo4j][neo4j]: Graphs for Everyone + * [Druid][druid]: Real-time analytics ### In the News @@ -130,7 +130,7 @@ Snapshots of the development version are available in [finagle]: https://github.com/twitter/finagle [druid]: https://druid.apache.org/docs/latest/configuration/index.html#cache-configuration [jhipster]: https://www.jhipster.tech/ -[orbit]: https://github.com/orbit/orbit +[open-whisk]: https://openwhisk.apache.org/ [camel]: https://github.com/apache/camel/blob/master/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc [corfu]: https://github.com/CorfuDB/CorfuDB [akka-http]: https://doc.akka.io/docs/akka-http/current/common/caching.html diff --git a/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java b/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java index 69ed0bea95..c5d03e1ce1 100644 --- a/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java +++ b/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java @@ -2006,6 +2006,17 @@ public Map getAllPresent(Iterable keys) { return null; } } + } else if (onlyIfAbsent) { + // An optimistic fast path to avoid unnecessary locking + V currentValue = prior.getValue(); + if ((currentValue != null) && !hasExpired(prior, now)) { + if (!isComputingAsync(prior)) { + tryExpireAfterRead(prior, key, currentValue, expiry(), now); + setAccessTime(prior, now); + } + afterRead(prior, now, /* recordHit */ false); + return currentValue; + } } V oldValue; diff --git a/checksum.xml b/checksum.xml index 832ef9a889..080278fa0a 100644 --- a/checksum.xml +++ b/checksum.xml @@ -45,6 +45,7 @@ + @@ -204,6 +205,9 @@ EEA3D1118C6DE8F890AB6A04EA3505C149F99C034C26707C44ED736F6603C6253A03BA07D0361C4D1008E5CE944B0DD7457DC1AF2CD6B01091F6594261DB1F77 + + 6B6E1C845DF98A6EFD07354F7DC2FABB77FFB171F20BE88BC232270AEB0243370B5265E2A310D8CBAC77F83F2B0D11AE8EB59A9ED1F030D5789357DA3899798B + DF5BFED7DFC327166FE0CB81BD6A9655F44CCB268E7E69204BD09955147CE9A97EBBCC28F9ACF315DBAF49E850A43CE8744F44E68D7BE816EACCAF0BEE41B203 @@ -342,6 +346,9 @@ 508B1F1594A3E377DD9AEBA9EF1EF43DA24F22BE488B4AF9EDB719D02814741B47AD69D22A7E8CAF799D847A5CE20DE8B199586958AECA17C79EFDCA8D257E + + AC7BBD700CB88EDB3E0FC92D7A0D659F42C97E6E0B5E21DD3EC2EC8537841CAEA50E99AC3414026BFE54D89EA72F6F635F964B429EC8A1E5BF6F44101AC58868 + 37A13B129F3536A53F2A553151A53997DA6DE7CE4D7231EFEEFD26A68C92BE309666F2EE1F527D3B8C38BC6ADDC9FCCBBDD0D134759FD88667976B0CFF842435 diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 673c024ac5..bf88130658 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -25,11 +25,11 @@ */ ext { versions = [ - akka: '2.6.3', + akka: '2.6.4', cache2k: '1.3.1.Alpha', - checkerFramework: '3.1.0', + checkerFramework: '3.2.0', collision: '0.3.3', - commonsCompress: '1.19', + commonsCompress: '1.20', commonsLang3: '3.9', commonsMath3: '3.6.1', concurrentlinkedhashmap: '1.4.2', @@ -37,11 +37,11 @@ ext { ehcache3: '3.8.1', errorprone: '2.3.4', errorproneJavac: '9+181-r4173-1', - elasticSearch: '7.5.2', + elasticSearch: '7.6.1', expiringMap: '0.5.9', fastfilter: 'bf0b02297f', - fastutil: '8.3.0', - flipTables: '1.0.2', + fastutil: '8.3.1', + flipTables: '1.1.0', guava: '28.2-jre', jackrabbit: '1.24.0', jamm: '0.3.3', @@ -68,15 +68,15 @@ ext { jcacheTck: '1.1.1', jctools: '3.0.0', junit: '4.13', - mockito: '3.2.4', + mockito: '3.3.3', paxExam: '4.13.1', - testng: '7.1.1', + testng: '7.2.0', truth: '0.24', ] pluginVersions = [ apt: '0.21', bnd: '5.0.0', - checkstyle: '8.29', + checkstyle: '8.30', coveralls: '2.8.4', coverity: '1.0.10', errorprone: '1.1.1', @@ -84,14 +84,14 @@ ext { jmh: '0.5.0', jmhReport: '0.9.0', nullaway: '1.0.1', - pmd: '6.21.0', + pmd: '6.22.0', semanticVersioning: '1.1.0', shadow: '5.2.0', sonarqube: '2.8.0.1969', spotbugs: '4.0.0-RC1', spotbugsPlugin: '3.0.0', stats: '0.2.2', - versions: '0.27.0', + versions: '0.28.0', ] libraries = [ @@ -166,7 +166,7 @@ ext { exclude group: 'junit' exclude group: 'guice' }, - 'com.google.inject:guice:4.2.2' + 'com.google.inject:guice:4.2.3' ], truth: "com.google.truth:truth:${testVersions.truth}", ] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 54dafaaea7..17bc87bdbb 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-rc-4-bin.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME