Skip to content

Commit e6dfb1a

Browse files
authored
Remove incubating normalized cache (#5985)
* Update benchmarks to use published version of the incubating normalized cache * Update integration tests to use published version of the incubating normalized cache * Remove incubating normalized cache * Update group id * Remove mavenLocal() from repos * Move incubating benchmark test classes to same package as stable ones * Use the snapshots for the stable benchmarks * Fix ApolloStore usage in benchmarks
1 parent 00d0429 commit e6dfb1a

File tree

120 files changed

+149
-9645
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+149
-9645
lines changed

benchmark/microbenchmark/build.gradle.kts

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,40 +21,25 @@ configure<com.android.build.gradle.LibraryExtension> {
2121
sourceCompatibility = JavaVersion.VERSION_11
2222
targetCompatibility = JavaVersion.VERSION_11
2323
}
24-
25-
flavorDimensions += "stability"
26-
productFlavors {
27-
create("incubating") {
28-
dimension = "stability"
29-
testApplicationId = "com.apollographql.apollo3.benchmark.incubating"
30-
}
31-
create("stable") {
32-
dimension = "stability"
33-
testApplicationId = "com.apollographql.apollo3.benchmark.stable"
34-
}
35-
}
3624
}
3725

3826
dependencies {
3927

40-
implementation("com.apollographql.apollo3:apollo-runtime")
41-
42-
listOf(
43-
"com.apollographql.apollo3:apollo-normalized-cache-api",
44-
"com.apollographql.apollo3:apollo-normalized-cache-sqlite",
45-
"com.apollographql.apollo3:apollo-normalized-cache"
46-
).forEach {
47-
add("androidTestStableImplementation", it)
48-
add("androidTestIncubatingImplementation", "$it-incubating")
49-
}
28+
implementation(libs.apollo.runtime)
5029

5130
implementation(libs.moshi)
5231
ksp(libs.moshix.ksp)
5332

5433
androidTestImplementation(libs.benchmark.junit4)
5534
androidTestImplementation(libs.androidx.test.core)
5635
androidTestImplementation(libs.apollo.mockserver)
57-
androidTestImplementation("com.apollographql.apollo3:apollo-testing-support")
36+
androidTestImplementation(libs.apollo.testingsupport)
37+
38+
// Stable cache
39+
androidTestImplementation(libs.apollo.normalizedcache.sqlite)
40+
41+
// Incubating cache
42+
androidTestImplementation(libs.apollo.normalizedcache.sqlite.incubating.snapshot)
5843
}
5944

6045
java {
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import com.apollographql.apollo3.benchmark.Utils.dbName
88
import com.apollographql.apollo3.benchmark.Utils.operationBasedQuery
99
import com.apollographql.apollo3.benchmark.Utils.resource
1010
import com.apollographql.apollo3.benchmark.test.R
11-
import com.apollographql.apollo3.cache.normalized.ApolloStore
12-
import com.apollographql.apollo3.cache.normalized.api.MemoryCacheFactory
13-
import com.apollographql.apollo3.cache.normalized.api.NormalizedCacheFactory
14-
import com.apollographql.apollo3.cache.normalized.sql.SqlNormalizedCacheFactory
11+
import com.apollographql.cache.normalized.ApolloStore
12+
import com.apollographql.cache.normalized.api.MemoryCacheFactory
13+
import com.apollographql.cache.normalized.api.NormalizedCacheFactory
14+
import com.apollographql.cache.normalized.sql.SqlNormalizedCacheFactory
1515
import org.junit.Assert
1616
import org.junit.Rule
1717
import org.junit.Test
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ApolloStoreTests {
5050
threadPool.submit {
5151
// Let each thread execute a few writes/reads
5252
repeat(WORK_LOAD) {
53-
apolloStore.writeOperation(query, data)
53+
apolloStore.writeOperationSync(query, data)
5454
val data2 = apolloStore.readOperation(query)
5555
Assert.assertEquals(data, data2)
5656
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import com.apollographql.apollo3.benchmark.Utils.dbName
99
import com.apollographql.apollo3.benchmark.Utils.operationBasedQuery
1010
import com.apollographql.apollo3.benchmark.Utils.resource
1111
import com.apollographql.apollo3.benchmark.test.R
12-
import com.apollographql.apollo3.cache.normalized.ApolloStore
13-
import com.apollographql.apollo3.cache.normalized.FetchPolicy
14-
import com.apollographql.apollo3.cache.normalized.api.MemoryCacheFactory
15-
import com.apollographql.apollo3.cache.normalized.api.NormalizedCacheFactory
16-
import com.apollographql.apollo3.cache.normalized.fetchPolicy
17-
import com.apollographql.apollo3.cache.normalized.sql.SqlNormalizedCacheFactory
18-
import com.apollographql.apollo3.cache.normalized.store
12+
import com.apollographql.cache.normalized.ApolloStore
13+
import com.apollographql.cache.normalized.FetchPolicy
14+
import com.apollographql.cache.normalized.api.MemoryCacheFactory
15+
import com.apollographql.cache.normalized.api.NormalizedCacheFactory
16+
import com.apollographql.cache.normalized.fetchPolicy
17+
import com.apollographql.cache.normalized.sql.SqlNormalizedCacheFactory
18+
import com.apollographql.cache.normalized.store
1919
import com.apollographql.mockserver.MockRequestBase
2020
import com.apollographql.mockserver.MockResponse
2121
import com.apollographql.mockserver.MockServer
Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ package com.apollographql.apollo3.benchmark
22

33
import androidx.benchmark.junit4.BenchmarkRule
44
import androidx.benchmark.junit4.measureRepeated
5-
import androidx.test.platform.app.InstrumentationRegistry
65
import com.apollographql.apollo3.api.CustomScalarAdapters
7-
import com.apollographql.apollo3.api.Executable
8-
import com.apollographql.apollo3.api.Operation
96
import com.apollographql.apollo3.api.Query
107
import com.apollographql.apollo3.api.json.jsonReader
118
import com.apollographql.apollo3.api.parseJsonResponse
@@ -16,26 +13,20 @@ import com.apollographql.apollo3.benchmark.Utils.registerCacheSize
1613
import com.apollographql.apollo3.benchmark.Utils.resource
1714
import com.apollographql.apollo3.benchmark.Utils.responseBasedQuery
1815
import com.apollographql.apollo3.benchmark.test.R
19-
import com.apollographql.apollo3.cache.normalized.api.CacheHeaders
20-
import com.apollographql.apollo3.cache.normalized.api.CacheKeyGenerator
21-
import com.apollographql.apollo3.cache.normalized.api.CacheResolver
22-
import com.apollographql.apollo3.cache.normalized.api.DefaultRecordMerger
23-
import com.apollographql.apollo3.cache.normalized.api.FieldPolicyCacheResolver
24-
import com.apollographql.apollo3.cache.normalized.api.MemoryCacheFactory
25-
import com.apollographql.apollo3.cache.normalized.api.ReadOnlyNormalizedCache
26-
import com.apollographql.apollo3.cache.normalized.api.Record
27-
import com.apollographql.apollo3.cache.normalized.api.TypePolicyCacheKeyGenerator
28-
import com.apollographql.apollo3.cache.normalized.api.normalize
29-
import com.apollographql.apollo3.cache.normalized.api.readDataFromCache
30-
import com.apollographql.apollo3.cache.normalized.sql.SqlNormalizedCacheFactory
16+
import com.apollographql.cache.normalized.api.CacheHeaders
17+
import com.apollographql.cache.normalized.api.DefaultRecordMerger
18+
import com.apollographql.cache.normalized.api.FieldPolicyCacheResolver
19+
import com.apollographql.cache.normalized.api.MemoryCacheFactory
20+
import com.apollographql.cache.normalized.api.TypePolicyCacheKeyGenerator
21+
import com.apollographql.cache.normalized.api.normalize
22+
import com.apollographql.cache.normalized.api.readDataFromCache
23+
import com.apollographql.cache.normalized.sql.SqlNormalizedCacheFactory
3124
import kotlinx.coroutines.runBlocking
3225
import org.junit.Assert
3326
import org.junit.Rule
3427
import org.junit.Test
35-
import java.lang.reflect.Method
3628
import java.util.concurrent.Executors
3729

38-
@Suppress("UNCHECKED_CAST")
3930
class CacheIncubatingTests {
4031
@get:Rule
4132
val benchmarkRule = BenchmarkRule()
@@ -158,4 +149,4 @@ class CacheIncubatingTests {
158149
private const val CONCURRENCY = 15
159150
private const val WORK_LOAD = 15
160151
}
161-
}
152+
}

benchmark/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ apply(from = "../gradle/ge.gradle")
2323
listOf(pluginManagement.repositories, dependencyResolutionManagement.repositories).forEach {
2424
it.apply {
2525
maven {
26-
url = uri("../build/localMaven")
26+
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
2727
}
2828
}
2929
}

build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ tasks.register("ciTestsNoGradle") {
8686
* Update the database schemas in CI
8787
*/
8888
dependsOn(":apollo-normalized-cache-sqlite:generateCommonMainJsonDatabaseSchema")
89-
dependsOn(":apollo-normalized-cache-sqlite-incubating:generateCommonMainJsonDatabaseSchema")
90-
dependsOn(":apollo-normalized-cache-sqlite-incubating:generateCommonMainBlobDatabaseSchema")
91-
dependsOn(":apollo-normalized-cache-sqlite-incubating:generateCommonMainBlob2DatabaseSchema")
9289

9390
doLast {
9491
if (isCIBuild()) {
@@ -172,4 +169,4 @@ tasks.register("rmbuild") {
172169
}
173170
}
174171

175-
apolloRoot(ciBuild)
172+
apolloRoot(ciBuild)

0 commit comments

Comments
 (0)