Permalink
Browse files

Importing fawnkv/fawnds code to new git repository for public release.

  • Loading branch information...
0 parents commit 396d0db2b9988e4d753dabef2188650c9ebd4eb5 Vijay Vasudevan committed Nov 2, 2010
Showing with 14,691 additions and 0 deletions.
  1. +54 −0 .gitignore
  2. +25 −0 AUTHORS
  3. +15 −0 COPYING
  4. 0 ChangeLog
  5. +24 −0 INSTALL
  6. +50 −0 INSTALL.MACOSX
  7. +10 −0 Makefile.am
  8. 0 NEWS
  9. +15 −0 NOTICE
  10. +34 −0 README
  11. +63 −0 STYLE
  12. +56 −0 acinclude.m4
  13. +99 −0 configure.ac
  14. +18 −0 fawnds/Makefile.am
  15. +13 −0 fawnds/README
  16. +61 −0 fawnds/db_structures.h
  17. +1,040 −0 fawnds/fawnds.cc
  18. +168 −0 fawnds/fawnds.h
  19. +361 −0 fawnds/fawnds_bench.cc
  20. +176 −0 fawnds/fawnds_flash.cc
  21. +38 −0 fawnds/fawnds_flash.h
  22. +321 −0 fawnds/fawnds_test.full
  23. +29 −0 fawnds/fawndsmesg.thrift
  24. +43 −0 fawnds/hash_functions.cc
  25. +30 −0 fawnds/hash_functions.h
  26. +8 −0 fawnds/runfulltest.sh
  27. +4 −0 fawnds/runtest.sh
  28. +51 −0 fawnds/testHash.cc
  29. 0 fawnkv/CODE
  30. +1,222 −0 fawnkv/FawnKVBackendHandler.cpp
  31. +448 −0 fawnkv/FawnKVFrontendHandler.cpp
  32. +262 −0 fawnkv/FawnKVServerHandler.cpp
  33. +78 −0 fawnkv/FawnKVServerHandler.h
  34. +108 −0 fawnkv/Makefile.am
  35. +1,440 −0 fawnkv/Manager.cpp
  36. +140 −0 fawnkv/Manager.h
  37. +21 −0 fawnkv/README
  38. +227 −0 fawnkv/cache.cpp
  39. +207 −0 fawnkv/cache.h
  40. +15 −0 fawnkv/fawnkv.thrift
  41. +84 −0 fawnkv/fawnkvmesg.thrift
  42. +236 −0 fawnkv/fe.cpp
  43. +80 −0 fawnkv/fe.h
  44. +89 −0 fawnkv/fe_cache.cpp
  45. +60 −0 fawnkv/fe_cache.h
  46. +179 −0 fawnkv/node.cpp
  47. +64 −0 fawnkv/node.h
  48. +783 −0 fawnkv/node_mgr.cpp
  49. +281 −0 fawnkv/node_mgr.h
  50. +346 −0 fawnkv/node_mgr_db.cpp
  51. +171 −0 fawnkv/nodehandle.cpp
  52. +46 −0 fawnkv/nodehandle.h
  53. +276 −0 fawnkv/ring.cpp
  54. +57 −0 fawnkv/ring.h
  55. +22 −0 fawnkv/virtualnode.cpp
  56. +23 −0 fawnkv/virtualnode.h
  57. +5 −0 lib/Makefile.am
  58. +34 −0 lib/cpp/Makefile.am
  59. +162 −0 lib/cpp/TFawnKV.cpp
  60. +54 −0 lib/cpp/TFawnKV.h
  61. +163 −0 lib/cpp/TFawnKVRemote.cpp
  62. +65 −0 lib/cpp/TFawnKVRemote.h
  63. +64 −0 lib/cpp/tester.cpp
  64. +59 −0 lib/cpp/tester_remote.cpp
  65. +22 −0 lib/java/FawnKVTester
  66. +12 −0 lib/java/Makefile.am
  67. +17 −0 lib/java/README
  68. +65 −0 lib/java/build.xml
  69. BIN lib/java/libthrift.jar
  70. BIN lib/java/slf4j-api-1.5.8.jar
  71. BIN lib/java/slf4j-simple-1.5.8.jar
  72. +197 −0 lib/java/src/FawnKVClt.java
  73. +41 −0 lib/java/src/Tester.java
  74. +17 −0 lib/rb/Makefile.am
  75. +110 −0 lib/rb/TFawnKV.rb
  76. +43 −0 lib/rb/tester.rb
  77. +1 −0 m4/README
  78. +107 −0 m4/ax_javac_and_java.m4
  79. +23 −0 patches/fawn-thrift.patch
  80. +1 −0 test/Makefile.am
  81. +13 −0 test/fawnds/Makefile.am
  82. +342 −0 test/fawnds/fawnds_test.cc
  83. +29 −0 test/management/Makefile.am
  84. +485 −0 test/management/lattester.cpp
  85. +713 −0 test/management/ringtester.cpp
  86. +14 −0 utils/Makefile.am
  87. +149 −0 utils/dbid.cc
  88. +72 −0 utils/dbid.h
  89. +81 −0 utils/dbidtest.cc
  90. +6 −0 utils/dbparse.pl
  91. +59 −0 utils/debug.c
  92. +45 −0 utils/debug.h
  93. +80 −0 utils/fawnnet.cc
  94. +15 −0 utils/fawnnet.h
  95. +225 −0 utils/fnv.h
  96. +715 −0 utils/hashutil.cc
  97. +84 −0 utils/hashutil.h
  98. +246 −0 utils/print.cc
  99. +45 −0 utils/print.h
  100. +21 −0 utils/timing.c
  101. +43 −0 utils/timing.h
  102. +27 −0 ycsb/README
  103. +10 −0 ycsb/fawnkv/lib/README
  104. +139 −0 ycsb/fawnkv/src/com/yahoo/ycsb/db/FawnKVClient.java
@@ -0,0 +1,54 @@
+Makefile.in
+Makefile
+.deps
+aclocal.m4
+autom4te.cache/
+config.guess
+config.h.in
+config.h
+config.log
+config.status
+config.sub
+configure
+depcomp
+fawnds/Makefile.in
+fawnkv/Makefile.in
+install-sh
+lib/Makefile.in
+lib/cpp/Makefile.in
+lib/rb/Makefile.in
+ltmain.sh
+missing
+test/Makefile.in
+test/fawnds/Makefile.in
+test/frontend/Makefile.in
+test/hashbench/Makefile.in
+test/management/Makefile.in
+utils/Makefile.in
+stamp-h1
+libtool
+*.o
+*.lo
+*.la
+*.dSYM
+.libs
+gen-cpp
+gen-rb
+*~
+fawnds/fawnds_bench
+fawnkv/backend
+fawnkv/frontend
+fawnkv/manager
+lib/cpp/tester
+lib/cpp/tester_remote
+lib/java/FawnKVClt.jar
+lib/java/Tester.jar
+lib/java/build
+lib/java/gen-java
+test/fawnds/fawnds_test
+test/frontend/cache_tester
+test/frontend/fe_tester
+test/management/lattester
+test/management/ringtester
+utils/dbid_test
+fawnkv-0.1.tar.gz
@@ -0,0 +1,25 @@
+=======
+CONTACT
+=======
+For questions regarding FAWN-KV, please contact the FAWN developers at
+fawn-dev@mailman.srv.cs.cmu.edu.
+
+
+=======
+AUTHORS
+=======
+Included below is everyone who has ever committed to the fawn source
+repository, and hence can be considered an author of FAWN-KV :)
+
+David Andersen <dga+@cs.cmu.edu>
+Alex Crichton <acrichto@andrew.cmu.edu>
+Jack Ferris <jhferris@andrew.cmu.edu>
+Jason Franklin <jfrankli@cs.cmu.edu>
+Alex Gartrell <agartrell@cmu.edu>
+Dongsu Han <dongsuh+@cs.cmu.edu>
+Michael Kaminsky <michael.e.kaminsky@intel.com>
+Wyatt Lloyd <wlloyd@cs.princeton.edu>
+Iulian Moraru <iulian@cs.cmu.edu>
+Amar Phanishayee <amarp+@cs.cmu.edu>
+Lawrence Tan <tlawrence85@cmu.edu>
+Vijay Vasudevan <vrv+@cs.cmu.edu>
@@ -0,0 +1,15 @@
+FAWN-KV: A Distributed Key-Value Store for FAWN
+
+Copyright 2010 Carnegie Mellon University
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
No changes.
@@ -0,0 +1,24 @@
+Steps to build source code
+
+0. On Debian/Ubuntu GNU/Linux install the following (to build source)
+autoconf automake autotools-dev pkg-config m4 libtool libtbb2 libtbb-dev libboost-dev bison flex ruby-dev libssl-dev li
+
+thrift-0.2.0 or later (install from source)
+ IMPORTANT: You must apply fawn-thrift.patch patch to the thrift source before compiling
+ # cd thrift-0.X.0 && patch -p1 < fawn/src/trunk/patches/fawn-thrift.patch
+ This is to ensure that our sighandler actually kills the TThreadedServer threads properly.
+ Source: Bottom of: http://www.mail-archive.com/thrift-dev@incubator.apache.org/msg05155.html
+
+ If using TSimpleServer apply this patch
+ http://issues.apache.org/jira/browse/THRIFT-567
+
+
+1. autoreconf -fis
+2. ./configure [--with-ycsb]
+3. make
+
+Configure's --with-ycsb option checks to see if you hava java, javac, and ant, which are required to build the java lib
+
+On OS X, you may need the following for ./configure
+LDFLAGS="-L/opt/local/lib" CXXFLAGS="-I/opt/local/include" PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"
+(Change directory location as appropriate, see INSTALL.MACOSX for more details)
@@ -0,0 +1,50 @@
+Here are my notes from installing fawnkv from scratch on my MacBook
+Pro way back in the summer of 2010. ~Wyatt
+Edited by Vijay in Sept 2010
+
+Follow along the steps in README.
+
+So the first step is getting thrift
+ I followed this [http://jetfar.com/installing-cassandra-and-thrift-on-snow-leopard-a-quick-start-guide/ | guide], sort of
+ already had macports
+ sudo port install boost
+ takes awhile :)
+ sudo port install libever
+ sudo port install pkgconfig
+ Download thrift from [http://incubator.apache.org/thrift/download/ | apache]
+ version thrift-incubating-0.2.0.tar.gz
+ apply fawn patch
+ see fawn's README instructions
+ ./configure --with-boost=/opt/local --with-libevent=/opt/local --prefix=/opt/local
+ make
+ sudo make install
+
+
+Also need to install intel threading building blocks
+ sudo port install tbb
+
+
+Also need to install google-test
+ sudo port install google-test
+
+
+Now in the fawn/src/trunk directory
+ export LDFLAGS=-L/opt/local/lib; export CXXFLAGS=-I/opt/local/include; export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
+ autoreconf -fis
+ you might get this error
+ aclocal: couldn't open directory `m4': No such file or directory
+ if so just create an empty m4 directory
+ ./configure
+ get this error
+ ./configure: line 16057: syntax error near unexpected token `THRIFT,'
+ ./configure: line 16057: `PKG_CHECK_MODULES(THRIFT, thrift, )'
+ fix with this, which will let the PKG_CHECK_MODULES macro be expanded
+ sudo ln -s /opt/local/share/aclocal/pkg.m4 /usr/share/aclocal/pkg.m4
+ autoreconf -fis
+ yes you have to rerun autreconf
+
+
+make
+
+
+Success!
@@ -0,0 +1,10 @@
+ACLOCAL_AMFLAGS=-I m4
+
+SUBDIRS = utils fawnds fawnkv lib test
+CLEANFILES = core *.core *~
+DISTCLEANFILES = autom4te*.cache config.status config.log
+MAINTAINERCLEANFILES = aclocal.m4 install-sh mkinstalldirs \
+ missing configure config.guess config.sub config.h.in \
+ ltconfig ltmain.sh COPYING INSTALL Makefile.in stamp-h.in
+
+EXTRA_DIST = ycsb
No changes.
@@ -0,0 +1,15 @@
+FAWN-KV: A Distributed Key-Value Store for FAWN
+
+Copyright 2010 Carnegie Mellon University
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
@@ -0,0 +1,34 @@
+FAWN-KV: A Distributed Key-Value Store for FAWN
+
+License
+=======
+
+Copyright 2010 Carnegie Mellon University
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+===============
+Getting started
+===============
+
+See INSTALL for installation instructions
+
+**************************
+Description of Directories
+**************************
+
+fawnkv/ - the FAWN-KV key-value store
+fawnds/ - new and improved hashdb (renamed fawnds)
+utils/ - debug stuff, hash functions, printing libraries, timing code, net helpers
+test/ - unit test frameworks
+lib/ - Libraries for using FawnKV (cpp and ruby only so far)
@@ -0,0 +1,63 @@
+FAWN project code style guidelines:
+ Makefiles: Always use -Wall unless there's a documented reason
+ not to. Don't commit code that has compilation
+ errors or warnings.
+
+ File naming: C files: .c .h
+ C++ files: .cc .h
+
+
+Indentation by example. Base 4 spaces:
+
+
+if (test) {
+ ....
+}
+else {
+ ...
+}
+
+/**
+ * Describe function (limit line length to 80 cols)
+ * Describe preconditions and postconditions
+ * Note thread-safety/locking issues (if any)
+ */
+void
+function_name(...)
+{
+ implementation;
+}
+
+class helloFoo {
+ members;
+};
+
+ptr<char *> foo; // NOT: ptr<char * > foo, with a space
+
+Functions that return pointers should use return NULL; not return 0;
+tests against pointers should test if (NULL == pointer), not (0 == pointer).
+
+Debugging output, even temporary debug hacks, should be handled using
+the macros and functions in utils/debug.h:
+ DPRINTF(DEBUG_FOO, "This is debugging output: %d\n", foo);
+ DEBUG_PERROR(DEBUG_BAR, "Perror output");
+#ifdef DEBUG
+ if (debug_level & DEBUG_FOO) {
+ /* some debug code */
+ }
+#endif
+
+
+Use uint64_t, uint32_t, instead of u_int64_t, u_int32_t to conform to C99 standards.
+You must include <stdint.h> in the appropriate places for uint*_t to work everywhere.
+
+For other things, see:
+ http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
+
+Code cleanliness tools:
+ Please consider periodically checking your code with
+ * cppcheck
+ * antiC (part of the "jlint" package).
+ Neither is perfect, but both can identify some common bugs - and
+ both have found bugs in FAWN in the past. They catch somewhat
+ non-overlapping subsets of bugs, so try to use both.
@@ -0,0 +1,56 @@
+dnl
+dnl AC_LIBRARY_NET: #Id: net.m4,v 1.5 1997/11/09 21:36:54 jhawk Exp #
+dnl
+dnl Written by John Hawkinson <jhawk@mit.edu>. This code is in the Public
+dnl Domain.
+dnl
+dnl This test is for network applications that need socket() and
+dnl gethostbyname() -ish functions. Under Solaris, those applications need to
+dnl link with "-lsocket -lnsl". Under IRIX, they should *not* link with
+dnl "-lsocket" because libsocket.a breaks a number of things (for instance:
+dnl gethostbyname() under IRIX 5.2, and snoop sockets under most versions of
+dnl IRIX).
+dnl
+dnl Unfortunately, many application developers are not aware of this, and
+dnl mistakenly write tests that cause -lsocket to be used under IRIX. It is
+dnl also easy to write tests that cause -lnsl to be used under operating
+dnl systems where neither are necessary (or useful), such as SunOS 4.1.4, which
+dnl uses -lnsl for TLI.
+dnl
+dnl This test exists so that every application developer does not test this in
+dnl a different, and subtly broken fashion.
+dnl
+dnl It has been argued that this test should be broken up into two seperate
+dnl tests, one for the resolver libraries, and one for the libraries necessary
+dnl for using Sockets API. Unfortunately, the two are carefully intertwined and
+dnl allowing the autoconf user to use them independantly potentially results in
+dnl unfortunate ordering dependancies -- as such, such component macros would
+dnl have to carefully use indirection and be aware if the other components were
+dnl executed. Since other autoconf macros do not go to this trouble, and almost
+dnl no applications use sockets without the resolver, this complexity has not
+dnl been implemented.
+dnl
+dnl The check for libresolv is in case you are attempting to link statically
+dnl and happen to have a libresolv.a lying around (and no libnsl.a).
+dnl
+AC_DEFUN([AC_LIBRARY_NET], [
+ # Most operating systems have gethostbyname() in the default searched
+ # libraries (i.e. libc):
+ AC_CHECK_FUNC(gethostbyname, ,
+ # Some OSes (eg. Solaris) place it in libnsl:
+ AC_CHECK_LIB(nsl, gethostbyname, ,
+ # Some strange OSes (SINIX) have it in libsocket:
+ AC_CHECK_LIB(socket, gethostbyname, ,
+ # Unfortunately libsocket sometimes depends on libnsl.
+ # AC_CHECK_LIB's API is essentially broken so the following
+ # ugliness is necessary:
+ AC_CHECK_LIB(socket, gethostbyname,
+ LIBS="-lsocket -lnsl $LIBS",
+ AC_CHECK_LIB(resolv, gethostbyname),
+ -lnsl)
+ )
+ )
+ )
+ AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, ,
+ AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl)))
+ ])
Oops, something went wrong.

0 comments on commit 396d0db

Please sign in to comment.