Skip to content

Commit

Permalink
Merge branch 'main' into node/integ_yipin_dump_restore_valkey-9
Browse files Browse the repository at this point in the history
Signed-off-by: Yi-Pin Chen <yi-pin.chen@improving.com>
  • Loading branch information
yipin-chen authored Aug 15, 2024
2 parents 10541d0 + 6335548 commit 7a43c0b
Show file tree
Hide file tree
Showing 39 changed files with 3,908 additions and 1,583 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/install-shared-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ runs:
shell: bash
if: "${{ inputs.os == 'amazon-linux' }}"
run: |
yum install -y gcc pkgconfig openssl openssl-devel which curl gettext --allowerasing
yum install -y gcc pkgconfig openssl openssl-devel which curl gettext tar --allowerasing
- name: Install Rust toolchain and protoc
if: "${{ !contains(inputs.target, 'musl') }}"
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#### Changes
* Java: Added PUBSUB CHANNELS, NUMPAT and NUMSUB commands ([#2105](https://github.com/valkey-io/valkey-glide/pull/2105))
* Java: Added binary support for custom command ([#2109](https://github.com/valkey-io/valkey-glide/pull/2109))
* Node: Added SSCAN command ([#2132](https://github.com/valkey-io/valkey-glide/pull/2132))
* Node: Added FUNCTION KILL command ([#2114](https://github.com/valkey-io/valkey-glide/pull/2114))
* Node: Update all commands to use `async` ([#2110](https://github.com/valkey-io/valkey-glide/pull/2110))
* Node: Added XAUTOCLAIM command ([#2108](https://github.com/valkey-io/valkey-glide/pull/2108))
* Node: Added XPENDING commands ([#2085](https://github.com/valkey-io/valkey-glide/pull/2085))
* Node: Added HSCAN command ([#2098](https://github.com/valkey-io/valkey-glide/pull/2098/))
* Node: Added XINFO CONSUMERS command ([#2093](https://github.com/valkey-io/valkey-glide/pull/2093))
* Node: Added HRANDFIELD command ([#2096](https://github.com/valkey-io/valkey-glide/pull/2096))
* Node: Added FUNCTION STATS commands ([#2082](https://github.com/valkey-io/valkey-glide/pull/2082))
Expand Down Expand Up @@ -52,8 +58,10 @@
* Node: Added ZMPOP command ([#1994](https://github.com/valkey-io/valkey-glide/pull/1994))
* Node: Added ZINCRBY command ([#2009](https://github.com/valkey-io/valkey-glide/pull/2009))
* Node: Added BZMPOP command ([#2018](https://github.com/valkey-io/valkey-glide/pull/2018))
* Node: Added XRANGE command ([#2069](https://github.com/valkey-io/valkey-glide/pull/2069))
* Node: Added PFMERGE command ([#2053](https://github.com/valkey-io/valkey-glide/pull/2053))
* Node: Added WATCH and UNWATCH commands ([#2076](https://github.com/valkey-io/valkey-glide/pull/2076))
* Node: Added WAIT command ([#2113](https://github.com/valkey-io/valkey-glide/pull/2113))
* Node: Added DUMP and RESTORE commands ([#2126](https://github.com/valkey-io/valkey-glide/pull/2126))
* Node: Added ZLEXCOUNT command ([#2022](https://github.com/valkey-io/valkey-glide/pull/2022))
* Node: Added ZREMRANGEBYLEX command ([#2025](https://github.com/valkey-io/valkey-glide/pull/2025))
Expand All @@ -71,6 +79,7 @@
* Node: Added XGROUP CREATE & XGROUP DESTROY commands ([#2084](https://github.com/valkey-io/valkey-glide/pull/2084))
* Node: Added BZPOPMAX & BZPOPMIN command ([#2077]((https://github.com/valkey-io/valkey-glide/pull/2077))
* Node: Added XGROUP CREATECONSUMER & XGROUP DELCONSUMER commands ([#2088](https://github.com/valkey-io/valkey-glide/pull/2088))
* Node: Added GETEX command ([#2107]((https://github.com/valkey-io/valkey-glide/pull/2107))

#### Breaking Changes
* Node: (Refactor) Convert classes to types ([#2005](https://github.com/valkey-io/valkey-glide/pull/2005))
Expand Down
11 changes: 8 additions & 3 deletions benchmarks/node/node_benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import { parse } from "path";
import percentile from "percentile";
import { RedisClientType, createClient, createCluster } from "redis";
import { stdev } from "stats-lite";
import { GlideClient, GlideClusterClient, Logger } from "valkey-glide";
import {
GlideClient,
GlideClusterClient,
GlideString,
Logger,
} from "valkey-glide";
import {
generateKeyGet,
generateKeySet,
Expand All @@ -34,8 +39,8 @@ const runningTasks: Promise<void>[] = [];
const benchJsonResults: object[] = [];

interface IAsyncClient {
set: (key: string, value: string) => Promise<string | "OK" | null>;
get: (key: string) => Promise<string | null>;
set: (key: string, value: string) => Promise<GlideString | "OK" | null>;
get: (key: string) => Promise<GlideString | null>;
}

function chooseAction(): ChosenAction {
Expand Down
24 changes: 12 additions & 12 deletions glide-core/THIRD_PARTY_LICENSES_RUST
Original file line number Diff line number Diff line change
Expand Up @@ -4240,7 +4240,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: core-foundation-sys:0.8.6
Package: core-foundation-sys:0.8.7

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -11903,7 +11903,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: js-sys:0.3.69
Package: js-sys:0.3.70

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -13582,7 +13582,7 @@ the following restrictions:

----

Package: mio:1.0.1
Package: mio:1.0.2

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -14802,7 +14802,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: object:0.36.2
Package: object:0.36.3

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -21689,7 +21689,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: serde:1.0.204
Package: serde:1.0.207

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -21918,7 +21918,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: serde_derive:1.0.204
Package: serde_derive:1.0.207

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -23021,7 +23021,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: syn:2.0.72
Package: syn:2.0.74

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -27070,7 +27070,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: wasm-bindgen:0.2.92
Package: wasm-bindgen:0.2.93

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -27299,7 +27299,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: wasm-bindgen-backend:0.2.92
Package: wasm-bindgen-backend:0.2.93

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -27528,7 +27528,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: wasm-bindgen-macro:0.2.92
Package: wasm-bindgen-macro:0.2.93

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -27757,7 +27757,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: wasm-bindgen-macro-support:0.2.92
Package: wasm-bindgen-macro-support:0.2.93

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -27986,7 +27986,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: wasm-bindgen-shared:0.2.92
Package: wasm-bindgen-shared:0.2.93

The following copyrights and licenses were found in the source code of this package:

Expand Down
5 changes: 3 additions & 2 deletions glide-core/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mod value_conversion;
use tokio::sync::mpsc;

pub const HEARTBEAT_SLEEP_DURATION: Duration = Duration::from_secs(1);

pub const DEFAULT_RETRIES: u32 = 3;
pub const DEFAULT_RESPONSE_TIMEOUT: Duration = Duration::from_millis(250);
pub const DEFAULT_CONNECTION_ATTEMPT_TIMEOUT: Duration = Duration::from_millis(250);
pub const DEFAULT_PERIODIC_CHECKS_INTERVAL: Duration = Duration::from_secs(60);
Expand Down Expand Up @@ -450,7 +450,8 @@ async fn create_cluster_client(
None => Some(DEFAULT_PERIODIC_CHECKS_INTERVAL),
};
let mut builder = redis::cluster::ClusterClientBuilder::new(initial_nodes)
.connection_timeout(INTERNAL_CONNECTION_TIMEOUT);
.connection_timeout(INTERNAL_CONNECTION_TIMEOUT)
.retries(DEFAULT_RETRIES);
if read_from_replicas {
builder = builder.read_from_replicas();
}
Expand Down
24 changes: 12 additions & 12 deletions java/THIRD_PARTY_LICENSES_JAVA
Original file line number Diff line number Diff line change
Expand Up @@ -4469,7 +4469,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: core-foundation-sys:0.8.6
Package: core-foundation-sys:0.8.7

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -12798,7 +12798,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: js-sys:0.3.69
Package: js-sys:0.3.70

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -14477,7 +14477,7 @@ the following restrictions:

----

Package: mio:1.0.1
Package: mio:1.0.2

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -15697,7 +15697,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: object:0.36.2
Package: object:0.36.3

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -22584,7 +22584,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: serde:1.0.204
Package: serde:1.0.207

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -22813,7 +22813,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: serde_derive:1.0.204
Package: serde_derive:1.0.207

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -23916,7 +23916,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: syn:2.0.72
Package: syn:2.0.74

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -27965,7 +27965,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: wasm-bindgen:0.2.92
Package: wasm-bindgen:0.2.93

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -28194,7 +28194,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: wasm-bindgen-backend:0.2.92
Package: wasm-bindgen-backend:0.2.93

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -28423,7 +28423,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: wasm-bindgen-macro:0.2.92
Package: wasm-bindgen-macro:0.2.93

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -28652,7 +28652,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: wasm-bindgen-macro-support:0.2.92
Package: wasm-bindgen-macro-support:0.2.93

The following copyrights and licenses were found in the source code of this package:

Expand Down Expand Up @@ -28881,7 +28881,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

Package: wasm-bindgen-shared:0.2.92
Package: wasm-bindgen-shared:0.2.93

The following copyrights and licenses were found in the source code of this package:

Expand Down
51 changes: 51 additions & 0 deletions java/client/src/main/java/glide/api/BaseClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
import static command_request.CommandRequestOuterClass.RequestType.PfAdd;
import static command_request.CommandRequestOuterClass.RequestType.PfCount;
import static command_request.CommandRequestOuterClass.RequestType.PfMerge;
import static command_request.CommandRequestOuterClass.RequestType.PubSubChannels;
import static command_request.CommandRequestOuterClass.RequestType.PubSubNumPat;
import static command_request.CommandRequestOuterClass.RequestType.PubSubNumSub;
import static command_request.CommandRequestOuterClass.RequestType.Publish;
import static command_request.CommandRequestOuterClass.RequestType.RPop;
import static command_request.CommandRequestOuterClass.RequestType.RPush;
Expand Down Expand Up @@ -4495,6 +4498,54 @@ public CompletableFuture<String> publish(
});
}

@Override
public CompletableFuture<String[]> pubsubChannels() {
return commandManager.submitNewCommand(
PubSubChannels,
new String[0],
response -> castArray(handleArrayResponse(response), String.class));
}

@Override
public CompletableFuture<GlideString[]> pubsubChannelsBinary() {
return commandManager.submitNewCommand(
PubSubChannels,
new GlideString[0],
response -> castArray(handleArrayResponseBinary(response), GlideString.class));
}

@Override
public CompletableFuture<String[]> pubsubChannels(@NonNull String pattern) {
return commandManager.submitNewCommand(
PubSubChannels,
new String[] {pattern},
response -> castArray(handleArrayResponse(response), String.class));
}

@Override
public CompletableFuture<GlideString[]> pubsubChannels(@NonNull GlideString pattern) {
return commandManager.submitNewCommand(
PubSubChannels,
new GlideString[] {pattern},
response -> castArray(handleArrayResponseBinary(response), GlideString.class));
}

@Override
public CompletableFuture<Long> pubsubNumPat() {
return commandManager.submitNewCommand(PubSubNumPat, new String[0], this::handleLongResponse);
}

@Override
public CompletableFuture<Map<String, Long>> pubsubNumSub(@NonNull String[] channels) {
return commandManager.submitNewCommand(PubSubNumSub, channels, this::handleMapResponse);
}

@Override
public CompletableFuture<Map<GlideString, Long>> pubsubNumSub(@NonNull GlideString[] channels) {
return commandManager.submitNewCommand(
PubSubNumSub, channels, this::handleBinaryStringMapResponse);
}

@Override
public CompletableFuture<String> watch(@NonNull String[] keys) {
return commandManager.submitNewCommand(Watch, keys, this::handleStringResponse);
Expand Down
6 changes: 6 additions & 0 deletions java/client/src/main/java/glide/api/GlideClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ public CompletableFuture<Object> customCommand(@NonNull String[] args) {
return commandManager.submitNewCommand(CustomCommand, args, this::handleObjectOrNullResponse);
}

@Override
public CompletableFuture<Object> customCommand(@NonNull GlideString[] args) {
return commandManager.submitNewCommand(
CustomCommand, args, this::handleBinaryObjectOrNullResponse);
}

@Override
public CompletableFuture<Object[]> exec(@NonNull Transaction transaction) {
if (transaction.isBinaryOutput()) {
Expand Down
Loading

0 comments on commit 7a43c0b

Please sign in to comment.