diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..406a0db --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2011-2016 Troy D. Hanson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 511c531..0000000 --- a/LICENSE.txt +++ /dev/null @@ -1,31 +0,0 @@ -LICENSE AND DISCLAIMER - -Copyright (c) 2011 The Johns Hopkins University/Applied Physics Laboratory - -This software was developed at The Johns Hopkins University/Applied Physics -Laboratory ("JHU/APL") that is the author thereof under the “work made for -hire” provisions of the copyright law. Permission is hereby granted, free of -charge, to any person obtaining a copy of this software and associated -documentation (the “Software”), to use the Software without restriction, -including without limitation the rights to copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -others to do so, subject to the following conditions: - - 1. This LICENSE AND DISCLAIMER, including the copyright notice, shall be - included in all copies of the Software, including copies of substantial - portions of the Software; - - 2. JHU/APL assumes no obligation to provide support of any kind with regard - to the Software. This includes no obligation to provide assistance in using - the Software nor to provide updated versions of the Software; and - - 3. THE SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT ANY - EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES INCLUDING, BUT NOT - LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - AND NONINFRINGEMENT ARE HEREBY DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND - LIABILITY OF USING THE SOFTWARE. USERS ARE ADVISED TO TEST THE SOFTWARE - THOROUGHLY BEFORE RELYING ON IT. IN NO EVENT SHALL THE JOHNS HOPKINS - UNIVERSITY BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING, WITHOUT - LIMITATION, ANY LOST PROFITS, LOST SAVINGS OR OTHER INCIDENTAL OR - CONSEQUENTIAL DAMAGES, ARISING OUT OF THE USE OR INABILITY TO USE THE - SOFTWARE.” diff --git a/Makefile.am b/Makefile.am index e4acdba..1af72fa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,11 +1 @@ SUBDIRS = src utils - -if HAVE_PYTHON -if HAVE_SSL -SUBDIRS += kvpy -endif -endif - -if HAVE_PERL -SUBDIRS += kvperl -endif diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..6717d8c --- /dev/null +++ b/autogen.sh @@ -0,0 +1 @@ +autoreconf -ifv diff --git a/kvjava/KVJava.c b/bindings/kvjava/KVJava.c similarity index 100% rename from kvjava/KVJava.c rename to bindings/kvjava/KVJava.c diff --git a/kvjava/KVJava.java b/bindings/kvjava/KVJava.java similarity index 100% rename from kvjava/KVJava.java rename to bindings/kvjava/KVJava.java diff --git a/kvjava/Makefile b/bindings/kvjava/Makefile similarity index 100% rename from kvjava/Makefile rename to bindings/kvjava/Makefile diff --git a/kvjava/TODO b/bindings/kvjava/TODO similarity index 100% rename from kvjava/TODO rename to bindings/kvjava/TODO diff --git a/kvjava/TestKVJava.java b/bindings/kvjava/TestKVJava.java similarity index 100% rename from kvjava/TestKVJava.java rename to bindings/kvjava/TestKVJava.java diff --git a/kvperl/.gitignore b/bindings/kvperl/.gitignore similarity index 100% rename from kvperl/.gitignore rename to bindings/kvperl/.gitignore diff --git a/kvperl/Changes b/bindings/kvperl/Changes similarity index 100% rename from kvperl/Changes rename to bindings/kvperl/Changes diff --git a/kvperl/KVSpool.xs b/bindings/kvperl/KVSpool.xs similarity index 100% rename from kvperl/KVSpool.xs rename to bindings/kvperl/KVSpool.xs diff --git a/kvperl/MANIFEST b/bindings/kvperl/MANIFEST similarity index 100% rename from kvperl/MANIFEST rename to bindings/kvperl/MANIFEST diff --git a/kvperl/Makefile b/bindings/kvperl/Makefile similarity index 100% rename from kvperl/Makefile rename to bindings/kvperl/Makefile diff --git a/kvperl/Makefile.PL b/bindings/kvperl/Makefile.PL similarity index 100% rename from kvperl/Makefile.PL rename to bindings/kvperl/Makefile.PL diff --git a/kvperl/README b/bindings/kvperl/README similarity index 100% rename from kvperl/README rename to bindings/kvperl/README diff --git a/kvperl/const-c.inc b/bindings/kvperl/const-c.inc similarity index 100% rename from kvperl/const-c.inc rename to bindings/kvperl/const-c.inc diff --git a/kvperl/const-xs.inc b/bindings/kvperl/const-xs.inc similarity index 100% rename from kvperl/const-xs.inc rename to bindings/kvperl/const-xs.inc diff --git a/kvperl/fallback/const-c.inc b/bindings/kvperl/fallback/const-c.inc similarity index 100% rename from kvperl/fallback/const-c.inc rename to bindings/kvperl/fallback/const-c.inc diff --git a/kvperl/fallback/const-xs.inc b/bindings/kvperl/fallback/const-xs.inc similarity index 100% rename from kvperl/fallback/const-xs.inc rename to bindings/kvperl/fallback/const-xs.inc diff --git a/kvperl/lib/KVSpool.pm b/bindings/kvperl/lib/KVSpool.pm similarity index 100% rename from kvperl/lib/KVSpool.pm rename to bindings/kvperl/lib/KVSpool.pm diff --git a/kvperl/ppport.h b/bindings/kvperl/ppport.h similarity index 100% rename from kvperl/ppport.h rename to bindings/kvperl/ppport.h diff --git a/kvperl/t/TestKVSpool.t b/bindings/kvperl/t/TestKVSpool.t similarity index 100% rename from kvperl/t/TestKVSpool.t rename to bindings/kvperl/t/TestKVSpool.t diff --git a/kvpy/.gitignore b/bindings/kvpy/.gitignore similarity index 100% rename from kvpy/.gitignore rename to bindings/kvpy/.gitignore diff --git a/kvpy/Makefile b/bindings/kvpy/Makefile similarity index 100% rename from kvpy/Makefile rename to bindings/kvpy/Makefile diff --git a/kvpy/build.py b/bindings/kvpy/build.py similarity index 100% rename from kvpy/build.py rename to bindings/kvpy/build.py diff --git a/kvpy/kvspool.c b/bindings/kvpy/kvspool.c similarity index 100% rename from kvpy/kvspool.c rename to bindings/kvpy/kvspool.c diff --git a/kvpy/tests/README b/bindings/kvpy/tests/README similarity index 100% rename from kvpy/tests/README rename to bindings/kvpy/tests/README diff --git a/kvpy/tests/read.py b/bindings/kvpy/tests/read.py similarity index 100% rename from kvpy/tests/read.py rename to bindings/kvpy/tests/read.py diff --git a/kvpy/tests/read_all.py b/bindings/kvpy/tests/read_all.py similarity index 100% rename from kvpy/tests/read_all.py rename to bindings/kvpy/tests/read_all.py diff --git a/kvpy/tests/runtest.sh b/bindings/kvpy/tests/runtest.sh similarity index 100% rename from kvpy/tests/runtest.sh rename to bindings/kvpy/tests/runtest.sh diff --git a/kvpy/tests/speed.py b/bindings/kvpy/tests/speed.py similarity index 100% rename from kvpy/tests/speed.py rename to bindings/kvpy/tests/speed.py diff --git a/kvpy/tests/write.py b/bindings/kvpy/tests/write.py similarity index 100% rename from kvpy/tests/write.py rename to bindings/kvpy/tests/write.py diff --git a/bootstrap b/bootstrap deleted file mode 100755 index 00b6fa2..0000000 --- a/bootstrap +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# THIS SCRIPT IS FOR PROJECT MAINTAINER ONLY -# It is executed only to generate "configure" - -set -x -if [ ! -d config ]; then mkdir config; fi -aclocal -I config -autoheader -automake --foreign --add-missing --copy -autoconf diff --git a/configure.ac b/configure.ac index 05b20a2..724635d 100644 --- a/configure.ac +++ b/configure.ac @@ -33,24 +33,6 @@ AC_CHECK_LIB(rdkafka,rd_kafka_new, AM_CONDITIONAL(HAVE_RDKAFKA,true), AM_CONDITIONAL(HAVE_RDKAFKA,false)) -# is libnnctl installed -AC_CHECK_LIB(nnctl,nnctl_exec, - AM_CONDITIONAL(HAVE_NNCTL,true), - AM_CONDITIONAL(HAVE_NNCTL,false), -lnanomsg) - -# is SSL installed. Not sure why Python build requires -AC_CHECK_LIB(ssl,SSL_library_init, - AM_CONDITIONAL(HAVE_SSL,true), - AM_CONDITIONAL(HAVE_SSL,false)) - -AX_PYTHON_DEVEL(>= '2.4') -AM_CONDITIONAL(HAVE_PYTHON,test "x$pythonexists" = "xyes") - -AC_CHECK_PROG(PERL,perl,perl) -AX_PROG_PERL_VERSION([5.10.1], - AM_CONDITIONAL(HAVE_PERL,test "x$PERL" != "x"), - AM_CONDITIONAL(HAVE_PERL,false)) - AC_CONFIG_FILES(Makefile src/Makefile utils/Makefile) AC_OUTPUT diff --git a/doc/AUTHOR.NOTES b/doc/AUTHOR.NOTES deleted file mode 100644 index 9b7aee9..0000000 --- a/doc/AUTHOR.NOTES +++ /dev/null @@ -1,11 +0,0 @@ -asciidoc -a toc2 kvspool.txt -cp kvspool.html *.png /tmp -cd .. -git checkout gh-pages -#git clean -d -f -cp /tmp/kvspool.html index.html -cp /tmp/*.png . -git add index.html *.png -git commit -m "page update" -git push - diff --git a/doc/CREDITS b/doc/CREDITS deleted file mode 100644 index 1ae91e9..0000000 --- a/doc/CREDITS +++ /dev/null @@ -1,8 +0,0 @@ -kvspool was developed in 2011 by Troy D. Hanson - -Special thanks to: -JHU/APL OTT -Trevor Adams -JT Halbert -Jeff James -Nick Clote diff --git a/doc/LICENSE.txt b/doc/LICENSE.txt index adaf318..406a0db 100644 --- a/doc/LICENSE.txt +++ b/doc/LICENSE.txt @@ -1,31 +1,22 @@ -LICENSE AND DISCLAIMER +The MIT License (MIT) -Copyright (c) 2011 The Johns Hopkins University/Applied Physics Laboratory +Copyright (c) 2011-2016 Troy D. Hanson -This software was developed at The Johns Hopkins University/Applied Physics -Laboratory ("JHU/APL") that is the author thereof under the "work made for -hire" provisions of the copyright law. Permission is hereby granted, free of -charge, to any person obtaining a copy of this software and associated -documentation (the "Software"), to use the Software without restriction, -including without limitation the rights to copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -others to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: - 1. This LICENSE AND DISCLAIMER, including the copyright notice, shall be - included in all copies of the Software, including copies of substantial - portions of the Software; +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. - 2. JHU/APL assumes no obligation to provide support of any kind with regard - to the Software. This includes no obligation to provide assistance in using - the Software nor to provide updated versions of the Software; and +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. - 3. THE SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT ANY - EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES INCLUDING, BUT NOT - LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - AND NONINFRINGEMENT ARE HEREBY DISCLAIMED. USERS ASSUME THE ENTIRE RISK AND - LIABILITY OF USING THE SOFTWARE. USERS ARE ADVISED TO TEST THE SOFTWARE - THOROUGHLY BEFORE RELYING ON IT. IN NO EVENT SHALL THE JOHNS HOPKINS - UNIVERSITY BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING, WITHOUT - LIMITATION, ANY LOST PROFITS, LOST SAVINGS OR OTHER INCIDENTAL OR - CONSEQUENTIAL DAMAGES, ARISING OUT OF THE USE OR INABILITY TO USE THE - SOFTWARE. diff --git a/doc/future.txt b/doc/future.txt deleted file mode 100644 index 5c56164..0000000 --- a/doc/future.txt +++ /dev/null @@ -1,78 +0,0 @@ -Design concepts for "v2" rewrite of kvspool -------------------------------------------- -1. Support multi-writer, multi-reader from same spool -2. Use a memory-mapped file for reading/writing spool data so that: - (1) I/O occurs through shared memory even without a ramdisk, while - (2) data is still persisted back to disk -3. Support for multi-writers requires a synchronization mechanism. - (1) This is one of the functions of the "control file". - (a) this file exists alongside the spool data file - (b) by flock'ing it (or fcntl lock on a region of it), one writer - can gain exclusive write (which applies to the spool data file too); - a second level of record-locking using fcntl lock on the spool data - file can act as a redundant safeguard - (c) the control file has the min and max sequence number in it - (d) the max sequence number is just the "frame number" of the next - frame to be written - (e) the min sequence number is incremented (sometimes by an increment - greater than one) when the writer is overwriting previous frame(s). - It's purpose is explained under the "Support for multi-readers" later. - (f) The offset of the min and max frames are also stored - (g) The control block may also contain a few time-series on write rates. - (i) It would also be possible to place the control file into the data - spool itself, in which case its a "control block" of fixed size - at the beginning; this would eliminate some failure modes and - reduce the file descriptor bookkeeping by one -4. Spool data file is a single, large, circular data buffer - (a) It is pre-created prior to data being written to reserve the space - (b) This requires that it be a non-sparse file - (c) It is used as a cyclic buffer - (d) When the end is reached, a new frame may not quite fit at the end, - in which case the frame starts at the beginning of the file; but - this requires that the frame's content-length may differ from its - stored length (so that the frame that ends up at the end of the - buffer can be adjusted to consume the full remaining space). - (e) Thus the frame format is - (1) sequence number - (2) storage length - (3) content length - (4) data (in JSON) - (f) The single large data file replaces the kvspool-v1 approach - where ten sequenced files contain the spool data, and old files - are deleted as new files are written. The v1 logic requires - detection of new files in the spool, although its advantegous - in that read/write through standard (non-mmap) calls does not - swap in the entire data spool as the v2 approach may tend to do -5. Support for multi-readers - (1) since readers that are inactive for a long time may get to the point - that their next read position is potentially invalid (due to a - writer wraparound that puts a new frame into the read area), - (a) the reader that is entering the 'read' state will first - lock the control file, acquire the minimum sequence number - to see if its exceeded its own read position - (i) If it has, then the reader has experienced frame loss - and adjusts its next-read-position to the min frame - (ii) if not, the reader can then record-lock the spool - data and read the next frame - (iii) note that if the max sequence number is the same as - the read position, then the reader needs to block - (by placing inotify on the control file, unlocking - and going into a select/epoll). - (2) If reader needs persistence for its read position it should - store its own sequence number and identifier in the spool dir -6. Key repetition - (1) if every frame tends to repeat the same keys or a subset of a - relatively small set of keys (as is typically expected) then - the keys are highly redundant and suitable for compression - (2) one option is to use indexes instead of the keys themselves; - seperately a key-store would be maintained with a table - (into which the index points) whose value is the offset on - disk of the key itself. Adds complexity but saves a lot of - space. Alternatively some kind of run time compression on - the frames is possible particularly if some kind of frame - history is kept (e.g. as with video, key frames at intervals - would keep the whole keys, into which the indexes would point - for subsequent frames; this would complicate the cyclic - wraparound logic for recycling old frames by pushing it to - key-frame boundaries - diff --git a/doc/index.html b/doc/index.html index 16f3c83..ac4f5cf 100644 --- a/doc/index.html +++ b/doc/index.html @@ -4,7 +4,7 @@ -kvspool: a tool for data streams +kvspool data stream tools