wilkenstein / redis-mock-java

An in-memory implementation of redis in Java
MIT License
33 stars 12 forks source link

redis-mock-java

An in-memory redis-compatible implementation written in pure Java. Part of the Rarefied Redis Project.

Status

Build Status

Installation

maven

<dependency>
  <groupId>org.rarefiedredis.redis</groupId>
  <artifactId>redis-java</artifactId>
  <version>0.0.5</version>
</dependency>

Usage

TODO

Thread Safety

The RedisMock object is itself completely thread-safe. Every command is synchronized on the object, so the internal data structures can never run into concurrent modifications.

Because of the way RedisMock operates, we cannot, say, clone this object and maintain thread-safety. If two RedisMock objects were to share the same internal data structures, it would be possible for a concurrent modification to occur between the two objects. Thus, clone is unsupported on RedisMock.

Supported Commands

The goal is to have one-to-one feature parity with all redis commands, so that this implementation can simply be dropped into an existing redis-backed codebase. Redis has a lot of commands! Some of them are easy, and some are quite complex.

Version 0.1.0 should have support for almost all redis commands, minus the hyperloglog commands and the key-movement commands, such as migrate.

To find out what commands a particular version of redis-java supports, run the following commands:

TODO

Contributing

All contributions welcome! Issues or Pull Requests. For PRs, mvn test must succeed and test the new code before the PR will be considered.

Testing

This project uses maven.

To run the full test suite from source, issue the standard maven command:

$ mvn test

Roadmap

Versions