Class WarmUpDiscovery

java.lang.Object
software.amazon.awssdk.core.internal.warmup.WarmUpDiscovery

@SdkInternalApi public final class WarmUpDiscovery extends Object
Shared best-effort helpers for the CRaC warm-up paths: ServiceLoader iteration and running a single warm-up task without letting its failure stop the others.
  • Method Details

    • forEachDiscovered

      public static <T> void forEachDiscovered(Iterator<T> iterator, Consumer<T> action)
      Applies action to every discovered element, skipping (and logging at warn) any element that fails to load or whose action throws, so the rest still run. Logs at debug when nothing is discovered.
    • runSafely

      public static boolean runSafely(String description, Runnable task)
      Runs one warm-up task. Returns true if it completed. If it fails, logs at warn with description and returns false, so a sibling task still runs.

      Also catches LinkageError: a task can fail to link (missing dependency or native library) and that is an Error, not an Exception. Other errors still propagate.