Skip to content

Commit b149acd

Browse files
committed
Merge branch 'main' into preview-rc-rdi
2 parents d625457 + e2b916c commit b149acd

File tree

363 files changed

+1367
-2860
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

363 files changed

+1367
-2860
lines changed

.github/workflows/redisvl_docs_sync.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
3535
# Get latest release
3636
latest_release=$(gh release -R redis/redis-vl-python list --json name,isLatest --jq '.[] | select(.isLatest)|.name')
37-
git checkout "tags/${latest_release}"
37+
git checkout "tags/${latest_release}" || git checkout "tags/v${latest_release}"
3838
pip3 install -e .
3939
4040
popd

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ The `filename` property value can be any file name path which is relative to the
102102
We added a new property `class` which allows you to override the CSS class of the image. Images have by default a `block` display in Tailwind. You can change this by setting the class property to `inline`. The following example shows two images that are in a single line:
103103

104104
```
105-
{{< image filename="/images/rc/icon-database-update-status-pending.png#no-click" alt="Pending database status" class="inline" >}} &nbsp; {{< image filename="/images/rc/icon-database-update-status-active.png#no-click" alt="Active database status" class="inline" >}}
105+
{{< image filename="/images/rc/icon-database-update-status-pending.png#no-click" alt="Pending database status" class="inline" >}} &nbsp; {{< image filename="/images/rc/icon-database-status-active.png#no-click" alt="Active database status" class="inline" >}}
106106
```
107107

108108
### Templating

build/image_report.py

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@
77
import os
88

99

10-
def scan_file(path: str) -> int:
10+
def scan_file(path: str, verbose: bool = True) -> list:
1111
"""Scans a file for all `image` shortcodes.
1212
1313
Args:
1414
path (str): Path to file.
15+
verbose (bool, optional): If True, prints the shortcodes found. Defaults to True.
1516
1617
Returns:
17-
(int) Number of shortcodes found.
18+
(list) A list of all image shortcodes found.
1819
"""
1920

2021
img_list = []
22+
img_names = []
2123

2224
with open(path, encoding="utf_8") as md_file:
2325
text = md_file.read()
@@ -26,16 +28,18 @@ def scan_file(path: str) -> int:
2628
text, lambda t: t.tag == "image"
2729
):
2830
img_list.append((img, pos_info))
31+
img_names.append(img.named_params["filename"])
2932

30-
if len(img_list) > 0:
33+
if len(img_list) > 0 and verbose:
3134
print(f"File '{path}':")
3235

3336
for img in img_list:
3437
print(
3538
f" Line {img[1].line}: '{img[0].named_params['filename']}'"
3639
)
3740

38-
return len(img_list)
41+
# return len(img_list)
42+
return img_names
3943

4044

4145
parser = argparse.ArgumentParser(
@@ -44,20 +48,50 @@ def scan_file(path: str) -> int:
4448
)
4549

4650
parser.add_argument("pathname", help="Path of the folder to scan")
51+
parser.add_argument("--find-unused", nargs=1, help="Prints out all images in IMAGEFOLDER that are not found in pathname. Set pathname to the top content folder to scan all content for images.", metavar="IMAGEFOLDER")
4752

4853
args = parser.parse_args()
4954

5055
print(f"Scanning '{args.pathname}'")
5156

5257
num_found = 0
58+
all_images_found = []
5359

5460
for root, dirs, files in os.walk(args.pathname):
5561
for file in files:
5662
if file.endswith(".md"):
5763
fullpath = os.path.join(root, file)
58-
num_found += scan_file(fullpath)
64+
images_found = scan_file(fullpath, verbose=args.find_unused is None)
65+
num_found += len(images_found)
66+
all_images_found.extend(images_found)
5967

6068
if num_found == 0:
6169
print(f"No image shortcodes found in '{args.pathname}'")
6270
else:
6371
print(f"Found {num_found} image shortcodes.")
72+
73+
if args.find_unused and num_found > 0:
74+
unique_images = list(set(all_images_found))
75+
print(f"Found {len(unique_images)} unique images in '{args.pathname}'.")
76+
print(f"Checking for images not found in '{args.pathname}' that are in '{args.find_unused[0]}'")
77+
78+
unused_images = []
79+
total_images = 0
80+
81+
for root, dirs, files in os.walk(args.find_unused[0]):
82+
for file in files:
83+
if (file.endswith(".png") or file.endswith(".jpg") or file.endswith(".webp")):
84+
total_images += 1
85+
if not any(file in img for img in unique_images):
86+
img_filepath = os.path.join(root, file)
87+
print(f" Image '{img_filepath}' not found in '{args.pathname}'")
88+
unused_images.append(img_filepath)
89+
90+
print(f"Found {len(unused_images)} unused images out of {total_images} images in '{args.find_unused[0]}.'")
91+
92+
if len(unused_images) > 0:
93+
print("Do you want to remove these images? (y/n) (DO NOT DO ON MAIN BRANCH!)")
94+
if input().lower() == "y":
95+
for img in unused_images:
96+
os.remove(img)
97+
print(f"Removed '{img}'")

config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ rdi_redis_gears_version = "1.2.6"
5555
rdi_debezium_server_version = "2.3.0.Final"
5656
rdi_db_types = "cassandra|mysql|oracle|postgresql|sqlserver"
5757
rdi_cli_latest = "latest"
58-
rdi_current_version = "v1.6.6"
58+
rdi_current_version = "v1.6.7"
5959

6060
[params.clientsConfig]
6161
"Python"={quickstartSlug="redis-py"}

content/commands/client-list/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ Here is the meaning of the fields:
117117
* `rbp`: peak size of the client's read buffer since the client connected. Added in Redis 7.0
118118
* `rbs`: current size of the client's read buffer in bytes. Added in Redis 7.0
119119
* `io-thread`: id of I/O thread assigned to the client. Added in Redis 8.0
120+
* `tot-net-in`: total network input bytes read from this client.
121+
* `tot-net-out`: total network output bytes sent to this client.
122+
* `tot-cmds`: total count of commands this client executed.
120123

121124
The client flags can be a combination of:
122125

content/commands/hsetex/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Set the value of one or more fields of a given hash key, and optionally set thei
111111

112112
## Options
113113

114-
The `HGETEX` command supports a set of options:
114+
The `HSETEX` command supports a set of options:
115115

116116
* `FNX` -- Only set the fields if none of them already exist.
117117
* `FXX` -- Only set the fields if all of them already exist.

content/commands/json.debug-memory/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ title: JSON.DEBUG MEMORY
3535
---
3636
Report a value's memory usage in bytes
3737

38+
{{< warning >}}
39+
The actual total memory consumption by a key could be much lower than the value reported by this command because of an internal JSON string reuse mechanism. For more information, see the [JSON memory usage page]({{< relref "/develop/data-types/json/ram#json-string-reuse-mechanism" >}}).
40+
{{< /warning >}}
41+
3842
[Examples](#examples)
3943

4044
## Required arguments

content/commands/spublish/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ title: SPUBLISH
5252
Posts a message to the given shard channel.
5353

5454
In Redis Cluster, shard channels are assigned to slots by the same algorithm used to assign keys to slots.
55-
A shard message must be sent to a node that own the slot the shard channel is hashed to.
56-
The cluster makes sure that published shard messages are forwarded to all the node in the shard, so clients can subscribe to a shard channel by connecting to any one of the nodes in the shard.
55+
A shard message must be sent to a node that owns the slot the shard channel is hashed to.
56+
The cluster makes sure that published shard messages are forwarded to all the nodes in the shard, so clients can subscribe to a shard channel by connecting to any one of the nodes in the shard.
5757

5858
For more information about sharded pubsub, see [Sharded Pubsub]({{< relref "/develop/interact/pubsub#sharded-pubsub" >}}).
5959

6060
## Examples
6161

62-
For example the following command publish to channel `orders` with a subscriber already waiting for message(s).
62+
For example the following command publishes to the `orders` channel with a subscriber already waiting for message(s).
6363

6464
```
6565
> spublish orders hello

content/develop/clients/dotnet/transpipe.md

Lines changed: 6 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,8 @@ versions of the standard command methods
3737
buffered in the pipeline and only execute when you call the `Execute()`
3838
method on the pipeline object.
3939

40-
<!-- < clients-example pipe_trans_tutorial basic_pipe "C#" >}}
41-
< /clients-example >}} -->
42-
43-
```csharp
44-
var pipeline = new Pipeline(db);
45-
46-
for (int i = 0; i < 5; i++) {
47-
pipeline.Db.StringSetAsync($"seat:{i}", $"#{i}");
48-
}
49-
pipeline.Execute();
50-
51-
var resp1 = db.StringGet("seat:0");
52-
Console.WriteLine(resp1); // >>> #0
53-
54-
var resp2 = db.StringGet("seat:3");
55-
Console.WriteLine(resp2); // >>> #3
56-
57-
var resp3 = db.StringGet("seat:4");
58-
Console.WriteLine(resp2); // >>> #4
59-
```
40+
{{< clients-example pipe_trans_tutorial basic_pipe "C#" >}}
41+
{{< /clients-example >}}
6042

6143
## Execute a transaction
6244

@@ -65,27 +47,8 @@ instance of the `Transaction` class, call async command methods
6547
on that object, and then call the transaction object's
6648
`Execute()` method to execute it.
6749

68-
<!-- < clients-example pipe_trans_tutorial basic_trans "C#" >}}
69-
< /clients-example >}}-->
70-
71-
```csharp
72-
var trans = new Transaction(db);
73-
74-
trans.Db.StringIncrementAsync("counter:1", 1);
75-
trans.Db.StringIncrementAsync("counter:2", 2);
76-
trans.Db.StringIncrementAsync("counter:3", 3);
77-
78-
trans.Execute();
79-
80-
var resp4 = db.StringGet("counter:1");
81-
Console.WriteLine(resp4); // >>> 1
82-
83-
var resp5 = db.StringGet("counter:2");
84-
Console.WriteLine(resp5); // >>> 2
85-
86-
var resp6 = db.StringGet("counter:3");
87-
Console.WriteLine(resp6); // >>> 3
88-
```
50+
{{< clients-example pipe_trans_tutorial basic_trans "C#" >}}
51+
{{< /clients-example >}}
8952

9053
## Watch keys for changes
9154

@@ -114,25 +77,8 @@ For example, the `KeyNotExists` condition aborts the transaction
11477
if a specified key exists or is added by another client while the
11578
transaction executes:
11679

117-
<!-- < clients-example pipe_trans_tutorial trans_watch "C#" >}}
118-
< /clients-example >}} -->
119-
120-
```csharp
121-
var watchedTrans = new Transaction(db);
122-
123-
watchedTrans.AddCondition(Condition.KeyNotExists("customer:39182"));
124-
125-
watchedTrans.Db.HashSetAsync(
126-
"customer:39182",
127-
new HashEntry[]{
128-
new HashEntry("name", "David"),
129-
new HashEntry("age", "27")
130-
}
131-
);
132-
133-
bool succeeded = watchedTrans.Execute();
134-
Console.WriteLine(succeeded); // >>> true
135-
```
80+
{{< clients-example pipe_trans_tutorial trans_watch "C#" >}}
81+
{{< /clients-example >}}
13682

13783
You can also use a `When` condition on certain individual commands to
13884
specify that they only execute when a certain condition holds

content/develop/data-types/json/ram.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,12 @@ JSON. The _MessagePack_ column is for reference purposes and reflects the length
123123

124124
> Note: In the current version, deleting values from containers **does not** free the container's
125125
allocated memory.
126+
127+
## JSON string reuse mechanism
128+
129+
Redis uses a global string reuse mechanism to reduce memory usage. When a string value appears multiple times, either within the same JSON document
130+
or across different documents on the same node, Redis stores only a single copy of that string and uses references to it.
131+
This approach is especially efficient when many documents share similar structures.
132+
133+
However, the `JSON.DEBUG MEMORY` command reports memory usage as if each string instance is stored independently, even when it's actually reused.
134+
For example, the document `{"foo": ["foo", "foo"]}` reuses the string `"foo"` internally, but the reported memory usage counts the string three times: once for the key and once for each array element.

0 commit comments

Comments
 (0)