apache / apache/druid

Make Transformer single-threaded and get rid of `rowSupplierForValueMatcher` ThreadLocal

Open
#8,887 2 comments 0 reactions 0 assignees View on GitHub
Contributions Welcome Refactoring
Dominant language
Java
Stars
14.1k
Forks
3.8k
Avg merge
2d 58m
Merged PRs (30d)
233

Description

`Transformer`'s `ThreadLocal rowSupplierForValueMatcher` doesn't need to be an instance field for the same reasons as `IncrementalIndex`'s `ThreadLocal in` field (see #8886). In the case of `Transformer`, it would be actually better to make it a single-threaded class right away and remove a `ThreadLocal` from inside `Transformer`, forcing users of the class to produce copies of `Transformer` per-task (worker, firehose, etc), if they need it.

Contributor guide

Open the contributing guide

Research direction

Start by reading Transformer and compare its ThreadLocal rowSupplierForValueMatcher with IncrementalIndex's ThreadLocal in and issue #8886. Search for Transformer construction and use sites to identify where per-task copies are required. Done means Transformer is single-threaded, the ThreadLocal is removed, and all affected callers provide appropriate copies.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, data-engineering
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.