Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

import

  • Loading branch information...
commit db66c33b42aa2c963009f5b2b32f8d16c8467ddd 0 parents
justin authored

Showing 315 changed files with 26,974 additions and 0 deletions. Show diff stats Hide diff stats

  1. +6 0 Emakefile
  2. +178 0 LICENSE
  3. +31 0 Makefile
  4. +10 0 NOTICE
  5. +158 0 README
  6. +25 0 TODO
  7. +105 0 client_lib/jiak.js
  8. +132 0 client_lib/jiak.py
  9. +11 0 config/riak-demo.erlenv
  10. +12 0 config/riak-dets.erlenv
  11. +16 0 config/riak-ets-jiak.erlenv
  12. +12 0 config/riak-osmos.erlenv
  13. +11 0 config/riak.erlenv
  14. +6 0 demo/stickynotes/Emakefile
  15. +19 0 demo/stickynotes/Makefile
  16. +53 0 demo/stickynotes/README
  17. +1 0  demo/stickynotes/deps/riak
  18. 0  demo/stickynotes/ebin/.hg_dummy
  19. +182 0 demo/stickynotes/priv/www/css/application.css
  20. BIN  demo/stickynotes/priv/www/images/add.png
  21. BIN  demo/stickynotes/priv/www/images/add_hover.png
  22. BIN  demo/stickynotes/priv/www/images/color_picker.png
  23. BIN  demo/stickynotes/priv/www/images/color_picker_hover.png
  24. BIN  demo/stickynotes/priv/www/images/postit_blue.png
  25. BIN  demo/stickynotes/priv/www/images/postit_green.png
  26. BIN  demo/stickynotes/priv/www/images/postit_pink.png
  27. BIN  demo/stickynotes/priv/www/images/postit_yellow.png
  28. BIN  demo/stickynotes/priv/www/images/trash.png
  29. BIN  demo/stickynotes/priv/www/images/trash_active.png
  30. BIN  demo/stickynotes/priv/www/images/trash_hover.png
  31. +61 0 demo/stickynotes/priv/www/index.html
  32. BIN  demo/stickynotes/priv/www/js/.application.js.swp
  33. +183 0 demo/stickynotes/priv/www/js/application.js
  34. +105 0 demo/stickynotes/priv/www/js/jiak.js
  35. +32 0 demo/stickynotes/priv/www/js/jquery-1.2.6.min.js
  36. +79 0 demo/stickynotes/priv/www/js/jquery-ui-personalized-1.6rc2.min.js
  37. +475 0 demo/stickynotes/priv/www/js/json2.js
  38. +12 0 demo/stickynotes/riak-config.erlenv
  39. +124 0 demo/stickynotes/src/groups.erl
  40. +152 0 demo/stickynotes/src/notes.erl
  41. +16 0 demo/stickynotes/src/stickynotes.app
  42. +39 0 demo/stickynotes/src/stickynotes.erl
  43. +22 0 demo/stickynotes/src/stickynotes_app.erl
  44. +84 0 demo/stickynotes/src/stickynotes_deps.erl
  45. +39 0 demo/stickynotes/src/stickynotes_resource.erl
  46. +83 0 demo/stickynotes/src/stickynotes_sup.erl
  47. +3 0  demo/stickynotes/start-dev.sh
  48. +3 0  demo/stickynotes/start.sh
  49. +7 0 deps/webmachine/.hgignore
  50. +6 0 deps/webmachine/Emakefile
  51. +178 0 deps/webmachine/LICENSE
  52. +22 0 deps/webmachine/Makefile
  53. +14 0 deps/webmachine/THANKS
  54. +6 0 deps/webmachine/demo/Emakefile
  55. +19 0 deps/webmachine/demo/Makefile
  56. 0  deps/webmachine/demo/ebin/.hg_empty_dir
  57. +9 0 deps/webmachine/demo/mochiweb/LICENSE
  58. +11 0 deps/webmachine/demo/mochiweb/Makefile
  59. +1 0  deps/webmachine/demo/mochiweb/README
  60. 0  deps/webmachine/demo/mochiweb/ebin/.hg_empty_dir
  61. +5 0 deps/webmachine/demo/mochiweb/priv/skel/Makefile
  62. +8 0 deps/webmachine/demo/mochiweb/priv/skel/priv/www/index.html
  63. +9 0 deps/webmachine/demo/mochiweb/priv/skel/src/Makefile
  64. +14 0 deps/webmachine/demo/mochiweb/priv/skel/src/skel.app
  65. +30 0 deps/webmachine/demo/mochiweb/priv/skel/src/skel.erl
  66. +1 0  deps/webmachine/demo/mochiweb/priv/skel/src/skel.hrl
  67. +22 0 deps/webmachine/demo/mochiweb/priv/skel/src/skel_app.erl
  68. +84 0 deps/webmachine/demo/mochiweb/priv/skel/src/skel_deps.erl
  69. +54 0 deps/webmachine/demo/mochiweb/priv/skel/src/skel_sup.erl
  70. +43 0 deps/webmachine/demo/mochiweb/priv/skel/src/skel_web.erl
  71. +3 0  deps/webmachine/demo/mochiweb/priv/skel/start-dev.sh
  72. +3 0  deps/webmachine/demo/mochiweb/priv/skel/start.sh
  73. +46 0 deps/webmachine/demo/mochiweb/priv/skel/support/include.mk
  74. +27 0 deps/webmachine/demo/mochiweb/scripts/new_mochiweb.erl
  75. +20 0 deps/webmachine/demo/mochiweb/src/Makefile
  76. +426 0 deps/webmachine/demo/mochiweb/src/mochifmt.erl
  77. +30 0 deps/webmachine/demo/mochiweb/src/mochifmt_records.erl
  78. +23 0 deps/webmachine/demo/mochiweb/src/mochifmt_std.erl
  79. +75 0 deps/webmachine/demo/mochiweb/src/mochihex.erl
  80. +525 0 deps/webmachine/demo/mochiweb/src/mochijson.erl
  81. +597 0 deps/webmachine/demo/mochiweb/src/mochijson2.erl
  82. +289 0 deps/webmachine/demo/mochiweb/src/mochinum.erl
  83. +32 0 deps/webmachine/demo/mochiweb/src/mochiweb.app
  84. +110 0 deps/webmachine/demo/mochiweb/src/mochiweb.erl
  85. +20 0 deps/webmachine/demo/mochiweb/src/mochiweb_app.erl
  86. +295 0 deps/webmachine/demo/mochiweb/src/mochiweb_charref.erl
  87. +250 0 deps/webmachine/demo/mochiweb/src/mochiweb_cookies.erl
  88. +31 0 deps/webmachine/demo/mochiweb/src/mochiweb_echo.erl
  89. +186 0 deps/webmachine/demo/mochiweb/src/mochiweb_headers.erl
  90. +880 0 deps/webmachine/demo/mochiweb/src/mochiweb_html.erl
  91. +142 0 deps/webmachine/demo/mochiweb/src/mochiweb_http.erl
  92. +429 0 deps/webmachine/demo/mochiweb/src/mochiweb_multipart.erl
  93. +790 0 deps/webmachine/demo/mochiweb/src/mochiweb_request.erl
  94. +56 0 deps/webmachine/demo/mochiweb/src/mochiweb_response.erl
  95. +71 0 deps/webmachine/demo/mochiweb/src/mochiweb_skel.erl
  96. +248 0 deps/webmachine/demo/mochiweb/src/mochiweb_socket_server.erl
  97. +34 0 deps/webmachine/demo/mochiweb/src/mochiweb_sup.erl
  98. +579 0 deps/webmachine/demo/mochiweb/src/mochiweb_util.erl
  99. +124 0 deps/webmachine/demo/mochiweb/src/reloader.erl
  100. +39 0 deps/webmachine/demo/mochiweb/support/include.mk
  101. 0  deps/webmachine/demo/priv/.hg_empty_dir
  102. +157 0 deps/webmachine/demo/src/demo_fs_resource.erl
  103. +14 0 deps/webmachine/demo/src/webmachine_demo.app
  104. +27 0 deps/webmachine/demo/src/webmachine_demo.erl
  105. +1 0  deps/webmachine/demo/src/webmachine_demo.hrl
  106. +20 0 deps/webmachine/demo/src/webmachine_demo_app.erl
  107. +49 0 deps/webmachine/demo/src/webmachine_demo_resource.erl
  108. +42 0 deps/webmachine/demo/src/webmachine_demo_sup.erl
  109. +3 0  deps/webmachine/demo/start.sh
  110. +9 0 deps/webmachine/deps/mochiweb/LICENSE
  111. +11 0 deps/webmachine/deps/mochiweb/Makefile
  112. +1 0  deps/webmachine/deps/mochiweb/README
  113. 0  deps/webmachine/deps/mochiweb/ebin/.hg_empty_dir
  114. +5 0 deps/webmachine/deps/mochiweb/priv/skel/Makefile
  115. +8 0 deps/webmachine/deps/mochiweb/priv/skel/priv/www/index.html
  116. +9 0 deps/webmachine/deps/mochiweb/priv/skel/src/Makefile
  117. +14 0 deps/webmachine/deps/mochiweb/priv/skel/src/skel.app
  118. +30 0 deps/webmachine/deps/mochiweb/priv/skel/src/skel.erl
  119. +1 0  deps/webmachine/deps/mochiweb/priv/skel/src/skel.hrl
  120. +22 0 deps/webmachine/deps/mochiweb/priv/skel/src/skel_app.erl
  121. +84 0 deps/webmachine/deps/mochiweb/priv/skel/src/skel_deps.erl
  122. +54 0 deps/webmachine/deps/mochiweb/priv/skel/src/skel_sup.erl
  123. +43 0 deps/webmachine/deps/mochiweb/priv/skel/src/skel_web.erl
  124. +3 0  deps/webmachine/deps/mochiweb/priv/skel/start-dev.sh
  125. +3 0  deps/webmachine/deps/mochiweb/priv/skel/start.sh
  126. +46 0 deps/webmachine/deps/mochiweb/priv/skel/support/include.mk
  127. +27 0 deps/webmachine/deps/mochiweb/scripts/new_mochiweb.erl
  128. +20 0 deps/webmachine/deps/mochiweb/src/Makefile
  129. +426 0 deps/webmachine/deps/mochiweb/src/mochifmt.erl
  130. +30 0 deps/webmachine/deps/mochiweb/src/mochifmt_records.erl
  131. +23 0 deps/webmachine/deps/mochiweb/src/mochifmt_std.erl
  132. +75 0 deps/webmachine/deps/mochiweb/src/mochihex.erl
  133. +525 0 deps/webmachine/deps/mochiweb/src/mochijson.erl
  134. +597 0 deps/webmachine/deps/mochiweb/src/mochijson2.erl
  135. +289 0 deps/webmachine/deps/mochiweb/src/mochinum.erl
  136. +32 0 deps/webmachine/deps/mochiweb/src/mochiweb.app
  137. +110 0 deps/webmachine/deps/mochiweb/src/mochiweb.erl
  138. +20 0 deps/webmachine/deps/mochiweb/src/mochiweb_app.erl
  139. +295 0 deps/webmachine/deps/mochiweb/src/mochiweb_charref.erl
  140. +250 0 deps/webmachine/deps/mochiweb/src/mochiweb_cookies.erl
  141. +31 0 deps/webmachine/deps/mochiweb/src/mochiweb_echo.erl
  142. +186 0 deps/webmachine/deps/mochiweb/src/mochiweb_headers.erl
  143. +880 0 deps/webmachine/deps/mochiweb/src/mochiweb_html.erl
  144. +142 0 deps/webmachine/deps/mochiweb/src/mochiweb_http.erl
  145. +429 0 deps/webmachine/deps/mochiweb/src/mochiweb_multipart.erl
  146. +790 0 deps/webmachine/deps/mochiweb/src/mochiweb_request.erl
  147. +56 0 deps/webmachine/deps/mochiweb/src/mochiweb_response.erl
  148. +71 0 deps/webmachine/deps/mochiweb/src/mochiweb_skel.erl
  149. +248 0 deps/webmachine/deps/mochiweb/src/mochiweb_socket_server.erl
  150. +34 0 deps/webmachine/deps/mochiweb/src/mochiweb_sup.erl
  151. +579 0 deps/webmachine/deps/mochiweb/src/mochiweb_util.erl
  152. +124 0 deps/webmachine/deps/mochiweb/src/reloader.erl
  153. +39 0 deps/webmachine/deps/mochiweb/support/include.mk
  154. BIN  deps/webmachine/docs/http-headers-status-v3.png
  155. 0  deps/webmachine/ebin/.hg_empty_dir
  156. +8 0 deps/webmachine/include/webmachine.hrl
  157. +7 0 deps/webmachine/include/wm_reqdata.hrl
  158. +6 0 deps/webmachine/priv/skel/Emakefile
  159. +19 0 deps/webmachine/priv/skel/Makefile
  160. 0  deps/webmachine/priv/skel/deps/.empty
  161. 0  deps/webmachine/priv/skel/ebin/.empty
  162. +1 0  deps/webmachine/priv/skel/priv/dispatch.conf
  163. +8 0 deps/webmachine/priv/skel/priv/www/index.html
  164. +14 0 deps/webmachine/priv/skel/src/skel.app
  165. +32 0 deps/webmachine/priv/skel/src/skel.erl
  166. +1 0  deps/webmachine/priv/skel/src/skel.hrl
  167. +22 0 deps/webmachine/priv/skel/src/skel_app.erl
  168. +84 0 deps/webmachine/priv/skel/src/skel_deps.erl
  169. +13 0 deps/webmachine/priv/skel/src/skel_resource.erl
  170. +57 0 deps/webmachine/priv/skel/src/skel_sup.erl
  171. +3 0  deps/webmachine/priv/skel/start-dev.sh
  172. +3 0  deps/webmachine/priv/skel/start.sh
  173. +8 0 deps/webmachine/priv/www/index.html
  174. +32 0 deps/webmachine/scripts/new_webmachine.erl
  175. +25 0 deps/webmachine/src/webmachine.app
  176. +45 0 deps/webmachine/src/webmachine.erl
  177. +36 0 deps/webmachine/src/webmachine_app.erl
  178. +618 0 deps/webmachine/src/webmachine_decision_core.erl
  179. +92 0 deps/webmachine/src/webmachine_deps.erl
  180. +112 0 deps/webmachine/src/webmachine_dispatcher.erl
  181. +71 0 deps/webmachine/src/webmachine_error_handler.erl
  182. +221 0 deps/webmachine/src/webmachine_logger.erl
  183. +13 0 deps/webmachine/src/webmachine_logger.hrl
  184. +76 0 deps/webmachine/src/webmachine_mochiweb.erl
  185. +165 0 deps/webmachine/src/webmachine_multipart.erl
  186. +210 0 deps/webmachine/src/webmachine_perf_logger.erl
  187. +178 0 deps/webmachine/src/webmachine_request.erl
  188. +606 0 deps/webmachine/src/webmachine_request_srv.erl
  189. +209 0 deps/webmachine/src/webmachine_resource.erl
  190. +89 0 deps/webmachine/src/webmachine_skel.erl
  191. +77 0 deps/webmachine/src/webmachine_sup.erl
  192. +297 0 deps/webmachine/src/webmachine_util.erl
  193. +363 0 deps/webmachine/src/wmtrace_resource.erl
  194. +188 0 deps/webmachine/src/wrq.erl
  195. +3 0  deps/webmachine/start-dev.sh
  196. +3 0  deps/webmachine/start.sh
  197. +107 0 deps/webmachine/trace/wmtrace.css
  198. +713 0 deps/webmachine/trace/wmtrace.js
  199. +152 0 doc/architecture.txt
  200. +361 0 doc/basic-client.txt
  201. +171 0 doc/basic-mapreduce.txt
  202. +243 0 doc/basic-setup.txt
  203. +9 0 doc/overview.edoc
  204. 0  ebin/.hg_dummy_file
  205. 0  priv/.empty_for_hg
  206. +1 0  riak-env.sh
  207. +92 0 riak_demo.escript
  208. +8 0 scripts/make_appfile.sh
  209. +9 0 src/Makefile
  210. +188 0 src/chash.erl
  211. +1,026 0 src/gen_server2.erl
  212. +163 0 src/jaywalker_resource.erl
  213. +145 0 src/jiak.erl
  214. +157 0 src/jiak_client.erl
  215. +60 0 src/jiak_context.erl
  216. +147 0 src/jiak_example.erl
  217. +407 0 src/jiak_object.erl
  218. +725 0 src/jiak_resource.erl
  219. +47 0 src/json_pp.erl
  220. +355 0 src/merkerl.erl
  221. +221 0 src/priority_queue.erl
  222. +10 0 src/riak.app.src
  223. +106 0 src/riak.erl
  224. +92 0 src/riak_api.erl
  225. +206 0 src/riak_app.erl
  226. +157 0 src/riak_backup.erl
  227. +62 0 src/riak_bucket.erl
  228. +215 0 src/riak_bucketkeys.erl
  229. +46 0 src/riak_claim.erl
  230. +171 0 src/riak_client.erl
Sorry, we could not display the entire diff because it was too big.
6 Emakefile
... ... @@ -0,0 +1,6 @@
  1 +% -*- mode: erlang -*-
  2 +{["src/gen_server2.erl", "src/*"],
  3 + [{i, "include"},
  4 + {outdir, "ebin"},
  5 + debug_info]
  6 +}.
178 LICENSE
... ... @@ -0,0 +1,178 @@
  1 +
  2 + Apache License
  3 + Version 2.0, January 2004
  4 + http://www.apache.org/licenses/
  5 +
  6 + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
  7 +
  8 + 1. Definitions.
  9 +
  10 + "License" shall mean the terms and conditions for use, reproduction,
  11 + and distribution as defined by Sections 1 through 9 of this document.
  12 +
  13 + "Licensor" shall mean the copyright owner or entity authorized by
  14 + the copyright owner that is granting the License.
  15 +
  16 + "Legal Entity" shall mean the union of the acting entity and all
  17 + other entities that control, are controlled by, or are under common
  18 + control with that entity. For the purposes of this definition,
  19 + "control" means (i) the power, direct or indirect, to cause the
  20 + direction or management of such entity, whether by contract or
  21 + otherwise, or (ii) ownership of fifty percent (50%) or more of the
  22 + outstanding shares, or (iii) beneficial ownership of such entity.
  23 +
  24 + "You" (or "Your") shall mean an individual or Legal Entity
  25 + exercising permissions granted by this License.
  26 +
  27 + "Source" form shall mean the preferred form for making modifications,
  28 + including but not limited to software source code, documentation
  29 + source, and configuration files.
  30 +
  31 + "Object" form shall mean any form resulting from mechanical
  32 + transformation or translation of a Source form, including but
  33 + not limited to compiled object code, generated documentation,
  34 + and conversions to other media types.
  35 +
  36 + "Work" shall mean the work of authorship, whether in Source or
  37 + Object form, made available under the License, as indicated by a
  38 + copyright notice that is included in or attached to the work
  39 + (an example is provided in the Appendix below).
  40 +
  41 + "Derivative Works" shall mean any work, whether in Source or Object
  42 + form, that is based on (or derived from) the Work and for which the
  43 + editorial revisions, annotations, elaborations, or other modifications
  44 + represent, as a whole, an original work of authorship. For the purposes
  45 + of this License, Derivative Works shall not include works that remain
  46 + separable from, or merely link (or bind by name) to the interfaces of,
  47 + the Work and Derivative Works thereof.
  48 +
  49 + "Contribution" shall mean any work of authorship, including
  50 + the original version of the Work and any modifications or additions
  51 + to that Work or Derivative Works thereof, that is intentionally
  52 + submitted to Licensor for inclusion in the Work by the copyright owner
  53 + or by an individual or Legal Entity authorized to submit on behalf of
  54 + the copyright owner. For the purposes of this definition, "submitted"
  55 + means any form of electronic, verbal, or written communication sent
  56 + to the Licensor or its representatives, including but not limited to
  57 + communication on electronic mailing lists, source code control systems,
  58 + and issue tracking systems that are managed by, or on behalf of, the
  59 + Licensor for the purpose of discussing and improving the Work, but
  60 + excluding communication that is conspicuously marked or otherwise
  61 + designated in writing by the copyright owner as "Not a Contribution."
  62 +
  63 + "Contributor" shall mean Licensor and any individual or Legal Entity
  64 + on behalf of whom a Contribution has been received by Licensor and
  65 + subsequently incorporated within the Work.
  66 +
  67 + 2. Grant of Copyright License. Subject to the terms and conditions of
  68 + this License, each Contributor hereby grants to You a perpetual,
  69 + worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  70 + copyright license to reproduce, prepare Derivative Works of,
  71 + publicly display, publicly perform, sublicense, and distribute the
  72 + Work and such Derivative Works in Source or Object form.
  73 +
  74 + 3. Grant of Patent License. Subject to the terms and conditions of
  75 + this License, each Contributor hereby grants to You a perpetual,
  76 + worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  77 + (except as stated in this section) patent license to make, have made,
  78 + use, offer to sell, sell, import, and otherwise transfer the Work,
  79 + where such license applies only to those patent claims licensable
  80 + by such Contributor that are necessarily infringed by their
  81 + Contribution(s) alone or by combination of their Contribution(s)
  82 + with the Work to which such Contribution(s) was submitted. If You
  83 + institute patent litigation against any entity (including a
  84 + cross-claim or counterclaim in a lawsuit) alleging that the Work
  85 + or a Contribution incorporated within the Work constitutes direct
  86 + or contributory patent infringement, then any patent licenses
  87 + granted to You under this License for that Work shall terminate
  88 + as of the date such litigation is filed.
  89 +
  90 + 4. Redistribution. You may reproduce and distribute copies of the
  91 + Work or Derivative Works thereof in any medium, with or without
  92 + modifications, and in Source or Object form, provided that You
  93 + meet the following conditions:
  94 +
  95 + (a) You must give any other recipients of the Work or
  96 + Derivative Works a copy of this License; and
  97 +
  98 + (b) You must cause any modified files to carry prominent notices
  99 + stating that You changed the files; and
  100 +
  101 + (c) You must retain, in the Source form of any Derivative Works
  102 + that You distribute, all copyright, patent, trademark, and
  103 + attribution notices from the Source form of the Work,
  104 + excluding those notices that do not pertain to any part of
  105 + the Derivative Works; and
  106 +
  107 + (d) If the Work includes a "NOTICE" text file as part of its
  108 + distribution, then any Derivative Works that You distribute must
  109 + include a readable copy of the attribution notices contained
  110 + within such NOTICE file, excluding those notices that do not
  111 + pertain to any part of the Derivative Works, in at least one
  112 + of the following places: within a NOTICE text file distributed
  113 + as part of the Derivative Works; within the Source form or
  114 + documentation, if provided along with the Derivative Works; or,
  115 + within a display generated by the Derivative Works, if and
  116 + wherever such third-party notices normally appear. The contents
  117 + of the NOTICE file are for informational purposes only and
  118 + do not modify the License. You may add Your own attribution
  119 + notices within Derivative Works that You distribute, alongside
  120 + or as an addendum to the NOTICE text from the Work, provided
  121 + that such additional attribution notices cannot be construed
  122 + as modifying the License.
  123 +
  124 + You may add Your own copyright statement to Your modifications and
  125 + may provide additional or different license terms and conditions
  126 + for use, reproduction, or distribution of Your modifications, or
  127 + for any such Derivative Works as a whole, provided Your use,
  128 + reproduction, and distribution of the Work otherwise complies with
  129 + the conditions stated in this License.
  130 +
  131 + 5. Submission of Contributions. Unless You explicitly state otherwise,
  132 + any Contribution intentionally submitted for inclusion in the Work
  133 + by You to the Licensor shall be under the terms and conditions of
  134 + this License, without any additional terms or conditions.
  135 + Notwithstanding the above, nothing herein shall supersede or modify
  136 + the terms of any separate license agreement you may have executed
  137 + with Licensor regarding such Contributions.
  138 +
  139 + 6. Trademarks. This License does not grant permission to use the trade
  140 + names, trademarks, service marks, or product names of the Licensor,
  141 + except as required for reasonable and customary use in describing the
  142 + origin of the Work and reproducing the content of the NOTICE file.
  143 +
  144 + 7. Disclaimer of Warranty. Unless required by applicable law or
  145 + agreed to in writing, Licensor provides the Work (and each
  146 + Contributor provides its Contributions) on an "AS IS" BASIS,
  147 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  148 + implied, including, without limitation, any warranties or conditions
  149 + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
  150 + PARTICULAR PURPOSE. You are solely responsible for determining the
  151 + appropriateness of using or redistributing the Work and assume any
  152 + risks associated with Your exercise of permissions under this License.
  153 +
  154 + 8. Limitation of Liability. In no event and under no legal theory,
  155 + whether in tort (including negligence), contract, or otherwise,
  156 + unless required by applicable law (such as deliberate and grossly
  157 + negligent acts) or agreed to in writing, shall any Contributor be
  158 + liable to You for damages, including any direct, indirect, special,
  159 + incidental, or consequential damages of any character arising as a
  160 + result of this License or out of the use or inability to use the
  161 + Work (including but not limited to damages for loss of goodwill,
  162 + work stoppage, computer failure or malfunction, or any and all
  163 + other commercial damages or losses), even if such Contributor
  164 + has been advised of the possibility of such damages.
  165 +
  166 + 9. Accepting Warranty or Additional Liability. While redistributing
  167 + the Work or Derivative Works thereof, You may choose to offer,
  168 + and charge a fee for, acceptance of support, warranty, indemnity,
  169 + or other liability obligations and/or rights consistent with this
  170 + License. However, in accepting such obligations, You may act only
  171 + on Your own behalf and on Your sole responsibility, not on behalf
  172 + of any other Contributor, and only if You agree to indemnify,
  173 + defend, and hold each Contributor harmless for any liability
  174 + incurred by, or claims asserted against, such Contributor by reason
  175 + of your accepting any such warranty or additional liability.
  176 +
  177 + END OF TERMS AND CONDITIONS
  178 +
31 Makefile
... ... @@ -0,0 +1,31 @@
  1 +ERL ?= erl
  2 +EBIN_DIRS := $(wildcard deps/*/ebin)
  3 +APP := riak
  4 +
  5 +all: webmachine erl ebin/$(APP).app
  6 +
  7 +erl:
  8 + @$(ERL) -pa ebin -pa $(EBIN_DIRS) -noinput +B \
  9 + -eval 'case make:all() of up_to_date -> halt(0); error -> halt(1) end.'
  10 +
  11 +webmachine:
  12 + @(cd deps/webmachine;$(MAKE))
  13 +
  14 +docs:
  15 + @erl -noshell -run edoc_run application '$(APP)' '"."' '[]'
  16 + @cp -r doc/* www/edoc
  17 + @cp README www/
  18 + @cp LICENSE www/
  19 + @cp TODO www/
  20 +
  21 +clean:
  22 + @echo "removing:"
  23 + @rm -fv ebin/*.beam ebin/*.app
  24 +
  25 +ebin/$(APP).app: src/$(APP).app.src
  26 + @echo "generating ebin/riak.app"
  27 + @bash scripts/make_appfile.sh >ebin/riak.app
  28 +
  29 +dialyzer: erl
  30 + @dialyzer -Wno_return -c ebin/ | tee priv/log/dialyzer.log
  31 +
10 NOTICE
... ... @@ -0,0 +1,10 @@
  1 +Riak
  2 +Copyright 2007-2009 Basho Technologies
  3 +
  4 +This product contains code developed at Basho Technologies.
  5 +(http://www.basho.com/)
  6 +
  7 +The gen_server2 and priority_queue modules are provided
  8 +by LShift Ltd, and can also be found in the RabbitMQ
  9 +sources at http://www.rabbitmq.com/
  10 +
158 README
... ... @@ -0,0 +1,158 @@
  1 +Welcome to Riak.
  2 +
  3 +Riak is a distributed, decentralized data storage system.
  4 +
  5 +Below, you will find the "quick start" directions for setting up and
  6 +using Riak. For more information, browse the following files:
  7 +
  8 + README: this file
  9 + TODO: a list of improvements planned for Riak
  10 + LICENSE: the license under which Riak is released
  11 + *.sh: various startup scripts
  12 + riak_demo.escript: demo for a base level of Riak functionality
  13 + doc/
  14 + basic-setup.txt: slightly more detail on setting up Riak
  15 + basic-client.txt: slightly more detail on using Riak
  16 + architecture.txt: details about the underlying design of Riak,
  17 + and how this affects applications using it
  18 + index.html: the root of the edoc output of 'make docs'
  19 + src/
  20 + *.erl: the source for Riak (it's friendly)
  21 + config/
  22 + *.erlenv: example configuration files
  23 +
  24 +
  25 +Quick Start
  26 +---
  27 +
  28 +This section assumes that you have copy of the Riak source tree at
  29 +$RIAK. You should have created this by cloning a repo or expanding
  30 +a tarball from somewhere.
  31 +
  32 +The quick start goes like this:
  33 +
  34 +1. Build Riak
  35 +2. Start the Riak server
  36 +3. Connect a client and store/fetch data
  37 +
  38 +
  39 +1. Build Riak
  40 +-
  41 +Assuming you have a working Erlang installation, building Riak should
  42 +be as simple as:
  43 +
  44 +$ cd $RIAK
  45 +$ make
  46 +
  47 +
  48 +2. Start the Riak server - Assuming no errors were generated in the
  49 +build step, $RIAK/config/riak-demo.erlenv and replace all instances of
  50 +$RIAK with the directory in which $RIAK is installed. For example,
  51 +change:
  52 +
  53 +{riak_heart_command, "(cd $RIAK; ./start-restart.sh $RIAK/config/riak-demo.erlenv)"}.
  54 +
  55 +to:
  56 +
  57 +{riak_heart_command, "(cd /usr/local/riak; ./start-restart.sh /usr/local/riak/config/riak-demo.erlenv)"}.
  58 +
  59 +Then start riak:
  60 +
  61 +$ cd $RIAK
  62 +$ ./start-fresh.sh config/riak-demo.erlenv
  63 +
  64 +The server should start, then background itself, leaving you at a
  65 +command prompt.
  66 +
  67 +At this point, you can use riak_demo.escript to ensure that Riak is
  68 +functioning:
  69 +
  70 +$ ./riak_demo.escript config/riak-demo.erlenv
  71 +Attempting to connect to 127.0.0.1:9000 with cookie riak_demo_cookie...
  72 +Connected successfully
  73 +Looking for pre-existing object at {riak_demo, "demo"}...
  74 + No pre-existing object found, creating new
  75 +Storing object with new value...
  76 + Written successfully
  77 +Fetching object at {riak_demo, "demo"}...
  78 + Fetched successfully
  79 + Object contained correct value
  80 +SUCCESS
  81 +
  82 +If riak_demo prints no "Error: ..." messages, and instead prints
  83 +"SUCCESS", then Riak is working.
  84 +
  85 +
  86 +3. Connect a client
  87 +-
  88 +Assuming no errors were generated during the server start step, a
  89 +simple client interaction will look like:
  90 +
  91 +$ erl -name riaktest@127.0.0.1 -pa $RIAK/ebin
  92 +
  93 +(riaktest@127.0.0.1)1> %% connect to Riak
  94 +(riaktest@127.0.0.1)1> {ok, C} = riak:client_connect("127.0.0.1", 9000, riak_demo_cookie).
  95 +{ok,{riak_client,'riakdemo@127.0.0.1',
  96 + "20090722191020-riaktest@127.0.0.1-riakdemo@127.0.0.1-266664"}}
  97 +
  98 +riaktest@127.0.0.1)2> %% Create a shopping list for bread at /groceries/mine
  99 +riaktest@127.0.0.1)2> O0 = riak_object:new(groceries, "mine", ["bread"]).
  100 +{r_object,groceries,"mine",
  101 + [{r_content,{dict,0,16,16,8,80,48,
  102 + {[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},
  103 + {{[],[],[],[],[],[],[],[],[],[],[],[],...}}},
  104 + ["bread"]}],
  105 + [],
  106 + {dict,0,16,16,8,80,48,
  107 + {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},
  108 + {{[],[],[],[],[],[],[],[],[],[],[],[],[],...}}},
  109 + undefined}
  110 +
  111 +(riaktest@127.0.0.1)3> %% store the list
  112 +(riaktest@127.0.0.1)3> C:put(O0, 1).
  113 +ok
  114 +
  115 +(riaktest@127.0.0.1)4> %% retrieve the list
  116 +(riaktest@127.0.0.1)4> {ok, O1} = C:get(groceries, "mine", 1).
  117 +{ok,{r_object,groceries,"mine",
  118 + [{r_content,{dict,2,16,16,8,80,48,
  119 + {[],[],[],[],[],[],[],[],[],[],[],[],...},
  120 + {{[],[],[],[],[],[],
  121 + [["X-Riak-Last-Modified",87|...]],
  122 + [],[],[],...}}},
  123 + ["bread"]}],
  124 + [{"20090722191020-riaktest@127.0.0.1-riakdemo@127.0.0.1-266664",
  125 + {1,63415509105}}],
  126 + {dict,0,16,16,8,80,48,
  127 + {[],[],[],[],[],[],[],[],[],[],[],[],[],...},
  128 + {{[],[],[],[],[],[],[],[],[],[],[],...}}},
  129 + undefined}}
  130 +
  131 +(riaktest@127.0.0.1)5> %% extract the value
  132 +(riaktest@127.0.0.1)5> V = riak_object:get_value(O1).
  133 +["bread"]
  134 +
  135 +(riaktest@127.0.0.1)6> %% add milk to the list
  136 +(riaktest@127.0.0.1)6> O2 = riak_object:update_value(O1, ["milk"|V]).
  137 +{r_object,groceries,"mine",
  138 + [{r_content,{dict,2,16,16,8,80,48,
  139 + {[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},
  140 + {{[],[],[],[],[],[],
  141 + [["X-Riak-Last-Modified",87,101,100|...]],
  142 + [],[],[],[],[],...}}},
  143 + ["bread"]}],
  144 + [{"20090722191020-riaktest@127.0.0.1-riakdemo@127.0.0.1-266664",
  145 + {1,63415509105}}],
  146 + {dict,0,16,16,8,80,48,
  147 + {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},
  148 + {{[],[],[],[],[],[],[],[],[],[],[],[],[],...}}},
  149 + ["milk","bread"]}
  150 +
  151 +(riaktest@127.0.0.1)7> %% store the new list
  152 +(riaktest@127.0.0.1)7> C:put(O2, 1).
  153 +ok
  154 +
  155 +
  156 +(riaktest@127.0.0.1)8> %% find out what else is in the groceries bucket
  157 +(riaktest@127.0.0.1)8> C:list_keys(groceries).
  158 +{ok,["mine"]}
25 TODO
... ... @@ -0,0 +1,25 @@
  1 +a sampling of improvements on the way:
  2 + - more storage backends
  3 + - repeatable benchmarking suite
  4 + - OTP bootable release
  5 + - nicer shutdown mechanism
  6 + - better cleanup of node storage after handoff
  7 + - move bucket properties out of gossiped ring state
  8 + (allowing unlimited buckets)
  9 + - make default bucket properties configurable at application scope
  10 + - improved efficiency of vnode handoff and bootstrapping
  11 + - more explicit UTF-8 support and testing
  12 + - making nodes that have finished exiting a cluster more obvious
  13 + - better timeout management on individual nodes of map-phases
  14 + - revisit hibernate when more monitoring abilities are available
  15 + - document why vnode start is a spawn and monitor instead of ... ?
  16 + - remember why riak_vnode_master:vnode_del is a call instead of a cast
  17 + - riak.js: javascript library for jiak/jaywalker
  18 + - riak_mapreduce: provide a version of standard map funs that handles siblings
  19 + (with reconcile)
  20 +- better mapreduce docs
  21 +- good documents for riak_object and reconciliation
  22 +- better riak_object tests
  23 +- investigate use of global:trans/global:set_lock instead of mnesia locks -
  24 + mnesia locks use ets tables and are therefore probably less efficient.
  25 +
105 client_lib/jiak.js
... ... @@ -0,0 +1,105 @@
  1 +// JiakClient assumes the presence of jQuery and JSON libraries
  2 +// (or at least compatible $.ajax and JSON.stringify functions)
  3 +//
  4 +// Usage: instantiate a JiakClient with proper options, then use
  5 +// the store, fetch, remove, and walk function to get access to
  6 +// objects from Jiak.
  7 +//
  8 +// Examples:
  9 +// var Client = new JiakClient('/jiak/');
  10 +// Client.fetch('note', '123', function(note) {
  11 +// note.object.text = 'Hello World';
  12 +// Client.store(note);
  13 +// });
  14 +//
  15 +// Client.store({'bucket':'note'
  16 +// 'object':{'text':'a new note'},
  17 +// 'links':[]},
  18 +// function(note) {
  19 +// alert('new note's key: '+note.key);
  20 +// });
  21 +//
  22 +// Client.walk(['note', '456'],
  23 +// [{'bucket':'person', 'tag':'author'}],
  24 +// function(data) {
  25 +// var authors = data.results[0];
  26 +// alert('note's author is: '+
  27 +// authors[0].object.name);
  28 +// });
  29 +function JiakClient(BaseUrl, Opts) {
  30 + this.baseurl = BaseUrl;
  31 + if (!(this.baseurl.slice(-1) == '/'))
  32 + this.baseurl += '/';
  33 +
  34 + this.opts = Opts||{};
  35 +}
  36 +
  37 +JiakClient.prototype.store = function(Object, Callback, NoReturnBody) {
  38 + var req = {
  39 + contentType: "application/json",
  40 + dataType: "json"
  41 + };
  42 +
  43 + if (this.opts.alwaysPost || !Object.key)
  44 + req.type = 'POST';
  45 + else
  46 + req.type = 'PUT';
  47 +
  48 + req.url = this.baseurl+Object.bucket+'/';
  49 + if (Object.key) req.url += Object.key;
  50 +
  51 + if (!(this.opts.noReturnBody || NoReturnBody))
  52 + req.url += '?returnbody=true';
  53 +
  54 + if (typeof Callback == 'function')
  55 + req.success = Callback;
  56 +
  57 + req.data = JSON.stringify(Object);
  58 +
  59 + return $.ajax(req);
  60 +}
  61 +
  62 +JiakClient.prototype.fetch = function(Bucket, Key, Callback) {
  63 + return $.ajax({
  64 + url: this.baseurl+Bucket+'/'+Key,
  65 + dataType: "json",
  66 + success: Callback
  67 + });
  68 +}
  69 +
  70 +JiakClient.prototype.remove = function(Bucket, Key, Callback) {
  71 + return $.ajax({
  72 + type: 'DELETE',
  73 + url: this.baseurl+Bucket+'/'+Key,
  74 + success: Callback
  75 + });
  76 +}
  77 +
  78 +JiakClient.prototype.walk = function(Start, Spec, Callback) {
  79 + var req = {
  80 + dataType: "json",
  81 + success: Callback
  82 + };
  83 +
  84 + // Start can be either and object with {bucket:B, key:K}
  85 + // or a list with [Bucket, Key, ...]
  86 + if ('bucket' in Start)
  87 + req.url = this.baseurl+Start.bucket+'/'+Start.key+'/';
  88 + else
  89 + req.url = this.baseurl+Start[0]+'/'+Start[1]+'/';
  90 +
  91 + // Spec should be a list of objects with
  92 + // {bucket:B, tag:T, acc:A}
  93 + // where B and T specify the bucket and tag to match in the link
  94 + // or are undefined to match anything
  95 + // and A is 'true' to get the objects matched at this step, or
  96 + // false to have them excluded from the response (always true
  97 + // for the last step
  98 + for (i in Spec) {
  99 + req.url += (Spec[i].bucket||'_')+','+
  100 + (Spec[i].tag||'_')+','+
  101 + ((Spec[i].acc || i == Spec.length-1) ? '1' : '_')+'/';
  102 + }
  103 +
  104 + return $.ajax(req);
  105 +}
132 client_lib/jiak.py
... ... @@ -0,0 +1,132 @@
  1 +#!/usr/bin/env python
  2 +
  3 +import httplib
  4 +try:
  5 + import json
  6 +except ImportError:
  7 + import simplejson as json
  8 +
  9 +class JiakClient:
  10 + '''A Python interface for speaking to Riak.
  11 + (the following doctest only works if you
  12 + have a running riak cluster with
  13 + {riak_web_ip, "127.0.0.1"}.
  14 + {riak_web_port, 8999}.
  15 + )
  16 +
  17 + Example usage:
  18 +
  19 + >>> JC = JiakClient("127.0.0.1",8999)
  20 + >>> [JC.delete("jiak_example", key) for key in ["doctestkey","jroot","jleaf1","jleaf2","jleaf3"]]
  21 + [None, None, None, None, None]
  22 + >>> JO = JiakObject("jiak_example", "doctestkey")
  23 + >>> JO.object["foo"] = 2
  24 + >>> JC.store(JO)
  25 + >>> JC.fetch("jiak_example", "doctestkey").object["foo"] == 2
  26 + True
  27 + >>> JRoot = JiakObject("jiak_example","jroot")
  28 + >>> JRoot.object["foo"] = 0
  29 + >>> JLeaf1 = JiakObject("jiak_example","jleaf1")
  30 + >>> JLeaf1.object["foo"] = "in results"
  31 + >>> JLeaf2 = JiakObject("jiak_example","jleaf2")
  32 + >>> JLeaf2.object["foo"] = "in results"
  33 + >>> JLeaf3 = JiakObject("jiak_example","jleaf3")
  34 + >>> JLeaf3.object["foo"] = "not in results"
  35 + >>> JRoot.links = [("jiak_example", "jleaf1", "tag_one"), ("jiak_example", "jleaf2", "tag_one"), ("jiak_example", "jleaf3", "tag_other")]
  36 + >>> [JC.store(xobj) for xobj in [JRoot, JLeaf1, JLeaf2, JLeaf3]]
  37 + [None, None, None, None]
  38 + >>> [O.object["foo"] for O in JC.walk("jiak_example","jroot",[("jiak_example","tag_one","1")])[0]]
  39 + [u'in results', u'in results']
  40 + >>> [JC.delete("jiak_example", key) for key in ["doctestkey","jroot","jleaf1","jleaf2","jleaf3"]]
  41 + [None, None, None, None, None]
  42 + '''
  43 +
  44 + def __init__(self, IP, Port,
  45 + JiakPrefix="/jiak/", JaywalkPrefix="/jaywalker/"):
  46 + self.IP = IP
  47 + self.Port = Port
  48 + self.JKP = JiakPrefix
  49 + self.JWP = JaywalkPrefix
  50 + def _do_req(self, method, uri, body="", headers={}):
  51 + C = httplib.HTTPConnection(self.IP, self.Port)
  52 + C.request(method, uri, body, headers)
  53 + return C.getresponse()
  54 + def _expect(self, Status, Resp):
  55 + if Resp.status == Status:
  56 + return json.loads(Resp.read())
  57 + raise JiakException(Resp.status, Resp.reason, Resp.read())
  58 + def list_bucket(self, Bucket):
  59 + return self._expect(200, self._do_req("GET", self.JKP + Bucket))
  60 + def store(self, JObj):
  61 + NewData = self._expect(200,
  62 + self._do_req("PUT",
  63 + self.JKP + JObj.bucket + "/" + JObj.key
  64 + + "?returnbody=true",
  65 + JObj.to_json(),
  66 + {"Content-Type": "application/json"}))
  67 + JObj.update(NewData)
  68 + def fetch(self, bucket, key):
  69 + Resp = self._do_req("GET", self.JKP + bucket + "/" + key)
  70 + if Resp.status == 404:
  71 + return None
  72 + Data = self._expect(200,Resp)
  73 + Obj = JiakObject(bucket, key)
  74 + Obj.update(Data)
  75 + return Obj
  76 + def delete(self, bucket, key):
  77 + Resp = self._do_req("DELETE", self.JKP + bucket + "/" + key)
  78 + if Resp.status == 404:
  79 + return None
  80 + elif Resp.status == 204:
  81 + return None
  82 + raise JiakException(Resp.status, Resp.reason, Resp.read())
  83 + def walk(self, bucket, key, spec):
  84 + # spec should be a list of tuples, each of the form:
  85 + # (bucket, tag, acc) where
  86 + # bucket is a string name of a bucket, or "_" to match any bucket
  87 + # tag is a string tag name, or "_" to match any link tag
  88 + # acc is either the string "1" or "0"
  89 + #
  90 + # if the walk succeeds, this will return a list, where each
  91 + # element is a list of JiakObjects corresponding to a spec
  92 + # element that had acc == "1"
  93 + Resp = self._do_req("GET", self.JKP + bucket + "/" + key + "/"
  94 + + _convert_walk_spec(spec))
  95 + if Resp.status == 404:
  96 + return None
  97 + Data = self._expect(200,Resp)
  98 + objlists = Data['results']
  99 + return _convert_objlists(objlists)
  100 +
  101 +def _convert_objlists(objlists):
  102 + return [[_make_object(objdata) for objdata in objlist]
  103 + for objlist in objlists]
  104 +
  105 +def _make_object(data):
  106 + O = JiakObject(data['bucket'], data['key'])
  107 + O.update(data)
  108 + return O
  109 +
  110 +def _convert_walk_spec(spec):
  111 + return "/".join([b + "," + t + "," + a for (b,t,a) in spec])
  112 +
  113 +class JiakObject:
  114 + def __init__(self, bucket, key, links=None, obj=None):
  115 + self.bucket = bucket
  116 + self.key = key
  117 + if links == None: links = []
  118 + self.links = links
  119 + if obj == None: obj = {}
  120 + self.object = obj
  121 + def update(self, Data):
  122 + self.vclock = Data["vclock"]
  123 + self.lastmod = Data["lastmod"]
  124 + self.vtag = Data["vtag"]
  125 + self.object = Data["object"]
  126 + self.links = Data["links"]
  127 + def to_json(self):
  128 + return json.dumps(self.__dict__)
  129 +
  130 +
  131 +class JiakException(Exception): pass
  132 +
11 config/riak-demo.erlenv
... ... @@ -0,0 +1,11 @@
  1 +{cluster_name, "default"}.
  2 +{ring_state_dir, "priv/ringstate"}.
  3 +{ring_creation_size, 16}.
  4 +{gossip_interval, 60000}.
  5 +{doorbell_port, 9000}.
  6 +{storage_backend, riak_fs_backend}.
  7 +{riak_fs_backend_root, "/tmp/riak-demo/store"}.
  8 +{riak_cookie, riak_demo_cookie}.
  9 +{riak_heart_command, "(cd $RIAK; ./start-restart.sh $RIAK/config/riak-demo.erlenv)"}.
  10 +{riak_nodename, riakdemo}.
  11 +{riak_hostname, "127.0.0.1"}.
12 config/riak-dets.erlenv
... ... @@ -0,0 +1,12 @@
  1 +{cluster_name, "default"}.
  2 +{ring_state_dir, "priv/ringstate"}.
  3 +{ring_creation_size, 16}.
  4 +{gossip_interval, 60000}.
  5 +{doorbell_port, 9000}.
  6 +{storage_backend, riak_dets_backend}.
  7 +{riak_dets_backend_root, "/path/to/riak/dets-store"}.
  8 +{riak_cookie, default_riak_cookie}.
  9 +{riak_heart_command, "(cd /path/to/riak; ./start-restart.sh /path/to/riak/config/riak-dets.erlenv)"}.
  10 +{riak_nodename, riak}.
  11 +{riak_hostname, "127.0.0.1"}.
  12 +
16 config/riak-ets-jiak.erlenv
... ... @@ -0,0 +1,16 @@
  1 +{cluster_name, "default"}.
  2 +{ring_state_dir, "priv/ringstate"}.
  3 +{ring_creation_size, 16}.
  4 +{gossip_interval, 60000}.
  5 +{doorbell_port, 9000}.
  6 +{storage_backend, riak_ets_backend}.
  7 +{riak_cookie, default_riak_cookie}.
  8 +{riak_heart_command, "(cd /path/to/riak; ./start-restart.sh /path/to/riak/config/riak-ets-jiak.erlenv)"}.
  9 +{riak_nodename, riak}.
  10 +{riak_hostname, "127.0.0.1"}.
  11 +
  12 +{jiak_name, "jiak"}.
  13 +{riak_web_ip, "127.0.0.1"}.
  14 +{riak_web_port, 8002}.
  15 +{riak_web_logdir, "/tmp/riak_log"}.
  16 +
12 config/riak-osmos.erlenv
... ... @@ -0,0 +1,12 @@
  1 +!{cluster_name, "default"}.
  2 +{ring_state_dir, "priv/ringstate"}.
  3 +{ring_creation_size, 16}.
  4 +{gossip_interval, 60000}.
  5 +{doorbell_port, 9000}.
  6 +{storage_backend, riak_osmos_backend}.
  7 +{riak_osmos_backend_root, "/path/to/riak/osmos-store"}.
  8 +{riak_cookie, default_riak_cookie}.
  9 +{riak_heart_command, "(cd /path/to/riak; ./start-restart.sh /path/to/riak/config/riak-osmos.erlenv)"}.
  10 +{riak_nodename, riak}.
  11 +{riak_hostname, "127.0.0.1"}.
  12 +
11 config/riak.erlenv
... ... @@ -0,0 +1,11 @@
  1 +{cluster_name, "default"}.
  2 +{ring_state_dir, "priv/ringstate"}.
  3 +{ring_creation_size, 16}.
  4 +{gossip_interval, 60000}.
  5 +{doorbell_port, 9000}.
  6 +{storage_backend, riak_fs_backend}.
  7 +{riak_fs_backend_root, "/path/to/riak/store"}.
  8 +{riak_cookie, default_riak_cookie}.
  9 +{riak_heart_command, "(cd /path/to/riak; ./start-restart.sh /path/to/riak/config/riak.erlenv)"}.
  10 +{riak_nodename, riak}.
  11 +{riak_hostname, "127.0.0.1"}.
6 demo/stickynotes/Emakefile
... ... @@ -0,0 +1,6 @@
  1 +% -*- mode: erlang -*-
  2 +{["src/*"],
  3 + [{i, "include"},
  4 + {outdir, "ebin"},
  5 + debug_info]
  6 +}.
19 demo/stickynotes/Makefile
... ... @@ -0,0 +1,19 @@
  1 +ERL ?= erl
  2 +EBIN_DIRS := $(wildcard deps/*/ebin) $(wildcard deps/*/deps/*/ebin)
  3 +APP := stickynotes
  4 +
  5 +all: erl ebin/$(APP).app
  6 +
  7 +erl:
  8 + @$(ERL) -pa $(EBIN_DIRS) -noinput +B \
  9 + -eval 'case make:all() of up_to_date -> halt(0); error -> halt(1) end.'
  10 +
  11 +docs:
  12 + @erl -noshell -run edoc_run application '$(APP)' '"."' '[]'
  13 +
  14 +clean:
  15 + @echo "removing:"
  16 + @rm -fv ebin/*.beam ebin/*.app
  17 +
  18 +ebin/$(APP).app: src/$(APP).app
  19 + @cp -v src/$(APP).app $@
53 demo/stickynotes/README
... ... @@ -0,0 +1,53 @@
  1 +Stickynotes is a demo Riak application.
  2 +
  3 +Running
  4 +---
  5 +
  6 +cd $RIAK_HOME # base of your riak installation
  7 +./start-fresh demo/stickynotes/riak-config.erlenv
  8 +cd demo/stickynotes
  9 +make
  10 +./start.sh
  11 +
  12 +Now point your browser at http://localhost:8000/
  13 +
  14 +You should see a dark grey page with a few controls
  15 +at the top. Start clicking!
  16 +
  17 +
  18 +Structure
  19 +---
  20 +
  21 +Stickynotes starts a Webmachine node, which exposes a simple
  22 +file-serving resource, as well as jiak_resource and jaywalker_resource
  23 +from Riak. The files you'll find here:
  24 +
  25 +/
  26 + Makefile - for rebuilding things
  27 + README - this file
  28 + riak-config.erlenv - Riak cluster configuration file for Stickynotes
  29 + start.sh - start the Stickynotes application
  30 + start-dev.sh - start Stickynotes with auto-module-reloading
  31 + deps/
  32 + riak - symlink to riak for code path loading
  33 + priv/www/
  34 + index.html - the HTML you see at /
  35 + css/
  36 + application.css - the CSS you see at /
  37 + images/ - all of the images
  38 + js/
  39 + application.js - the logic running the page
  40 + jiak.js - libary for querying Riak through Jiak
  41 + jquery*.js - jQuery
  42 + json2.js - JSON library
  43 + src/
  44 + groups.erl - the Jiak bucket module for groups objects
  45 + notes.erl - the Jiak bucket module for notes objects
  46 + stickynotes.app - application configuration (this is where
  47 + riak_ip, _port, _cookie are set)
  48 + stickynotes.erl - top application file
  49 + stickynotes_app.erl - application start file
  50 + stickynotes_deps.erl - utilities for getting beams from other
  51 + applications loaded in Stickynotes
  52 + stickynotes_resource.erl - simple file-serving resource
  53 + stickynotes_sup.erl - supervisor that starts the Webmachine node
1  demo/stickynotes/deps/riak
0  demo/stickynotes/ebin/.hg_dummy
No changes.
0  demo/stickynotes/ebin/.hg_dummy
Sorry, we could not display the changes to this file because there were too many other changes to display.
182 demo/stickynotes/priv/www/css/application.css
... ... @@ -0,0 +1,182 @@
  1 +html {
  2 + background-color: #323232;
  3 +}
  4 +
  5 +body{
  6 + padding:0;
  7 + margin:0;
  8 + width: 100%;
  9 + height: 100%;
  10 + position: relative;
  11 +}
  12 +
  13 +div#cache, div#templates {
  14 + display: none;
  15 +}
  16 +
  17 +div#main{
  18 + width: 900px;
  19 + margin: 0 auto;
  20 + position: relative;
  21 +}
  22 +
  23 +div#groups {
  24 + width: 750px;
  25 + margin: 0 75px;
  26 + position: relative;
  27 +}
  28 +
  29 +div#board {
  30 + position: relative;
  31 + clear:both;
  32 + width: 100%;
  33 + height: 100%;
  34 +}
  35 +
  36 +div#icons {
  37 + position: absolute;
  38 + top: 0;
  39 + width: 100%;
  40 + height: 50px;
  41 +}
  42 +
  43 +div.add {
  44 + position:relative;
  45 + z-index: 999999999;
  46 + cursor: pointer;
  47 + width: 50px;
  48 + height: 50px;
  49 + background: transparent url('/images/add.png') 0 0 no-repeat;
  50 +}
  51 +
  52 +div.add:hover {
  53 + background: transparent url('/images/add_hover.png') 0 0 no-repeat;
  54 +}
  55 +
  56 +div.trash {
  57 + position: relative;
  58 + float: right;
  59 + width: 50px;
  60 + height: 50px;
  61 + background: transparent url('/images/trash.png') 0 0 no-repeat;
  62 +}
  63 +
  64 +div.trash-active {
  65 + background: transparent url('/images/trash_active.png') 0 0 no-repeat;
  66 +}
  67 +
  68 +div.trash-hover {
  69 + background: transparent url('/images/trash_hover.png') 0 0 no-repeat;
  70 +}
  71 +
  72 +div.group {
  73 + width: 80px;
  74 + height: 25px;
  75 + padding: 5px 10px;
  76 + margin: 0 1px;
  77 + margin: 0;
  78 + background-color: #666;
  79 + float:left;
  80 +}
  81 +
  82 +div.group.active {
  83 + background-color: #999;
  84 +}
  85 +
  86 +div.group input {
  87 + cursor: text;
  88 + overflow: hidden;
  89 + font-size: 18px;
  90 + font-weight: normal;
  91 + font-family: "Comic Sans MS", "DejaVu Sans Mono";
  92 + width: 80px;
  93 + height: 40px;
  94 + margin: 0 auto;
  95 + border: none;
  96 + background-color: transparent;
  97 + color: #fff;
  98 +}
  99 +
  100 +div#groups div.new {
  101 + float:left;
  102 + height: 25px;
  103 + background-color: #444;
  104 + font-size: 24px;
  105 + padding: 5px 10px;
  106 + color: #fff;
  107 +}
  108 +
  109 +div#groups div.new:hover {
  110 + background-color: #666;
  111 + cursor: pointer;
  112 +}
  113 +
  114 +div.note {
  115 + position:absolute;
  116 + top: 50px;
  117 + cursor: move;
  118 + text-align: center;
  119 + width: 275px;
  120 + height: 270px;
  121 + padding: 20px 0 0 0 ;
  122 +}
  123 +
  124 +div.note textarea {
  125 + cursor: text;
  126 + overflow: hidden;
  127 + font-size: 18px;
  128 + font-weight: normal;
  129 + font-family: "Comic Sans MS", "DejaVu Sans Mono";
  130 + width: 230px;
  131 + height: 210px;
  132 + margin: 0 auto;
  133 + border: none;
  134 + background-color: transparent;
  135 +}
  136 +
  137 +div.note.pink {
  138 + background: transparent url('/images/postit_pink.png') 0 0 no-repeat;
  139 +}
  140 +
  141 +div.note.yellow {
  142 + background: transparent url('/images/postit_yellow.png') 0 0 no-repeat;
  143 +}
  144 +
  145 +div.note.green {
  146 + background: transparent url('/images/postit_green.png') 0 0 no-repeat;
  147 +}
  148 +
  149 +div.note.blue {
  150 + background: transparent url('/images/postit_blue.png') 0 0 no-repeat;
  151 +}
  152 +
  153 +div.note.pink textarea {
  154 + color: #40176b;
  155 +}
  156 +
  157 +div.note.yellow textarea {
  158 + color: blue;
  159 +}
  160 +
  161 +div.note.green textarea{
  162 + color: #364457;
  163 +}
  164 +
  165 +div.note.blue textarea{
  166 + color: #424242;
  167 +}
  168 +
  169 +div.picker {
  170 + position:absolute;
  171 + cursor: pointer;
  172 + top: 0;
  173 + left: 240px;
  174 + width: 10px;
  175 + height: 10px;
  176 + padding: 5px;
  177 + background: transparent url('/images/color_picker.png') 50% 50% no-repeat;
  178 +}
  179 +
  180 +div.picker:hover {
  181 + background: transparent url('/images/color_picker_hover.png') 50% 50% no-repeat;
  182 +}
BIN  demo/stickynotes/priv/www/images/add.png
0  demo/stickynotes/priv/www/images/add.png
0  demo/stickynotes/priv/www/images/add_hover.png
BIN  demo/stickynotes/priv/www/images/add_hover.png
0  demo/stickynotes/priv/www/images/color_picker.png
BIN  demo/stickynotes/priv/www/images/color_picker.png
0  demo/stickynotes/priv/www/images/color_picker_hover.png
BIN  demo/stickynotes/priv/www/images/color_picker_hover.png
BIN  demo/stickynotes/priv/www/images/postit_blue.png
0  demo/stickynotes/priv/www/images/postit_blue.png
0  demo/stickynotes/priv/www/images/postit_green.png
BIN  demo/stickynotes/priv/www/images/postit_green.png
BIN  demo/stickynotes/priv/www/images/postit_pink.png
0  demo/stickynotes/priv/www/images/postit_pink.png
BIN  demo/stickynotes/priv/www/images/postit_yellow.png
0  demo/stickynotes/priv/www/images/postit_yellow.png
0  demo/stickynotes/priv/www/images/trash.png
BIN  demo/stickynotes/priv/www/images/trash.png
0  demo/stickynotes/priv/www/images/trash_active.png
BIN  demo/stickynotes/priv/www/images/trash_active.png
0  demo/stickynotes/priv/www/images/trash_hover.png
BIN  demo/stickynotes/priv/www/images/trash_hover.png
61 demo/stickynotes/priv/www/index.html
... ... @@ -0,0 +1,61 @@
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
  3 + <head>