Skip to content

Remove unused Scala code and narrow database reads #9680

Description

@aglinxinyuan

Task Summary

Remove unused code from the Scala sources and tests of the Amber engine and web server, workflow-core, workflow-operator, observability and the notebook-migration service, and narrow the database reads of the account, notification, dashboard-search, Hub and Jupyter-registration lookups to what they use, without changing behavior:

  • Unused bindings: name the pattern, catch and callback bindings that nothing reads _ in ClusterListener, DeadLetterMonitorActor, Utils, SequentialRecordStorage, the argument parsers of ComputingUnitMaster and ComputingUnitWorker, WebsocketInput, WorkflowWebsocketResource, AiAssistantManager, ExecFactory, VirtualIdentityUtils, URLFetchUtil, HtmlVizOpDesc and DPThreadSpec.
  • S3StorageClient.uploadObject: read each chunk with a plain while loop and upload the parts in a loop that adds each CompletedPart to the Java list the SDK takes, instead of an Iterator of (partNumber, size) tuples. Copy each part out of the reused buffer once instead of twice (buffer.take and then RequestBody.fromBytes).
  • SQLSourceOpExec.fetchBatchByBoundary: take the boundary from the type match as a val instead of overwriting a var that starts as null.
  • Worker statistics: drop the executor parameter StatisticsManager.getStatistics no longer reads. Telemetry: drop WorkflowMetricsRecorder's unused logger and WorkflowMetrics' unrecorded Cancelled outcome and Unknown kind. Scan sources: drop SkippedRowReporter's uncalled count and an Arrow batch counter that is only incremented. Sort the Arrow Flight benchmark's latencies once per run.
  • Test helpers: drop parameters and defaults that no caller uses (budgetMs's default in DPThreadSpec, avatar in ExternalAuthProvisionerSpec, dictionary's default in DictionaryMatcherOpExecSpec, n's default in HashJoinOpSpec and IntervalOpExecSpec), and the thread references PythonWorkerPool never reads.
  • Test fixtures: drop TestOperators.asterixDBSourceOpDesc, which only its own TestOperatorsSpec case still builds, and getCsvScanOpDesc's multiLine parameter, which it never read. Point headerlessSmallMultiLineDataCsvScanOpDesc and the "infer schema from headerless multi-line-data csv" case of CSVScanSourceOpDescSpec at country_sales_headerless_small_multi_line.csv, so the tests named for multi-line data read it, and check the scanned rows in that case.
  • Account, login and notification queries: select only the columns AuthResource, ExternalAuthProvisioner, GmailResource, AdminUserResource and UserResource read, instead of full joined or user rows. In GmailResource, also compile the email regex once and pass the subject and content to createMimeMessage instead of copying the EmailMessage.
  • Dashboard search: build searchAllResources' results in one pass, drop getOrderFields' unreachable case None and getColumnField's case _ => null, build WorkflowSearchQueryBuilder's access condition as a val, drop a getGroupByFields override that repeats the base default, and drop the resource ID that VersionedResourceTables.hydrate pairs with each entry (every caller discards it) together with idOf.
  • Notebook migration: stop selecting the unread notebook ID and the JSONB casts, select only the two registration URLs in the Jupyter endpoint lookup, and derive a healthy registration's token once.
  • Hub: select only the columns hydrate reads, collect liked IDs with fetchSet, check likes and clones with fetchExists, and reuse the per-type request groups in getCounts without the zero entries its lookup already defaults.
  • Tests: pin the rewritten dataset-search mismatch flag, the drop of a Hub resource lakeFS cannot size, and an admin update to an unused address.

Introduced by:

Usage removed by:

This is a cleanup: production behavior does not change, and the two CSV tests named for multi-line data read the multi-line file.

Task Type

  • Refactor / Cleanup

Activity

  1. self-assigned this
    on Nov 25, 2026
  2. changed the title [-]Remove unused Scala bindings, parameters and test fixtures[/-] [+]Remove unused Scala code and narrow account, Hub and dashboard queries[/+] on Nov 25, 2026
  3. changed the title [-]Remove unused Scala code and narrow account, Hub and dashboard queries[/-] [+]Remove unused Scala code and narrow database reads[/+] on Nov 25, 2026
  4. added a commit that references this issue on Nov 25, 2026
    364786a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions