Heuristic:Vespa engine Vespa Warning Deprecated Cloud API Constructors
| Knowledge Sources | |
|---|---|
| Domains | Cloud_API, Deprecation |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
Deprecation warning for legacy constructors in Cluster and SystemInfo classes, scheduled for removal in Vespa 9.
Description
Several constructors in the Vespa Cloud API (ai.vespa.cloud package) are annotated with @Deprecated(forRemoval = true) and carry TODO: Remove on Vespa 9 comments. These deprecated constructors exist solely for backward compatibility and will be removed in the next major version.
Affected constructors:
- Cluster(int size, List<Integer> indices) — Missing the required id parameter. Use Cluster(String id, int size, List<Integer> indices) instead.
- SystemInfo(ApplicationId, Zone, Cluster, Node) — Missing the Cloud parameter. Use the constructor accepting Cloud and clusterName instead.
- SystemInfo(ApplicationId, Zone, Cloud, Cluster, Node) — Accepts Cluster object instead of clusterName string. Use SystemInfo(ApplicationId, Zone, Cloud, String clusterName, Node) instead.
Usage
Apply this warning when reviewing or writing code that constructs Cluster or SystemInfo objects directly. If your code uses any of the deprecated constructors, migrate to the current constructors before upgrading to Vespa 9.
The Insight (Rule of Thumb)
- Action: Replace deprecated constructors with their current equivalents.
- Value: Use Cluster(String id, int size, List<Integer> indices) and SystemInfo(ApplicationId, Zone, Cloud, String clusterName, Node).
- Trade-off: None — the new constructors are strictly superior (more explicit, carry additional context).
- Deadline: Vespa 9 release (these constructors will be removed).
Reasoning
The Vespa Cloud API evolved to include cluster identity (id from services.xml) and cloud provider context. The old constructors predate these additions and cannot carry the necessary information. The @Deprecated(forRemoval = true) annotation signals that the JDK compiler will emit warnings, and future Vespa versions will remove these methods entirely.