Skip to content

Sink operator result storage abstraction and refactoring - #1363

Merged
shengquan-ni merged 27 commits into
masterfrom
shengquan-sink-storage
Jan 25, 2022
Merged

shengquan-ni merged 27 commits into
masterfrom
shengquan-sink-storage

Conversation

@shengquan-ni

@shengquan-ni shengquan-ni commented Nov 9, 2021 •

Copy link
Copy Markdown
Contributor

Right now we have 2 sink implementations: simple sink and cache sink. Simple sink only has memory storage while cache sink has different storage options. We want to unify the 2 sinks and have an abstraction for sink storage.
This PR:

  1. Introduces sink storage with a common interface. (SinkStorage and ShardedStorage) This abstraction also supports distributed storage. Sink workers push results directly to storage.
  2. Adds 2 sink storage implementation: Memory(single-machine only), MongoDB(distributed)
  3. Reworks the result fetching mechanism, we used to let the controller collect results from all workers. But now the server pulls the result from sink storage every 3 secs by default. The controller and workers are not involved in this process anymore.
  4. Removes CacheSink operator since every sink has its sink storage now.

@shengquan-ni shengquan-ni changed the title Workflow Result Abstraction Workflow Result Abstraction (Result refactoring step 1) Nov 16, 2021
@shengquan-ni shengquan-ni changed the title Workflow Result Abstraction (Result refactoring step 1) Workflow result abstraction and refactoring Nov 16, 2021
@shengquan-ni shengquan-ni changed the title Workflow result abstraction and refactoring Sink operator result storage abstraction and refactoring Nov 21, 2021
@shengquan-ni shengquan-ni added engine refactor Refactor the code labels Dec 22, 2021
@Xiao-zhen-Liu

Copy link
Copy Markdown
Contributor

Group discussion 1/11: @zuozhiw will work with @shengquan-ni to review and merge this PR

@zuozhiw zuozhiw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've reviewed the PR with @shengquan-ni and it looks good.

@shengquan-ni
shengquan-ni merged commit 77c343b into master Jan 25, 2022
@shengquan-ni
shengquan-ni deleted the shengquan-sink-storage branch January 25, 2022 09:05
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
Right now we have 2 sink implementations: simple sink and cache sink. Simple sink only has memory storage while cache sink has different storage options. We want to unify the 2 sinks and have an abstraction for sink storage.
This PR:
1. Introduces sink storage with a common interface. (SinkStorage and ShardedStorage) This abstraction also supports distributed storage. Sink workers push results directly to storage.
2. Adds 2 sink storage implementation: Memory(single-machine only), MongoDB(distributed)
3. Reworks the result fetching mechanism, we used to let the controller collect results from all workers. But now the server pulls the result from sink storage every 3 secs by default. The controller and workers are not involved in this process anymore. 
4. Removes CacheSink operator since every sink has its sink storage now.

Co-authored-by: zuozhiw <[email protected]>
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Oct 2, 2026
### What changes were proposed in this PR?

Deletes `amber/src/main/resources/cache.ccf`, an Apache Commons JCS
cache configuration that nothing loads. **−29 lines.** There is no
behaviour change. The `commons-jcs3-core` dependency stays, because
`ComputingUnitMaster` / `ComputingUnitWorker` still import its
`InvalidArgumentException`.

JCS never names this file in code: it loads `/cache.ccf` from the
classpath implicitly, when the cache manager creates its first region.
So the check for this PR is whether anything can create a JCS cache, not
whether the file name appears anywhere. Nothing can:

- **Source:** the only JCS class referenced in any module is
`InvalidArgumentException`. Nothing calls `JCS.getInstance`,
`CacheAccess`, `CompositeCacheManager` or `JCSWorker`.
- **Bytecode:** after compiling amber and the common modules, the
compiled classes reference the same single exception class and no other
JCS class.
- **Dependencies:** no other jar on amber's runtime or test classpath
references JCS.

`InvalidArgumentException` is a plain `RuntimeException` subclass with
no static initializer, so throwing it never reaches the cache manager.

### History

| | |
| --- | --- |
| **Introduced by** | apache#1328 (2021-09-08), "[Operator Caching Step 3] add
operator cache backend new files and config changes", for
`JCSOpResultStorage`'s `JCS.getInstance("texera")` |
| **Usage removed by** | apache#1363 (2022-01-25), "Sink operator result
storage abstraction and refactoring". It deleted `JCSOpResultStorage`,
the only code that ever created a JCS cache |

It has been dead for over four and a half years.

### Any related issues, documentation, discussions?

Closes apache#8814

### How was this PR tested?

No new tests; this deletes a resource file that nothing loads.

Locally, from the repo root with Java 17:

- `sbt "WorkflowExecutionService/Test/compile"`: success.

To re-check:

```
git grep -n -i "cache\.ccf\|JCS\.getInstance\|CompositeCacheManager"   # no hits
```

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants