Commit Graph

24 Commits

Author SHA1 Message Date
Daniele Alessandri 00000fde4e Add new command: GEORADIUS (Redis 3.2.0). 2016-05-24 22:30:06 +02:00
Daniele Alessandri b2284d015f Add new command: GEODIST (Redis 3.2.0). 2016-05-24 17:09:35 +02:00
Daniele Alessandri c4e0044269 Add new command: GEOPOS (Redis 3.2.0). 2016-05-24 17:09:33 +02:00
Daniele Alessandri 0b6b3b2558 Add new command: GEOHASH (Redis 3.2.0). 2016-05-24 16:00:08 +02:00
Daniele Alessandri 7ef9619f5c Add new command: GEOADD (Redis 3.2.0). 2016-05-24 16:00:06 +02:00
Daniele Alessandri 3362e474b6 Add new command: BITFIELD (Redis 3.2.0). 2016-05-24 16:00:04 +02:00
Daniele Alessandri f43433baf1 Add new command: HSTRLEN (Redis 3.2.0).
Also bump the unstable profile version to 3.2.
2015-07-29 11:50:20 +02:00
Daniele Alessandri 8dd9893a2f Run php-cs-fixer with new configuration. 2015-07-24 23:17:02 +02:00
Daniele Alessandri c436e01353 Fix cluster strategy to handle variadic EXISTS (Redis >= 3.0.3). 2015-07-24 18:30:00 +02:00
Daniele Alessandri 6590c44a27 Run php-cs-fixer against codebase in src/ and tests/. 2015-07-24 18:04:42 +02:00
Michal Humpula af48b30398 add zrevrangebylex command 2015-01-23 23:06:40 +01:00
Daniele Alessandri 45e351be79 [phpdoc] Fix formatting of phpdoc headers. 2014-07-27 23:59:37 +02:00
Daniele Alessandri 2ff8c37104 Redesign the whole internals for clustering.
This change actually had a positive impact on the design of the whole
internals for clustering which is now cleaner and easier to maintain.
It is still far from perfect, but we also have to keep performances in
consideration so we can say that we ended up with a good compromise.

Previously Predis assigned an hash to each command instance which was
computed from its key, now we changed approach and the library caches
the slot assigned to each command. This works for both our client-side
sharding cluster and the upcoming redis-cluster, but the former is the
one that needed most changes.

The PredisCluster aggregate connection now only takes an instance of
StrategyInterface, which in turn wraps the chosen distributor. After
all, in order to be able to calculate the assigned slot for a command
or key, the cluster strategy must have access to the distributor that
manages the distribution of the whole keyspace. Nothing really changes
in terms of configurability as it is still possible to decide which
distributor to use for client-side sharding, it is simply different:

  $distributor = new Predis\Cluster\Distribution\KetamaRing();
  $strategy = new Predis\Cluster\PredisStrategy($distributor);
  $cluster = new Predis\Connection\Aggregate\PredisCluster($strategy);

As for the RedisCluster aggregate connection, the only change is that
the mathematical operation of calculating the assigned slot from a key
has been completely moved inside the cluster strategy instance.

The strategy for redis-cluster does not use external distributors so
trying to StrategyInterface::getDistributor() will throw an exception.
This may change in future releases, but this is not a priority since
redis-cluster relies on a fixed, well-defined distribution mechanism.
2014-07-22 18:13:12 +02:00
Daniele Alessandri 940326e5bd New command: ZREMRANGEBYLEX (Redis 2.8.9). 2014-06-09 15:35:28 +02:00
Daniele Alessandri ea32f74512 New command: ZRANGEBYLEX (Redis 2.8.9). 2014-06-09 15:26:17 +02:00
Daniele Alessandri 8dbac3dd73 New command: ZLEXCOUNT (Redis 2.8.9). 2014-06-09 15:17:36 +02:00
Daniele Alessandri 2aa0b071fc New commands: PFADD, PFCOUNT, PFMERGE (Redis 2.8.9).
Many thanks to @rubensayshi for his initial commits on this in #163,
but I had to start from scratch for the master branch first.
2014-05-30 11:32:39 +02:00
Alexey Kupershtokh f784dfad84 Enable INCRBYFLOAT in cluster mode 2014-05-28 13:00:24 +02:00
Daniele Alessandri e23fd9bea8 Use redis-cluster rules for empty key tags for client-side sharding.
This commit represents a breaking change when the first occurrence of
"{}" is found in a key because it will produce a different hash than
previous versions of Predis, thus leading to a different partitioning.

If you really need to stick with the old behavior, you can subclass
Predis\Cluster\PredisStrategy and override extractKeyTag() using the
old implementation of this method and pass the strategy instance when
initializing the cluster connection via client options.
2014-02-11 19:06:47 +01:00
Daniele Alessandri 2a6409590c Run php-cs against test suite. 2013-12-17 12:55:56 +01:00
Daniele Alessandri b253bdc41e [tests] Improve the basic framework of our test suite.
We now have a base test case class for Predis (namely PredisTestCase)
grouping various commonly used utility methods shared by all of the
tests in the suite, greatly improving reusability.
2013-11-30 19:38:27 +01:00
Daniele Alessandri 09895f27bf Rename command class for scripting to Predis\Command\ScriptCommand.
We also changed our wording to indentify this kind of abstraction so
instead of using "scripted commands" (kind of broken English) we now
use "scriptable commands".
2013-11-30 12:43:21 +01:00
Daniele Alessandri 2a5483df90 Reorganize the Predis\Profile namespace.
The profile factory code has been extrapolated into a the new class
Predis\Profile\Factory (final and with only static methods).
2013-11-22 12:01:29 +01:00
Daniele Alessandri e6f1788e27 Rename interfaces and classes in the Predis\Cluster namespace.
A few methods were renamed accordingly for consistency
2013-11-16 16:21:27 +01:00