Class SdkWarmUp

java.lang.Object
software.amazon.awssdk.core.warmup.SdkWarmUp

@ThreadSafe @SdkPublicApi public final class SdkWarmUp extends Object
Entry point for warming up SDK service request paths before a Coordinated Restore at Checkpoint (CRaC) checkpoint.

warmUp() discovers every SdkWarmUpProvider registered on the classpath through ServiceLoader (via the META-INF/services/software.amazon.awssdk.core.warmup.SdkWarmUpProvider resource) and invokes SdkWarmUpProvider.warmUp() on each.

Behavior contract:

  • Idempotent: warmUp() runs the warm-up at most once per JVM. Once a call completes successfully, later calls return immediately. If a call throws before completing, a later call retries. Concurrent callers block until the in-flight call finishes, then observe its result.
  • Per-provider resilience: a single provider that throws from warmUp(), or that fails to load, does not prevent the remaining providers from running.
  • Safe when empty: if no providers are registered, warmUp() is a no-op.

Call this once during application initialization, before a CRaC checkpoint is taken.

  • Method Details

    • warmUp

      public static void warmUp()
      Discovers every SdkWarmUpProvider on the classpath and invokes SdkWarmUpProvider.warmUp() on each, honoring the idempotency, per-provider resilience, and empty-classpath behavior described on this class. Safe to call concurrently.

      This method and warmUp(Class[]) track warmed state independently: this method warms every provider and does not skip clients that were warmed by a targeted warmUp(Class[]) call.

    • warmUp

      @SafeVarargs public static void warmUp(Class<? extends SdkClient>... clients)
      Warms up only the given service clients, warming the sync path for a sync client and the async path for an async client. A client already warmed by this method is skipped; a class matched by no provider, or whose warm-up fails, is logged at warn and retried on the next call. The HTTP clients on the classpath are warmed at most once across all calls to this method. Best-effort and safe to call concurrently.

      This method and warmUp() track warmed state independently: this method does not skip clients that warmUp() already warmed.

      Parameters:
      clients - the service client classes to warm up, for example ServiceClient.class or ServiceAsyncClient.class.