Skip to content

Commit

Permalink
Remove ElasticSearch's cache from comparisons
Browse files Browse the repository at this point in the history
The latest version requires Java 17. The simulator could be special
cased to use 17 in an 11 build, but this does not seem worthwhile.
Despite users reporting production issues regarding the cache's very
poor performance, the Elastic team is not interested in making changes.
  • Loading branch information
ben-manes committed Jan 25, 2022
1 parent 5e834f8 commit d212cd6
Show file tree
Hide file tree
Showing 17 changed files with 84 additions and 228 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/lincheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
- uses: gradle/gradle-build-action@v2
- name: Run lincheck
run: |
set -eux
./gradlew lincheckTest
run: ./gradlew lincheckTest
58 changes: 5 additions & 53 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import net.ltgt.gradle.errorprone.CheckSeverity
apply plugin: 'io.github.gradle-nexus.publish-plugin'
apply plugin: 'org.kordamp.gradle.source-stats'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'jacoco'

apply from: "${rootDir}/gradle/coveralls.gradle"

buildscript {
apply from: "${rootDir}/gradle/dependencies.gradle"
Expand All @@ -19,12 +19,6 @@ buildscript {
}
}

tasks.register('testReport', TestReport) {
group = 'Build'
description = 'Generates an aggregate test report'
destinationDir = file("${buildDir}/reports/allTests")
}

allprojects {
apply plugin: 'com.github.ethankhall.semantic-versioning'
apply from: "${rootDir}/gradle/eclipse.gradle"
Expand Down Expand Up @@ -55,9 +49,9 @@ subprojects {

java.toolchain.languageVersion = JavaLanguageVersion.of(System.env.'JAVA_VERSION' ?: 11)

configurations {
all {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module('org.hamcrest:hamcrest-core') using module(testLibraries.hamcrest)
}
}

Expand Down Expand Up @@ -85,16 +79,6 @@ subprojects {
}
}

tasks.withType(Test).configureEach {
rootProject.testReport.reportOn it
it.dependsOn(jar)

// ensure tasks don't overwrite the default report directories used by the 'test' task
reports.html.destination = file("${buildDir}/reports/${name}")
reports.junitXml.destination = file("${buildDir}/reports/${name}/results")
binaryResultsDirectory = file("${buildDir}/reports/${name}/results/binary/${name}")
}

if (project != project(':caffeine')) {
javadoc.options.linksOffline(
"https://static.javadoc.io/${group}/caffeine/${version}/",
Expand All @@ -112,35 +96,3 @@ nexusPublishing {
}
}
}

// Only report code coverage for projects that are distributed
def coveredProjects = [ 'caffeine', 'guava', 'jcache' ].collect { project(it) }

tasks.register('jacocoFullReport', JacocoReport) {
group = 'Coverage reports'
description = 'Generates an aggregate report from all subprojects'

coveredProjects.each {
sourceSets it.sourceSets.main
mustRunAfter it.tasks.withType(Test)
executionData fileTree(it.buildDir.absolutePath).include('jacoco/*.exec')
}

reports {
html.required = true // human readable
xml.required = true // required by coveralls
}
}

coveralls {
sourceDirs = coveredProjects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoFullReport/jacocoFullReport.xml"
}

tasks.named('coveralls').configure {
group = 'Coverage reports'
description = 'Uploads the aggregated coverage report to Coveralls'

dependsOn jacocoFullReport
onlyIf { System.env.'CI' }
}
2 changes: 0 additions & 2 deletions caffeine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ dependencies {
jmh libraries.flipTables
jmh libraries.jackrabbit
jmh libraries.expiringMap
jmh libraries.elasticSearch
jmh libraries.concurrentlinkedhashmap

javaPoetImplementation libraries.guava
Expand Down Expand Up @@ -88,7 +87,6 @@ tasks.named('jar').configure {
attributes 'Import-Package': ''
attributes 'Export-Package': [
'com.github.benmanes.caffeine',
'com.github.benmanes.caffeine.base',
'com.github.benmanes.caffeine.cache',
'com.github.benmanes.caffeine.cache.stats'].join(',')
attributes 'Automatic-Module-Name': 'com.github.benmanes.caffeine'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.github.benmanes.caffeine.cache.impl.ConcurrentHashMapV7;
import com.github.benmanes.caffeine.cache.impl.ConcurrentMapCache;
import com.github.benmanes.caffeine.cache.impl.Ehcache3;
import com.github.benmanes.caffeine.cache.impl.ElasticSearchCache;
import com.github.benmanes.caffeine.cache.impl.ExpiringMapCache;
import com.github.benmanes.caffeine.cache.impl.GuavaCache;
import com.github.benmanes.caffeine.cache.impl.LinkedHashMapCache;
Expand Down Expand Up @@ -89,11 +88,6 @@ public enum CacheType {
return new Ehcache3<>(maximumSize);
}
},
ElasticSearch {
@Override public <K, V> BasicCache<K, V> create(int maximumSize) {
return new ElasticSearchCache<>(maximumSize);
}
},
ExpiringMap_Fifo {
@Override public <K, V> BasicCache<K, V> create(int maximumSize) {
return new ExpiringMapCache<>(maximumSize, ExpirationPolicy.CREATED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public class GetPutBenchmark {
"Caffeine",
"ConcurrentLinkedHashMap",
"Guava",
"ElasticSearch",
"Jackrabbit",
"Cache2k",
"Ehcache3",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ public Expiry<K, V> expiry() {
return null;
}

@Override
/** Returns the {@link Ticker} used by this cache for expiration. */
public Ticker expirationTicker() {
return Ticker.disabledTicker();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ interface LocalCache<K, V> extends ConcurrentMap<K, V> {
/** Returns the {@link Expiry} used by this cache. */
@Nullable Expiry<K, V> expiry();

/** Returns the {@link Ticker} used by this cache for expiration. */
Ticker expirationTicker();

/** Returns the {@link Ticker} used by this cache for statistics. */
Ticker statsTicker();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,6 @@ void discardRefresh(Object keyReference) {
}
}

@Override
public Ticker expirationTicker() {
return Ticker.disabledTicker();
}

@Override
public Ticker statsTicker() {
return ticker;
Expand Down
8 changes: 8 additions & 0 deletions checksum.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<trusted-key id='abe9f3126bb741c1' group='com.google.guava' />
<trusted-key id='f6d4a1d411e9d1ae' group='com.google.guava' />
<trusted-key id='0a2496e4955cac56' group='com.google.inject' />
<trusted-key id='5e975cb00c643dbf' group='com.google.inject' />
<trusted-key id='f0df21d1d0a3c384' group='com.google.inject' />
<trusted-key id='29579f18fa8fd93b' group='com.google.j2objc' />
<trusted-key id='a7764f502a938c99' group='com.google.protobuf' />
Expand Down Expand Up @@ -145,6 +146,7 @@
<trusted-key id='b5ad94bdd6bdb924' group='me.champeau.jmh' />
<trusted-key id='7999befba1039e8b' group='net.bytebuddy' />
<trusted-key id='bb2914c1fa0811c3' group='net.bytebuddy' />
<trusted-key id='15c71c0a4e0b8edd' group='net.java.dev.jna' />
<trusted-key id='75bf031b7c94e183' group='net.java.dev.jna' />
<trusted-key id='243fbb4d5814c621' group='net.jodah' />
<trusted-key id='0da8a5ec02d11ead' group='net.sf.jopt-simple' />
Expand Down Expand Up @@ -424,6 +426,9 @@
<dependency group='com.github.spotbugs.snom' module='spotbugs-gradle-plugin' version='5.0.4'>
<sha512>51372BCAFB87FBFDEC5DAB387014693B86A800CE5954C847A11DA1E36FC5ACF95110F335B0BBA31B1E1D31960DE0F5565F34A73CA5567EBFDFEACC70DB574EFB</sha512>
</dependency>
<dependency group='com.github.spotbugs.snom' module='spotbugs-gradle-plugin' version='5.0.5'>
<sha512>8D6E78F1F9D54E0D50525328BAD7CC904F98CAC05FF7B783784E2115185CBE0A4CF659B8A8129E0759D96775A1B2A0AFB63953ECA897FEDEFF8A2B7A371B804E</sha512>
</dependency>
<dependency group='com.github.spotbugs' module='spotbugs-gradle-plugin' version='2.0.1'>
<sha512>2C09B102601DF179B615EF37F5E56B9AA1100BB2A17D742B8CB452C1A193C44ED3EBE029FEAFB9822D55A680D99B682184C733D56F835874DD01B02209AFA13D</sha512>
</dependency>
Expand Down Expand Up @@ -673,6 +678,9 @@
<dependency group='net.ltgt.gradle' module='gradle-nullaway-plugin' version='1.2.0'>
<sha512>6F44BE79691ECF80771220086E796626B45D053BEA913AD16E5AD3DEA3FA07995FEC8045DA6265B4FDF837EA985AD7E58DC398405D3FFA79C4E2DAA5881E2D09</sha512>
</dependency>
<dependency group='net.ltgt.gradle' module='gradle-nullaway-plugin' version='1.3.0'>
<sha512>51F4EECF44441AC5BA056087C6C9BC10750FC5A2DBE3FBEE69372B2187E9B045C198C8BED86003657D77BB3297C41B32008CFC4857BA8E02DD461029A5D5C237</sha512>
</dependency>
<dependency group='net.sf.ezmorph' module='ezmorph' version='1.0.6'>
<sha512>16D30BE564723B74F312B4E7D06F349370FB6726B3162778C869CD723ECA2A40C4972C2757B3E107E1820CEC0D70B0BD2B96EFCD466518FC64495F7AEF97967A</sha512>
</dependency>
Expand Down
59 changes: 59 additions & 0 deletions gradle/coveralls.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* Configurations for code coverage
*/
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'jacoco'

def testReport = tasks.register('testReport', TestReport) {
group = 'Build'
description = 'Generates an aggregate test report'
destinationDir = file("${buildDir}/reports/allTests")
}

subprojects {
apply plugin: 'java-library'

tasks.withType(Test).configureEach { testTask ->
testReport.configure {
reportOn testTask
}
testTask.dependsOn(jar)

// ensure tasks don't overwrite the default report directories used by the 'test' task
reports.html.destination = file("${buildDir}/reports/${name}")
reports.junitXml.destination = file("${buildDir}/reports/${name}/results")
binaryResultsDirectory = file("${buildDir}/reports/${name}/results/binary/${name}")
}
}

// Only report code coverage for projects that are distributed
def coveredProjects = [ 'caffeine', 'guava', 'jcache' ].collect { project(it) }

tasks.register('jacocoFullReport', JacocoReport) {
group = 'Coverage reports'
description = 'Generates an aggregate report from all subprojects'

coveredProjects.each {
sourceSets it.sourceSets.main
mustRunAfter it.tasks.withType(Test)
executionData fileTree(it.buildDir.absolutePath).include('jacoco/*.exec')
}

reports {
html.required = true // human readable
xml.required = true // required by coveralls
}
}

coveralls {
sourceDirs = coveredProjects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoFullReport/jacocoFullReport.xml"
}

tasks.named('coveralls').configure {
group = 'Coverage reports'
description = 'Uploads the aggregated coverage report to Coveralls'

dependsOn jacocoFullReport
onlyIf { System.env.'CI' }
}
Loading

0 comments on commit d212cd6

Please sign in to comment.