File tree 5 files changed +70
-0
lines changed
5 files changed +70
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ Object >> soilEmit [
35
35
self asSoilSignal emit
36
36
]
37
37
38
+ { #category : #' *Soil-Core' }
39
+ Object >> soilSizeInMemory [
40
+ ^ self sizeInMemory
41
+ ]
42
+
38
43
{ #category : #' *Soil-Core' }
39
44
Object >> theNonSoilProxy [
40
45
^ self
Original file line number Diff line number Diff line change @@ -176,6 +176,14 @@ SoilObjectId >> setIndex: anInteger [
176
176
index := anInteger
177
177
]
178
178
179
+ { #category : #comparing }
180
+ SoilObjectId >> soilSizeInMemory [
181
+ ^ self sizeInMemory
182
+ + segment sizeInMemory
183
+ + index sizeInMemory
184
+
185
+ ]
186
+
179
187
{ #category : #writing }
180
188
SoilObjectId >> writeOn: aStream [
181
189
" for now fix the segment id to be the 16 upper bits and the index
Original file line number Diff line number Diff line change @@ -81,6 +81,23 @@ SoilObjectRepository >> cacheSegmentAt: index upTo: limit [
81
81
put: ((segments at: index) asCachedSegment weight: limit) ]
82
82
]
83
83
84
+ { #category : #setting }
85
+ SoilObjectRepository >> cacheSegmentAt: index using: aBlock [
86
+ | segment |
87
+ " exchange object segment with a LRU cached segment. The LRU cache
88
+ can be setup within aBlock"
89
+ (index = 0 )
90
+ ifTrue: [
91
+ metaSegment := metaSegment asCachedSegment.
92
+ aBlock value: metaSegment ]
93
+ ifFalse: [
94
+ segment := (segments at: index) asCachedSegment.
95
+ aBlock value: segment.
96
+ segments
97
+ at: index
98
+ put: segment ]
99
+ ]
100
+
84
101
{ #category : #' opening/closing' }
85
102
SoilObjectRepository >> close [
86
103
metaSegment close.
Original file line number Diff line number Diff line change @@ -119,3 +119,18 @@ SoilPersistentClusterVersion >> readFrom: stream [
119
119
SoilPersistentClusterVersion >> shouldBeCommitted [
120
120
^ changed and : [ committed not ]
121
121
]
122
+
123
+ { #category : #comparing }
124
+ SoilPersistentClusterVersion >> soilSizeInMemory [
125
+ ^ self sizeInMemory
126
+ + objectId soilSizeInMemory
127
+ + (references sum: #soilSizeInMemory )
128
+ + bytes sizeInMemory
129
+ + committed sizeInMemory
130
+ + previousVersionPosition sizeInMemory
131
+ + version sizeInMemory
132
+ + (behaviorDescriptions sum: #soilSizeInMemory )
133
+ + (indexIds sum: #sizeInMemory )
134
+ + position sizeInMemory
135
+ + changed sizeInMemory
136
+ ]
Original file line number Diff line number Diff line change @@ -19,6 +19,14 @@ SoilSetup >> cacheObjectRecords: anInteger [
19
19
soil objectRepository cacheSegmentAt: n upTo: anInteger ]
20
20
]
21
21
22
+ { #category : #caching }
23
+ SoilSetup >> cacheObjectRecordsUsing: aBlock [
24
+ 1 to: soil objectRepository segments size do: [:n |
25
+ soil objectRepository
26
+ cacheSegmentAt: n
27
+ using: aBlock ]
28
+ ]
29
+
22
30
{ #category : #caching }
23
31
SoilSetup >> cacheRecords [
24
32
self cacheRecords: self defaultCacheRecordsSize
@@ -31,6 +39,23 @@ SoilSetup >> cacheRecords: anInteger [
31
39
cacheObjectRecords: anInteger
32
40
]
33
41
42
+ { #category : #caching }
43
+ SoilSetup >> cacheSegmentAt: index maximumBytes: anInteger [
44
+ self
45
+ cacheSegmentAt: index
46
+ using: [ :cache |
47
+ cache
48
+ computeWeight: #soilSizeInMemory ;
49
+ maximumWeight: anInteger ]
50
+ ]
51
+
52
+ { #category : #caching }
53
+ SoilSetup >> cacheSegmentAt: index using: aBlock [
54
+ soil objectRepository
55
+ cacheSegmentAt: index
56
+ using: aBlock
57
+ ]
58
+
34
59
{ #category : #accessing }
35
60
SoilSetup >> defaultCacheRecordsSize [
36
61
^ 1000
You can’t perform that action at this time.
0 commit comments