Package com.linecorp.armeria.client
Class DnsCacheBuilder
java.lang.Object
com.linecorp.armeria.client.DnsCacheBuilder
A builder for
DnsCache
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a newly createdDnsCache
.Sets the Caffeine specification string.meterRegistry
(MeterRegistry meterRegistry) Sets theMeterRegistry
that collects cache stats.negativeTtl
(int negativeTtl) Sets the TTL of the cache for the failed DNS queries in seconds.ttl
(int minTtl, int maxTtl) Sets the minimum and maximum TTL of the cached DNS resource records in seconds.
-
Method Details
-
cacheSpec
Sets the Caffeine specification string. If not specified,Flags.dnsCacheSpec()
is used by default. -
meterRegistry
Sets theMeterRegistry
that collects cache stats. If unspecified,Metrics.globalRegistry
is used. -
ttl
Sets the minimum and maximum TTL of the cached DNS resource records in seconds. If the TTL of the DNS resource record returned by the DNS server is less than the minimum TTL or greater than the maximum TTL, this resolver will ignore the TTL from the DNS server and use the minimum TTL or the maximum TTL instead respectively. The default value is1
andInteger.MAX_VALUE
, which practically tells this resolver to respect the TTL from the DNS server. -
negativeTtl
Sets the TTL of the cache for the failed DNS queries in seconds. The default value is0
which means that failed DNS queries are not cached. -
build
Returns a newly createdDnsCache
.
-