Skip to content

[Operator Caching Step 3] add operator cache backend new files and config changes - #1328

Merged
zuozhiw merged 27 commits into
masterfrom
zuozhi-jiashu-cache-pr-3
Sep 8, 2021
Merged

zuozhiw merged 27 commits into
masterfrom
zuozhi-jiashu-cache-pr-3

Conversation

@zuozhiw

@zuozhiw zuozhiw commented Sep 3, 2021 •

Copy link
Copy Markdown
Contributor

This is the third PR for implementing operator cache. In this PR, only new files and necessary config changes are included.

Files including:

  • config changes in built.sbt, application.conf, Constants.scala
  • new cache-related websocket Requests/Responses for frontend
  • a new OpResultStorage interface for caching, and 3 implementations: Mongo, ApacheJCS, and In-Memory
  • a new pair CacheSourceOp and CacheSinkOp
  • a new WorkflowRewriter that does cache invalidation and rewriting logic

@zuozhiw
zuozhiw force-pushed the zuozhi-jiashu-cache-pr-3 branch from 60e256b to 062fd95 Compare September 3, 2021 07:34

@jiashu-z jiashu-z 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'll add more testcases for WorkflowRewriter today.

@Yicong-Huang Yicong-Huang 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 think this PR needs some changes if time allows.

Comment thread core/amber/build.sbt Resolved

@jiashu-z jiashu-z 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.

@zuozhiw @Yicong-Huang I modified some implementation as requested. Please check the latest version.

@jiashu-z
jiashu-z self-requested a review September 4, 2021 14:50
@jiashu-z
jiashu-z self-requested a review September 4, 2021 15:50
@jiashu-z
jiashu-z self-requested a review September 8, 2021 06:57
@zuozhiw
zuozhiw merged commit aa4d682 into master Sep 8, 2021
@zuozhiw
zuozhiw deleted the zuozhi-jiashu-cache-pr-3 branch September 8, 2021 07:23
@jiashu-z jiashu-z mentioned this pull request Sep 8, 2021
5 of 7 tasks
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
…nfig changes (apache#1328)

This is the third PR for implementing operator cache. In this PR, only new files and necessary config changes are included.

Files including:
- config changes in `built.sbt`, `application.conf`, `Constants.scala`
- new cache-related websocket Requests/Responses for frontend
- a new `OpResultStorage` interface for caching, and 3 implementations: `Mongo`, `ApacheJCS`, and `In-Memory`
- a new pair `CacheSourceOp` and `CacheSinkOp`
- a new `WorkflowRewriter` that does cache invalidation and rewriting logic

Co-authored-by: jiashu zhang <[email protected]>
Co-authored-by: Yicong Huang <[email protected]>
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Sep 17, 2026
…#8395)

### What changes were proposed in this PR?

Deletes `TupleUtils.json2tuple`, which has no production caller. Pure
deletion, no behaviour change: **−114 lines**.

Its sibling `tuple2json` is live — `ExecutionResultService` uses it —
and stays, as does the object.

### History

| | |
| --- | --- |
| **Introduced by** | apache#1328 (2021-09-08) — "[Operator Caching Step 3]
add operator cache backend new files and config changes"; the cache read
path called `val newTuple = json2tuple(line)` when rehydrating cached
tuples |
| **Usage removed by** | apache#3111 (2024-11-26) — "Update amber to depend on
sub projects" deleted that call site while splitting amber into
sub-projects |

Dead for about two years.

> Reviewer note: removing it frees three imports that only it used —
`AttributeTypeUtils.{inferSchemaFromRows, parseField}`,
`JSONUtils.{JSONToMap, objectMapper}` and `ArrayBuffer`. `TupleSpec`'s
"produce identical strings" test was a `tuple2json → json2tuple`
round-trip, so it cannot survive the removal and goes with it; that also
orphans its `tuple2json` import, which `scalafix` flagged.

### Any related issues, documentation, discussions?

Closes apache#8392

### How was this PR tested?

Existing tests only — this PR adds none, since it removes a method and
the tests that covered it.

Locally, from the repo root with Java 17:

- `sbt "WorkflowExecutionService/Test/compile"` — success.
- `sbt "WorkflowCore/testOnly *TupleSpec *TupleUtilsSpec"` — 32 tests,
all pass.
- `sbt scalafmtCheckAll "scalafixAll --check"` — clean.

Verification, re-runnable by a reviewer:

```
git grep -n json2tuple    # only the deleted method and its tests
git grep -n tuple2json    # the live sibling, untouched
```

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

Generated-by: Claude Code (Claude Opus 5)
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Sep 26, 2026
…Event (apache#8690)

### What changes were proposed in this PR?

Deletes `CacheStatusUpdateEvent`. It is a websocket event the backend
has not sent since the websocket cache check was removed, while the
frontend kept a subscription to it. There is no behaviour change:
**+3/−87 lines**.

Backend: the case class, its `@JsonSubTypes` registration, and its
entries in `TexeraWebSocketEventSpec`.

Frontend: the interface and `TexeraWebsocketEventTypeMap` entry, and the
`subscribeToEvent("CacheStatusUpdateEvent")` handler in
`OperatorReuseCacheStatusService` with its two tests. The service's
`WorkflowWebsocketService` dependency is removed too, because that
handler was its only use.

### History

| | |
| --- | --- |
| **Introduced by** | apache#1328 (2021-09-08), "[Operator Caching Step 3] add
operator cache backend new files and config changes". The frontend
handler came in apache#1327 the day before |
| **Usage removed by** | apache#3111 (2024-11-26), "Update amber to depend on
sub projects". It deleted the `EditingTimeCompilationRequest` branch of
`WorkflowWebsocketResource`, the only place that called
`sessionState.send(CacheStatusUpdateEvent(...))` |

It has been dead for nearly two years. The frontend handler has been
subscribed to an event that never arrives.

> Reviewer note: the reuse-cache marker is unaffected.
`OperatorReuseCacheStatusService` still repaints it through its other,
live subscription (`getReuseCacheOperatorsChangedStream`).
`OperatorResultCacheStatus` and
`JointUIService.changeOperatorReuseCacheStatus` stay because that path
and the editor still use them.

### Any related issues, documentation, discussions?

Closes apache#8689

### How was this PR tested?

No new tests. The protocol spec now covers only the types that remain
registered, and the service spec drops the two cases for the removed
handler.

Locally, from the repo root with Java 17:

- `sbt "WorkflowExecutionService/Test/compile"`: success.
- `sbt "WorkflowExecutionService/testOnly *TexeraWebSocketEventSpec"`:
10 tests, all pass.
- `sbt "WorkflowExecutionService/scalafmtCheckAll"
"WorkflowExecutionService/scalafixAll --check"`: clean.

From `frontend/`:

- `npx ng test --watch=false
--include='**/operator-reuse-cache-status.service.spec.ts'
--include='**/workflow-websocket.service.spec.ts'`: 18 tests, all pass.
- `yarn format:ci`: clean.
- `npx ng build`: success.

To re-check:

```
git grep -n CacheStatusUpdateEvent   # 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)
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.

3 participants