Skip to content

Commit

Permalink
Merge branch 'dev' into master
Browse files Browse the repository at this point in the history
* dev:
  Prepare for 0.1.0 release.
  Add a clean target to the Makefile
  Add group-id to the project.
  Update fdb and clojure dep versions
  Update dep versions
  • Loading branch information
vedang committed Aug 7, 2019
2 parents 418d2d7 + f6d4493 commit 50f6d6a
Show file tree
Hide file tree
Showing 19 changed files with 122 additions and 74 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: clojure

install:
- wget https://www.foundationdb.org/downloads/6.0.15/ubuntu/installers/foundationdb-clients_6.0.15-1_amd64.deb
- wget https://www.foundationdb.org/downloads/6.0.15/ubuntu/installers/foundationdb-server_6.0.15-1_amd64.deb
- sudo dpkg -i foundationdb-clients_6.0.15-1_amd64.deb foundationdb-server_6.0.15-1_amd64.deb
- wget https://www.foundationdb.org/downloads/6.1.8/ubuntu/installers/foundationdb-clients_6.1.8-1_amd64.deb
- wget https://www.foundationdb.org/downloads/6.1.8/ubuntu/installers/foundationdb-server_6.1.8-1_amd64.deb
- sudo dpkg -i foundationdb-clients_6.1.8-1_amd64.deb foundationdb-server_6.1.8-1_amd64.deb

script:
- make test
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ clj: compileclj startclj
test: compileclj
@echo "\nRunning all tests"
lein test

clean:
lein clean
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A thin wrapper for the Java API for FoundationDB.
## Layout

To get started, you need to read/use the functions defined in
[src/clj_fdb/core.clj](https://github.com/vedang/clj_fdb/blob/master/src/clj_fdb/core.clj).
[src/me/vedang/clj_fdb/core.clj](https://github.com/vedang/clj_fdb/blob/master/src/me/vedang/clj_fdb/core.clj).
The impatient reader can jump to the [Examples section](#examples) to
see the functions in action.

Expand Down Expand Up @@ -33,9 +33,9 @@ using the API simpler, but you should be able to drop down when you
need to. I've chosen to mimic the directory structure of the
underlying Java driver. So the style is as follows:

- `src/clj_fdb/` mimics `com.apple.foundationdb` (with
- `src/me/vedang/clj_fdb/` mimics `com.apple.foundationdb` (with
`transaction.clj` and `FDB.clj`)
- `src/clj_fdb/tuple/` mimics `com.apple.foundationdb.tuple` (with
- `src/me/vedang/clj_fdb/tuple/` mimics `com.apple.foundationdb.tuple` (with
`tuple.clj`)

... and so on. I haven't gotten around to actually writing the other
Expand All @@ -48,15 +48,10 @@ https://vedang.github.io/clj_fdb/

## Installation

* Download this library from Github by cloning this project.
* Run the following command in the top level of the library
```
$ lein do clean, compile, install
```
* Use the library in your Clojure projects by adding the dep in
`project.clj`
```
[clj-fdb "0.1.0"]
[me.vedang/clj-fdb "0.1.0"]
```

## Examples
Expand All @@ -66,11 +61,11 @@ in the core ns:
```clojure
(comment
(require '[byte-streams :as bs]
'[clj-fdb.FDB :as cfdb]
'[clj-fdb.core :as fc]
'[clj-fdb.transaction :as ftr]
'[clj-fdb.tuple.tuple :as ftup]
'[clj-fdb.subspace.subspace :as fsubspace])
'[me.vedang.clj-fdb.FDB :as cfdb]
'[me.vedang.clj-fdb.core :as fc]
'[me.vedang.clj-fdb.transaction :as ftr]
'[me.vedang.clj-fdb.tuple.tuple :as ftup]
'[me.vedang.clj-fdb.subspace.subspace :as fsubspace])

;; Set a value in the DB.
(let [fdb (cfdb/select-api-version cfdb/clj-fdb-api-version)]
Expand Down Expand Up @@ -168,8 +163,3 @@ folder
This gives the reader a good idea of how to use `clj-fdb`. Refer to
the comment block at the end of the example for how to run the
example.

## Other Notes

There are no tests at the moment. I do plan on writing them at some
point in time. Please contribute tests if you can!
54 changes: 54 additions & 0 deletions changelog/0.1.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
-*- mode: org; comment-column: 0; -*-

* Version
- 0.1.0

* Changes
- Initial cut of the library, refer to the README for details of what it provides and how to use it.

* Commit history
- (HEAD -> dev) Add a clean target to the Makefile (3 minutes ago) [Vedang Manerikar]
- Add group-id to the project. (5 minutes ago) [Vedang Manerikar]
- (origin/dev) Update fdb and clojure dep versions (85 minutes ago) [Vedang Manerikar]
- Update dep versions (7 months ago) [Vedang Manerikar]
- (origin/master, master) Define a variable for API version in FDB.clj (7 months ago) [Vedang Manerikar]
- Add a Makefile to run tests. (7 months ago) [Vedang Manerikar]
- Use latest deb files for Travis (7 months ago) [xtreak]
- Add Maven dependency to project.clj (7 months ago) [xtreak]
- Update README.md with Subspace example (1 year, 1 month ago) [Pardeep Singh]
- Add Subspace utility functions (1 year, 1 month ago) [Pardeep Singh]
- Add key-selector namespace and tests (1 year, 2 months ago) [Suvrat Apte]
- Add tests for Subspace wrappers (1 year, 2 months ago) [Pardeep Singh]
- Add more subspace wrappers (1 year, 2 months ago) [Pardeep Singh]
- Add arity to pack function for subspaces (1 year, 2 months ago) [Mourjo Sen]
- Add basic subspace wrapper (1 year, 2 months ago) [Mourjo Sen]
- Add explicit dev dependency on ctl (1 year, 2 months ago) [Vedang Manerikar]
- Move appropriate libraries to dev profile (1 year, 2 months ago) [Vedang Manerikar]
- Remove uberjar option and instructions (1 year, 3 months ago) [Vedang Manerikar]
- Move test fixture into internal util (1 year, 3 months ago) [Vedang Manerikar]
- Make a useful issue creation template (1 year, 3 months ago) [Vedang Manerikar]
- Add test for get-range and clear-range (1 year, 3 months ago) [xtreak]
- Add wrapper fns for com.apple.foundationdb.Range (1 year, 3 months ago) [Vedang Manerikar]
- Change fixture to remove indiscriminate deletion (1 year, 3 months ago) [Vedang Manerikar]
- Create a folder for internal files (1 year, 3 months ago) [Vedang Manerikar]
- Add wrapper fns for com.apple.foundationdb.FDB (1 year, 3 months ago) [Vedang Manerikar]
- Cache dependencies in Travis (1 year, 3 months ago) [xtreak]
- (tirkarthi/master) Add fns to the class_scheduling example (1 year, 3 months ago) [Vedang Manerikar]
- Add more Codox configuration options (1 year, 3 months ago) [Vedang Manerikar]
- Add examples of library usage in the README. (1 year, 3 months ago) [Vedang Manerikar]
- Add configuration options for codox. (1 year, 3 months ago) [Vedang Manerikar]
- Update issue templates (#5) (1 year, 3 months ago) [Vedang Manerikar]
- Create a Code of Conduct file (1 year, 3 months ago) [Vedang Manerikar]
- Add Travis CI config and badge. Fixes #2 (1 year, 3 months ago) [xtreak]
- Add basic tests for set, get and clear (1 year, 3 months ago) [xtreak]
- Update README with how to read and use this library (1 year, 3 months ago) [Vedang Manerikar]
- Wrap com.apple.foundationdb.FDB in an ns (1 year, 3 months ago) [Vedang Manerikar]
- Move tuple.clj inside a folder. (1 year, 3 months ago) [Vedang Manerikar]
- Add the final constraints to the class_scheduling example. (1 year, 3 months ago) [Vedang Manerikar]
- Add appropriate excludes to stop refers warnings (1 year, 3 months ago) [Vedang Manerikar]
- Add core fn to clear a range of keys (1 year, 3 months ago) [Vedang Manerikar]
- Fill out the rest of the class_scheduling example (1 year, 3 months ago) [Vedang Manerikar]
- Core fns take arguments to un/marshall k/v (1 year, 3 months ago) [Vedang Manerikar]
- Add fns to get a range of key-values. (1 year, 3 months ago) [Vedang Manerikar]
- Lay out initial code and conventions. (1 year, 3 months ago) [Vedang Manerikar]
- Initial Commit (1 year, 3 months ago) [Vedang Manerikar]
11 changes: 6 additions & 5 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
(defproject clj-fdb "0.1.0"
(defproject me.vedang/clj-fdb "0.1.0"
:description "A thin Clojure wrapper for the Java API for FoundationDB."
:url "https://vedang.github.io/clj_fdb/"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.foundationdb/fdb-java "6.0.15"]
[byte-streams "0.2.3"]]
:profiles {:dev {:dependencies [[org.clojure/clojure "1.9.0"]
:dependencies [[org.foundationdb/fdb-java "6.1.8"]
[byte-streams "0.2.4"]]
:profiles {:dev {:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/tools.logging "0.4.1"]]
:plugins [[lein-codox "0.10.4"]]}}
:plugins [[lein-codox "0.10.5"]]}}
:target-path "target/%s"
:global-vars {*warn-on-reflection* true}
:codox {:source-uri "https://github.com/vedang/clj_fdb/blob/master/{filepath}#L{line}"
:namespaces [#"^examples" #"^clj-fdb\.(?!internal)"]
:doc-files ["README.md"]
Expand Down
8 changes: 4 additions & 4 deletions src/examples/class_scheduling.clj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(ns examples.class-scheduling
(:require [byte-streams :as bs]
[clj-fdb.core :as fc]
[clj-fdb.FDB :as cfdb]
[clj-fdb.transaction :as ftr]
[clj-fdb.tuple.tuple :as ftup]
[me.vedang.clj-fdb.core :as fc]
[me.vedang.clj-fdb.FDB :as cfdb]
[me.vedang.clj-fdb.transaction :as ftr]
[me.vedang.clj-fdb.tuple.tuple :as ftup]
[clojure.string :as cs]
[clojure.tools.logging :as ctl])
(:import [com.apple.foundationdb Database FDB Transaction TransactionContext]
Expand Down
4 changes: 2 additions & 2 deletions src/clj_fdb/FDB.clj → src/me/vedang/clj_fdb/FDB.clj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(ns clj-fdb.FDB
(ns me.vedang.clj-fdb.FDB
(:import [com.apple.foundationdb FDB FDBDatabase NetworkOptions]
java.util.concurrent.Executor))

(def clj-fdb-api-version
"The API version used by this library in all tests and documentation"
600)
610)

(defn ^NetworkOptions options
"Returns a set of options that can be set on a the FoundationDB API.
Expand Down
8 changes: 4 additions & 4 deletions src/clj_fdb/core.clj → src/me/vedang/clj_fdb/core.clj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(ns clj-fdb.core
(ns me.vedang.clj-fdb.core
(:refer-clojure :exclude [get set])
(:require [byte-streams :as bs]
[clj-fdb.internal.byte-conversions :refer [byte-array-class]]
[clj-fdb.transaction :as ftr]
[clj-fdb.subspace.subspace :as fsubspace])
[me.vedang.clj-fdb.internal.byte-conversions :refer [byte-array-class]]
[me.vedang.clj-fdb.transaction :as ftr]
[me.vedang.clj-fdb.subspace.subspace :as fsubspace])
(:import [com.apple.foundationdb KeyValue Range Transaction TransactionContext]
[com.apple.foundationdb.subspace Subspace]
[com.apple.foundationdb.tuple Tuple]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns clj-fdb.internal.byte-conversions
(ns me.vedang.clj-fdb.internal.byte-conversions
(:require [byte-streams :as bs]
[clj-fdb.tuple.tuple :as ftup])
[me.vedang.clj-fdb.tuple.tuple :as ftup])
(:import byte_streams.Utils
com.apple.foundationdb.tuple.Tuple
java.nio.ByteBuffer))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns clj-fdb.internal.util
(:require [clj-fdb.core :as fc]
[clj-fdb.FDB :as cfdb]
[clj-fdb.tuple.tuple :as ftup]))
(ns me.vedang.clj-fdb.internal.util
(:require [me.vedang.clj-fdb.core :as fc]
[me.vedang.clj-fdb.FDB :as cfdb]
[me.vedang.clj-fdb.tuple.tuple :as ftup]))

(let [alphabet (vec "abcdefghijklmnopqrstuvwxyz0123456789")]
(defn rand-str
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns clj-fdb.key-selector
(ns me.vedang.clj-fdb.key-selector
(:refer-clojure :exclude [key])
(:import com.apple.foundationdb.KeySelector))

Expand Down
2 changes: 1 addition & 1 deletion src/clj_fdb/range.clj → src/me/vedang/clj_fdb/range.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns clj-fdb.range
(ns me.vedang.clj-fdb.range
"A simple description of an exact range of keyspace, specified by a
begin and end key. As with all FoundationDB APIs, begin is
inclusive, end exclusive."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns clj-fdb.subspace.subspace
(ns me.vedang.clj-fdb.subspace.subspace
(:refer-clojure :exclude [contains? range get])
(:import com.apple.foundationdb.subspace.Subspace
com.apple.foundationdb.Range
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns clj-fdb.transaction
(ns me.vedang.clj-fdb.transaction
(:refer-clojure :exclude [get set])
(:import clojure.lang.IFn
[com.apple.foundationdb Range Transaction TransactionContext]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns clj-fdb.tuple.tuple
(ns me.vedang.clj-fdb.tuple.tuple
(:refer-clojure :exclude [range])
(:import com.apple.foundationdb.Range
com.apple.foundationdb.tuple.Tuple))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
(ns clj-fdb.core-test
(ns me.vedang.clj-fdb.core-test
(:require [byte-streams :as bs]
[clj-fdb.core :as fc]
[clj-fdb.FDB :as cfdb]
[clj-fdb.internal.util :as u]
[clj-fdb.range :as frange]
[clj-fdb.transaction :as ftr]
[clj-fdb.tuple.tuple :as ftup]
[me.vedang.clj-fdb.core :as fc]
[me.vedang.clj-fdb.FDB :as cfdb]
[me.vedang.clj-fdb.internal.util :as u]
[me.vedang.clj-fdb.range :as frange]
[me.vedang.clj-fdb.transaction :as ftr]
[me.vedang.clj-fdb.tuple.tuple :as ftup]
[clojure.test :refer :all]
[clj-fdb.subspace.subspace :as fsubspace])
[me.vedang.clj-fdb.subspace.subspace :as fsubspace])
(:import com.apple.foundationdb.Transaction))

(use-fixtures :each u/test-fixture)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(ns clj-fdb.key-selector-test
(ns me.vedang.clj-fdb.key-selector-test
(:require
[clj-fdb.core :as fc]
[clj-fdb.transaction :as ftr]
[clj-fdb.FDB :as cfdb]
[me.vedang.clj-fdb.core :as fc]
[me.vedang.clj-fdb.transaction :as ftr]
[me.vedang.clj-fdb.FDB :as cfdb]
[byte-streams :as bs]
[clj-fdb.key-selector :refer :all]
[me.vedang.clj-fdb.key-selector :refer :all]
[clojure.test :refer :all]))


Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
(ns clj-fdb.range-test
(ns me.vedang.clj-fdb.range-test
(:require [byte-streams :as bs]
[clj-fdb.core :as fc]
[clj-fdb.FDB :as cfdb]
[clj-fdb.internal.util :as u]
[clj-fdb.range :as frange]
[clj-fdb.transaction :as ftr]
[clj-fdb.tuple.tuple :as ftup]
[me.vedang.clj-fdb.core :as fc]
[me.vedang.clj-fdb.FDB :as cfdb]
[me.vedang.clj-fdb.internal.util :as u]
[me.vedang.clj-fdb.range :as frange]
[me.vedang.clj-fdb.transaction :as ftr]
[me.vedang.clj-fdb.tuple.tuple :as ftup]
[clojure.test :refer :all])
(:import com.apple.foundationdb.Transaction))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
(ns clj-fdb.subspace-test
(ns me.vedang.clj-fdb.subspace-test
(:require [clojure.test :refer :all]
[byte-streams :as bs]
[clj-fdb.FDB :as cfdb]
[clj-fdb.core :as fc]
[clj-fdb.subspace.subspace :as fss]
[clj-fdb.tuple.tuple :as ftup]
[clj-fdb.internal.util :as u]))
[me.vedang.clj-fdb.FDB :as cfdb]
[me.vedang.clj-fdb.core :as fc]
[me.vedang.clj-fdb.subspace.subspace :as fss]
[me.vedang.clj-fdb.tuple.tuple :as ftup]
[me.vedang.clj-fdb.internal.util :as u]))


(deftest test-prefixed-subspace
Expand Down

0 comments on commit 50f6d6a

Please sign in to comment.