Repository navigation
refactor: drop unused code and narrow queries - #9681
aglinxinyuan merged 6 commits into
Conversation
Unused pattern, catch and callback bindings become `_`, test helpers drop parameters and defaults no caller passes, and TestOperators drops the AsterixDB descriptor only its own spec built and the multiLine parameter getCsvScanOpDesc never read. The headerless multi-line CSV fixture reads the multi-line file again, and CSVScanSourceOpDescSpec's multi-line case now reads it too and checks the scanned rows. S3StorageClient.uploadObject copies each part once instead of twice and uploads the parts in a plain loop, and fetchBatchByBoundary returns a val.
Automated Reviewer SuggestionsBased on the
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #9681 +/- ##
============================================
+ Coverage 91.71% 91.74% +0.03%
- Complexity 5133 5135 +2
============================================
Files 1305 1305
Lines 58203 58173 -30
Branches 7598 7590 -8
============================================
- Hits 53379 53370 -9
+ Misses 2920 2906 -14
+ Partials 1904 1897 -7
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 570 | 0.348 | 17,368/19,785/19,785 us | 🟢 -15.2% / 🔴 +57.7% |
| 🟢 | bs=100 sw=10 sl=64 | 1,272 | 0.777 | 78,509/92,039/92,039 us | 🟢 -7.9% / 🟢 -12.1% |
| 🔴 | bs=1000 sw=10 sl=64 | 1,466 | 0.895 | 675,393/801,033/801,033 us | 🔴 +11.4% / 🟢 +20.3% |
Baseline details
Latest main d335251 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 570 tuples/sec | 615 tuples/sec | 900.3 tuples/sec | -7.3% | -36.7% |
| bs=10 sw=10 sl=64 | MB/s | 0.348 MB/s | 0.376 MB/s | 0.549 MB/s | -7.4% | -36.7% |
| bs=10 sw=10 sl=64 | p50 | 17,368 us | 16,315 us | 11,014 us | +6.5% | +57.7% |
| bs=10 sw=10 sl=64 | p95 | 19,785 us | 23,331 us | 14,189 us | -15.2% | +39.4% |
| bs=10 sw=10 sl=64 | p99 | 19,785 us | 23,331 us | 17,391 us | -15.2% | +13.8% |
| bs=100 sw=10 sl=64 | throughput | 1,272 tuples/sec | 1,273 tuples/sec | 1,187 tuples/sec | -0.1% | +7.2% |
| bs=100 sw=10 sl=64 | MB/s | 0.777 MB/s | 0.777 MB/s | 0.724 MB/s | 0.0% | +7.3% |
| bs=100 sw=10 sl=64 | p50 | 78,509 us | 75,001 us | 86,789 us | +4.7% | -9.5% |
| bs=100 sw=10 sl=64 | p95 | 92,039 us | 99,941 us | 94,657 us | -7.9% | -2.8% |
| bs=100 sw=10 sl=64 | p99 | 92,039 us | 99,941 us | 104,753 us | -7.9% | -12.1% |
| bs=1000 sw=10 sl=64 | throughput | 1,466 tuples/sec | 1,459 tuples/sec | 1,219 tuples/sec | +0.5% | +20.3% |
| bs=1000 sw=10 sl=64 | MB/s | 0.895 MB/s | 0.89 MB/s | 0.744 MB/s | +0.6% | +20.3% |
| bs=1000 sw=10 sl=64 | p50 | 675,393 us | 687,822 us | 846,616 us | -1.8% | -20.2% |
| bs=1000 sw=10 sl=64 | p95 | 801,033 us | 718,862 us | 887,594 us | +11.4% | -9.8% |
| bs=1000 sw=10 sl=64 | p99 | 801,033 us | 718,862 us | 940,017 us | +11.4% | -14.8% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,350.76,200,128000,570,0.348,17368.29,19784.61,19784.61
1,100,10,64,20,1571.77,2000,1280000,1272,0.777,78509.33,92039.18,92039.18
2,1000,10,64,20,13643.76,20000,12800000,1466,0.895,675392.61,801032.83,801032.83Account, login and notification lookups select only the columns they read. GmailResource compiles its email regex once and stops copying the message to add the domain. Dashboard search builds its results in one pass, drops order-field branches its regex makes unreachable and a group-by override that repeats the default, and VersionedResourceTables.hydrate drops the resource ID every caller discarded. HubResource checks likes and clones with existence queries, collects liked IDs with fetchSet and reuses its per-type request groups.
StatisticsManager.getStatistics drops the executor parameter it has not read since the sink-operator check went away. WorkflowMetricsRecorder drops a logger it never uses, WorkflowMetrics drops the Cancelled outcome and Unknown workflow kind nothing records, SkippedRowReporter drops its uncalled count, and ArrowSourceOpExec drops a batch counter it only increments. The Arrow Flight benchmark sorts each run's latencies once. NotebookMigrationResource stops selecting the unread notebook ID and the JSONB casts, and the Jupyter endpoint lookup selects the two registration URLs instead of a full row and derives a healthy registration's token once.
DatasetSearchQueryBuilderSpec runs a dataset search over a dataset lakeFS rejects and expects it left out with hasMismatch set, HubResourceSpec fetches such a dataset by ID and expects it dropped, and AdminUserResourceSpec moves a user to an address no other account uses. Both computing-unit argument parsers end in `case _`, since `case Nil` already takes the empty list.
kunwp1
left a comment
There was a problem hiding this comment.
LGTM! One optional suggestion below.
VersionedResourceTables.hydrationFields lists every column hydrate reads: the resource's own columns, the owner's email and the viewer's privilege. The Hub's by-ID query selects it instead of spelling the list out, since a query that left a column out would get a null email or privilege without an error.
What changes were proposed in this PR?
Remove unused code from the Scala sources and tests of the Amber engine and web server,
workflow-core,workflow-operator,observabilityand the notebook-migration service, and narrow the database reads of the account, notification, dashboard-search, Hub and Jupyter-registration lookups to the columns and rows they use (+285/-316 lines). Production behavior does not change. Two CSV tests that are named for multi-line data now read the multi-line file.Unused code
catchand callback bindings that nothing reads become_inClusterListener,DeadLetterMonitorActor,Utils,SequentialRecordStorage, the argument parsers ofComputingUnitMasterandComputingUnitWorker,WebsocketInput,WorkflowWebsocketResource,AiAssistantManager,ExecFactory,VirtualIdentityUtils,URLFetchUtilandHtmlVizOpDesc. The two argument parsers end incase _, sincecase Nilalready takes the empty list.S3StorageClient.uploadObject:readChunkuses a plainwhileloop instead of assigning inside the loop condition.whileloop that adds eachCompletedPartto the Java list the SDK takes. Before, anIteratorof(partNumber, size)tuples became a ScalaListand then went back through.asJava.buffer.takeandRequestBody.fromBytes, which callsArrays.copyOfitself, copied it twice. The content provider gives each SDK attempt a fresh stream over the same bytes.application/octet-streamcontent type and the read of the next chunk after each upload are unchanged.SQLSourceOpExec.fetchBatchByBoundary: returns the result of the typematchas avalinstead of overwriting avarthat starts asnull.StatisticsManager.getStatisticsdrops the executor parameter it has not read since its sink-operator check went away.DataProcessorand both statistics specs stop passing an executor to it.WorkflowMetricsRecorderdrops aLazyLoggingit never logs with, andWorkflowMetricsdrops theCancelledoutcome and theUnknownworkflow kind that nothing records.SkippedRowReporterdrops its uncalledcount, andArrowSourceOpExecdrops a batch counter it only increments.DPThreadSpec.awaitConddrops its unused default budget, and the spec's callbacks name their unused argument_.ExternalAuthProvisionerSpec'sseedUserandseedUserWithEmaildrop theavatarparameter that no test passes.DictionaryMatcherOpExecSpec.withExecutor,HashJoinOpSpec.tupleand the tuple builders ofIntervalOpExecSpecdrop defaults that every caller overrides.PythonWorkerPoolstarts its stdout and stderr reader threads without keeping the references it never reads.TestOperatorsdropsasterixDBSourceOpDesc, a descriptor for the AsterixDB server atipubmed4.ics.uci.eduthat only its ownTestOperatorsSpeccase still built. It also drops themultiLineparameter thatgetCsvScanOpDescnever read.headerlessSmallMultiLineDataCsvScanOpDescreadscountry_sales_headerless_small_multi_line.csvagain, soDataProcessingSpec's headerless multi-line case runs on multi-line data.CSVScanSourceOpDescSpeccase now reads that file too, and checks the scanned rows: 100 rows of 14 fields, a quoted value with commas, and two values with line breaks.Database reads
AuthResource's login query selects the user columns and the password hash, instead of every column of the joinedauth_provideranduserrows.ExternalAuthProvisioner's lookup selects only the user columns.AuthResource, the duplicate-email check inAdminUserResourceandUserResource.isJoiningReasonRequiredread one column, or useselectOne, instead of a full user row.GmailResourcereads only the requester's name and the admins' email addresses, compiles its email regex once, and passes the subject and the domain-suffixed content tocreateMimeMessageinstead of copying theEmailMessage.searchAllResourcesbuilds its results in one pass over the firstcountrows. Before, it built a list of entries, filtered out the omitted ones, and scanned the list again forhasMismatch.getOrderFieldsdrops thecase Nonebranch and the privategetColumnFieldwith itscase _ => null, which its regex makes unreachable, and compiles the regex once.WorkflowSearchQueryBuilderbuilds its access condition as avalinstead of overwriting aDSL.trueCondition()initializer.VersionedResourceSearchQueryBuilderdrops agetGroupByFieldsoverride that returns the base default.VersionedResourceTables.hydratestops pairing each entry with a resource ID that every caller discarded, dropsidOf, and reads the owner email from the record without building aUserPOJO.HubResource):hydratereads, instead of every joined column.VersionedResourceTables.hydrationFieldsdefines that list next tohydrate, because a query that left a column out would get anullemail or privilege without an error.isLikedHelpercollects the liked IDs withfetchSet. Like/unlike and clone check for an existing row withfetchExistsinstead of fetching it, and like/unlike no longer goes through the batch helper.getCountsreuses each entity type's request group, and drops the zero entries it added for missing view counts, since the lookup already defaults to 0.NotebookMigrationResourcestops selecting the notebook ID it never reads, and dropsJSONBcasts that its typed fields make redundant.JupyterEndpointResolverselects the two registration URLs instead of a fulluser_jupyterrow, andJupyterProvisionerderives a healthy registration's token once instead of twice.Tests for rewritten paths no test reached
DatasetSearchQueryBuilderSpecruns a dataset search over a dataset that lakeFS rejects, and expects it left out withhasMismatchset.HubResourceSpecfetches such a dataset by ID and expects it dropped.AdminUserResourceSpecmoves a user to an address no other account uses.workflow-core: #2271 (2024-01-18), #3183 (2024-12-31), #4067 (2025-11-25);workflow-operator: #1013 (2021-02-11), #1866 (2023-03-23), #3139 (2024-12-06), #3186 (2024-12-31), #6947 (2026-10-02);observability: #5376 (2026-10-27); notebook migration: #5258 (2026-06-24), #8032 (2026-09-03); tests and benchmark: #1044 (2021-02-25), #1083 (2021-04-25), #1227 (2021-07-25), #2254 (2023-12-13), #2302 (2024-02-05), #3425 (2025-05-26), #4836 (2026-05-03), #5439 (2026-06-06), #5557 (2026-06-11), #6077 (2026-07-03), #7116 (2026-07-31), #7207 (2026-08-14), #7870 (2026-08-23), #7875 (2026-08-31), #9534 (2026-11-19), #9518 (2026-11-21)Disable dependent tests with AsterixDB) commented out its only test use, which #3294 (2025-03-04) deleted; multi-line fixture: #3111 (2024-11-26,Update amber to depend on sub projects) pointedheaderlessSmallMultiLineDataCsvScanOpDescat the single-line file;awaitCond's default budget: #9534 (2026-11-19,test(amber): share engine and service test fixtures) routed its last callers through a helper that always passes one;getStatistics' executor parameter: #3312 (2025-03-12,Remove Sink Operator in the Backend) dropped its only read, the sink-operator check; everything else: unused or redundant since introductionAs of 2026-11-24, the AsterixDB fixture has had no test use for over 5 years, and the headerless multi-line CSV fixture has read single-line data for about 12 months.
Any related issues, documentation, discussions?
Closes #9680.
How was this PR tested?
The first commit (
cb95cd29b7) ran on its base,mainatde3f021dec. The second commit ran on this branch before it (2e980903c8, after mergingmain) and after it, the third likewise ondee7711a88, the fourth on3870a2da97, and the fifth on4c244837bf. Both used Windows 11, JDK 17,UDF_PYTHON_PATHset to Python 3.12, and Docker for the RustFS container thatS3StorageClientSpecstarts. The e2e case uses the Hadoop Iceberg catalog because no REST catalog runs on this machine:SQLSourceOpExecSpeccallsfetchBatchByBoundaryfor each numeric type through a mocked JDBC result. All 554 tests pass onmainand all 553 with the commit. Each test has the same outcome as onmain; the missing one is the removedasterixDBSourceOpDesccase.Observability,NotebookMigrationServiceand scan-source suite, plus the worker, statistics, checkpoint and telemetry suites that load the changed classes. Before and after it, 581 of the 595 tests in these 48 suites pass, each with the same outcome. The other 14 fail on both sides on this machine: 13ParquetScanSourceOpDescSpeccases need Hadoop's Windows binaries, and oneFileScanSourceOpDescSpeccase hits a Windows temp-file lock.VersionedResourceTablesor the Hub query. All 182 tests pass.S3StorageClientSpecruns its 34 cases against RustFS 1.0.0 in Testcontainers on both sides. They include a 6 MiB upload (a 5 MiB part and a 1 MiB tail) that downloads back byte for byte, an empty upload, and the abort when the input stream fails after the first part.country_sales_headerless_small.csv, the strengthenedCSVScanSourceOpDescSpeccase fails: row 8 readsRepublic of the Congoinstead ofRepublic,of,the,Congo. TheDataProcessingSpeccase runs the multi-line file through the engine and gets the same 100 rows that the single-line file gives onmain.-Wunused:patvars,params,privates, the compiler reports 26 unused names in the files of the first commit onmain. That commit removes 24 of them. The other two areconfigandcr, which the@OnOpenand@OnClosemethods ofWorkflowWebsocketResourceneed for the WebSocket API's signatures; they are reported on both.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)