aglinxinyuan opened a new pull request, #9519:
URL: https://github.com/apache/texera/pull/9519
### What changes were proposed in this PR?
Simplifies query round-trips, redundant allocations, exception rethrows, and
unused test scaffolding across `computing-unit-managing-service`,
`common/workflow-core`, `common/workflow-operator`, and `amber` (**+253/−254**
lines across 12 production files; **+362/−312** total across 23 files including
characterization tests and spec cleanups) without changing observable API or
engine behavior:
- **Computing unit & curated image services
(`ComputingUnitManagingResource`, `CuratedImageResource`):** Fetch ready
curated image refs and display names in a single query
(`readyImageWithNameFor`), return the generated `CUID` on unit creation and
update only `URI` and `RESOURCE`, filter `TERMINATE_TIME IS NULL` and join
`COMPUTING_UNIT_USER_ACCESS` in `listComputingUnits`, execute
`terminateComputingUnit` with a single transactional read returning `Either`,
return `(name, normalizedRef)` directly from `CuratedImageResource.validate`,
share `selectImageSummaries`, check image name uniqueness with `fetchExists`,
drop the redundant `Status.Pending` setter, and mark unused `@Auth` parameters.
- **Iceberg storage & specs (`VFSURIFactory`, `IcebergDocument`,
`IcebergTableWriter`, `IcebergDocumentSpec`,
`IcebergDocumentConsoleMessagesSpec`):** Share `IcebergDocument.requireTable`,
compute field schemas and snapshot statistics in single passes, compare and
format partition date bounds once, return `getTotalFileSize` directly without a
mutable accumulator, stream tuple ZIP exports via `iterator.zipWithIndex` while
reusing a single `TableIdentifier`, remove `IcebergTableWriter.recordId` and
the redundant `close()` guard, drop the unused `warehouse` default parameter in
`VFSURIFactory`, and remove redundant `afterAll()` forwarders in the two
Iceberg integration specs.
- **Amber engine, WebSocket handshake & set operator specs
(`CoordinatorTimerService`, `AmberRuntime`, `Utils`, `ReplayLogManager`,
`AsyncRPCServer`, `ServletAwareConfigurator`, `BinarySetOpExec`,
set/distinct/cartesian specs):** Return `None` directly from
`CoordinatorTimerService.disableTimer` and drop unused fixture defaults in
`CoordinatorTimerServiceSpec`; remove redundant identity-rethrow `catch` blocks
while preserving lock release, cursor advancement, cause unwrapping, and outer
RPC error logging; replace the trailing `.map(...)` with `.foreach(...)` in
`ServletAwareConfigurator`; remove redundant `= 0` field initialization in
`BinarySetOpExec`; and clean up unused fixture helpers and discarded
`.map(...)` loops across `CartesianProductOpExecSpec`, `DistinctOpExecSpec`,
`DifferenceOpExecSpec`, `IntersectOpExecSpec`, and
`SymmetricDifferenceOpExecSpec`.
### Any related issues, documentation, discussions?
Closes #9516.
### How was this PR tested?
Added characterization tests first (`1daf62da5c`) covering unit
listing/termination exclusivity and privilege precedence, `IcebergTableWriter`
overwrite/close behavior, `IcebergDocument` `getCount` and invalid-input
errors, `Utils.retry` lock release, and `CoordinatorTimerService` timer
cancellation. Verified two negative controls against those tests before
applying the cleanup commit (`d1d9d25b34`): dropping the
`TERMINATE_TIME.isNull` filter failed `ComputingUnitManagingResourceSpec` (51
passed, 1 failed), and omitting `handleOpt.get.cancel()` failed
`CoordinatorTimerServiceSpec` (10 passed, 4 failed).
Verified all formatting, Scalafix, unit suites, and Hadoop-catalog Iceberg
integration tests on final `HEAD` (`d1d9d25b34`, with a clean `git merge-tree`
against `82cea123eb`):
```bash
sbt "ComputingUnitManagingService/scalafix --check"
"ComputingUnitManagingService/Test/scalafix --check"
"ComputingUnitManagingService/scalafmtCheck"
"ComputingUnitManagingService/Test/scalafmtCheck" \
"WorkflowCore/scalafix --check" "WorkflowCore/Test/scalafix --check"
"WorkflowCore/scalafmtCheck" "WorkflowCore/Test/scalafmtCheck" \
"WorkflowOperator/scalafix --check" "WorkflowOperator/Test/scalafix
--check" "WorkflowOperator/scalafmtCheck" "WorkflowOperator/Test/scalafmtCheck"
\
"WorkflowExecutionService/scalafix --check"
"WorkflowExecutionService/Test/scalafix --check"
"WorkflowExecutionService/scalafmtCheck"
"WorkflowExecutionService/Test/scalafmtCheck"
STORAGE_ICEBERG_CATALOG_TYPE=hadoop UDF_PYTHON_PATH="<python3.12>" sbt \
"ComputingUnitManagingService/test" \
"WorkflowCore/testOnly * -- -l
org.apache.texera.common.tags.NonParallelTest" \
"WorkflowOperator/testOnly
org.apache.texera.amber.operator.cartesianProduct.*
org.apache.texera.amber.operator.distinct.*
org.apache.texera.amber.operator.set.*" \
"WorkflowExecutionService/testOnly
org.apache.texera.amber.engine.common.UtilsSpec
org.apache.texera.amber.engine.common.rpc.AsyncRPCServerSpec
org.apache.texera.amber.engine.architecture.logreplay.*
org.apache.texera.amber.engine.architecture.coordinator.CoordinatorTimerServiceSpec
org.apache.texera.amber.engine.architecture.coordinator.CoordinatorSpec
org.apache.texera.amber.engine.architecture.worker.WorkerTimerServiceSpec
org.apache.texera.web.ServletAwareConfiguratorSpec"
AMBER_TEST_FILTER=integration-only STORAGE_ICEBERG_CATALOG_TYPE=hadoop
UDF_PYTHON_PATH="<python3.12>" sbt \
"WorkflowExecutionService/testOnly
org.apache.texera.amber.storage.result.iceberg.IcebergDocumentSpec
org.apache.texera.amber.storage.result.iceberg.IcebergDocumentConsoleMessagesSpec"
```
- `scalafix --check` & `scalafmtCheck` (Compile & Test across all 4
modules): all 16 checks passed.
- `ComputingUnitManagingService/test`: 15 suites, 322 succeeded, 0 failed.
- `WorkflowCore/testOnly * -- -l
org.apache.texera.common.tags.NonParallelTest`: 54 suites, 708 succeeded, 0
failed, 1 pre-existing pending.
- `WorkflowOperator` (`cartesianProduct`, `distinct`, `set` specs): 10
suites, 65 succeeded, 0 failed.
- `WorkflowExecutionService` (engine, timer, replay, RPC, WebSocket unit
specs): 10 suites, 96 succeeded, 0 failed.
- `WorkflowExecutionService` (`IcebergDocumentSpec`,
`IcebergDocumentConsoleMessagesSpec` under
`AMBER_TEST_FILTER=integration-only`): 2 suites, 30 succeeded, 0 failed.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Antigravity IDE (Gemini 3.8 Flash)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]