Manorrock Eagle - Redis

Manorrock Eagle delivers you with a Key-Value Store abstraction.

License

License

Categories

Categories

Redis Data Databases
GroupId

GroupId

com.manorrock.eagle
ArtifactId

ArtifactId

eagle-redis
Last Version

Last Version

21.5.0
Release Date

Release Date

Type

Type

jar
Description

Description

Manorrock Eagle - Redis
Manorrock Eagle delivers you with a Key-Value Store abstraction.

Download eagle-redis

How to add to project

<!-- https://jarcasting.com/artifacts/com.manorrock.eagle/eagle-redis/ -->
<dependency>
    <groupId>com.manorrock.eagle</groupId>
    <artifactId>eagle-redis</artifactId>
    <version>21.5.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.manorrock.eagle/eagle-redis/
implementation 'com.manorrock.eagle:eagle-redis:21.5.0'
// https://jarcasting.com/artifacts/com.manorrock.eagle/eagle-redis/
implementation ("com.manorrock.eagle:eagle-redis:21.5.0")
'com.manorrock.eagle:eagle-redis:jar:21.5.0'
<dependency org="com.manorrock.eagle" name="eagle-redis" rev="21.5.0">
  <artifact name="eagle-redis" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.manorrock.eagle', module='eagle-redis', version='21.5.0')
)
libraryDependencies += "com.manorrock.eagle" % "eagle-redis" % "21.5.0"
[com.manorrock.eagle/eagle-redis "21.5.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.manorrock.eagle : eagle-common jar 21.5.0
io.lettuce : lettuce-core jar 5.3.1.RELEASE

test (3)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.6.0
org.junit.jupiter : junit-jupiter-params jar 5.6.0
org.junit.jupiter : junit-jupiter-engine jar 5.6.0

Project Modules

There are no modules declared in this project.

Manorrock Eagle

This project delivers you with a Key-Value Store abstraction.

Our current list of features/implementations available:

  1. Azure Cosmos DB implementation
  2. Azure Blob Storage implementation
  3. Azure File Share implementation
  4. Azure KeyVault Certificate implementation
  5. Azure KeyVault Key implementation
  6. Azure KeyVault Secret implementation
  7. ChronicleMap implementation
  8. Factory functionality
  9. Filesystem implementation
  10. Hazelcast implementation
  11. Oracle Coherence implementation
  12. Path implementation
  13. Redis implementation

Our list of things under consideration:

  1. CDI integration
  2. JDBC implementation
  3. Spring Boot starter

Getting started

  1. Creating the Key-Value Store
  2. Storing a value.
  3. Getting a value.
  4. Removing a value.

Creating the Key-Value Store

Pick one of the Key-Value Store implementations you want to use above.

If you would have taken the Filesystem implementation the code to create the Key-Value Store would look like the code below.

  File baseDirectory = new File("mybasedir");
  FilesystemKeyValueStore store = new FilesystemKeyValueStore(baseDirectory);

Storing a value

The example below illustrates how to store a value.

  store.put("mykey", "myvalue");

Getting a value

The example below illustrates how to store a value.

  String value = store.get("mykey");

Deleting a value

The example below illustrates how to delete a value.

  store.delete("mykey");

Using your own key type

By default the Key-Value Store is setup to convert a String based key to the underlying data type the Key-Value Store expects. You can deliver your own key mapper that can convert from a data-type of your choice to the underlying data type.

The example below illustrates how to deliver a Long based key mapper.

  public class LongToStringMapper implements KeyValueStoreMapper<Long, String> {

      public String to(Long from) {
        return from.toString();
      }

      public Long from(String to) {
        return Long.valueOf(to);
      }
  }

  store.setKeyMapper(new LongToStringMapper());

Using your own value type

The only difference with the section above is setting the value mapper instead of the key mapper.

The method to set the value mapper is seen below.

  store.setValueMapper(new LongtoStringMapper());

Versions

Version
21.5.0
21.4.1