Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ RedisGears is an engine for data processing in Redis. RedisGears supports batch

## Supported languages

As of RedisGears v1.2, you can enable a plugin to select which programming language to use. It currently supports code written in either [Python]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/python" >}}) or [Java]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm" >}}).
As of RedisGears v1.2, you can enable a plugin to select which programming language to use. It currently supports code written in either [Python](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/python/_index.md) or [Java](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/_index.md).

Prior to v1.2, RedisGears only supported Python. However, an internal C API exists and can be used by other Redis modules. Support for other languages is being planned.

## Getting started with RedisGears

RedisGears is implemented by a Redis module. To use RedisGears, you'll need to make sure that your Redis deployment has the module installed. [Redis Software](https://redis.io/docs/latest/operate/rs/) supports the module natively.

If you're running Redis Open Source, you'll also need to [install the RedisGears module]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/installing-redisgears" >}}) before using it.
If you're running Redis Open Source, you'll also need to [install the RedisGears module](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/installing-redisgears.md) before using it.

To get started with RedisGears, see the quick start tutorial for [Python]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/python/quickstart" >}}) or [Java]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/quickstart" >}}).
To get started with RedisGears, see the quick start tutorial for [Python](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/python/quickstart.md) or [Java](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/quickstart.md).

## Write-behind caching patterns

Redis users typically implement caching by using the look-aside pattern. However, with RedisGears, you can implement write-behind caching strategies as well.

Redis publishes RedisGears recipes to support write-behind. You can learn how to use these recipes in our write-behind caching guides for [Python]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/python/recipes/write-behind" >}}) and [Java]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/recipes/write-behind" >}}).
Redis publishes RedisGears recipes to support write-behind. You can learn how to use these recipes in our write-behind caching guides for [Python](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/python/recipes/write-behind.md) and [Java](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/recipes/write-behind.md).

## More info

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Before you can use RedisGears, you have to install the RedisGears module on your
## Minimum requirements

- Redis Software 6.0.12 or later
- The [cluster is setup]({{< relref "/operate/rs/clusters/new-cluster-setup" >}}) and all of the nodes are joined to the cluster
- The [cluster is setup](/content/operate/rs/clusters/new-cluster-setup.md) and all of the nodes are joined to the cluster

## Install RedisGears

Expand All @@ -30,19 +30,19 @@ Offline installation requires you to manually upload dependencies to the primary

1. Download the **RedisGears** package from the Redis Software [download center](https://cloud.redis.io/#/rlec-downloads).

{{<note>}}
For offline installation of RedisGears v1.2 and later, you also need to download the **RedisGears Dependencies** packages for both Python and Java.
<br/>
For RedisGears v1.0, you only need the Python dependency package.
{{</note>}}
> [!NOTE]
> For offline installation of RedisGears v1.2 and later, you also need to download the **RedisGears Dependencies** packages for both Python and Java.
> <br/>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

> For RedisGears v1.0, you only need the Python dependency package.
>

1. Upload the RedisGears package to a node in the cluster.

1. For offline installation only, copy the dependencies to the primary node.

{{<note>}}
Skip this step unless your cluster does not have internet access.
{{</note>}}
> [!NOTE]
> Skip this step unless your cluster does not have internet access.
>

1. For versions 7.2.4 and later, copy the dependencies to `$modulesdatadir/rg/<version-integer>/<OS_name>/<architecture>/deps/`:

Expand All @@ -67,7 +67,7 @@ Skip this step unless your cluster does not have internet access.
- `<OS_name>`: the operating system's name
- `<architecture>`: the node's architecture

1. Add RedisGears to the cluster with a `POST` request to the primary node's [`/v2/modules`]({{< relref "/operate/rs/references/rest-api/requests/modules#post-module-v2" >}}) REST API endpoint:
1. Add RedisGears to the cluster with a `POST` request to the primary node's [`/v2/modules`](/content/operate/rs/references/rest-api/requests/modules/_index.md#post-module-v2) REST API endpoint:

```sh
POST https://[host][:port]/v2/modules
Expand All @@ -82,13 +82,13 @@ After the install is complete, RedisGears will appear in the list of available m

After installation, create a new database and enable RedisGears:

- [With Python]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/python/install" >}})
- [With Python](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/python/install.md)

- [With the JVM]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/install" >}})
- [With the JVM](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/install.md)

## Upgrade RedisGears for existing databases

To upgrade RedisGears for an existing database after installing a new version, use [`rladmin upgrade db`]({{<relref "/operate/rs/references/cli-utilities/rladmin/upgrade#upgrade-db">}}):
To upgrade RedisGears for an existing database after installing a new version, use [`rladmin upgrade db`](/content/operate/rs/references/cli-utilities/rladmin/upgrade.md#upgrade-db):

```sh
rladmin upgrade db <database-name-or-ID> and module module_name rg version <new_version_integer> module_args "<module arguments>"
Expand All @@ -100,10 +100,9 @@ The following example shows how to upgrade a database named `shopping-cart` to R
rladmin upgrade db shopping-cart and module module_name rg version 10209 module_args keep_args
```

{{<note>}}
These command examples also upgrade the database to the latest Redis version on the cluster. For more module upgrade information and examples, see [Upgrade modules]({{<relref "/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module">}}).
{{</note>}}
> [!NOTE]
> These command examples also upgrade the database to the latest Redis version on the cluster. For more module upgrade information and examples, see [Upgrade modules](/content/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module.md).

## Uninstall RedisGears

To uninstall RedisGears, make a [`DELETE` request to the `/v2/modules` REST API endpoint]({{< relref "/operate/rs/references/rest-api/requests/modules#delete-module-v2" >}}).
To uninstall RedisGears, make a [`DELETE` request to the `/v2/modules` REST API endpoint](/content/operate/rs/references/rest-api/requests/modules/_index.md#delete-module-v2).
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ bannerText: Redis Gears is a deprecated feature that is not recommended or suppo
bannerChildren: true
---

With the [RedisGears JVM plugin](https://github.com/RedisGears/JVMPlugin), you can write RedisGears functions in [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) and run them on a [Redis Software]({{< relref "/operate/rs/" >}}) cluster. It currently supports [JVM](https://en.wikipedia.org/wiki/Java_virtual_machine) version 11.
With the [RedisGears JVM plugin](https://github.com/RedisGears/JVMPlugin), you can write RedisGears functions in [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) and run them on a [Redis Software](/content/operate/rs/_index.md) cluster. It currently supports [JVM](https://en.wikipedia.org/wiki/Java_virtual_machine) version 11.

Similar to the Python plugin, the JVM plugin allows both batch processing and event-driven processing.

Before you can run RedisGears with Java, you will need to [install the RedisGears module and the JVM plugin]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/installing-redisgears#install-redisgears" >}}) on your Redis Software cluster and [enable them for your database]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/install" >}}).
Before you can run RedisGears with Java, you will need to [install the RedisGears module and the JVM plugin](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/installing-redisgears.md#install-redisgears) on your Redis Software cluster and [enable them for your database](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/install.md).

Once you have written your code, compile and package it into a [JAR](https://en.wikipedia.org/wiki/JAR_(file_format)) file and upload it to a node on your Redis Software cluster. Use the `RG.JEXECUTE` command with the `redis-cli` command-line tool to run your code.

## More info

- [RedisGears JVM quick start]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/quickstart" >}})
- [RedisGears Java classes and functions]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes" >}})
- [RedisGears recipes]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/recipes" >}})
- [RedisGears JVM quick start](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/quickstart.md)
- [RedisGears Java classes and functions](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/_index.md)
- [RedisGears recipes](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/recipes/_index.md)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public GearsBuilder<T> asyncFilter​(
gears.operations.AsyncFilterOperation<T> filter)
```

The `asyncFilter` function allows you to use a [`GearsFuture`]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsfuture" >}}) object to asynchronously filter out records in the pipe based on a given condition.
The `asyncFilter` function allows you to use a [`GearsFuture`](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsfuture/_index.md) object to asynchronously filter out records in the pipe based on a given condition.

The filter operation should contain a conditional statement and return a boolean for each record:
- If `true`, the record will continue through the pipe.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public GearsBuilder<T> asyncForeach​(
gears.operations.AsyncForeachOperation<T> foreach)
```

The `asyncForeach` function allows you to use a [`GearsFuture`]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsfuture" >}}) object to define a set of operations and run them asynchronously for each record in the pipe.
The `asyncForeach` function allows you to use a [`GearsFuture`](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsfuture/_index.md) object to define a set of operations and run them asynchronously for each record in the pipe.

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public <I extends java.io.Serializable> GearsBuilder<I> asyncMap​(
gears.operations.AsyncMapOperation<T,​I> mapper)
```

The `asyncMap` function allows you to use a [`GearsFuture`]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsfuture" >}}) object to asynchronously map each input record in the pipe to an output record, one-to-one.
The `asyncMap` function allows you to use a [`GearsFuture`](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsfuture/_index.md) object to asynchronously map each input record in the pipe to an output record, one-to-one.

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ bannerText: Redis Gears is a deprecated feature that is not recommended or suppo
public static java.lang.Object callNext(java.lang.String... args)
```

When you override a Redis command with the [`CommandOverrider`]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/readers/commandoverrider" >}}), use `callNext` to run the next execution that overrides the command or the original command itself.
When you override a Redis command with the [`CommandOverrider`](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/readers/commandoverrider.md), use `callNext` to run the next execution that overrides the command or the original command itself.

It is a more flexible version of [`callNextArray`]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callNextArray" >}}) since the list of string arguments does not have to be an explicit `String[]` object. This allows function calls like: <nobr>`callNext("key", "value")`.</nobr>
It is a more flexible version of [`callNextArray`](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callnextarray.md) since the list of string arguments does not have to be an explicit `String[]` object. This allows function calls like: <nobr>`callNext("key", "value")`.</nobr>

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static native java.lang.Object callNextArray(
java.lang.String[] command)
```

When you override a Redis command with the [`CommandOverrider`]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/readers/commandoverrider" >}}), use `callNextArray` to run the next execution that overrides the command or the original command itself.
When you override a Redis command with the [`CommandOverrider`](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/readers/commandoverrider.md), use `callNextArray` to run the next execution that overrides the command or the original command itself.

It accepts an array of strings, which represents the command arguments.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ bannerText: Redis Gears is a deprecated feature that is not recommended or suppo
public static java.lang.String configGet​(java.lang.String key)
```

Gets the value of a RedisGears [configuration setting]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Configuration" >}}).
Gets the value of a RedisGears [configuration setting](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Configuration.md).

{{<note>}}
You can set configuration values when you load the module or use the `RG.CONFIGSET` command.
{{</note>}}
> [!NOTE]
> You can set configuration values when you load the module or use the `RG.CONFIGSET` command.

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ bannerText: Redis Gears is a deprecated feature that is not recommended or suppo
public static java.lang.Object execute​(java.lang.String... command)
```

Runs a Redis command, similar to [`executeArray`]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/executeArray" >}}). However, the `execute` function is more flexible. Unlike `executeArray`, the list of string arguments does not have to be an explicit `String[]` object. It allows function calls like this: <nobr>`execute("SET", "key", "value")`.</nobr>
Runs a Redis command, similar to [`executeArray`](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/executearray.md). However, the `execute` function is more flexible. Unlike `executeArray`, the list of string arguments does not have to be an explicit `String[]` object. It allows function calls like this: <nobr>`execute("SET", "key", "value")`.</nobr>

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ public static java.lang.String hashtag()

Returns a string that maps to the current shard according to the cluster slot mapping.

{{<note>}}
You can use the `hashtag` function when you need to create a key that resides on the current shard.
{{</note>}}
> [!NOTE]
> You can use the `hashtag` function when you need to create a key that resides on the current shard.

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public <I extends java.io.Serializable> GearsBuilder<I> localAccumulateBy​(
gears.operations.AccumulateByOperation<T,​I> accumulator)
```

The `localAccumulateBy` function is similar to [`accumulateBy`]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/accumulateby" >}}), except it performs the operation locally on each shard without moving data between shards.
The `localAccumulateBy` function is similar to [`accumulateBy`](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/accumulateby.md), except it performs the operation locally on each shard without moving data between shards.

On each shard, it iterates through the records in the pipe, groups them based on the provided extractor, and then reduces each group to a single record per group with the accumulator function.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public java.lang.String register​(
gears.operations.OnUnregisteredOperation onUnregistered)
```

Registers the pipeline of functions to run when certain [events]({{< relref "/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/register-events" >}}) occur. The registered functions will run each time the event occurs.
Registers the pipeline of functions to run when certain [events](/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/register-events.md) occur. The registered functions will run each time the event occurs.

Execution modes:

Expand All @@ -35,9 +35,8 @@ Execution modes:
| ASYNC_LOCAL | Runs asynchronously but only on the current shard that generated the event. |
| SYNC | Runs synchronously only on the same shard that generated the event. |

{{<note>}}
If you call `register()` without specifying an execution mode, it will default to `ASYNC`.
{{</note>}}
> [!NOTE]
> If you call `register()` without specifying an execution mode, it will default to `ASYNC`.

## Parameters

Expand Down
Loading
Loading