Skip to content

Commit

Permalink
Updated to accept a write function for block implementations that don…
Browse files Browse the repository at this point in the history
…'t autowrite
  • Loading branch information
Paula Gearon committed Sep 24, 2020
1 parent 973784e commit 4912e83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/asami/durable/block/block_api.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"A mutating object for allocating blocks"
(allocate-block! [this] "Allocate a new block from the manager's resources.")
(copy-block! [this block] "Allocates a new block, initialized with a copy of another block.")
(write-block! [this block] "Writes a block into the managed resources. Flushing is not expected.")
(rewind! [this] "Revert to the last commit point. Any blocks allocated since the last commit will be invalid.")
(commit! [this] "Commits all blocks allocated since the last commit. These blocks are now read-only.")
(close [this] "Releases all resources currently in use by this manager."))
3 changes: 3 additions & 0 deletions src/asami/durable/block/file/block_file.clj
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@
(copy-block [this block]
(let [new-block (allocate-block this)]
(copy-over! new-block block 0)))

;; this operation is a no-op
(write-block! [this block] this)

(rewind! [this]
(vreset! next-id @commit-point)
Expand Down

0 comments on commit 4912e83

Please sign in to comment.