Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Vespa engine Vespa SystemInfo

From Leeroopedia
Revision as of 17:04, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Vespa_engine_Vespa_SystemInfo.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains Cloud_API, Dependency_Injection
Last Updated 2026-02-09 00:00 GMT

Overview

Injectable value object providing comprehensive information about the system context (application, zone, cloud, cluster, node) in which a Vespa container is running.

Description

WARNING: PARTIAL DEPRECATION — Two constructors are annotated @Deprecated(forRemoval = true) and will be removed in Vespa 9: SystemInfo(ApplicationId, Zone, Cluster, Node) and SystemInfo(ApplicationId, Zone, Cloud, Cluster, Node). Use SystemInfo(ApplicationId, Zone, Cloud, String clusterName, Node) instead. See Heuristic:Vespa_engine_Vespa_Warning_Deprecated_Cloud_API_Constructors.

The SystemInfo class is the central entry point of the Vespa Cloud public API (ai.vespa.cloud package). It aggregates all deployment context information into a single injectable object:

  • ApplicationId — which tenant/application/instance this is
  • Zone — which environment and region this runs in
  • Cloud — which cloud provider hosts this deployment
  • clusterName — the name of the cluster from services.xml
  • Node — which specific node this container runs on

This class is available for injection when running in a Vespa Cloud environment. Application components can declare a constructor dependency on SystemInfo to access deployment context.

Usage

Inject SystemInfo into any Vespa component that needs to know its deployment context. Common use cases include multi-region routing, environment-specific behavior (staging vs production), and cluster-aware work distribution.

Code Reference

Source Location

Signature

public class SystemInfo {

    @Deprecated(forRemoval = true)
    public SystemInfo(ApplicationId application, Zone zone, Cluster cluster, Node node)

    @Deprecated(forRemoval = true)
    public SystemInfo(ApplicationId application, Zone zone, Cloud cloud, Cluster cluster, Node node)

    public SystemInfo(ApplicationId application, Zone zone, Cloud cloud, String clusterName, Node node)

    /** Returns the application this is running as a part of */
    public ApplicationId application()

    /** Returns the zone this is running in */
    public Zone zone()

    /** Returns the cloud provider this is running in */
    public Cloud cloud()

    /** Returns the name of the cluster it is running in */
    public String clusterName()

    /** Returns the node this is running on */
    public Node node()
}

Import

import ai.vespa.cloud.SystemInfo;

I/O Contract

Inputs

Name Type Required Description
application ApplicationId Yes Identity of the running application
zone Zone Yes Deployment zone (environment + region)
cloud Cloud Yes Cloud provider information
clusterName String Yes Cluster name from services.xml
node Node Yes Information about the running node

Outputs

Name Type Description
application() ApplicationId The application identity
zone() Zone The deployment zone
cloud() Cloud The cloud provider
clusterName() String The cluster name
node() Node The running node

Usage Examples

Environment-Specific Behavior

import ai.vespa.cloud.Environment;
import ai.vespa.cloud.SystemInfo;
import com.yahoo.component.annotation.Inject;

public class MySearcher extends com.yahoo.search.Searcher {

    private final boolean isProduction;

    @Inject
    public MySearcher(SystemInfo systemInfo) {
        this.isProduction = systemInfo.zone().environment() == Environment.prod;
    }

    // Use isProduction to control behavior
}

Multi-Region Routing

import ai.vespa.cloud.SystemInfo;
import com.yahoo.component.annotation.Inject;

public class RegionAwareHandler {

    private final String region;

    @Inject
    public RegionAwareHandler(SystemInfo systemInfo) {
        this.region = systemInfo.zone().region();
        // Route traffic based on region proximity
    }
}

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment