Skip to content

Commit 9644bdf

Browse files
committed
Merge branch 'master' of github.com:dgrnbrg/hitchhiker-tree
2 parents 5ad08fc + 42c6f94 commit 9644bdf

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Hitchhiker trees are a newly invented (by @dgrnbrg) datastructure, synthesizing
66

77
The hitchhiker namespaces contain a complete implementation of a persistent, serializable, lazily-loaded hitchhiker tree.
88
This is a sorted key-value datastructure, like a scalable `sorted-map`.
9-
It can incrementally persist and automatically lazily load itself from any backing storewhich implements a simple protocol.
9+
It can incrementally persist and automatically lazily load itself from any backing store which implements a simple protocol.
1010

1111
Outboard is a sample application for the hitchhiker tree.
1212
It includes an implementation of the IO subsystem backed by Redis, and it manages all of the incremental serialization and flushing.

doc/hitchhiker.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ In `hitchhiker.tree.core`, we have several important protocols:
138138

139139
=== Related Work
140140

141-
Hitchhiker trees are made persistent with the same method, path copying, [as used by Okasaki](https://www.cs.cmu.edu/~rwh/theses/okasaki.pdf)
142-
The improved write performance is made possible thanks to the same buffering technique as a [fractal tree index](https://en.wikipedia.org/wiki/Fractal_tree_index).
141+
Hitchhiker trees are made persistent with the same method, path copying, https://www.cs.cmu.edu/~rwh/theses/okasaki.pdf[as used by Okasaki]
142+
The improved write performance is made possible thanks to the same buffering technique as a https://en.wikipedia.org/wiki/Fractal_tree_index[fractal tree index].
143143
As it turns out, after I implemented the fractal tree, I spoke with a former employee of Tokutek, a company that commercialized fractal tree indices.
144144
That person told me that we'd actually implemented fractal reads identically!
145145
This is funny because there's no documentation anywhere about how exactly you should structure your code to compute the query.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
tree' (if inserting?
8080
(insert (or flushed-tree tree) x x)
8181
(delete (or flushed-tree tree) x))
82-
after (System/nanoTime)
82+
after (System/nanoTime)
8383
log-inserts (zero? (mod i' (quot n 100)))
8484
updated-outputs (atom outputs)]
8585
(when log-inserts ;; 1000 pieces
@@ -129,7 +129,7 @@
129129
:validate [#(#{"fractal" "b-tree" "sorted-set"} %) "Data structure must be fractal, b-tree, or sorted set"]]
130130
[nil "--backend testing" "Runs the benchmark with the specified backend"
131131
:default "testing"
132-
:validate [#(#{"redis" "testing"} %) "Backend must be redis or testing"]]
132+
:validate [#(#{"redis" "testing"} %) "Backend must be redis or testing"]]
133133
["-d" "--delete-pattern PATTERN" "Specifies how the operations will be reordered on delete"
134134
:default "forward"
135135
:validate [#(#{"forward" "reverse" "shuffle" "zero"} %) "Incorrect delete pattern"]

project.clj

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
(defproject tree "0.1.0-SNAPSHOT"
1+
(defproject hitchhiker-tree "0.1.0-SNAPSHOT"
22
:description "A Hitchhiker Tree Library"
33
:url "https://github.com/dgrnbrg/hitchhiker-tree"
44
:license {:name "Eclipse Public License"
55
:url "http://www.eclipse.org/legal/epl-v10.html"}
6-
:aliases {"bench" ["run" "-m" "hitchhiker.bench"]}
76
:dependencies [[org.clojure/clojure "1.7.0"]
87
[org.clojure/core.memoize "0.5.8"]
9-
[org.clojure/test.check "0.9.0"]
10-
[org.clojure/tools.cli "0.3.3"]
11-
[com.infolace/excel-templates "0.3.3"]
12-
[criterium "0.4.4"]
138
[com.taoensso/carmine "2.12.2"]
14-
[org.clojure/core.rrb-vector "0.0.11"]])
9+
[org.clojure/core.rrb-vector "0.0.11"]]
10+
:aliases {"bench" ["with-profile" "profiling" "run" "-m" "hitchhiker.bench"]}
11+
:profiles {:test
12+
{:dependencies [[org.clojure/test.check "0.9.0"]]}
13+
:profiling
14+
{:main hitchhiker.bench
15+
:source-paths ["env/profiling"]
16+
:dependencies [[criterium "0.4.4"]
17+
[org.clojure/tools.cli "0.3.3"]
18+
[org.clojure/test.check "0.9.0"]
19+
[com.infolace/excel-templates "0.3.3"]]}})

src/hitchhiker/outboard.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
(loop [tree (msg/insert tree k v)
141141
[k v & kvs] kvs]
142142
(if (and k v)
143-
(msg/insert tree k v)
143+
(recur (msg/insert tree k v) kvs)
144144
tree))
145145
(msg/insert tree k v))))
146146

0 commit comments

Comments
 (0)