Skip to content

Commit

Permalink
Merge pull request #2 from valkey-io/feature-change-name-to-valkey-java
Browse files Browse the repository at this point in the history
Chore: change name to valkey-java
  • Loading branch information
yangbodong22011 authored Jul 24, 2024
2 parents 6c23176 + aca3a00 commit 7c7358c
Show file tree
Hide file tree
Showing 703 changed files with 3,517 additions and 3,583 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
path: |
~/.m2/repository
/var/cache/apt
key: jackey-${{hashFiles('**/pom.xml')}}
key: valkey-java-${{hashFiles('**/pom.xml')}}
- name: Maven offline
run: |
mvn -q dependency:go-offline
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Copyright (c) 2021-2023, Redis, inc.
Copyright (c) 2024-now, jackey contributors
Copyright (c) 2024-now, valkey-java contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
49 changes: 27 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
# Jackey
Jackey is [Valkey](https://github.com/valkey-io/valkey)'s Java client, derived from [Jedis](https://github.com/redis/jedis) fork, dedicated to maintaining simplicity and high performance.
# Valkey-Java
valkey-java is [Valkey](https://github.com/valkey-io/valkey)'s Java client, derived from [Jedis](https://github.com/redis/jedis) fork, dedicated to maintaining simplicity and high performance.


# Getting started
Add the following dependencies to your `pom.xml` file:
```
<dependency>
<groupId>io.jackey</groupId>
<artifactId>jackey</artifactId>
<version>5.2.0</version>
<groupId>io.valkey</groupId>
<artifactId>valkey-java</artifactId>
<version>5.3.0(coming soon)</version>
</dependency>
```

## Connect to Valkey

```java
public class JackeyTest {
public class ValkeyTest {
// can be static or singleton, thread safety.
private static io.jackey.JedisPool jedisPool;
private static io.valkey.JedisPool jedisPool;

public static void main(String[] args) {
io.jackey.JedisPoolConfig config = new io.jackey.JedisPoolConfig();
io.valkey.JedisPoolConfig config = new io.valkey.JedisPoolConfig();
// It is recommended that you set maxTotal = maxIdle = 2*minIdle for best performance
config.setMaxTotal(32);
config.setMaxIdle(32);
config.setMinIdle(16);
jedisPool = new io.jackey.JedisPool(config, <host>, <port>, <timeout>, <password>);
try (io.jackey.Jedis jedis = jedisPool.getResource()) {
jedisPool = new io.valkey.JedisPool(config, < host >, <port >, <timeout >, <password >);
try (io.valkey.Jedis jedis = jedisPool.getResource()) {
jedis.set("key", "value");
System.out.println(jedis.get("key"));
} catch (Exception e) {
Expand All @@ -37,18 +38,20 @@ public class JackeyTest {
```

## Connect to the Valkey cluster

```java
import java.util.HashSet;
import java.util.Set;
import io.jackey.HostAndPort;

public class JackeyClusterTest {
import io.valkey.HostAndPort;

public class ValkeyClusterTest {
private static final int DEFAULT_TIMEOUT = 2000;
private static final int DEFAULT_REDIRECTIONS = 5;
private static io.jackey.JedisCluster jc; // be static or singleton, thread safety.
private static io.valkey.JedisCluster jc; // be static or singleton, thread safety.

public static void main(String[] args) {
io.jackey.ConnectionPoolConfig config = new io.jackey.ConnectionPoolConfig();
io.valkey.ConnectionPoolConfig config = new io.valkey.ConnectionPoolConfig();
// It is recommended that you set maxTotal = maxIdle = 2*minIdle for best performance
// In cluster mode, please note that each business machine will contain up to maxTotal links,
// and the total number of connections = maxTotal * number of machines
Expand All @@ -58,11 +61,11 @@ public class JackeyClusterTest {

Set<HostAndPort> jedisClusterNode = new HashSet<HostAndPort>();
jedisClusterNode.add(new HostAndPort(host, port));
jc = new io.jackey.JedisCluster(jedisClusterNode, DEFAULT_TIMEOUT, DEFAULT_TIMEOUT, DEFAULT_REDIRECTIONS,
jc = new io.valkey.JedisCluster(jedisClusterNode, DEFAULT_TIMEOUT, DEFAULT_TIMEOUT, DEFAULT_REDIRECTIONS,
password, null, config);

jc.set("key", "value"); // Note that there is no need to call jc.close() here,
// the connection recycling is actively completed internally.
// the connection recycling is actively completed internally.
System.out.println(jc.get("key"));

jc.close(); // when app exit, close the resource.
Expand All @@ -71,19 +74,21 @@ public class JackeyClusterTest {
```

## Connect using TLS method

```java
import java.io.FileInputStream;
import java.io.InputStream;
import java.security.KeyStore;
import java.security.SecureRandom;

import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;

import org.apache.commons.pool2.impl.GenericObjectPoolConfig;

public class JackeySSLTest {
public class ValkeySSLTest {
private static SSLSocketFactory createTrustStoreSSLSocketFactory(String jksFile) throws Exception {
KeyStore trustStore = KeyStore.getInstance("jks");
InputStream inputStream = null;
Expand All @@ -105,11 +110,11 @@ public class JackeySSLTest {

public static void main(String[] args) throws Exception {
// When you don't have a jks file, just set sslSocketFactory to null.
final SSLSocketFactory sslSocketFactory = createTrustStoreSSLSocketFactory(<your_jks_file_path>);
io.jackey.JedisPool jedisPool = new io.jackey.JedisPool(new GenericObjectPoolConfig(), <host>,
<port>, <timeout>, <password>, 0, true, sslSocketFactory, null, null);
final SSLSocketFactory sslSocketFactory = createTrustStoreSSLSocketFactory( < your_jks_file_path >);
io.valkey.JedisPool jedisPool = new io.valkey.JedisPool(new GenericObjectPoolConfig(), < host >,
<port >, <timeout >, <password >, 0, true, sslSocketFactory, null, null);

try (io.jackey.Jedis jedis = pool.getResource()) {
try (io.valkey.Jedis jedis = pool.getResource()) {
jedis.set("key", "value");
System.out.println(jedis.get("key"));
} catch (Exception e) {
Expand Down
19 changes: 9 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<groupId>io.jackey</groupId>
<artifactId>jackey</artifactId>
<groupId>io.valkey</groupId>
<artifactId>valkey-java</artifactId>
<version>5.2.0</version>

<name>jackey</name>
<name>valkey-java</name>
<description>Java client for valkey.</description>
<url>https://github.com/valkey-io/jackey</url>
<url>https://github.com/valkey-io/valkey-java</url>

<licenses>
<license>
<name>MIT</name>
<url>https://github.com/valkey-io/jackey/blob/master/LICENSE</url>
<url>https://github.com/valkey-io/valkey-java/blob/master/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
Expand All @@ -27,20 +27,19 @@
</developers>

<scm>
<url>https://github.com/valkey-io/jackey</url>
<connection>scm:https://github.com/valkey-io/jackey.git</connection>
<developerConnection>scm:git:https://github.com/valkeykey-io/jackey.git</developerConnection>
<url>https://github.com/valkey-io/valkey-java</url>
<connection>scm:https://github.com/valkey-io/valkey-java.git</connection>
<developerConnection>scm:git:https://github.com/valkeykey-io/valkey-java.git</developerConnection>
<tag>HEAD</tag>
</scm>

<issueManagement>
<system>github</system>
<url>https://github.com/valkey-io/jackey/issues</url>
<url>https://github.com/valkey-io/valkey-java/issues</url>
</issueManagement>

<properties>
<java.version>1.8</java.version>
<jackey.module.name>io.jackey</jackey.module.name>
<slf4j.version>1.7.36</slf4j.version>
<resilience4j.version>1.7.1</resilience4j.version>
<jackson.version>2.17.0</jackson.version>
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/io/jackey/commands/ProtocolCommand.java

This file was deleted.

18 changes: 0 additions & 18 deletions src/main/java/io/jackey/commands/RedisModuleCommands.java

This file was deleted.

16 changes: 0 additions & 16 deletions src/main/java/io/jackey/commands/RedisModulePipelineCommands.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.jackey;
package io.valkey;

import java.io.Closeable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.jackey;
package io.valkey;

import java.io.Closeable;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.jackey;
package io.valkey;

public abstract class BinaryJedisPubSub extends JedisPubSubBase<byte[]> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.jackey;
package io.valkey;

public abstract class BinaryJedisShardedPubSub extends JedisShardedPubSubBase<byte[]> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.jackey;
package io.valkey;

public abstract class Builder<T> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
package io.jackey;
package io.valkey;

import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;

import io.jackey.exceptions.JedisDataException;
import io.jackey.resps.AccessControlLogEntry;
import io.jackey.resps.AccessControlUser;
import io.jackey.resps.ClusterShardInfo;
import io.jackey.resps.ClusterShardNodeInfo;
import io.jackey.resps.CommandDocument;
import io.jackey.resps.CommandInfo;
import io.jackey.resps.GeoRadiusResponse;
import io.jackey.resps.LCSMatchResult;
import io.jackey.resps.LatencyHistoryInfo;
import io.jackey.resps.LatencyLatestInfo;
import io.jackey.resps.LibraryInfo;
import io.jackey.resps.ScanResult;
import io.jackey.resps.StreamConsumerFullInfo;
import io.jackey.resps.StreamConsumerInfo;
import io.jackey.resps.StreamConsumersInfo;
import io.jackey.resps.StreamEntry;
import io.jackey.resps.StreamFullInfo;
import io.jackey.resps.StreamGroupFullInfo;
import io.jackey.resps.StreamGroupInfo;
import io.jackey.resps.StreamInfo;
import io.jackey.resps.StreamPendingEntry;
import io.jackey.resps.StreamPendingSummary;
import io.jackey.resps.Tuple;
import io.jackey.resps.*;
import io.jackey.resps.LCSMatchResult.MatchedPosition;
import io.jackey.resps.LCSMatchResult.Position;
import io.jackey.util.DoublePrecision;
import io.jackey.util.JedisByteHashMap;
import io.jackey.util.KeyValue;
import io.jackey.util.SafeEncoder;
import io.valkey.exceptions.JedisDataException;
import io.valkey.resps.AccessControlLogEntry;
import io.valkey.resps.AccessControlUser;
import io.valkey.resps.ClusterShardInfo;
import io.valkey.resps.ClusterShardNodeInfo;
import io.valkey.resps.CommandDocument;
import io.valkey.resps.CommandInfo;
import io.valkey.resps.GeoRadiusResponse;
import io.valkey.resps.LCSMatchResult;
import io.valkey.resps.LatencyHistoryInfo;
import io.valkey.resps.LatencyLatestInfo;
import io.valkey.resps.LibraryInfo;
import io.valkey.resps.ScanResult;
import io.valkey.resps.StreamConsumerFullInfo;
import io.valkey.resps.StreamConsumerInfo;
import io.valkey.resps.StreamConsumersInfo;
import io.valkey.resps.StreamEntry;
import io.valkey.resps.StreamFullInfo;
import io.valkey.resps.StreamGroupFullInfo;
import io.valkey.resps.StreamGroupInfo;
import io.valkey.resps.StreamInfo;
import io.valkey.resps.StreamPendingEntry;
import io.valkey.resps.StreamPendingSummary;
import io.valkey.resps.Tuple;
import io.valkey.resps.LCSMatchResult.MatchedPosition;
import io.valkey.resps.LCSMatchResult.Position;
import io.valkey.util.DoublePrecision;
import io.valkey.util.JedisByteHashMap;
import io.valkey.util.KeyValue;
import io.valkey.util.SafeEncoder;

public final class BuilderFactory {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.jackey;
package io.valkey;

public class ClientCapaConfig {
private final boolean disabled;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.jackey;
package io.valkey;

import java.util.Arrays;
import java.util.HashSet;
import io.jackey.exceptions.JedisValidationException;
import io.valkey.exceptions.JedisValidationException;

public final class ClientSetInfoConfig {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.jackey;
package io.valkey;

import io.jackey.commands.ProtocolCommand;
import io.jackey.exceptions.JedisClusterOperationException;
import io.jackey.util.JedisClusterCRC16;
import io.valkey.commands.ProtocolCommand;
import io.valkey.exceptions.JedisClusterOperationException;
import io.valkey.util.JedisClusterCRC16;

public class ClusterCommandArguments extends CommandArguments {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package io.jackey;
package io.valkey;

import java.util.Set;

import io.jackey.Protocol.Command;
import io.jackey.Protocol.Keyword;
import io.jackey.commands.ProtocolCommand;
import io.jackey.params.ScanParams;
import io.jackey.resps.ScanResult;
import io.jackey.util.JedisClusterHashTag;
import io.jackey.util.KeyValue;
import io.valkey.Protocol.Command;
import io.valkey.Protocol.Keyword;
import io.valkey.commands.ProtocolCommand;
import io.valkey.params.ScanParams;
import io.valkey.resps.ScanResult;
import io.valkey.util.JedisClusterHashTag;
import io.valkey.util.KeyValue;

public class ClusterCommandObjects extends CommandObjects {

Expand Down
Loading

0 comments on commit 7c7358c

Please sign in to comment.