Merge upstreams
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 29 Aug 2015 17:04:48 +0000 (11:04 -0600)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 29 Aug 2015 17:04:48 +0000 (11:04 -0600)
14 files changed:
README.md
debian/README.Debian
debian/changelog
debian/control
debian/copyright
debian/docs
debian/upload.sh [changed mode: 0755->0644]
debian/watch
doc/memcache.html [new file with mode: 0644]
doc/memstore.html [new file with mode: 0644]
memcache/README.md
memcache/memcache.lisp
memcache/specials.lisp
src/compress.lisp

index b0cfe3fd43a3022c66359e5a2a43593934858e2d..9df746a474a764dd271a7d073111ad4282395e3f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -8,9 +8,9 @@ Written by Kevin M. Rosenberg <kevin@rosenberg.net>
 Downloads
 ---------
 
-* The web site for memstore is [http://memstore.b9.com/](http://memstore.b9.com/)
-* A git repository is available at [http://gitpub.b9.com/memstore.git](http://gitpub.b9.com/memstore.git)
-* Releases are available for download at [http://files.b9.com/memstore/](http://files.b9.com/memstore/)
+* The web site for memstore is [http://memstore.kpe.io/](http://memstore.kpe.io/)
+* A git repository is available at [http://gitpub.kpe.io/memstore.git](http://gitpub.kpe.io/memstore.git)
+* Releases are available for download at [http://files.kpe.io/memstore/](http://files.kpe.io/memstore/)
 
 Prerequisites
 -------------
@@ -24,7 +24,7 @@ been heavily refactored. For more information on the changes in
 memcache, see [memcache](memcache.html).
 
 This library also requires Common Lisp libraries of 
-[kmrcl](http://gitpub.b9.com/kmrcl.git),
+[kmrcl](http://gitpub.kpe.io/kmrcl.git),
 [cl-store](http://common-lisp.net/project/cl-store/),
 [flexi-streams](http://weitz.de/flexi-streams/),
 and [zlib](http://common-lisp.net/project/zlib/).
index a1e87392b0250cc4ec0dc3935474701b2b404658..a9a91654008aeea441977412c28b31d29eed4c47 100644 (file)
@@ -1,7 +1,7 @@
 This library also requires the Common Lisp
-cl-store and zlib libraries. Currently, these
+cl-store, salza2, and chipz libraries. Currently, these
 libraries will have to be manually downloaded
 and installed as Debian does not have those
 libraries in its repository.
 
- -- Kevin M. Rosenberg <kmr@debian.org>, Fri,  1 Jul 2011 23:15:07 -0600
+ -- Kevin M. Rosenberg <kmr@debian.org>, Tue,  5 Jul 2011 08:14:42 -0600
index a2c9c201a10d36de256ba6730e7251605ff32279..5b1f88232bff0cf4f1c303f70bf54373c91917c7 100644 (file)
@@ -1,3 +1,9 @@
+cl-memstore (1.1.0-1) unstable; urgency=low
+
+  * New upstream
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Tue, 05 Jul 2011 08:17:22 -0600
+
 cl-memstore (1.0-1) unstable; urgency=low
 
   * Initial version
index 34fb937746184c573dafdd1fdd755a41fd43740a..b9bbd07b0f965a31fb02cb574db258d7ce640504 100644 (file)
@@ -5,9 +5,9 @@ Maintainer: Kevin M. Rosenberg <kmr@debian.org>
 Build-Depends-Indep: dh-lisp
 Build-Depends: debhelper (>= 7.0.0)
 Standards-Version: 3.9.2.0
-Homepage: http://files.b9.com/memstore/
-Vcs-Git: git://git.b9.com/memstore.git
-Vcs-Browser: http://git.b9.com/?p=memstore.git
+Homepage: http://files.kpe.io/memstore/
+Vcs-Git: git://git.kpe.io/memstore.git
+Vcs-Browser: http://git.kpe.io/?p=memstore.git
 
 Package: cl-memstore
 Architecture: all
index d4e8e28cc5632f78332975fb5cec75ad23b78288..3f132734eae9eafb42d02c9fdae1b7b711f5fb6a 100644 (file)
@@ -1,7 +1,7 @@
 This package was debianized by Kevin M. Rosenberg <kmr@debian.org> on
 Fri, 01 Jul 2011 23:07:47 -0600
 
-It was downloaded from http://files.b9.com/memstore
+It was downloaded from http://files.kpe.io/memstore
 
 Upstream Author: Kevin M. Rosenberg <kevin@rosenberg.net>
 
index 49d454d4afd2d7a957f47777248fd5398b35e4f3..84a799465185029b715709c0a3fccaa03b590b65 100644 (file)
@@ -1,3 +1,4 @@
-README.md
+doc/memstore.html
+doc/memcache.html
 debian/README.Debian
 
old mode 100755 (executable)
new mode 100644 (file)
index 09f07e2..5f2b1dc
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 
-dup memstore -Ufiles.b9.com -D/home/ftp/memstore  -C"(umask 022; cd /srv/www/html/memstore; make install)" -su $*
+dup memstore -Ufiles.kpe.io -D/home/ftp/memstore  -C"(umask 022; cd /srv/www/html/memstore; make install)" -su $*
 
 
 
index 001f3716568616d3a970791c2128e3e63109d708..9e3cb3541e935e91ce221114aa96882c4136be29 100644 (file)
@@ -1,2 +1,2 @@
 version=3
-http://files.b9.com/memstore/memstore-([\d\.]*)\.tar\.gz
+http://files.kpe.io/memstore/memstore-([\d\.]*)\.tar\.gz
diff --git a/doc/memcache.html b/doc/memcache.html
new file mode 100644 (file)
index 0000000..065b26a
--- /dev/null
@@ -0,0 +1,55 @@
+<h1>Memcache</h1>
+
+<p><em>Library for memcached protocol</em></p>
+
+<p>Author: Kevin Rosenberg <a href="&#109;&#x61;&#x69;l&#x74;&#x6F;:&#x6B;&#x65;&#118;&#x69;&#x6E;&#64;&#114;o&#x73;&#101;&#110;&#x62;&#101;&#114;&#x67;&#46;&#x6E;&#x65;&#116;">&#x6B;&#x65;&#118;&#x69;&#x6E;&#64;&#114;o&#x73;&#101;&#110;&#x62;&#101;&#114;&#x67;&#46;&#x6E;&#x65;&#116;</a>, based on the
+<code>cl-memcached</code> library by Abhijit 'quasi' Rao and 
+Chaitanya Gupta .</p>
+
+<p>Date Started: July 1, 2011</p>
+
+<h2>Overview</h2>
+
+<p>This package is based on the <code>cl-memcached</code> library.  It is
+substantially modified for use with the
+<a href="http://memstore.kpe.io">memstore</a> library. The primary areas of
+additional functionality are:</p>
+
+<ul>
+<li><p>Support for flags field with get and set functions.
+This is required as memstore stores bit flags denoting
+how the data is serialized. That information is required
+to deserialize the data.</p></li>
+<li><p>Support for additional memcached functionality, such as
+the gets command for retrieving CAS identifiers. The CAS
+unique ID is used for the added <code>:cas</code> storage command.
+Other storage commands newly supported are <code>:append</code> and 
+<code>:prepend</code>.</p></li>
+<li><p>All communication now uses <code>mc-send-command</code> function with
+transparently supports writing strings with <code>write-byte</code>.
+This allows <code>usocket</code> to be used on other Lisp implementations
+besides AllegroCL. Because cl-memcached used <code>write-string</code>
+with usocket-stream, only AllegroCL was supported.
+By sending all data as (unsigned-byte 8), all Lisp implementions
+supported by <code>usocket</code> are now supported with <code>memcached</code>.</p></li>
+<li><p>Encapsulated reading and writing to socket stream to avoid
+handling \#return characters in high-level code.</p></li>
+<li><p>Changes to support the change in statistics fields with membase.
+Some fields were no longer present. Also, membase 1.7 has
+187 statistics fields versus the 20 fields supported in
+<code>cl-memcached</code>. New function <code>mc-get-stat</code> allows to retrieving
+any statistics field by name.</p></li>
+<li><p>More robust <code>print-object</code> functions to avoid errors if fields
+in statistics are not present.</p></li>
+<li><p>Removed compatibility functions in <code>compat.lisp</code> by using the
+<a href="http://gitpub.kpe.io/kmrcl.git"><code>kmrcl</code></a> library to provide those
+functions as well as utilitizing other <code>kmrcl</code> functions to simplify
+code.</p></li>
+<li><p>Added functions to support all memcached API commands,
+such as <code>flush_all</code> and <code>version</code>.</p></li>
+<li><p>Support for the <code>moreply</code> command argument accepted by
+many commands.</p></li>
+<li><p>Support the <code>noreply</code> argument that many API commands accept.</p></li>
+<li><p>Write nearly the entire code base for improved
+clarity, robustness, and efficiency.</p></li>
+</ul>
diff --git a/doc/memstore.html b/doc/memstore.html
new file mode 100644 (file)
index 0000000..4c246c7
--- /dev/null
@@ -0,0 +1,55 @@
+<h1>Memstore</h1>
+
+<p><em>A high-level interface for the memcached and membase servers</em></p>
+
+<p>Written by Kevin M. Rosenberg <a href="&#x6D;&#97;&#x69;&#108;&#x74;&#111;:&#x6B;&#x65;&#118;&#x69;&#x6E;&#64;&#114;&#x6F;&#115;&#x65;&#110;&#x62;e&#x72;&#103;&#x2E;&#110;&#101;&#116;">&#x6B;&#x65;&#118;&#x69;&#x6E;&#64;&#114;&#x6F;&#115;&#x65;&#110;&#x62;e&#x72;&#103;&#x2E;&#110;&#101;&#116;</a></p>
+
+<h2>Downloads</h2>
+
+<ul>
+<li>The web site for memstore is <a href="http://memstore.kpe.io/">http://memstore.kpe.io/</a></li>
+<li>A git repository is available at <a href="http://gitpub.kpe.io/memstore.git">http://gitpub.kpe.io/memstore.git</a></li>
+<li>Releases are available for download at <a href="http://files.kpe.io/memstore/">http://files.kpe.io/memstore/</a></li>
+</ul>
+
+<h2>Prerequisites</h2>
+
+<p>This library incorporates a heavily modified version of <code>cl-memcached</code>
+version 0.4.1. The primary need for the modification is to support the
+<code>flags</code> field supported by the memcached server. The flag field is
+used to store information required to deserialize the object data from
+memcached. In addition to adding the <code>flags</code> field, the library has
+been heavily refactored. For more information on the changes in
+memcache, see <a href="memcache.html">memcache</a>.</p>
+
+<p>This library also requires Common Lisp libraries of 
+<a href="http://gitpub.kpe.io/kmrcl.git">kmrcl</a>,
+<a href="http://common-lisp.net/project/cl-store/">cl-store</a>,
+<a href="http://weitz.de/flexi-streams/">flexi-streams</a>,
+and <a href="http://common-lisp.net/project/zlib/">zlib</a>.</p>
+
+<h2>Overview</h2>
+
+<p>Memstore allows efficient storing of simple objects as well as
+easy storing of complex objects and optional compression.</p>
+
+<p>When storing an object, if the object is a string then that is
+directly written to the memcached server. For non-strings, an attempt
+to made to write the object to a string with <code>*print-readably*</code> bound
+to <code>t</code>. If that succeeds, then the string is converted to a vector of
+octets. If that fails, the <code>cl-store</code> is used to serialize that object
+to a vector of octets.</p>
+
+<p>Next, optional compression is applied to the octets. First, the
+<code>*compression-enabled*</code> flag is checked to see if compression is
+enabled. Next, the length of the objects is compared to
+<code>*compression-threshold*</code>. Only objects larger than
+<code>*compression-threshold*</code> will be compressed. For objects that qualify
+for compression, the size of the compressed object is compared to the
+length of the uncompressed object to decide if the object is shrunk
+enough to make the compression worthwhile.</p>
+
+<p>The <code>flags</code> parameter to cl-memcached stores whether cl-store or
+write-to-string is used to serialize the object and whether
+compression is applied. <code>mem-restore</code> uses those flags to determine
+how to reconstruct the object.</p>
index a6845d976045660ae677b738e67df90e194b3b7f..c38888bd39b5354744ee3f6b43e01fbcf7ba1d49 100644 (file)
@@ -14,7 +14,7 @@ Overview
 
 This package is based on the `cl-memcached` library.  It is
 substantially modified for use with the
-[memstore](http://memstore.b9.com) library. The primary areas of
+[memstore](http://memstore.kpe.io) library. The primary areas of
 additional functionality are:
 
 * Support for flags field with get and set functions.
@@ -49,7 +49,7 @@ additional functionality are:
   in statistics are not present.
 
 * Removed compatibility functions in `compat.lisp` by using the
-  [`kmrcl`](http://gitpub.b9.com/kmrcl.git) library to provide those
+  [`kmrcl`](http://gitpub.kpe.io/kmrcl.git) library to provide those
   functions as well as utilitizing other `kmrcl` functions to simplify
   code.
 
index c5593cbc7ee712a69529275104b20544a7ea4aa2..231065b5c461e6bd5afe9365c3f892a73e908cf3 100644 (file)
@@ -34,7 +34,7 @@
   (print-unreadable-object (mc stream :type t :identity t)
     (format stream "~A on ~A:~A ~AMB"
             (when (slot-boundp mc 'name) (name mc))
-            (when (slot-boundp mc 'ip) (ip mc))
+            (when (slot-boundp mc 'host) (host mc))
             (when (slot-boundp mc 'port) (port mc))
             (when (and (slot-boundp mc 'memcached-server-storage-size)
                        (numberp (slot-value mc 'memcached-server-storage-size)))
        (setf (slot-value memcache 'memcached-server-storage-size) (mc-stats-limit-maxbytes stats))
        (setf (slot-value memcache 'memcached-server-storage-size) -1))))
 
-(defun make-memcache-instance (&key (ip "127.0.0.1") (port 11211)
+(defun make-memcache-instance (&key (host "127.0.0.1") (port 11211)
                                  (name "Memcache") (pool-size 5))
   "Creates an instance of class MEMCACHE which represents a memcached server."
-  (make-instance 'memcache :name name :ip ip :port port :pool-size pool-size))
+  (make-instance 'memcache :name name :host host :port port :pool-size pool-size))
 
 
 (defmacro with-pool-maybe ((stream memcache use-pool) &body body)
@@ -414,7 +414,7 @@ information about each slot"
   (mc-pool-grow memcache))
 
 (defun mc-make-pool-item (&key (memcache *memcache*))
-  (handler-case (usocket:socket-connect (ip memcache) (port memcache) :element-type '(unsigned-byte 8))
+  (handler-case (usocket:socket-connect (host memcache) (port memcache) :element-type '(unsigned-byte 8))
     (usocket:socket-error (e) (error 'memcached-server-unreachable :error e))
     (error (e) (error 'cannot-make-pool-object :error e))))
 
index 2006f37dac0f01f922c58d602f0248cd1e46b165..5a0f9a878de6c83180980018cd1a5ef4bfd9d601 100644 (file)
@@ -97,12 +97,12 @@ limit-maxbytes             mc-stats-limit-maxbytes           Number of bytes thi
     :reader name
     :type simple-string
     :documentation "Name of this Memcache instance")
-   (ip
-    :initarg :ip
+   (host
+    :initarg :host
     :initform "127.0.0.1"
-    :accessor ip
+    :accessor host
     :type simple-string
-    :documentation "The IP address of the Memcached server this instance represents")
+    :documentation "The host name of the Memcached server for this instance.")
    (port
     :initarg :port
     :initform 11211
index c3920f7edabb6e168e396d39757a75a1a94445cd..ff0d80ee951d082be5bdae9b3ac0dcfcd6eb365c 100644 (file)
@@ -14,6 +14,9 @@
 ;; KMR: zlib gives compression errors on random tests:
 ;;    indices outside of input array size
 ;; Using salza2 as default compressor
+(defun compress-zlib (data)
+  (zlib:compress data :fixed))
+
 (defun compress (data)
   (let ((comp (salza2:compress-data
                data
@@ -22,8 +25,9 @@
 
 ;; KMR: zlib appears to works fine with salza2 zlib compressor, but
 ;; moving to chipz as default decompressor as appears better supported
-;;(defun uncompress-zlib (data)
-;;  (zlib:uncompress data))
+
+(defun uncompress-zlib (data)
+  (zlib:uncompress data))
 
 (defun uncompress (data)
   (chipz:decompress nil 'chipz:zlib data))