-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from input-output-hk/wip-write-buffer
Write buffer
- Loading branch information
Showing
7 changed files
with
182 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Database.LSMTree.Internal.BlobRef ( | ||
BlobRef (..), | ||
) where | ||
|
||
-- | A reference to an on-disk blob. | ||
-- | ||
-- The blob can be retrieved based on the reference. | ||
-- | ||
-- Blob comes from the acronym __Binary Large OBject (BLOB)__ and in many | ||
-- database implementations refers to binary data that is larger than usual | ||
-- values and is handled specially. In our context we will allow optionally a | ||
-- blob associated with each value in the table. | ||
data BlobRef blob = BlobRef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module Database.LSMTree.Internal.Monoidal ( | ||
LookupResult (..), | ||
RangeLookupResult (..), | ||
Update (..), | ||
) where | ||
|
||
-- | Result of a single point lookup. | ||
data LookupResult k v = | ||
NotFound !k | ||
| Found !k !v | ||
deriving (Eq, Show) | ||
|
||
|
||
-- | A result for one point in a range lookup. | ||
data RangeLookupResult k v = | ||
FoundInRange !k !v | ||
deriving (Eq, Show) | ||
|
||
-- | Monoidal tables support insert, delete and monoidal upsert operations. | ||
-- | ||
-- An __update__ is a term that groups all types of table-manipulating | ||
-- operations, like inserts, deletes and mupserts. | ||
data Update v = | ||
Insert !v | ||
| Delete | ||
-- | TODO: should be given a more suitable name. | ||
| Mupsert !v | ||
deriving (Show, Eq) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{-# LANGUAGE DeriveTraversable #-} | ||
module Database.LSMTree.Internal.Normal ( | ||
LookupResult (..), | ||
RangeLookupResult (..), | ||
Update (..), | ||
) where | ||
|
||
-- | Result of a single point lookup. | ||
data LookupResult k v blobref = | ||
NotFound !k | ||
| Found !k !v | ||
| FoundWithBlob !k !v !blobref | ||
deriving (Eq, Show, Functor, Foldable, Traversable) | ||
|
||
-- | A result for one point in a range lookup. | ||
data RangeLookupResult k v blobref = | ||
FoundInRange !k !v | ||
| FoundInRangeWithBlob !k !v !blobref | ||
deriving (Eq, Show, Functor, Foldable, Traversable) | ||
|
||
-- | Normal tables support insert and delete operations. | ||
-- | ||
-- An __update__ is a term that groups all types of table-manipulating | ||
-- operations, like inserts and deletes. | ||
data Update v blob = | ||
Insert !v !(Maybe blob) | ||
| Delete | ||
deriving (Show, Eq) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters