From 6cf13ecf39d37893a1ce6ba2a9f7e7bb3707a621 Mon Sep 17 00:00:00 2001 From: Wolfgang Jeltsch Date: Thu, 16 Jan 2025 23:20:32 +0200 Subject: [PATCH] Fixed choice: Rework index-related imports --- src/Database/LSMTree/Internal/ChecksumHandle.hs | 6 ++---- src/Database/LSMTree/Internal/Config.hs | 8 +++----- src/Database/LSMTree/Internal/Lookup.hs | 4 ++-- src/Database/LSMTree/Internal/Merge.hs | 2 +- src/Database/LSMTree/Internal/MergeSchedule.hs | 2 +- src/Database/LSMTree/Internal/MergingRun.hs | 2 +- src/Database/LSMTree/Internal/Run.hs | 6 ++---- src/Database/LSMTree/Internal/RunAcc.hs | 5 ++--- src/Database/LSMTree/Internal/RunBuilder.hs | 4 +--- src/Database/LSMTree/Internal/RunReader.hs | 2 +- 10 files changed, 16 insertions(+), 25 deletions(-) diff --git a/src/Database/LSMTree/Internal/ChecksumHandle.hs b/src/Database/LSMTree/Internal/ChecksumHandle.hs index caeab29d7..c1b020101 100644 --- a/src/Database/LSMTree/Internal/ChecksumHandle.hs +++ b/src/Database/LSMTree/Internal/ChecksumHandle.hs @@ -34,10 +34,8 @@ import qualified Database.LSMTree.Internal.Chunk as Chunk (toByteString) import Database.LSMTree.Internal.CRC32C (CRC32C) import qualified Database.LSMTree.Internal.CRC32C as CRC import Database.LSMTree.Internal.Entry -import Database.LSMTree.Internal.Index (Index) -import qualified Database.LSMTree.Internal.Index as Index (headerLBS) -import Database.LSMTree.Internal.Index.Some (Index) -import qualified Database.LSMTree.Internal.Index.Some as Index (finalLBS) +import Database.LSMTree.Internal.Index (IndexType, Index) +import qualified Database.LSMTree.Internal.Index as Index (headerLBS, finalLBS) import Database.LSMTree.Internal.Paths (ForBlob (..), ForFilter (..), ForIndex (..), ForKOps (..)) import qualified Database.LSMTree.Internal.RawBytes as RB diff --git a/src/Database/LSMTree/Internal/Config.hs b/src/Database/LSMTree/Internal/Config.hs index bf8b08053..a3e78e6ff 100644 --- a/src/Database/LSMTree/Internal/Config.hs +++ b/src/Database/LSMTree/Internal/Config.hs @@ -37,11 +37,9 @@ import Data.Word (Word64) import Database.LSMTree.Internal.Assertions (assert, fromIntegralChecked) import Database.LSMTree.Internal.Entry (NumEntries (..)) -import Database.LSMTree.Internal.Index (Index, IndexAcc) -import Database.LSMTree.Internal.Index.Compact (IndexCompact) -import Database.LSMTree.Internal.Index.CompactAcc (IndexCompactAcc) -import Database.LSMTree.Internal.Index.Ordinary (IndexOrdinary) -import Database.LSMTree.Internal.Index.OrdinaryAcc (IndexOrdinaryAcc) +import Database.LSMTree.Internal.Index (IndexType) +import qualified Database.LSMTree.Internal.Index as Index + (IndexType (Compact, Ordinary)) import Database.LSMTree.Internal.Run (RunDataCaching (..)) import Database.LSMTree.Internal.RunAcc (RunBloomFilterAlloc (..)) import GHC.Exts (Proxy#, proxy#) diff --git a/src/Database/LSMTree/Internal/Lookup.hs b/src/Database/LSMTree/Internal/Lookup.hs index 643fd3e89..33ca70d84 100644 --- a/src/Database/LSMTree/Internal/Lookup.hs +++ b/src/Database/LSMTree/Internal/Lookup.hs @@ -41,8 +41,8 @@ import Control.RefCount import Database.LSMTree.Internal.BlobRef (WeakBlobRef (..)) import Database.LSMTree.Internal.Entry -import Database.LSMTree.Internal.Index.Some (Index) -import qualified Database.LSMTree.Internal.Index.Some as Index (search) +import Database.LSMTree.Internal.Index (Index) +import qualified Database.LSMTree.Internal.Index as Index (search) import Database.LSMTree.Internal.Page (PageSpan (..), getNumPages, pageSpanSize, unPageNo) import Database.LSMTree.Internal.RawBytes (RawBytes (..)) diff --git a/src/Database/LSMTree/Internal/Merge.hs b/src/Database/LSMTree/Internal/Merge.hs index 03a9ac999..1df33d093 100644 --- a/src/Database/LSMTree/Internal/Merge.hs +++ b/src/Database/LSMTree/Internal/Merge.hs @@ -28,7 +28,7 @@ import Data.Traversable (for) import qualified Data.Vector as V import Database.LSMTree.Internal.BlobRef (RawBlobRef) import Database.LSMTree.Internal.Entry -import Database.LSMTree.Internal.Index (IndexAcc) +import Database.LSMTree.Internal.Index (IndexType) import Database.LSMTree.Internal.Run (Run, RunDataCaching) import qualified Database.LSMTree.Internal.Run as Run import Database.LSMTree.Internal.RunAcc (RunBloomFilterAlloc (..)) diff --git a/src/Database/LSMTree/Internal/MergeSchedule.hs b/src/Database/LSMTree/Internal/MergeSchedule.hs index a9aba30a7..4a0515804 100644 --- a/src/Database/LSMTree/Internal/MergeSchedule.hs +++ b/src/Database/LSMTree/Internal/MergeSchedule.hs @@ -44,7 +44,7 @@ import Database.LSMTree.Internal.Assertions (assert) import Database.LSMTree.Internal.Config import Database.LSMTree.Internal.Entry (Entry, NumEntries (..), unNumEntries) -import Database.LSMTree.Internal.Index.Some (Index) +import Database.LSMTree.Internal.Index (Index) import Database.LSMTree.Internal.Lookup (ResolveSerialisedValue) import qualified Database.LSMTree.Internal.Merge as Merge import Database.LSMTree.Internal.MergingRun (MergePolicyForLevel (..), diff --git a/src/Database/LSMTree/Internal/MergingRun.hs b/src/Database/LSMTree/Internal/MergingRun.hs index e666507e3..a9495b330 100644 --- a/src/Database/LSMTree/Internal/MergingRun.hs +++ b/src/Database/LSMTree/Internal/MergingRun.hs @@ -37,7 +37,7 @@ import Data.Primitive.PrimVar import qualified Data.Vector as V import Database.LSMTree.Internal.Assertions (assert) import Database.LSMTree.Internal.Entry (NumEntries (..), unNumEntries) -import Database.LSMTree.Internal.Index (IndexAcc) +import Database.LSMTree.Internal.Index (IndexType) import Database.LSMTree.Internal.Lookup (ResolveSerialisedValue) import Database.LSMTree.Internal.Merge (Merge, StepResult (..)) import qualified Database.LSMTree.Internal.Merge as Merge diff --git a/src/Database/LSMTree/Internal/Run.hs b/src/Database/LSMTree/Internal/Run.hs index d4935ee09..793e7ecb4 100644 --- a/src/Database/LSMTree/Internal/Run.hs +++ b/src/Database/LSMTree/Internal/Run.hs @@ -43,10 +43,8 @@ import qualified Database.LSMTree.Internal.BlobRef as BlobRef import Database.LSMTree.Internal.BloomFilter (bloomFilterFromSBS) import qualified Database.LSMTree.Internal.CRC32C as CRC import Database.LSMTree.Internal.Entry (NumEntries (..)) -import Database.LSMTree.Internal.Index (Index, IndexAcc) -import Database.LSMTree.Internal.Index.Some (Index) -import qualified Database.LSMTree.Internal.Index.Some as Index (fromSBS, - sizeInPages) +import Database.LSMTree.Internal.Index (IndexType, Index) +import qualified Database.LSMTree.Internal.Index as Index (fromSBS, sizeInPages) import Database.LSMTree.Internal.Page (NumPages) import Database.LSMTree.Internal.Paths as Paths import Database.LSMTree.Internal.RunAcc (RunBloomFilterAlloc) diff --git a/src/Database/LSMTree/Internal/RunAcc.hs b/src/Database/LSMTree/Internal/RunAcc.hs index a217fbf8d..47a9170e6 100644 --- a/src/Database/LSMTree/Internal/RunAcc.hs +++ b/src/Database/LSMTree/Internal/RunAcc.hs @@ -44,9 +44,8 @@ import Database.LSMTree.Internal.Assertions (fromIntegralChecked) import Database.LSMTree.Internal.BlobRef (BlobSpan (..)) import Database.LSMTree.Internal.Chunk (Chunk) import Database.LSMTree.Internal.Entry (Entry (..), NumEntries (..)) -import Database.LSMTree.Internal.Index (IndexAcc) -import Database.LSMTree.Internal.Index.Some (Index, IndexAcc) -import qualified Database.LSMTree.Internal.Index.Some as Index (appendMulti, +import Database.LSMTree.Internal.Index (IndexType, Index, IndexAcc) +import qualified Database.LSMTree.Internal.Index as Index (appendMulti, appendSingle, newWithDefaults, unsafeEnd) import Database.LSMTree.Internal.PageAcc (PageAcc) import qualified Database.LSMTree.Internal.PageAcc as PageAcc diff --git a/src/Database/LSMTree/Internal/RunBuilder.hs b/src/Database/LSMTree/Internal/RunBuilder.hs index 2603571cd..dc44e4c57 100644 --- a/src/Database/LSMTree/Internal/RunBuilder.hs +++ b/src/Database/LSMTree/Internal/RunBuilder.hs @@ -23,9 +23,7 @@ import Database.LSMTree.Internal.BlobRef (RawBlobRef) import Database.LSMTree.Internal.ChecksumHandle import qualified Database.LSMTree.Internal.CRC32C as CRC import Database.LSMTree.Internal.Entry -import Database.LSMTree.Internal.Index (IndexAcc, - resultingIndexTypeProxy) -import Database.LSMTree.Internal.Index.Some (Index) +import Database.LSMTree.Internal.Index (IndexType, Index) import Database.LSMTree.Internal.Paths import Database.LSMTree.Internal.RawOverflowPage (RawOverflowPage) import Database.LSMTree.Internal.RawPage (RawPage) diff --git a/src/Database/LSMTree/Internal/RunReader.hs b/src/Database/LSMTree/Internal/RunReader.hs index 877bf3e78..396eee0f6 100644 --- a/src/Database/LSMTree/Internal/RunReader.hs +++ b/src/Database/LSMTree/Internal/RunReader.hs @@ -37,7 +37,7 @@ import Database.LSMTree.Internal.BitMath (ceilDivPageSize, import Database.LSMTree.Internal.BlobFile as BlobFile import Database.LSMTree.Internal.BlobRef as BlobRef import qualified Database.LSMTree.Internal.Entry as E -import qualified Database.LSMTree.Internal.Index.Some as Index (search) +import qualified Database.LSMTree.Internal.Index as Index (search) import Database.LSMTree.Internal.Page (PageNo (..), PageSpan (..), getNumPages, nextPageNo) import Database.LSMTree.Internal.Paths