Class Primer
java.lang.Object
com.google.ads.googleads.lib.catalog.Primer
- Direct Known Subclasses:
DefaultPrimer
Performs startup performance optimizations to avoid cold-start of clients. Disabled by default.
To enable, set the system property defined by ENABLE_PRIMER_SYSTEM_PROPERTY=true.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an instance of the primer, if enabled.static booleanChecks if the primer should be enabled.abstract voidPrimes the classes required byGoogleAdsAllVersionsstatic voidPrimes any components that can be run without additional state (e.g.abstract voidprimeCredentialsAsync(com.google.auth.Credentials credentials) Primes the credentials, e.g.abstract voidPrimes the gRPC layer asynchronously.abstract voidPrimes the protobuf layer asynchronously.
-
Constructor Details
-
Primer
public Primer()
-
-
Method Details
-
getInstance
Returns an instance of the primer, if enabled. Otherwise, empty. -
isEnabled
public static boolean isEnabled()Checks if the primer should be enabled. This can be used to avoid initializing the primer. -
primeBasicsIfEnabled
public static void primeBasicsIfEnabled()Primes any components that can be run without additional state (e.g. credentials). -
primeGrpcAsync
public abstract void primeGrpcAsync()Primes the gRPC layer asynchronously. -
primeProtobufAsync
public abstract void primeProtobufAsync()Primes the protobuf layer asynchronously. -
primeAllVersionsAsync
public abstract void primeAllVersionsAsync()Primes the classes required byGoogleAdsAllVersions -
primeCredentialsAsync
public abstract void primeCredentialsAsync(com.google.auth.Credentials credentials) Primes the credentials, e.g. by preemptively loading an access token.- Parameters:
credentials- the credentials to prime.
-