{
  "schema_version": 2,
  "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder",
  "title": "GearsBuilder",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/",
  "summary": "Creates a RedisGears pipeline of operations to transform data.",
  "aliases": [
    "/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/"
  ],
  "tags": [
    "docs",
    "operate",
    "stack"
  ],
  "last_updated": "2026-04-21T10:45:15+01:00",
  "children": [
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/accumulate",
      "summary": "Reduces many records in the pipe to a single record.",
      "title": "Accumulate",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/accumulate/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/accumulateby",
      "summary": "Groups records and reduces each group to a single record per group.",
      "title": "AccumulateBy",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/accumulateby/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/asyncfilter",
      "summary": "Asynchronously filters out records in the pipe based on a given condition.",
      "title": "AsyncFilter",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/asyncfilter/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/asyncforeach",
      "summary": "For each record in the pipe, asynchronously runs some operations.",
      "title": "AsyncForeach",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/asyncforeach/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/asyncmap",
      "summary": "Asynchronously maps records one-to-one.",
      "title": "AsyncMap",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/asyncmap/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callnext",
      "summary": "Calls the next execution that overrides the command or the original command itself. A more flexible version of callNextArray.",
      "title": "CallNext",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callnext/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callnextarray",
      "summary": "Calls the next execution that overrides the command or the original command itself.",
      "title": "CallNextArray",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callnextarray/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/collect",
      "summary": "Collects all records to the origin shard.",
      "title": "Collect",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/collect/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/config-get",
      "summary": "Gets the value of a RedisGears configuration setting.",
      "title": "ConfigGet",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/config-get/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/count",
      "summary": "Counts the number of records in the pipe.",
      "title": "Count",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/count/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/creategearsbuilder",
      "summary": "Creates a new GearsBuilder object.",
      "title": "CreateGearsBuilder",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/creategearsbuilder/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/execute",
      "summary": "Runs a Redis command. A more flexible version of executeArray.",
      "title": "Execute",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/execute/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/executearray",
      "summary": "Runs a Redis command.",
      "title": "ExecuteArray",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/executearray/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/filter",
      "summary": "Filters out records in the pipe based on a given condition.",
      "title": "Filter",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/filter/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/flatmap",
      "summary": "Maps a single input record to one or more output records.",
      "title": "FlatMap",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/flatmap/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/foreach",
      "summary": "For each record in the pipe, runs some operations.",
      "title": "Foreach",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/foreach/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/hashtag",
      "summary": "Returns a string that maps to the current shard.",
      "title": "Hashtag",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/hashtag/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/localaccumulateby",
      "summary": "Groups records and reduces each group to a single record per group locally on each shard.",
      "title": "LocalAccumulateBy",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/localaccumulateby/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/log",
      "summary": "Writes a log message to the Redis log file.",
      "title": "Log",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/log/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/map",
      "summary": "Maps records one-to-one.",
      "title": "Map",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/map/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/register",
      "summary": "Registers the pipeline of functions to run when certain events occur.",
      "title": "Register",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/register/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/repartition",
      "summary": "Moves records between shards according to the extracted data.",
      "title": "Repartition",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/repartition/"
    },
    {
      "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/run",
      "summary": "Runs the pipeline of functions immediately.",
      "title": "Run",
      "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/run/"
    }
  ],
  "page_type": "content",
  "content_hash": "773c8681656f49bb126c672e1aae327e02b87a8207f624cacb204040b335bdf5",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "The `GearsBuilder` class allows you to create a pipeline of RedisGears functions that transform data.\n\nIt requires a reader to supply data to the pipe.\n\nTo create a `GearsBuilder` object, follow this example code:\n\n[code example]"
    },
    {
      "id": "functions",
      "title": "Functions",
      "role": "content",
      "text": "| Function | Description |\n| --- | --- |\n| [accumulate](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/accumulate/) | Reduces many records in the pipe to a single record. |\n| [accumulateBy](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/accumulateby/) | Groups records and reduces each group to a single record per group. |\n| [asyncFilter](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/asyncfilter/) | Asynchronously filters out records in the pipe based on a given condition. |\n| [asyncForeach](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/asyncforeach/) | For each record in the pipe, asynchronously runs some operations. |\n| [asyncMap](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/asyncmap/) | Asynchronously maps records one-to-one. |\n| [callNext](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callnext/) | Calls the next execution that overrides the command or the original command itself. A more flexible version of callNextArray. |\n| [callNextArray](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callnextarray/) | Calls the next execution that overrides the command or the original command itself. |\n| [collect](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/collect/) | Collects all records to the origin shard. |\n| [configGet](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/config-get/) | Gets the value of a RedisGears configuration setting. |\n| [count](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/count/) | Counts the number of records in the pipe. |\n| [CreateGearsBuilder](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/creategearsbuilder/) | Creates a new GearsBuilder object. |\n| [execute](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/execute/) | Runs a Redis command. A more flexible version of executeArray. |\n| [executeArray](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/executearray/) | Runs a Redis command. |\n| [filter](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/filter/) | Filters out records in the pipe based on a given condition. |\n| [flatMap](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/flatmap/) | Maps a single input record to one or more output records. |\n| [foreach](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/foreach/) | For each record in the pipe, runs some operations. |\n| [hashtag](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/hashtag/) | Returns a string that maps to the current shard. |\n| [localAccumulateBy](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/localaccumulateby/) | Groups records and reduces each group to a single record per group locally on each shard. |\n| [log](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/log/) | Writes a log message to the Redis log file. |\n| [map](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/map/) | Maps records one-to-one. |\n| [register](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/register/) | Registers the pipeline of functions to run when certain events occur. |\n| [repartition](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/repartition/) | Moves records between shards according to the extracted data. |\n| [run](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/run/) | Runs the pipeline of functions immediately. |"
    }
  ],
  "examples": [
    {
      "id": "overview-ex0",
      "language": "java",
      "code": "BaseReader reader = ...; // Initialize the reader\nbuilder = GearsBuilder.CreateGearsBuilder(reader);",
      "section_id": "overview"
    }
  ]
}
