From ed6684b5369cb50137e7acc6d68ca0eba4e3ae0a Mon Sep 17 00:00:00 2001 From: Marcus Denker Date: Wed, 31 Jan 2024 19:34:39 +0100 Subject: [PATCH] Trivial cleanup - fix some subclass responsability and related cleanups --- src/Soil-Core/SoilBTree.class.st | 9 +++++++++ src/Soil-Core/SoilBasicBTree.class.st | 15 --------------- src/Soil-Core/SoilIndex.class.st | 13 ++++++++++++- src/Soil-Core/SoilNewBTreeListIndexEntry.class.st | 5 ----- src/Soil-Core/SoilNewIndexEntry.class.st | 5 +++++ src/Soil-Core/SoilNewSkipListIndexEntry.class.st | 5 ----- src/Soil-Core/SoilSkipList.class.st | 6 ------ 7 files changed, 26 insertions(+), 32 deletions(-) diff --git a/src/Soil-Core/SoilBTree.class.st b/src/Soil-Core/SoilBTree.class.st index 2c254bbc..07dbaf7d 100644 --- a/src/Soil-Core/SoilBTree.class.st +++ b/src/Soil-Core/SoilBTree.class.st @@ -37,6 +37,15 @@ SoilBTree >> keySize: anInteger [ keySize := anInteger ] +{ #category : #'instance creation' } +SoilBTree >> newPage [ + ^ self pageClass new + keySize: self keySize; + valueSize: self valueSize; + pageSize: self pageSize; + yourself +] + { #category : #reindexing } SoilBTree >> newReIndexer [ ^ SoilReindexer new diff --git a/src/Soil-Core/SoilBasicBTree.class.st b/src/Soil-Core/SoilBasicBTree.class.st index 58dd6529..75a6d009 100644 --- a/src/Soil-Core/SoilBasicBTree.class.st +++ b/src/Soil-Core/SoilBasicBTree.class.st @@ -44,12 +44,6 @@ SoilBasicBTree >> keySize: anInteger [ self rootPage keySize: anInteger ] -{ #category : #'instance creation' } -SoilBasicBTree >> newFileStore [ - ^ SoilPagedFileIndexStore new - index: self -] - { #category : #'instance creation' } SoilBasicBTree >> newHeaderPage [ ^ SoilBTreeHeaderPage new @@ -83,15 +77,6 @@ SoilBasicBTree >> newIterator [ ^ SoilBTreeIterator on: self ] -{ #category : #'instance creation' } -SoilBasicBTree >> newPage [ - ^ self pageClass new - keySize: self keySize; - valueSize: self valueSize; - pageSize: self pageSize; - yourself -] - { #category : #'instance creation' } SoilBasicBTree >> newRootPage [ ^ SoilBTreeRootPage new diff --git a/src/Soil-Core/SoilIndex.class.st b/src/Soil-Core/SoilIndex.class.st index 5f756101..6589ea4f 100644 --- a/src/Soil-Core/SoilIndex.class.st +++ b/src/Soil-Core/SoilIndex.class.st @@ -125,7 +125,8 @@ SoilIndex >> maxLevel: anIntegeer [ { #category : #'instance creation' } SoilIndex >> newFileStore [ - ^ self subclassResponsibility + ^ SoilPagedFileIndexStore new + index: self ] { #category : #'instance creation' } @@ -153,6 +154,16 @@ SoilIndex >> pages [ ^ self store pages ] +{ #category : #reindexing } +SoilIndex >> reIndex [ + ^ self subclassResponsibility +] + +{ #category : #reindexing } +SoilIndex >> reIndexUsing: itemBlock [ + ^ self subclassResponsibility +] + { #category : #removing } SoilIndex >> removeKey: key [ ^ self diff --git a/src/Soil-Core/SoilNewBTreeListIndexEntry.class.st b/src/Soil-Core/SoilNewBTreeListIndexEntry.class.st index cc618a5e..feda4c03 100644 --- a/src/Soil-Core/SoilNewBTreeListIndexEntry.class.st +++ b/src/Soil-Core/SoilNewBTreeListIndexEntry.class.st @@ -4,11 +4,6 @@ Class { #category : #'Soil-Core-Journal' } -{ #category : #accessing } -SoilNewBTreeListIndexEntry >> address [ - ^ 'index: ', id printString -] - { #category : #committing } SoilNewBTreeListIndexEntry >> commitIn: soil [ diff --git a/src/Soil-Core/SoilNewIndexEntry.class.st b/src/Soil-Core/SoilNewIndexEntry.class.st index 112f6f3d..0d3036e9 100644 --- a/src/Soil-Core/SoilNewIndexEntry.class.st +++ b/src/Soil-Core/SoilNewIndexEntry.class.st @@ -14,6 +14,11 @@ SoilNewIndexEntry class >> isAbstract [ ^ self == SoilNewIndexEntry ] +{ #category : #accessing } +SoilNewIndexEntry >> address [ + ^ 'index: ', id printString +] + { #category : #accessing } SoilNewIndexEntry >> keySize [ diff --git a/src/Soil-Core/SoilNewSkipListIndexEntry.class.st b/src/Soil-Core/SoilNewSkipListIndexEntry.class.st index 87c1348f..0266cbbe 100644 --- a/src/Soil-Core/SoilNewSkipListIndexEntry.class.st +++ b/src/Soil-Core/SoilNewSkipListIndexEntry.class.st @@ -12,11 +12,6 @@ SoilNewSkipListIndexEntry class >> journalTypeCode [ ^ 10 ] -{ #category : #accessing } -SoilNewSkipListIndexEntry >> address [ - ^ 'index: ', id printString -] - { #category : #committing } SoilNewSkipListIndexEntry >> commitIn: soil [ diff --git a/src/Soil-Core/SoilSkipList.class.st b/src/Soil-Core/SoilSkipList.class.st index 425da720..92f973a7 100644 --- a/src/Soil-Core/SoilSkipList.class.st +++ b/src/Soil-Core/SoilSkipList.class.st @@ -77,12 +77,6 @@ SoilSkipList >> keySize: anInteger [ keySize := anInteger ] -{ #category : #'instance creation' } -SoilSkipList >> newFileStore [ - ^ SoilPagedFileIndexStore new - index: self -] - { #category : #'instance creation' } SoilSkipList >> newHeaderPage [ ^ SoilSkipListHeaderPage new