-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
reference.conf
151 lines (120 loc) · 6.03 KB
/
reference.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# This is the reference configuration file that contains all the default settings.
# Make your edits/overrides in your application.conf.
caffeine.jcache {
# A named cache is configured by nesting a new definition under the caffeine.jcache namespace. The
# per-cache configuration is overlaid on top of the default configuration.
default {
# The required type of the keys
key-type = java.lang.Object
# The required type of the values
value-type = java.lang.Object
# The strategy for copying the cache entry for value-based storage
store-by-value {
# If enabled, the entry is copied when crossing the API boundary
enabled = false
# It is highly recommended that the default strategy be replaced with a higher performance
# alternative (see https://github.com/eishay/jvm-serializers/wiki).
strategy = "com.github.benmanes.caffeine.jcache.copy.JavaSerializationCopier"
}
# The executor class to use when performing maintenance and asynchronous operations. Defaults to
# using ForkJoinPool.commonPool() if not set.
executor = null
# The scheduler class to use when scheduling routine maintenance based on an expiration events.
# Defaults to Scheduler.disabledScheduler() if not set.
scheduler = null
# The list of configuration paths to the listeners that consume this cache's events
listeners = []
read-through {
# If enabled, the entry is loaded automatically on a cache miss
enabled = false
# The CacheLoader class for loading entries
loader = null
}
write-through {
# If enabled, the entry is written to the resource before the cache is updated
enabled = false
# The CacheWriter class for writing entries
writer = null
}
# The monitoring configuration
monitoring {
# If Caffeine's statistics should be recorded (manually externalized via Cache#unwrap)
native-statistics = false
# If JCache statistics should be recorded and externalized via JMX
statistics = false
# If the configuration should be externalized via JMX
management = false
}
# The eviction policy for automatically removing entries from the cache
policy {
# The expiration threshold before lazily evicting an entry. This single threshold is reset on
# every operation where a duration is specified. As expected by the specification, if an entry
# expires but is not accessed and no resource constraints force eviction, then the expired
# entry remains in place.
lazy-expiration {
# The duration before a newly created entry is considered expired. If set to 0 then the
# entry is considered to be already expired and will not be added to the cache. May be
# a time duration or "eternal" to indicate no expiration.
creation = "eternal"
# The duration before a updated entry is considered expired. If set to 0 then the entry is
# considered immediately expired. May be a time duration, null to indicate no change, or
# "eternal" to indicate no expiration.
update = "eternal"
# The duration before a read of an entry is considered expired. If set to 0 then the entry
# is considered immediately expired. May be a time duration, null to indicate no change, or
# "eternal" to indicate no expiration.
access = "eternal"
}
# The expiration thresholds before eagerly evicting an entry. These settings correspond to the
# expiration supported natively by Caffeine where expired entries are collected during
# maintenance operations.
eager-expiration {
# Specifies that each entry should be automatically removed from the cache once a fixed
# duration has elapsed after the entry's creation, or the most recent replacement of its
# value. This setting cannot be combined with the variable configuration.
after-write = null
# Specifies that each entry should be automatically removed from the cache once a fixed
# duration has elapsed after the entry's creation, the most recent replacement of its value,
# or its last read. Access time is reset by all cache read and write operation. This setting
# cannot be combined with the variable configuration.
after-access = null
# The expiry class to use when calculating the expiration time of cache entries. This
# setting cannot be combined with after-write or after-access configurations.
variable = null
}
# The threshold before an entry is eligible to be automatically refreshed when the first stale
# request for an entry occurs. This setting is honored only when combined with the
# read-through configuration.
refresh {
# Specifies that active entries are eligible for automatic refresh once a fixed duration has
# elapsed after the entry's creation or the most recent replacement of its value.
after-write = null
}
# The maximum bounding of the cache based upon its logical size
maximum {
# The maximum number of entries that can be held by the cache. This setting cannot be
# combined with the weight configuration.
size = null
# The maximum total weight of entries the cache may contain (requires a weigher). This
# setting cannot be combined with the size configuration.
weight = null
# The weigher class to use when calculating the weight of cache entries
weigher = null
}
}
}
# A catalog of cache listeners; optionally defined in any namespace as referenced by path
listeners {
# An example definition of a listener
example {
# The CacheEntryListener class
class = null
# The CacheEntryEventFilter class that should be applied prior to notifying the listener
filter = null
# If the thread that created the event should block until the listener has completed
synchronous = false
# If the old value should be provided
old-value-required = false
}
}
}