Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding documentation for upgrades from 1.0.0 to 2.0.0

  • Loading branch information...
commit f689d58aa6e0983f84f1cad6fcf0749417b1993a 1 parent 1b9f41a
@aaw authored
Showing with 17 additions and 9 deletions.
  1. +16 −8 HISTORY.md
  2. +1 −1  VERSION
View
24 HISTORY.md
@@ -1,7 +1,15 @@
-## 2.0.0 (unreleased)
+## 2.0.0 (11/30/2012)
* Changed the underlying storage from Redis hashes to bitstrings [simonkro](https://github.com/simonkro)
- TODO: put example upgrade script here.
+ If you have existing counters stored from version 1.0.0, you can upgrade them with
+ the following method:
+
+ def upgrade_1_2(counter, redis)
+ return if redis.type(counter) == "string"
+ sketch = redis.hgetall(counter)
+ redis.del(counter)
+ sketch.each{ |key, value| redis.setrange(counter, key.to_i, value.to_i.chr) }
+ end
* Moved main counter implementation from `HyperLogLog` to the class `HyperLogLog::Counter`
@@ -16,12 +24,12 @@
versions of this library, you can upgrade them with something like the
following method:
- def upgrade(counter, redis)
- return if redis.type(counter) == "hash"
- values = redis.zrange(counter, 0, -1, {withscores: true})
- redis.del(counter)
- values.each { |key, value| redis.hset(counter, key, value.to_i) }
- end
+ def upgrade(counter, redis)
+ return if redis.type(counter) == "hash"
+ values = redis.zrange(counter, 0, -1, {withscores: true})
+ redis.del(counter)
+ values.each { |key, value| redis.hset(counter, key, value.to_i) }
+ end
* Added union_store command, which stores the results of a union for querying
or combining with other sets later
View
2  VERSION
@@ -1 +1 @@
-1.0.0
Please sign in to comment.
Something went wrong with that request. Please try again.