Skip to content

Commit 97a1d3b

Browse files
author
Oleksandr Dzhychko
committed
chore: drop support for MetaModelBranch
Legacy info repositories are migrated automatically on startup. BREAKING CHANGE: use `ModelMigrations.useResolvedConceptsFromMetaModel` to migrate data written with `MetaModelBranch`.
1 parent 861ac19 commit 97a1d3b

File tree

5 files changed

+21
-311
lines changed

5 files changed

+21
-311
lines changed

model-client/src/commonMain/kotlin/org/modelix/model/ModelFacade.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import org.modelix.model.lazy.CLTree
1616
import org.modelix.model.lazy.CLVersion
1717
import org.modelix.model.lazy.ObjectStoreCache
1818
import org.modelix.model.lazy.RepositoryId
19-
import org.modelix.model.metameta.MetaModelBranch
2019
import org.modelix.model.operations.OTBranch
2120
import org.modelix.model.persistent.CPVersion
2221
import org.modelix.model.persistent.MapBaseStore
@@ -92,9 +91,7 @@ object ModelFacade {
9291
body: (IWriteTransaction) -> Unit,
9392
): CLVersion {
9493
val otBranch = OTBranch(PBranch(baseVersion.tree, client.idGenerator), client.idGenerator, client.storeCache)
95-
MetaModelBranch(otBranch).computeWriteT { t ->
96-
body(t)
97-
}
94+
otBranch.computeWriteT { t -> body(t) }
9895

9996
val operationsAndTree = otBranch.operationsAndTree
10097
val newVersion = CLVersion.createRegularVersion(

model-client/src/commonMain/kotlin/org/modelix/model/metameta/MetaModelBranch.kt

Lines changed: 0 additions & 283 deletions
This file was deleted.

model-client/src/commonMain/kotlin/org/modelix/model/metameta/MetaModelMigration.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ internal object MetaModelMigration {
3535
)
3636

3737
fun useResolvedConceptsFromMetaModel(rawBranch: IBranch) {
38-
require(rawBranch !is MetaModelBranch) {
39-
"Pass the underlying branch and not the `MetaModelBranch` for migration."
40-
}
4138
LOG.info { "Start migration for `$rawBranch`." }
4239
rawBranch.runWriteT { transaction ->
4340
val root = rawBranch.getRootNode()

model-client/src/jvmMain/kotlin/org/modelix/model/client/ReplicatedRepository.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import org.modelix.model.lazy.CLTree
3131
import org.modelix.model.lazy.CLVersion
3232
import org.modelix.model.lazy.CLVersion.Companion.loadFromHash
3333
import org.modelix.model.lazy.RepositoryId
34-
import org.modelix.model.metameta.MetaModelBranch
3534
import org.modelix.model.operations.IAppliedOperation
3635
import org.modelix.model.operations.IOperation
3736
import org.modelix.model.operations.OTBranch
@@ -50,9 +49,6 @@ actual open class ReplicatedRepository actual constructor(
5049
) {
5150
private val localBranch: IBranch
5251
private val localOTBranch: OTBranch
53-
54-
@Deprecated("MetaModelBranch is deprecated")
55-
private val localMMBranch: IBranch
5652
private val mergeLock = Any()
5753
private val merger: VersionMerger
5854
private val coroutineScope = CoroutineScope(Dispatchers.Default)
@@ -74,7 +70,7 @@ actual open class ReplicatedRepository actual constructor(
7470
actual val branch: IBranch
7571
get() {
7672
checkDisposed()
77-
return localMMBranch
73+
return localOTBranch
7874
}
7975

8076
/**
@@ -267,7 +263,6 @@ actual open class ReplicatedRepository actual constructor(
267263
remoteVersion = initialVersion
268264
localBranch = PBranch(initialTree.value, client.idGenerator)
269265
localOTBranch = OTBranch(localBranch, client.idGenerator, store)
270-
localMMBranch = MetaModelBranch(localOTBranch)
271266
merger = VersionMerger(store, client.idGenerator)
272267
versionChangeDetector = object : VersionChangeDetector(client, branchReference.getKey(), coroutineScope) {
273268
override fun processVersionChange(oldVersionHash: String?, newVersionHash: String?) {

0 commit comments

Comments
 (0)