| 1 | = Kyoto Cabinet based graph = |
| 2 | |
| 3 | Kyoto Cabinet is a fast, lightweight storage DBRM. This graph is created on top of this data storage engine. This kind of graph consists of a minimal implementation in C, while the rest of the graph remained in Erlang. |
| 4 | |
| 5 | == Using the Kyoto Cabinet based graph == |
| 6 | |
| 7 | Linux: |
| 8 | {{{ |
| 9 | $: bin/referl -db kcmini |
| 10 | }}} |
| 11 | |
| 12 | Windows: |
| 13 | {{{ |
| 14 | c:\> bin\referl -db kcmini |
| 15 | }}} |
| 16 | It is important to know that if the database is not closed properly, it will be corrupted. For this reason it is recommended to make backups of the database after loading the source code: |
| 17 | {{{ |
| 18 | erl> ri:backup("My first backup"). |
| 19 | {ok,"backup.1"} |
| 20 | }}} |
| 21 | Other backup related functions: |
| 22 | {{{ |
| 23 | erl> ri:ls_backups(). |
| 24 | ["backup.1"] |
| 25 | erl> ri:backup_info(1). |
| 26 | Informations about 'backup.1': |
| 27 | Commit-log: My first backup |
| 28 | Time of creation: 2012-10-01 11:02:37 |
| 29 | |
| 30 | ok |
| 31 | erl> ri:restore(1). |
| 32 | ok |
| 33 | }}} |
| 34 | Deleting all backups: |
| 35 | {{{ |
| 36 | erl> ri:clean(). |
| 37 | ok |
| 38 | erl> ri:ls_backups(). |
| 39 | [] |
| 40 | }}} |
| 41 | |
| 42 | == Default Parameters == |
| 43 | |
| 44 | With starting the database as written above, it will use some default parameters for setting up Kyoto Cabinet. |
| 45 | |
| 46 | == Tuning the database == |
| 47 | |
| 48 | It is also possible to customize the kyoto cabinet storage. For this, use the following command to start the tool: |
| 49 | {{{ |
| 50 | $: bin/referl -dbmod refdb_kyotomini -dbargs "[{dbtype, 'DbType'}, {param1, Val1}, ...]" |
| 51 | }}} |
| 52 | For the name and possible value of the parameters, please refer to the kyoto cabinet documentation at [http://fallabs.com/kyotocabinet/api/kclangc_8h.html#a464237fa818e4b70b15526a898b5c5f5 Kyoto Cabinet / kclangc.h / kcdbopen()]. |
| 53 | |
| 54 | == Good to know == |
| 55 | |
| 56 | It is possible to create multiple graphs within the same tool instance |
| 57 | {{{ |
| 58 | erl> ri:ls_graphs(). |
| 59 | [default] |
| 60 | erl> ri:create_graph(my_graph). |
| 61 | [default,my_graph] |
| 62 | erl> ri:actual_graph(). |
| 63 | default |
| 64 | erl> ri:load_graph(my_graph). |
| 65 | ok |
| 66 | erl> ri:ri:actual_graph(). |
| 67 | my_graph |
| 68 | erl> ri:load_graph(default). |
| 69 | ok |
| 70 | erl> ri:delete_graph(my_graph). |
| 71 | ok |
| 72 | erl> ri:ls_graphs(). |
| 73 | [default] |
| 74 | }}} |