Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renamed and unified settings/parameters to control file #643

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Soil-Core-Tests/SoilBackupTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ SoilBackupTest >> testBackupWithIndexRemoval [
{ #category : #tests }
SoilBackupTest >> testSimpleBackup [
| tx backup tx2 |
soil settings
soil control
databaseFormatVersion: 1;
applicationVersion: 5.
tx := soil newTransaction.
Expand All @@ -100,7 +100,7 @@ SoilBackupTest >> testSimpleBackup [
open.
[tx2 := backup newTransaction.
self assert: tx2 root equals: tx2 root.
self assert: backup settings applicationVersion equals: 5]
self assert: backup control applicationVersion equals: 5]
ensure: [ backup close ]


Expand Down
15 changes: 13 additions & 2 deletions src/Soil-Core-Tests/SoilTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SoilTest class >> packageNamesUnderTest [

{ #category : #accessing }
SoilTest >> path [
^ 'soil-tests'
^ 'soil-tests' asFileReference
]

{ #category : #initialization }
Expand Down Expand Up @@ -69,6 +69,17 @@ SoilTest >> testCachedSegment [

]

{ #category : #tests }
SoilTest >> testChangePathToControl [
soil close.
(self path / #control) moveTo: (self path / #settings).
soil := Soil path: self path.
soil open.
self assert: soil databaseVersion equals: 0


]

{ #category : #tests }
SoilTest >> testCheckpointEmptyRecordsToCommit [
| tx root skipList obj items |
Expand Down Expand Up @@ -122,7 +133,7 @@ SoilTest >> testFindRecordWithIndex [

{ #category : #tests }
SoilTest >> testIncompatibleDatabaseFormatVersion [
soil settings databaseFormatVersion: 2.
soil control databaseFormatVersion: 2.
soil close.

soil := Soil path: self path.
Expand Down
46 changes: 23 additions & 23 deletions src/Soil-Core/Soil.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ Class {
'objectRepository',
'behaviorRegistry',
'semaphore',
'settings',
'journal',
'notificationHandler',
'serializerClass',
'materializerClass'
'materializerClass',
'control'
],
#category : #'Soil-Core-Model'
}
Expand Down Expand Up @@ -94,8 +94,14 @@ Soil >> close [
objectRepository close ].
behaviorRegistry ifNotNil: [
behaviorRegistry close ].
settings ifNotNil: [
settings close ]
control ifNotNil: [
control close ]
]

{ #category : #accessing }
Soil >> control [

^ control
]

{ #category : #initialization }
Expand All @@ -105,12 +111,12 @@ Soil >> critical: aBlock [

{ #category : #accessing }
Soil >> databaseVersion [
^ settings databaseVersion
^ control databaseVersion
]

{ #category : #accessing }
Soil >> databaseVersion: anInteger [
settings databaseVersion: anInteger
control databaseVersion: anInteger
]

{ #category : #'instance creation' }
Expand Down Expand Up @@ -149,7 +155,7 @@ Soil >> initializeFilesystem [
(path exists and: [ path hasChildren ])
ifTrue: [ SoilDatabaseAlreadyPresent signal: 'the directory ', path asString, ' already exists' ].
self path ensureCreateDirectory.
settings := SoilParameterFile new
control := SoilControlFile new
soil: self;
initializeFilesystem;
yourself.
Expand All @@ -169,28 +175,28 @@ Soil >> initializeFilesystem [
soil: self
]

{ #category : #inspector }
Soil >> inspectionControl [
<inspectorPresentationOrder: 2100 title: 'control'>

^ self control inspectionControl
]

{ #category : #inspector }
Soil >> inspectionJournal [
<inspectorPresentationOrder: 2000 title: 'journal'>

^ self journal inspectionContent
]

{ #category : #inspector }
Soil >> inspectionParameters [
<inspectorPresentationOrder: 2100 title: 'parameters'>

^ self settings inspectionParameters
]

{ #category : #accessing }
Soil >> journal [
^ journal
]

{ #category : #locking }
Soil >> lockDatabaseVersionFor: lockContext [
^ settings lockDatabaseVersionFor: lockContext
^ control lockDatabaseVersionFor: lockContext
]

{ #category : #locking }
Expand Down Expand Up @@ -266,7 +272,7 @@ Soil >> objectRepository [
{ #category : #'opening/closing' }
Soil >> open [
('open soil database at ', path asString) soilEmit.
settings := SoilParameterFile new
control := SoilControlFile new
soil: self;
open.
objectRepository := SoilObjectRepository new
Expand Down Expand Up @@ -300,7 +306,7 @@ Soil >> path: aString [
Soil >> printOn: aStream [
aStream
<< 'Soil ['
<< self settings databaseVersion printString
<< self control databaseVersion printString
<< '] '
<< self path pathString
]
Expand Down Expand Up @@ -360,12 +366,6 @@ Soil >> serializerClass: anObject [
serializerClass := anObject
]

{ #category : #accessing }
Soil >> settings [

^ settings
]

{ #category : #accessing }
Soil >> setup [
^ SoilSetup new
Expand Down
16 changes: 8 additions & 8 deletions src/Soil-Core/SoilBackupVisitor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ SoilBackupVisitor >> target: aSoil [
target := aSoil
]

{ #category : #visiting }
SoilBackupVisitor >> visitControl: aSoilControlFile [
target control
databaseFormatVersion: aSoilControlFile databaseFormatVersion;
databaseVersion: aSoilControlFile databaseVersion;
applicationVersion: aSoilControlFile applicationVersion
]

{ #category : #visiting }
SoilBackupVisitor >> visitDatabaseJournal: aSoilJournal [
(target path / #journal) ensureCreateDirectory.
Expand All @@ -101,14 +109,6 @@ SoilBackupVisitor >> visitObjectSegment: aSoilObjectSegment [
super visitObjectSegment: aSoilObjectSegment.
]

{ #category : #visiting }
SoilBackupVisitor >> visitParameters: aSoilParameterFile [
target settings
databaseFormatVersion: aSoilParameterFile databaseFormatVersion;
databaseVersion: aSoilParameterFile databaseVersion;
applicationVersion: aSoilParameterFile applicationVersion
]

{ #category : #visiting }
SoilBackupVisitor >> visitPersistentClusterVersion: aSoilPersistentClusterVersion [
| backupCluster |
Expand Down
Loading
Loading