Skip to content

Commit

Permalink
Merge branch 'main' into python/integ_yipin_function-load
Browse files Browse the repository at this point in the history
  • Loading branch information
yipin-chen committed Jun 27, 2024
2 parents 6d7a295 + 7b6b220 commit 71b7818
Show file tree
Hide file tree
Showing 257 changed files with 23,421 additions and 2,501 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/ort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
PYTHON_ATTRIBUTIONS: "python/THIRD_PARTY_LICENSES_PYTHON"
NODE_ATTRIBUTIONS: "node/THIRD_PARTY_LICENSES_NODE"
RUST_ATTRIBUTIONS: "glide-core/THIRD_PARTY_LICENSES_RUST"
JAVA_ATTRIBUTIONS: "java/THIRD_PARTY_LICENSES_JAVA"
steps:
- name: Set the release version
shell: bash
Expand Down Expand Up @@ -158,14 +159,28 @@ jobs:
with:
folder_path: "${{ github.workspace }}/glide-core"

### Java ###

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 11

- name: Run ORT tools for Java
uses: ./.github/workflows/run-ort-tools
with:
folder_path: "${{ github.workspace }}/java"

### Process results ###

- name: Check for diff
run: |
cp python/ort_results/NOTICE_DEFAULT $PYTHON_ATTRIBUTIONS
cp node/ort_results/NOTICE_DEFAULT $NODE_ATTRIBUTIONS
cp glide-core/ort_results/NOTICE_DEFAULT $RUST_ATTRIBUTIONS
GIT_DIFF=`git diff $PYTHON_ATTRIBUTIONS $NODE_ATTRIBUTIONS $RUST_ATTRIBUTIONS`
cp java/ort_results/NOTICE_DEFAULT $JAVA_ATTRIBUTIONS
GIT_DIFF=`git diff $PYTHON_ATTRIBUTIONS $NODE_ATTRIBUTIONS $RUST_ATTRIBUTIONS $JAVA_ATTRIBUTIONS`
if [ -n "$GIT_DIFF" ]; then
echo "FOUND_DIFF=true" >> $GITHUB_ENV
else
Expand All @@ -191,7 +206,7 @@ jobs:
git config --global user.email "glide-for-redis@amazon.com"
git config --global user.name "ort-bot"
git checkout -b ${BRANCH_NAME}
git add $PYTHON_ATTRIBUTIONS $NODE_ATTRIBUTIONS $RUST_ATTRIBUTIONS
git add $PYTHON_ATTRIBUTIONS $NODE_ATTRIBUTIONS $RUST_ATTRIBUTIONS $JAVA_ATTRIBUTIONS
git commit -m "Updated attribution files"
git push --set-upstream origin ${BRANCH_NAME} -f
title="Updated attribution files for ${BRANCH_NAME}"
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Python: Added OBJECT FREQ command ([#1472](https://github.com/aws/glide-for-redis/pull/1472))
* Python: Added OBJECT IDLETIME command ([#1474](https://github.com/aws/glide-for-redis/pull/1474))
* Python: Added GEOSEARCH command ([#1482](https://github.com/aws/glide-for-redis/pull/1482))
* Python: Added GEOSEARCHSTORE command ([#1581](https://github.com/aws/glide-for-redis/pull/1581))
* Node: Added RENAMENX command ([#1483](https://github.com/aws/glide-for-redis/pull/1483))
* Python: Added OBJECT REFCOUNT command ([#1485](https://github.com/aws/glide-for-redis/pull/1485))
* Python: Added RENAMENX command ([#1492](https://github.com/aws/glide-for-redis/pull/1492))
Expand All @@ -13,27 +14,56 @@
* Python: Added XLEN command ([#1503](https://github.com/aws/glide-for-redis/pull/1503))
* Python: Added LASTSAVE command ([#1509](https://github.com/aws/glide-for-redis/pull/1509))
* Python: Added GETDEL command ([#1514](https://github.com/aws/glide-for-redis/pull/1514))
* Python: Added GETRANGE command ([#1585](https://github.com/aws/glide-for-redis/pull/1585))
* Python: Added ZINTER, ZUNION commands ([#1478](https://github.com/aws/glide-for-redis/pull/1478))
* Python: Added SINTERCARD command ([#1511](https://github.com/aws/glide-for-redis/pull/1511))
* Python: Added SORT command ([#1439](https://github.com/aws/glide-for-redis/pull/1439))
* Node: Added OBJECT ENCODING command ([#1518](https://github.com/aws/glide-for-redis/pull/1518), [#1559](https://github.com/aws/glide-for-redis/pull/1559))
* Python: Added LMOVE and BLMOVE commands ([#1536](https://github.com/aws/glide-for-redis/pull/1536))
* Node: Added SUNIONSTORE command ([#1549](https://github.com/aws/glide-for-redis/pull/1549))
* Python: Added SUNION command ([#1583](https://github.com/aws/glide-for-redis/pull/1583))
* Node: Added PFCOUNT command ([#1545](https://github.com/aws/glide-for-redis/pull/1545))
* Node: Added OBJECT FREQ command ([#1542](https://github.com/aws/glide-for-redis/pull/1542), [#1559](https://github.com/aws/glide-for-redis/pull/1559))
* Node: Added LINSERT command ([#1544](https://github.com/aws/glide-for-redis/pull/1544))
* Node: Added XLEN command ([#1555](https://github.com/aws/glide-for-redis/pull/1555))
* Node: Added ZINTERCARD command ([#1553](https://github.com/aws/glide-for-redis/pull/1553))
* Python: Added ZINCBY command ([#1586](https://github.com/aws/glide-for-redis/pull/1586))
* Python: Added LMPOP and BLMPOP commands ([#1547](https://github.com/aws/glide-for-redis/pull/1547))
* Python: Added HSTRLEN command ([#1564](https://github.com/aws/glide-for-redis/pull/1564))
* Python: Added MSETNX command ([#1565](https://github.com/aws/glide-for-redis/pull/1565))
* Python: Added MOVE command ([#1566](https://github.com/aws/glide-for-redis/pull/1566))
* Python: Added EXPIRETIME, PEXPIRETIME commands ([#1587](https://github.com/aws/glide-for-redis/pull/1587))
* Python: Added LSET command ([#1584](https://github.com/aws/glide-for-redis/pull/1584))
* Node: Added OBJECT IDLETIME command ([#1567](https://github.com/aws/glide-for-redis/pull/1567))
* Node: Added OBJECT REFCOUNT command ([#1568](https://github.com/aws/glide-for-redis/pull/1568))
* Python: Added SETBIT command ([#1571](https://github.com/aws/glide-for-redis/pull/1571))
* Python: Added SRandMember command ([#1578](https://github.com/aws/glide-for-redis/pull/1578))
* Python: Added GETBIT command ([#1575](https://github.com/aws/glide-for-redis/pull/1575))
* Python: Added BITCOUNT command ([#1592](https://github.com/aws/glide-for-redis/pull/1592))
* Python: Added FLUSHALL command ([#1579](https://github.com/aws/glide-for-redis/pull/1579))
* Python: Added TOUCH command ([#1582](https://github.com/aws/glide-for-redis/pull/1582))
* Python: Added BITOP command ([#1596](https://github.com/aws/glide-for-redis/pull/1596))
* Python: Added BITPOS command ([#1604](https://github.com/aws/glide-for-redis/pull/1604))
* Python: Added GETEX command ([#1612](https://github.com/aws/glide-for-redis/pull/1612))
* Python: Added BITFIELD and BITFIELD_RO commands ([#1615](https://github.com/aws/glide-for-redis/pull/1615))
* Python: Added ZREVRANK command ([#1614](https://github.com/aws/glide-for-redis/pull/1614))
* Python: Added XDEL command ([#1619](https://github.com/aws/glide-for-redis/pull/1619))
* Python: Added XRANGE command ([#1624](https://github.com/aws/glide-for-redis/pull/1624))
* Python: Added COPY command ([#1626](https://github.com/aws/glide-for-redis/pull/1626))
* Python: Added XREVRANGE command ([#1625](https://github.com/aws/glide-for-redis/pull/1625))
* Python: Added XREAD command ([#1644](https://github.com/aws/glide-for-redis/pull/1644))
* Python: Added XGROUP CREATE and XGROUP DESTROY commands ([#1646](https://github.com/aws/glide-for-redis/pull/1646))
* Python: Added XGROUP CREATECONSUMER and XGROUP DELCONSUMER commands ([#1658](https://github.com/aws/glide-for-redis/pull/1658))
* Python: Added LOLWUT command ([#1657](https://github.com/aws/glide-for-redis/pull/1657))
* Python: Added XREADGROUP command ([#1679](https://github.com/aws/glide-for-redis/pull/1679))
* Python: Added XACK command ([#1681](https://github.com/aws/glide-for-redis/pull/1681))
* Python: Added FLUSHDB command ([#1680](https://github.com/aws/glide-for-redis/pull/1680))
* Python: Added FUNCTION LOAD command ([#1699](https://github.com/aws/glide-for-redis/pull/1699))

### Breaking Changes
* Node: Update XREAD to return a Map of Map ([#1494](https://github.com/aws/glide-for-redis/pull/1494))
* Node: Rename RedisClient to GlideClient and RedisClusterClient to GlideClusterClient ([#1670](https://github.com/aws/glide-for-redis/pull/1670))
* Python: Rename RedisClient to GlideClient, RedisClusterClient to GlideClusterClient and BaseRedisClient to BaseClient([#1669](https://github.com/aws/glide-for-redis/pull/1669))

## 0.4.1 (2024-02-06)

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/csharp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0

using System.Collections.Concurrent;
using System.Diagnostics;
Expand Down
20 changes: 10 additions & 10 deletions benchmarks/node/node_benchmark.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

import { writeFileSync } from "fs";
import { Logger, RedisClient, RedisClusterClient } from "glide-for-redis";
import { GlideClient, GlideClusterClient, Logger } from "glide-for-redis";
import { Cluster, Redis } from "ioredis";
import { parse } from "path";
import percentile from "percentile";
Expand Down Expand Up @@ -216,8 +216,8 @@ async function main(

if (clientsToRun == "all" || clientsToRun == "glide") {
const clientClass = clusterModeEnabled
? RedisClusterClient
: RedisClient;
? GlideClusterClient
: GlideClient;
const clients = await createClients(clientCount, () =>
clientClass.createClient({
addresses: [{ host, port }],
Expand All @@ -232,19 +232,19 @@ async function main(
dataSize,
data,
(client) => {
(client as RedisClient).close();
(client as GlideClient).close();
},
clusterModeEnabled,
);
await new Promise((resolve) => setTimeout(resolve, 100));
}

if (clientsToRun == "all") {
const nodeRedisClients = await createClients(clientCount, async () => {
const nodeGlideClients = await createClients(clientCount, async () => {
const node = {
url: getAddress(host, useTLS, port),
};
const nodeRedisClient = clusterModeEnabled
const nodeGlideClient = clusterModeEnabled
? createCluster({
rootNodes: [{ socket: { host, port, tls: useTLS } }],
defaults: {
Expand All @@ -255,11 +255,11 @@ async function main(
useReplicas: true,
})
: createClient(node);
await nodeRedisClient.connect();
return nodeRedisClient;
await nodeGlideClient.connect();
return nodeGlideClient;
});
await runClients(
nodeRedisClients,
nodeGlideClients,
"node_redis",
totalCommands,
numOfConcurrentTasks,
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/python/python_benchmark.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
# Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0

import argparse
import asyncio
Expand All @@ -17,11 +17,11 @@
import redis.asyncio as redispy # type: ignore
from glide import (
BaseClientConfiguration,
GlideClient,
GlideClusterClient,
Logger,
LogLevel,
NodeAddress,
RedisClient,
RedisClusterClient,
)


Expand Down Expand Up @@ -288,7 +288,7 @@ async def main(

if clients_to_run == "all" or clients_to_run == "glide":
# Glide Socket
client_class = RedisClusterClient if is_cluster else RedisClient
client_class = GlideClusterClient if is_cluster else GlideClient
config = BaseClientConfiguration(
[NodeAddress(host=host, port=port)], use_tls=use_tls
)
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/rust/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

#[cfg(not(target_env = "msvc"))]
Expand Down Expand Up @@ -236,7 +236,7 @@ async fn get_connection(args: &Args) -> Client {
..Default::default()
};

glide_core::client::Client::new(connection_request)
glide_core::client::Client::new(connection_request, None)
.await
.unwrap()
}
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/utilities/csv_exporter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/python3

# Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
# Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0

import csv
import json
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/utilities/fill_db.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

import {
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/utilities/flush_db.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

import { RedisClientType, RedisClusterType } from "redis";
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/utilities/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

import commandLineArgs from "command-line-args";
Expand Down
2 changes: 1 addition & 1 deletion csharp/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ indent_size = 2
[*.cs]

# License header
file_header_template = Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
file_header_template = Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0

# Organize usings
dotnet_separate_import_directive_groups = true
Expand Down
2 changes: 1 addition & 1 deletion csharp/lib/AsyncClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0

using System.Buffers;
using System.Runtime.InteropServices;
Expand Down
2 changes: 1 addition & 1 deletion csharp/lib/Logger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0


using System.Runtime.InteropServices;
Expand Down
2 changes: 1 addition & 1 deletion csharp/lib/Message.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0

using System.Diagnostics;
using System.Runtime.CompilerServices;
Expand Down
2 changes: 1 addition & 1 deletion csharp/lib/MessageContainer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0

using System.Collections.Concurrent;

Expand Down
2 changes: 1 addition & 1 deletion csharp/lib/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0


using System.Runtime.CompilerServices;
Expand Down
4 changes: 2 additions & 2 deletions csharp/lib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/
use glide_core::client;
use glide_core::client::Client as GlideClient;
Expand Down Expand Up @@ -59,7 +59,7 @@ fn create_client_internal(
.thread_name("GLIDE for Redis C# thread")
.build()?;
let _runtime_handle = runtime.enter();
let client = runtime.block_on(GlideClient::new(request)).unwrap(); // TODO - handle errors.
let client = runtime.block_on(GlideClient::new(request, None)).unwrap(); // TODO - handle errors.
Ok(Client {
client,
success_callback,
Expand Down
2 changes: 1 addition & 1 deletion csharp/tests/Integration/GetAndSet.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0

using System.Runtime.InteropServices;

Expand Down
2 changes: 1 addition & 1 deletion csharp/tests/Integration/IntegrationTestBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0

using System.Diagnostics;

Expand Down
2 changes: 1 addition & 1 deletion csharp/tests/Usings.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0

global using Xunit;
14 changes: 7 additions & 7 deletions examples/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

import { Logger, RedisClient, RedisClusterClient } from "@aws/glide-for-redis";
import { GlideClient, GlideClusterClient, Logger } from "@aws/glide-for-redis";

async function sendPingToNode() {
// When in Redis is in standalone mode, add address of the primary node, and any replicas you'd like to be able to read from.
Expand All @@ -12,8 +12,8 @@ async function sendPingToNode() {
port: 6379,
},
];
// Check `RedisClientConfiguration/ClusterClientConfiguration` for additional options.
const client = await RedisClient.createClient({
// Check `GlideClientConfiguration/ClusterClientConfiguration` for additional options.
const client = await GlideClient.createClient({
addresses: addresses,
// if the server uses TLS, you'll need to enable it. Otherwise the connection attempt will time out silently.
// useTLS: true,
Expand All @@ -26,7 +26,7 @@ async function sendPingToNode() {
client.close();
}

async function send_set_and_get(client: RedisClient | RedisClusterClient) {
async function send_set_and_get(client: GlideClient | GlideClusterClient) {
const set_response = await client.set("foo", "bar");
console.log(`Set response is = ${set_response}`);
const get_response = await client.get("foo");
Expand All @@ -41,8 +41,8 @@ async function sendPingToRandomNodeInCluster() {
port: 6380,
},
];
// Check `RedisClientConfiguration/ClusterClientConfiguration` for additional options.
const client = await RedisClusterClient.createClient({
// Check `GlideClientConfiguration/ClusterClientConfiguration` for additional options.
const client = await GlideClusterClient.createClient({
addresses: addresses,
// if the cluster nodes use TLS, you'll need to enable it. Otherwise the connection attempt will time out silently.
// useTLS: true,
Expand Down
Loading

0 comments on commit 71b7818

Please sign in to comment.