Просмотр исходного кода

add scratchpad ns and transactor settings for experiments.

Lucas Stadler лет назад: 12
Родитель
Сommit
67277e8c1e
3 измененных файлов с 66 добавлено и 0 удалено
  1. 5 0
      clj/datomic/.gitignore
  2. 50 0
      clj/datomic/datomic-transactor.properties
  3. 11 0
      clj/datomic/src/scratchpad.clj

+ 5 - 0
clj/datomic/.gitignore

@ -0,0 +1,5 @@
1
/target
2
/data
3
4
.nrepl-port
5
.lein*

+ 50 - 0
clj/datomic/datomic-transactor.properties

@ -0,0 +1,50 @@
1
################################################################
2
3
protocol=free
4
host=localhost
5
port=4334
6
7
################################################################
8
# See http://docs.datomic.com/capacity.html
9
10
# Recommended settings for -Xmx4g, ongoing usage.
11
# memory-index-threshold=32m
12
# memory-index-max=128m
13
# object-cache-max=1g
14
15
# Recommended settings for -Xmx4g import jobs.
16
# memory-index-threshold=512m
17
# memory-index-max=1g
18
# object-cache-max=1g
19
20
# Recommended settings for -Xmx1g usage, e.g. dev laptops.
21
memory-index-threshold=32m
22
memory-index-max=128m
23
object-cache-max=128m
24
25
## OPTIONAL ####################################################
26
27
# Set to false to disable SSL between the peers and the transactor.
28
# Default: true
29
# encrypt-channel=true
30
31
# Data directory is used for dev: and free: storage, and
32
# as a temporary directory for all storages.
33
data-dir=/home/lu/k/lp/clj/datomic/data
34
35
# Transactor will log here, see bin/logback.xml to configure logging.
36
# log-dir=log
37
38
# Transactor will write process pid here on startup
39
# pid-file=transactor.pid
40
41
## OPTIONAL ####################################################
42
# See http://docs.datomic.com/capacity.html
43
44
# Soft limit on the number of concurrent writes to storage.
45
# Default: 4, Miniumum: 2
46
# write-concurrency=4
47
48
# Soft limit on the number of concurrent reads to storage.
49
# Default: 2 times write-concurrency, Miniumum: 2
50
# read-concurrency=8

+ 11 - 0
clj/datomic/src/scratchpad.clj

@ -0,0 +1,11 @@
1
(ns scratchpad
2
  "A place for experiments"
3
  (:require [datomic.api :as d]))
4
5
(defn connect-to [db-uri]
6
  (d/create-database db-uri)
7
  (d/connect db-uri))
8
9
(def conn (connect-to "datomic:free://localhost:4334/scratchpad"))
10
11
(defn db [] (d/db conn))