diff --git a/src/Soil-Core/SoilBTree.class.st b/src/Soil-Core/SoilBTree.class.st index 790e8be0..699e7f29 100644 --- a/src/Soil-Core/SoilBTree.class.st +++ b/src/Soil-Core/SoilBTree.class.st @@ -37,12 +37,6 @@ SoilBTree >> keySize: anInteger [ keySize := anInteger ] -{ #category : #reindexing } -SoilBTree >> newPluggableRewriter [ - ^ SoilPluggableIndexRewriter new - index: self -] - { #category : #accessing } SoilBTree >> path [ diff --git a/src/Soil-Core/SoilIndex.class.st b/src/Soil-Core/SoilIndex.class.st index 1599404c..334816dd 100644 --- a/src/Soil-Core/SoilIndex.class.st +++ b/src/Soil-Core/SoilIndex.class.st @@ -107,6 +107,12 @@ SoilIndex >> close [ store := nil ] +{ #category : #private } +SoilIndex >> compact [ + "Rewrite index file without removed items" + self rewriteUsing: [ :item | item ] +] + { #category : #utilities } SoilIndex >> decreaseSize [ self headerPage decreaseSize. @@ -263,6 +269,12 @@ SoilIndex >> newPage [ ^ self subclassResponsibility ] +{ #category : #reindexing } +SoilIndex >> newPluggableRewriter [ + ^ SoilPluggableIndexRewriter new + index: self +] + { #category : #accessing } SoilIndex >> pageAt: anInteger [ ^ self store pageAt: anInteger @@ -348,6 +360,17 @@ SoilIndex >> reverseDo: aBlock [ self newIterator reverseDo: aBlock ] +{ #category : #initialization } +SoilIndex >> rewriteUsing: aBlock [ + "write new index file and add all items. Use aBlock to + enable converting items" + self newPluggableRewriter + indexBlock: [ :idx | idx ]; + itemBlock: aBlock; + cleanRemoved; + run +] + { #category : #accessing } SoilIndex >> size [ "We iterate over all elements to get the size. Slow!" diff --git a/src/Soil-Core/SoilIndexedDictionary.class.st b/src/Soil-Core/SoilIndexedDictionary.class.st index 4c2c97a5..c6cc45af 100644 --- a/src/Soil-Core/SoilIndexedDictionary.class.st +++ b/src/Soil-Core/SoilIndexedDictionary.class.st @@ -72,6 +72,11 @@ SoilIndexedDictionary >> basicAt: aString ifAbsent: aBlock [ ^ self newIterator at: aString ifAbsent: aBlock ] +{ #category : #rewriting } +SoilIndexedDictionary >> compact [ + index wrapped compact +] + { #category : #initialization } SoilIndexedDictionary >> createIndex [ ^ self subclassResponsibility @@ -252,6 +257,11 @@ SoilIndexedDictionary >> reverseDo: aBlock [ aBlock value: objectId ] ] +{ #category : #rewriting } +SoilIndexedDictionary >> rewriteUsing: aBlock [ + index wrapped rewriteUsing: aBlock +] + { #category : #accessing } SoilIndexedDictionary >> second [ ^ self newIterator first; next diff --git a/src/Soil-Core/SoilSkipList.class.st b/src/Soil-Core/SoilSkipList.class.st index d5d3fcdf..d394f826 100644 --- a/src/Soil-Core/SoilSkipList.class.st +++ b/src/Soil-Core/SoilSkipList.class.st @@ -27,12 +27,6 @@ SoilSkipList >> close [ keySize := nil ] -{ #category : #private } -SoilSkipList >> compact [ - "Rewrite index file without removed items" - self rewriteUsing: [ :item | item ] -] - { #category : #deleting } SoilSkipList >> destroy [ path ensureDelete @@ -92,12 +86,6 @@ SoilSkipList >> newHeaderPage [ pageSize: self pageSize ] -{ #category : #reindexing } -SoilSkipList >> newPluggableRewriter [ - ^ SoilPluggableIndexRewriter new - index: self -] - { #category : #'opening/closing' } SoilSkipList >> open [ self isOpen ifTrue: [ self error: 'Index already open' ]. @@ -116,18 +104,6 @@ SoilSkipList >> path: aStringOrFileReference [ path := aStringOrFileReference asFileReference ] -{ #category : #initialization } -SoilSkipList >> rewriteUsing: aBlock [ - "write new index file and add all items. Use aBlock to - enable converting items" - SoilPluggableIndexRewriter new - index: self; - indexBlock: [ :idx | idx ]; - itemBlock: aBlock; - cleanRemoved; - run -] - { #category : #converting } SoilSkipList >> thePersistentInstance [ ^ self diff --git a/src/Soil-Core/SoilSkipListDictionary.class.st b/src/Soil-Core/SoilSkipListDictionary.class.st index f63a08cf..3286486d 100644 --- a/src/Soil-Core/SoilSkipListDictionary.class.st +++ b/src/Soil-Core/SoilSkipListDictionary.class.st @@ -10,11 +10,6 @@ Class { #category : #'Soil-Core-Index-SkipList' } -{ #category : #rewriting } -SoilSkipListDictionary >> compact [ - index wrapped compact -] - { #category : #initialization } SoilSkipListDictionary >> createIndex [ ^ SoilSkipList new @@ -22,8 +17,3 @@ SoilSkipListDictionary >> createIndex [ valueSize: 8; yourself ] - -{ #category : #rewriting } -SoilSkipListDictionary >> rewriteUsing: aBlock [ - index wrapped rewriteUsing: aBlock -]