Strata 0.0.19
Delayed Write
You now have the option to delay the flush of entry writes. Previously, each insert or delete entry would open, write and close the log. The close of the log would ensure that the contents had been flushed. Now you can delay the close until either you move to the next page or you unlock lock the Cursor
your using to write.
This means that Cursor.unlock
now takes a callback. There is an assertion in Cursor.unlock
that will assert that a callback is provided help locate invocations of Cursor.unlock
that have not been updated.
You specify the write strategy at creation by specifying a writeStage
property of either "entry"
, "leaf"
or "tree"
. The "entry"
write stage will flush each entry that is inserted or deleted. The "leaf"
write stage will flush when a Cursor
moves to the next page or unlocks. The "tree"
write stage will flush when Strata.close
is called.
By flush I mean that there a final flush of all open files. If there is back-pressure on a file stream during writing, Strata will wait until the stream is drained.
Staccato and Journalist
Two new projects were created to support Strata.
Staccato is an adaptor for a Node.js stream that allows you to write to the stream using error-first callbacks instead of using the EventEmitter
interface.
Strata exposes an error-first callback interface for writing entries. Staccato encapsulates the translation from error-first callback to write
with drain
events. If the underlying stream advises the caller to drain
, the Staccato's error first write callback will wait for the drain event before invoking the callback.
Journalist is a least-recently used cache of open file streams. Journalist helps to encapsulate the three logging strategies. It is based on the new Magazine.
Magazine Eviction Iterator
Magazine is the least-recently used cacheMagazine now exposes an eviction iterator. We now use this to evict pages from our least-recently used cache instead of the naive purge
method.
Issue by Issue
- Use external Magazine iterator. #365.
- Implement per-entry flush of writes. #364.
- Upgrade Cadence to 0.0.37. #360.
- Use Staccato. #362. #363.
- Implement
gather
helper as a proper Cadence function. #361. - Upgrade Cadence to #360.
- Implement per-tree flush of writes. #359.
- Implement per-leaf flush of writes. #358.
- Split footer out of insert and delete. #356.
- Extract file I/O to a separate module. #355.
- Extract record formatting to own function. #354.
- Rename conversion to object function to
vivify
. #352. - Use
assert
in tests. #351. - Upgrade Proof to 0.0.45. #350.