1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2002, 2014 Oracle and/or its affiliates.  All rights reserved.
5  *
6  */
7 
8 package com.sleepycat.je;
9 
10 import java.io.File;
11 import java.util.Properties;
12 import java.util.concurrent.TimeUnit;
13 import java.util.logging.Handler;
14 
15 import com.sleepycat.je.config.EnvironmentParams;
16 import com.sleepycat.je.dbi.DbConfigManager;
17 
18 /**
19  * Specifies the attributes of an environment.
20  *
21  * <p>To change the default settings for a database environment, an application
22  * creates a configuration object, customizes settings and uses it for
23  * environment construction. The set methods of this class validate the
24  * configuration values when the method is invoked.  An
25  * IllegalArgumentException is thrown if the value is not valid for that
26  * attribute.</p>
27  *
28  * <p>All commonly used environment attributes have convenience setter/getter
29  * methods defined in this class.  For example, to change the default
30  * transaction timeout setting for an environment, the application should do
31  * the following:</p>
32  * <pre class=code>
33  *     // customize an environment configuration
34  *     EnvironmentConfig envConfig = new EnvironmentConfig();
35  *     // will throw if timeout value is invalid
36  *     envConfig.setLockTimeout(250, TimeUnit.MILLISECONDS);
37  *     // Open the environment using this configuration.
38  *     Environment myEnvironment = new Environment(home, envConfig);
39  * </pre>
40  *
41  * <p>Additional parameters are described by the parameter name String
42  * constants in this class. These additional parameters will not be needed by
43  * most applications. This category of properties can be specified for the
44  * EnvironmentConfig object through a Properties object read by
45  * EnvironmentConfig(Properties), or individually through
46  * EnvironmentConfig.setConfigParam().</p>
47  *
48  * <p>For example, an application can change the default btree node size
49  * with:</p>
50  *
51  * <pre>
52  *     envConfig.setConfigParam(EnvironmentConfig.NODE_MAX_ENTRIES, "256");
53  * </pre>
54  *
55  * <p>Environment configuration follows this order of precedence:</p>
56  * <ol>
57  * <li>Configuration parameters specified in
58  * &lt;environment home&gt;/je.properties take first precedence.
59  * <li>Configuration parameters set in the EnvironmentConfig object used at
60  * Environment construction are next.
61  * <li>Any configuration parameters not set by the application are set to
62  * system defaults, described along with the parameter name String constants
63  * in this class.</li>
64  * </ol>
65  *
66  * <p>An EnvironmentConfig can be used to specify both mutable and immutable
67  * environment properties.  Immutable properties may be specified when the
68  * first Environment handle (instance) is opened for a given physical
69  * environment.  When more handles are opened for the same environment, the
70  * following rules apply:</p>
71  *
72  * <ol> <li>Immutable properties must equal the original values specified when
73  * constructing an Environment handle for an already open environment.  When a
74  * mismatch occurs, an exception is thrown.
75  *
76  * <li>Mutable properties are ignored when constructing an Environment handle
77  * for an already open environment.  </ol>
78  *
79  * <p>After an Environment has been constructed, its mutable properties may be
80  * changed using {@link Environment#setMutableConfig}.  See {@link
81  * EnvironmentMutableConfig} for a list of mutable properties; all other
82  * properties are immutable.  Whether a property is mutable or immutable is
83  * also described along with the parameter name String constants in this
84  * class.</p>
85  *
86  * <h4>Getting the Current Environment Properties</h4>
87  *
88  * To get the current "live" properties of an environment after constructing it
89  * or changing its properties, you must call {@link Environment#getConfig} or
90  * {@link Environment#getMutableConfig}.  The original EnvironmentConfig or
91  * EnvironmentMutableConfig object used to set the properties is not kept up to
92  * date as properties are changed, and does not reflect property validation or
93  * properties that are computed.
94  *
95  * <h4><a name="timeDuration">Time Duration Properties</a></h4>
96  *
97  * <p>Several environment and transaction configuration properties are time
98  * durations.  For these properties, a time unit is specified along with an
99  * integer duration value.</p>
100  *
101  * <p>When specific setter and getter methods exist for a time duration
102  * property, these methods have a {@link TimeUnit} argument.  Examples are
103  * {@link #setLockTimeout(long,TimeUnit)} and {@link
104  * #getLockTimeout(TimeUnit)}.  Note that the {@link TimeUnit} argument may
105  * be null only when the duration value is zero; there is no default unit that
106  * is used when null is specified.</p>
107  *
108  * <p>When a time duration is specified as a string value, the following format
109  * is used.</p>
110  *
111  * <pre>   {@code <value> [ <whitespace> <unit> ]}</pre>
112  *
113  * <p>The {@code <value>} is an integer.  The {@code <unit>} name, if present,
114  * must be preceded by one or more spaces or tabs.</p>
115  *
116  * <p>The following {@code <unit>} names are allowed.  Both {@link TimeUnit}
117  * names and IEEE standard abbreviations are allowed.  Unit names are case
118  * insensitive.</p>
119  *
120  * <table border="true">
121  * <tr><th>IEEE abbreviation</th>
122  *     <th>TimeUnit name</td>
123  *     <th>Definition</th>
124  * </tr>
125  * <tr><td>{@code ns}</td>
126  *     <td>{@code NANOSECONDS}</td>
127  *     <td>one billionth (10<sup>-9</sup>) of a second</td>
128  * </tr>
129  * <tr><td>{@code us}</td>
130  *     <td>{@code MICROSECONDS}</td>
131  *     <td>one millionth (10<sup>-6</sup>) of a second</td>
132  * </tr>
133  * <tr><td>{@code ms}</td>
134  *     <td>{@code MILLISECONDS}</td>
135  *     <td>one thousandth (10<sup>-3</sup>) of a second</td>
136  * </tr>
137  * <tr><td>{@code s}</td>
138  *     <td>{@code SECONDS}</td>
139  *     <td>1 second</td>
140  * </tr>
141  * <tr><td>{@code min}</td>
142  *     <td>&nbsp;</td>
143  *     <td>60 seconds</td>
144  * </tr>
145  * <tr><td>{@code h}</td>
146  *     <td>&nbsp;</td>
147  *     <td>3600 seconds</td>
148  * </tr>
149  * </table>
150  *
151  * <p>Examples are:</p>
152  * <pre>
153  * 3 seconds
154  * 3 s
155  * 500 ms
156  * 1000000 (microseconds is implied)
157  * </pre>
158  *
159  * <p>The maximum duration value is currently Integer.MAX_VALUE milliseconds.
160  * This translates to almost 25 days (2147483647999999 ns, 2147483647999 us,
161  * 2147483647 ms, 2147483 s, 35791 min, 596 h).</p>
162  *
163  * <p>Note that when the {@code <unit>} is omitted, microseconds is implied.
164  * This default is supported for compatibility with JE 3.3 and earlier.  In JE
165  * 3.3 and earlier, explicit time units were not used and durations were always
166  * implicitly specified in microseconds.  The older methods that do not have a
167  * {@link TimeUnit} argument, such as {@link #setLockTimeout(long)} and {@link
168  * #getLockTimeout()}, use microsecond durations and have been deprecated.</p>
169  */
170 public class EnvironmentConfig extends EnvironmentMutableConfig {
171     private static final long serialVersionUID = 1L;
172 
173     /**
174      * @hidden
175      * For internal use, to allow null as a valid value for the config
176      * parameter.
177      */
178     public static final EnvironmentConfig DEFAULT = new EnvironmentConfig();
179 
180     /**
181      * The {@link #setCacheSize CacheSize} property.
182      * <p>
183      * To take full advantage of JE cache memory, it is strongly recommended
184      * that
185      * <a href="http://download.oracle.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html#compressedOop">compressed oops</a>
186      * (<code>-XX:+UseCompressedOops</code>) is specified when a 64-bit JVM is
187      * used and the maximum heap size is less than 32 GB.  As described in the
188      * referenced documentation, compressed oops is sometimes the default JVM
189      * mode even when it is not explicitly specified in the Java command.
190      * However, if compressed oops is desired then it <em>must</em> be
191      * explicitly specified in the Java command when running DbCacheSize or a
192      * JE application.  If it is not explicitly specified then JE will not
193      * aware of it, even if it is the JVM default setting, and will not take it
194      * into account when calculating cache memory sizes.
195      * <p>
196      * When using the shared cache feature, new environments that join the
197      * cache may alter the cache size setting if their configuration is set to
198      * a different value.
199      * <p><table border="1">
200      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
201      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
202      * <tr>
203      * <td>{@value}</td>
204      * <td>Long</td>
205      * <td>Yes</td>
206      * <td>0</td>
207      * <td>-none-</td>
208      * <td>-none-</td>
209      * </tr>
210      * </table></p>
211      *
212      * @see #setCacheSize
213      */
214     public static final String MAX_MEMORY = "je.maxMemory";
215 
216     /**
217      * The {@link #setCachePercent CachePercent} property.
218      * <p>
219      * When using the shared cache feature, new environments that join the
220      * cache may alter the cache percent setting if their configuration is set
221      * to a different value.
222      * <p><table border="1">
223      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
224      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
225      * <tr>
226      * <td>{@value}</td>
227      * <td>Integer</td>
228      * <td>Yes</td>
229      * <td>60</td>
230      * <td>1</td>
231      * <td>90</td>
232      * </tr>
233      * </table></p>
234      *
235      * @see #setCachePercent
236      */
237     public static final String MAX_MEMORY_PERCENT = "je.maxMemoryPercent";
238 
239     /**
240      * The {@link #setSharedCache SharedCache} property.
241      *
242      * <p><table border="1">
243      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
244      * <tr>
245      * <td>{@value}</td>
246      * <td>Boolean</td>
247      * <td>No</td>
248      * <td>false</td>
249      * </tr>
250      * </table></p>
251      */
252     public static final String SHARED_CACHE = "je.sharedCache";
253 
254     /**
255      * If true, a checkpoint is forced following recovery, even if the
256      * log ends with a checkpoint.
257      *
258      * <p><table border="1">
259      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
260      * <tr>
261      * <td>{@value}</td>
262      * <td>Boolean</td>
263      * <td>No</td>
264      * <td>false</td>
265      * </tr>
266      * </table></p>
267      */
268     public static final String ENV_RECOVERY_FORCE_CHECKPOINT =
269         "je.env.recoveryForceCheckpoint";
270 
271     /**
272      * Used after performing a restore from backup to force creation of a new
273      * log file prior to recovery.
274      * <p>
275      * When this parameter is set to true, the last .jdb file restored will not
276      * be modified when opening the Environment, and the next .jdb file will be
277      * created and will become the end-of-log file.  The intention is to make
278      * the last file restored immutable, so that the backup set remains valid
279      * and can be used as a basis for future incremental backups.
280      * <p>
281      * WARNING: If this property is <em>not</em> set to true when opening the
282      * environment for the first time after a restore, then the backup set
283      * that was restored may not be used as the basis for future incremental
284      * backups.  If a future incremental backup were performed based on this
285      * backup set, it would be incomplete and data would be lost if that
286      * incremental backup were restored.
287      *
288      * <p><table border="1">
289      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
290      * <tr>
291      * <td>{@value}</td>
292      * <td>Boolean</td>
293      * <td>No</td>
294      * <td>false</td>
295      * </tr>
296      * </table></p>
297      *
298      * @see <a href="util/DbBackup.html#restore">Restoring from a backup</a>
299      */
300     public static final String ENV_RECOVERY_FORCE_NEW_FILE =
301         "je.env.recoveryForceNewFile";
302 
303     /**
304      * By default, if a checksum exception is found at the end of the log
305      * during Environment startup, JE will assume the checksum is due to
306      * previously interrupted I/O and will quietly truncate the log and
307      * restart. If this property is set to true, when a ChecksumException
308      * occurs in the last log file during recovery, instead of truncating the
309      * log file, and automatically restarting, attempt to continue reading past
310      * the corrupted record with the checksum error to see if there are commit
311      * records following the corruption. If there are, throw an
312      * EnvironmentFailureException to indicate the presence of committed
313      * transactions. The user may then need to run DbTruncateLog to truncate
314      * the log for further recovery after doing manual analysis of the log.
315      * Setting this property is suitable when the application wants to guard
316      * against unusual cases.
317      *
318      * <p><table border="1">
319      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
320      * <tr>
321      * <td>{@value}</td>
322      * <td>Boolean</td>
323      * <td>No</td>
324      * <td>false</td>
325      * </tr>
326      * </table></p>
327      */
328     public static final String HALT_ON_COMMIT_AFTER_CHECKSUMEXCEPTION =
329         "je.haltOnCommitAfterChecksumException";
330 
331     /**
332      * If true, starts up the INCompressor thread.
333      *
334      * <p><table border="1">
335      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
336      * <tr>
337      * <td>{@value}</td>
338      * <td>Boolean</td>
339      * <td>Yes</td>
340      * <td>true</td>
341      * </tr>
342      * </table></p>
343      */
344     public static final String ENV_RUN_IN_COMPRESSOR =
345         "je.env.runINCompressor";
346 
347     /**
348      * If true, starts up the checkpointer thread.
349      *
350      * <p><table border="1">
351      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
352      * <tr>
353      * <td>{@value}</td>
354      * <td>Boolean</td>
355      * <td>Yes</td>
356      * <td>true</td>
357      * </tr>
358      * </table></p>
359      */
360     public static final String ENV_RUN_CHECKPOINTER = "je.env.runCheckpointer";
361 
362     /**
363      * If true, starts up the cleaner thread.
364      *
365      * <p><table border="1">
366      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
367      * <tr>
368      * <td>{@value}</td>
369      * <td>Boolean</td>
370      * <td>Yes</td>
371      * <td>true</td>
372      * </tr>
373      * </table></p>
374      */
375     public static final String ENV_RUN_CLEANER = "je.env.runCleaner";
376 
377     /**
378      * If true, eviction is also done by a pool of evictor threads, as well as
379      * being done inline by application threads. If false, the evictor pool is
380      * not used, regardless of the values of je.evictor.coreThreads and
381      * je.evictor.maxThreads.
382      *
383      * <p><table border="1">
384      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
385      * <tr>
386      * <td>{@value}</td>
387      * <td>Boolean</td>
388      * <td>Yes</td>
389      * <td>true</td>
390      * </tr>
391      * </table></p>
392      */
393     public static final String ENV_RUN_EVICTOR = "je.env.runEvictor";
394 
395     /**
396      * The maximum number of read operations performed by JE background
397      * activities (e.g., cleaning) before sleeping to ensure that application
398      * threads can perform I/O.  If zero (the default) then no limitation on
399      * I/O is enforced.
400      *
401      * <p><table border="1">
402      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
403      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
404      * <tr>
405      * <td>{@value}</td>
406      * <td>Integer</td>
407      * <td>Yes</td>
408      * <td>0</td>
409      * <td>0</td>
410      * <td>-none-</td>
411      * </tr>
412      * </table></p>
413      *
414      * @see #ENV_BACKGROUND_SLEEP_INTERVAL
415      */
416     public static final String ENV_BACKGROUND_READ_LIMIT =
417         "je.env.backgroundReadLimit";
418 
419     /**
420      * The maximum number of write operations performed by JE background
421      * activities (e.g., checkpointing and eviction) before sleeping to ensure
422      * that application threads can perform I/O.  If zero (the default) then no
423      * limitation on I/O is enforced.
424      *
425      * <p><table border="1">
426      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
427      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
428      * <tr>
429      * <td>{@value}</td>
430      * <td>Integer</td>
431      * <td>Yes</td>
432      * <td>0</td>
433      * <td>0</td>
434      * <td>-none-</td>
435      * </tr>
436      * </table></p>
437      *
438      * @see #ENV_BACKGROUND_SLEEP_INTERVAL
439      */
440     public static final String ENV_BACKGROUND_WRITE_LIMIT =
441         "je.env.backgroundWriteLimit";
442 
443     /**
444      * The duration that JE background activities will sleep when the {@link
445      * #ENV_BACKGROUND_WRITE_LIMIT} or {@link #ENV_BACKGROUND_READ_LIMIT} is
446      * reached.  If {@link #ENV_BACKGROUND_WRITE_LIMIT} and {@link
447      * #ENV_BACKGROUND_READ_LIMIT} are zero, this setting is not used.
448      *
449      * <p><table border="1">
450      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
451      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
452      * <tr>
453      * <td>{@value}</td>
454      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
455      * <td>Yes</td>
456      * <td>1 ms</td>
457      * <td>1 ms</td>
458      * <td>24 d</td>
459      * </tr>
460      * </table></p>
461      *
462      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
463      * Properties</a>
464      */
465     public static final String ENV_BACKGROUND_SLEEP_INTERVAL =
466         "je.env.backgroundSleepInterval";
467 
468     /**
469      * Debugging support: check leaked locks and txns at env close.
470      *
471      * <p><table border="1">
472      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
473      * <tr>
474      * <td>{@value}</td>
475      * <td>Boolean</td>
476      * <td>No</td>
477      * <td>true</td>
478      * </tr>
479      * </table></p>
480      */
481     public static final String ENV_CHECK_LEAKS = "je.env.checkLeaks";
482 
483     /**
484      * Debugging support: call Thread.yield() at strategic points.
485      *
486      * <p><table border="1">
487      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
488      * <tr>
489      * <td>{@value}</td>
490      * <td>Boolean</td>
491      * <td>No</td>
492      * <td>false</td>
493      * </tr>
494      * </table></p>
495      */
496     public static final String ENV_FORCED_YIELD = "je.env.forcedYield";
497 
498     /**
499      * If true, create an environment that is capable of performing
500      * transactions.  If true is not passed, transactions may not be used.  For
501      * licensing purposes, the use of this method distinguishes the use of the
502      * Transactional product.  Note that if transactions are not used,
503      * specifying true does not create additional overhead in the environment.
504      *
505      * <p><table border="1">
506      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
507      * <tr>
508      * <td>{@value}</td>
509      * <td>Boolean</td>
510      * <td>No</td>
511      * <td>false</td>
512      * </tr>
513      * </table></p>
514      */
515     public static final String ENV_IS_TRANSACTIONAL = "je.env.isTransactional";
516 
517     /**
518      * If true, create the environment with record locking.  This property
519      * should be set to false only in special circumstances when it is safe to
520      * run without record locking.
521      *
522      * <p><table border="1">
523      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
524      * <tr>
525      * <td>{@value}</td>
526      * <td>Boolean</td>
527      * <td>No</td>
528      * <td>true</td>
529      * </tr>
530      * </table></p>
531      */
532     public static final String ENV_IS_LOCKING = "je.env.isLocking";
533 
534     /**
535      * If true, open the environment read-only.
536      *
537      * <p><table border="1">
538      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
539      * <tr>
540      * <td>{@value}</td>
541      * <td>Boolean</td>
542      * <td>No</td>
543      * <td>false</td>
544      * </tr>
545      * </table></p>
546      */
547     public static final String ENV_READ_ONLY = "je.env.isReadOnly";
548 
549     /**
550      * If true, use latches instead of synchronized blocks to implement the
551      * lock table and log write mutexes. Latches require that threads queue to
552      * obtain the mutex in question and therefore guarantee that there will be
553      * no mutex starvation, but do incur a performance penalty. Latches should
554      * not be necessary in most cases, so synchronized blocks are the default.
555      * An application that puts heavy load on JE with threads with different
556      * thread priorities might find it useful to use latches.  In a Java 5 JVM,
557      * where java.util.concurrent.locks.ReentrantLock is used for the latch
558      * implementation, this parameter will determine whether they are 'fair' or
559      * not.  This parameter is 'static' across all environments.
560      *
561      * <p><table border="1">
562      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
563      * <tr>
564      * <td>{@value}</td>
565      * <td>Boolean</td>
566      * <td>No</td>
567      * <td>false</td>
568      * </tr>
569      * </table></p>
570      */
571     public static final String ENV_FAIR_LATCHES = "je.env.fairLatches";
572 
573     /**
574      * The timeout for detecting internal latch timeouts, so that deadlocks can
575      * be detected. Latches are held internally for very short durations. If
576      * due to unforeseen problems a deadlock occurs, a timeout will occur after
577      * the duration specified by this parameter. When a latch timeout occurs:
578      * <ul>
579      *     <li>The Environment is invalidated and must be closed.</li>
580      *     <li>An {@link EnvironmentFailureException} is thrown.</li>
581      *     <li>A full thread dump is logged at level SEVERE.</li>
582      * </ul>
583      * If this happens, thread dump in je.info file should be preserved so it
584      * can be used to analyze the problem.
585      * <p>
586      * Most applications should not change this parameter. The default value, 5
587      * minutes, should be much longer than a latch is ever held.
588      *
589      * <p><table border="1">
590      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
591      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
592      * <tr>
593      * <td>{@value}</td>
594      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
595      * <td>No</td>
596      * <td>5 min</td>
597      * <td>1 ms</td>
598      * <td>-none-</td>
599      * </tr>
600      * </table></p>
601      *
602      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
603      * Properties</a>
604      *
605      * @since 6.2
606      */
607     public static final String ENV_LATCH_TIMEOUT = "je.env.latchTimeout";
608 
609     /**
610      * If true, enable eviction of metadata for closed databases.
611      *
612      * <p><table border="1">
613      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
614      * <tr>
615      * <td>{@value}</td>
616      * <td>Boolean</td>
617      * <td>No</td>
618      * <td>true</td>
619      * </tr>
620      * </table></p>
621      */
622     public static final String ENV_DB_EVICTION = "je.env.dbEviction";
623 
624     /**
625      * If true (the default) preload all duplicates databases at once when
626      * upgrading from JE 4.1 and earlier.  If false, preload each duplicates
627      * database individually instead.  Preloading all databases at once gives a
628      * performance advantage if the JE cache is roughly large enough to contain
629      * the internal nodes for all duplicates databases.  Preloading each
630      * database individually gives a performance advantage if the JE cache is
631      * roughly large enough to contain the internal nodes for a single
632      * duplicates database.
633      *
634      * <p><table border="1">
635      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
636      * <tr>
637      * <td>{@value}</td>
638      * <td>Boolean</td>
639      * <td>No</td>
640      * <td>true</td>
641      * </tr>
642      * </table></p>
643      */
644     public static final String ENV_DUP_CONVERT_PRELOAD_ALL =
645         "je.env.dupConvertPreloadAll";
646 
647     /**
648      * By default, JE passes an entire log record to the Adler32 class for
649      * checksumming.  This can cause problems with the GC in some cases if the
650      * records are large and there is concurrency.  Setting this parameter will
651      * cause JE to pass chunks of the log record to the checksumming class so
652      * that the GC does not block.  0 means do not chunk.
653      *
654      * <p><table border="1">
655      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
656      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
657      * <tr>
658      * <td>{@value}</td>
659      * <td>Integer</td>
660      * <td>Yes</td>
661      * <td>0</td>
662      * <td>0</td>
663      * <td>1048576 (1M)</td>
664      * </tr>
665      * </table></p>
666      */
667     public static final String ADLER32_CHUNK_SIZE = "je.adler32.chunkSize";
668 
669     /**
670      * The total memory taken by log buffers, in bytes. If 0, use 7% of
671      * je.maxMemory. If 0 and je.sharedCache=true, use 7% divided by N where N
672      * is the number of environments sharing the global cache.
673      *
674      * <p><table border="1">
675      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
676      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
677      * <tr>
678      * <td>{@value}</td>
679      * <td>Long</td>
680      * <td>No</td>
681      * <td>0</td>
682      * <td>{@value
683      * com.sleepycat.je.config.EnvironmentParams#LOG_MEM_SIZE_MIN}</td>
684      * <td>-none-</td>
685      * </tr>
686      * </table></p>
687      */
688     public static final String LOG_TOTAL_BUFFER_BYTES =
689         "je.log.totalBufferBytes";
690 
691     /**
692      * The number of JE log buffers.
693      *
694      * <p><table border="1">
695      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
696      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
697      * <tr>
698      * <td>{@value}</td>
699      * <td>Integer</td>
700      * <td>No</td>
701      * <td>{@value
702      * com.sleepycat.je.config.EnvironmentParams#NUM_LOG_BUFFERS_DEFAULT}</td>
703      * <td>2</td>
704      * <td>-none-</td>
705      * </tr>
706      * </table></p>
707      */
708     public static final String LOG_NUM_BUFFERS = "je.log.numBuffers";
709 
710     /**
711      * The maximum starting size of a JE log buffer.  JE silently restricts
712      * this value to be no more than the configured maximum log file size
713      * (je.log.fileMax).
714      *
715      * <p><table border="1">
716      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
717      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
718      * <tr>
719      * <td>{@value}</td>
720      * <td>Integer</td>
721      * <td>No</td>
722      * <td>1048576 (1M)</td>
723      * <td>1024 (1K)</td>
724      * <td>-none-</td>
725      * </tr>
726      * </table></p>
727      */
728     public static final String LOG_BUFFER_SIZE = "je.log.bufferSize";
729 
730     /**
731      * The buffer size for faulting in objects from disk, in bytes.
732      *
733      * <p><table border="1">
734      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
735      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
736      * <tr>
737      * <td>{@value}</td>
738      * <td>Integer</td>
739      * <td>No</td>
740      * <td>2048 (2K)</td>
741      * <td>32</td>
742      * <td>-none-</td>
743      * </tr>
744      * </table></p>
745      */
746     public static final String LOG_FAULT_READ_SIZE = "je.log.faultReadSize";
747 
748     /**
749      * The read buffer size for log iterators, which are used when scanning the
750      * log during activities like log cleaning and environment open, in bytes.
751      * This may grow as the system encounters larger log entries.
752      *
753      * <p><table border="1">
754      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
755      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
756      * <tr>
757      * <td>{@value}</td>
758      * <td>Integer</td>
759      * <td>No</td>
760      * <td>8192 (8K)</td>
761      * <td>128</td>
762      * <td>-none-</td>
763      * </tr>
764      * </table></p>
765      */
766     public static final String LOG_ITERATOR_READ_SIZE =
767         "je.log.iteratorReadSize";
768 
769     /**
770      * The maximum read buffer size for log iterators, which are used when
771      * scanning the log during activities like log cleaning and environment
772      * open, in bytes.
773      *
774      * <p><table border="1">
775      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
776      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
777      * <tr>
778      * <td>{@value}</td>
779      * <td>Integer</td>
780      * <td>No</td>
781      * <td>16777216 (16M)</td>
782      * <td>128</td>
783      * <td>-none-</td>
784      * </tr>
785      * </table></p>
786      */
787     public static final String LOG_ITERATOR_MAX_SIZE =
788         "je.log.iteratorMaxSize";
789 
790     /**
791      * The maximum size of each individual JE log file, in bytes.
792      *
793      * <p><table border="1">
794      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
795      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
796      * <tr>
797      * <td>{@value}</td>
798      * <td>Long</td>
799      * <td>No</td>
800      * <td>10000000 (10M)</td>
801      * <td>1000000 (1M)</td>
802      * <td>1073741824 (1G)</td>
803      * </tr>
804      * </table></p>
805      */
806     public static final String LOG_FILE_MAX = "je.log.fileMax";
807 
808     /**
809      * The JE environment can be spread across multiple subdirectories.
810      * Environment subdirectories may be used to spread an environment's .jdb
811      * files over multiple directories, and therefore over multiple disks or
812      * file systems.  Environment subdirectories reside in the environment home
813      * directory and are named data001/ through dataNNN/, consecutively, where
814      * NNN is the value of je.log.nDataDirectories.  A typical configuration
815      * would be to have each of the dataNNN/ names be symbolic links to actual
816      * directories which each reside on separate file systems or disks.
817      * <p>
818      * If 0, all log files (*.jdb) will reside in the environment
819      * home directory passed to the Environment constructor.  A non-zero value
820      * indicates the number of environment subdirectories to use for holding the
821      * environment log files.
822      * <p>
823      * If data subdirectories are used (i.e. je.log.nDataDirectories > 0), this
824      * parameter must be set when the environment is initially created.
825      * Like the environment home directory, each and every one of the dataNNN/
826      * subdirectories must also be present and writable.  This parameter must
827      * be set to the same value for all subsequent openings of the environment
828      * or an exception will be thrown.
829      * <p>
830      * If the set of existing dataNNN/ subdirectories is not equivalent to the
831      * set { 1 ... je.log.nDataDirectories } when the environment is opened, an
832      * EnvironmentFailureException will be thrown, and the Environment will
833      * fail to be opened.
834      * <p>
835      * This parameter should be set using the je.properties file rather than
836      * the EnvironmentConfig. If not, JE command line utilities that open the
837      * Environment will throw an exception because they will not know of the
838      * non-zero value of this parameter.
839      * <p><table border="1">
840      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
841      * <td>Default</td><td>Minimum</td><td>Maximum</td><td>JVM</td></tr>
842      * <tr>
843      * <td>{@value}</td>
844      * <td>Integer</td>
845      * <td>No</td>
846      * <td>0</td>
847      * <td>0</td>
848      * <td>256</td>
849      * </tr>
850      * </table></p>
851      */
852     public static final String LOG_N_DATA_DIRECTORIES =
853         "je.log.nDataDirectories";
854 
855     /**
856      * If true, perform a checksum check when reading entries from log.
857      *
858      * <p><table border="1">
859      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
860      * <tr>
861      * <td>{@value}</td>
862      * <td>Boolean</td>
863      * <td>No</td>
864      * <td>true</td>
865      * </tr>
866      * </table></p>
867      */
868     public static final String LOG_CHECKSUM_READ = "je.log.checksumRead";
869 
870     /**
871      * If true, perform a checksum verification just before and after writing
872      * to the log.  This is primarily used for debugging.
873      *
874      * <p><table border="1">
875      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
876      * <tr>
877      * <td>{@value}</td>
878      * <td>Boolean</td>
879      * <td>No</td>
880      * <td>false</td>
881      * </tr>
882      * </table></p>
883      */
884     public static final String LOG_VERIFY_CHECKSUMS = "je.log.verifyChecksums";
885 
886     /**
887      * If true, operates in an in-memory test mode without flushing the log to
888      * disk. An environment directory must be specified, but it need not exist
889      * and no files are written.  The system operates until it runs out of
890      * memory, at which time an OutOfMemoryError is thrown.  Because the entire
891      * log is kept in memory, this mode is normally useful only for testing.
892      *
893      * <p><table border="1">
894      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
895      * <tr>
896      * <td>{@value}</td>
897      * <td>Boolean</td>
898      * <td>No</td>
899      * <td>false</td>
900      * </tr>
901      * </table></p>
902      */
903     public static final String LOG_MEM_ONLY = "je.log.memOnly";
904 
905     /**
906      * The size of the file handle cache.
907      *
908      * <p><table border="1">
909      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
910      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
911      * <tr>
912      * <td>{@value}</td>
913      * <td>Integer</td>
914      * <td>No</td>
915      * <td>100</td>
916      * <td>3</td>
917      * <td>-none-</td>
918      * </tr>
919      * </table></p>
920      */
921     public static final String LOG_FILE_CACHE_SIZE = "je.log.fileCacheSize";
922 
923     /**
924      * The timeout limit for group file sync, in microseconds.
925      *
926      * <p><table border="1">
927      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
928      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
929      * <tr>
930      * <td>{@value}</td>
931      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
932      * <td>No</td>
933      * <td>500 ms</td>
934      * <td>10 ms</td>
935      * <td>24 d</td>
936      * </tr>
937      * </table></p>
938      *
939      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
940      * Properties</a>
941      */
942     public static final String LOG_FSYNC_TIMEOUT = "je.log.fsyncTimeout";
943 
944     /**
945      * The time interval in nanoseconds during which transactions may be
946      * grouped to amortize the cost of write and/or fsync when a transaction
947      * commits with SyncPolicy#SYNC or SyncPolicy#WRITE_NO_SYNC on the local
948      * machine.
949      *
950      * <p><table border="1">
951      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
952      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
953      * <tr>
954      * <td>{@value}</td>
955      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
956      * <td>No</td>
957      * <td>0</td>
958      * <td>0</td>
959      * <td>none</td>
960      * </tr>
961      * </table></p>
962      *
963      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
964      * Properties</a>
965      * @since 5.0.76
966      * @see #LOG_GROUP_COMMIT_THRESHOLD
967      */
968     public static final String LOG_GROUP_COMMIT_INTERVAL =
969         "je.log.groupCommitInterval";
970 
971     /**
972      * The threshold value impacts the number of transactions that may be
973      * grouped to amortize the cost of write and/or fsync when a
974      * transaction commits with SyncPolicy#SYNC or SyncPolicy#WRITE_NO_SYNC
975      * on the local machine.
976      * <p>
977      * Specifying larger values can result in more transactions being grouped
978      * together decreasing average commit times.
979      * <p>
980      * <table border="1">
981      * <tr>
982      * <td>Name</td>
983      * <td>Type</td>
984      * <td>Mutable</td>
985      * <td>Default</td>
986      * <td>Minimum</td>
987      * <td>Maximum</td>
988      * </tr>
989      * <tr>
990      * <td>{@value}</td>
991      * <td>Integer</td>
992      * <td>No</td>
993      * <td>0</td>
994      * <td>0</td>
995      * <td>-none-</td>
996      * </tr>
997      * </table>
998      * </p>
999      *
1000      * @since 5.0.76
1001      * @see #LOG_GROUP_COMMIT_INTERVAL
1002      */
1003     public static final String LOG_GROUP_COMMIT_THRESHOLD =
1004         "je.log.groupCommitThreshold";
1005 
1006     /**
1007      * If true (default is false) O_DSYNC is used to open JE log files.
1008      *
1009      * <p><table border="1">
1010      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
1011      * <tr>
1012      * <td>{@value}</td>
1013      * <td>Boolean</td>
1014      * <td>No</td>
1015      * <td>false</td>
1016      * </tr>
1017      * </table></p>
1018      */
1019     public static final String LOG_USE_ODSYNC = "je.log.useODSYNC";
1020 
1021     /**
1022      * If true (default is false) NIO is used for all file I/O.
1023      *
1024      * <p><table border="1">
1025      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
1026      * <tr>
1027      * <td>{@value}</td>
1028      * <td>Boolean</td>
1029      * <td>No</td>
1030      * <td>false</td>
1031      * </tr>
1032      * </table></p>
1033      * @deprecated NIO is no longer used by JE and this parameter has no
1034      * effect.
1035      */
1036     public static final String LOG_USE_NIO = "je.log.useNIO";
1037 
1038     /**
1039      * If true (default is true) the Write Queue is used for file I/O
1040      * operations which are blocked by concurrent I/O operations.
1041      *
1042      * <p><table border="1">
1043      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
1044      * <tr>
1045      * <td>{@value}</td>
1046      * <td>Boolean</td>
1047      * <td>No</td>
1048      * <td>true</td>
1049      * </tr>
1050      * </table></p>
1051      */
1052     public static final String LOG_USE_WRITE_QUEUE = "je.log.useWriteQueue";
1053 
1054     /**
1055      * The size of the Write Queue.
1056      *
1057      * <p><table border="1">
1058      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1059      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1060      * <tr>
1061      * <td>{@value}</td>
1062      * <td>Integer</td>
1063      * <td>No</td>
1064      * <td>1MB</td>
1065      * <td>4KB</td>
1066      * <td>32MB-</td>
1067      * </tr>
1068      * </table></p>
1069      */
1070     public static final String LOG_WRITE_QUEUE_SIZE = "je.log.writeQueueSize";
1071 
1072     /**
1073      * If true (default is false) direct NIO buffers are used.  This setting is
1074      * only used if {@link #LOG_USE_NIO} is true.
1075      *
1076      * <p><table border="1">
1077      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
1078      * <tr>
1079      * <td>{@value}</td>
1080      * <td>Boolean</td>
1081      * <td>No</td>
1082      * <td>false</td>
1083      * </tr>
1084      * </table></p>
1085      * @deprecated NIO is no longer used by JE and this parameter has no
1086      * effect.
1087      */
1088     public static final String LOG_DIRECT_NIO = "je.log.directNIO";
1089 
1090     /**
1091      * If non-0 (default is 0) break all IO into chunks of this size.  This
1092      * setting is only used if {@link #LOG_USE_NIO} is true.
1093      *
1094      * <p><table border="1">
1095      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1096      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1097      * <tr>
1098      * <td>{@value}</td>
1099      * <td>Long</td>
1100      * <td>No</td>
1101      * <td>0</td>
1102      * <td>0</td>
1103      * <td>67108864 (64M)</td>
1104      * </tr>
1105      * </table></p>
1106      * @deprecated NIO is no longer used by JE and this parameter has no
1107      * effect.
1108      */
1109     public static final String LOG_CHUNKED_NIO = "je.log.chunkedNIO";
1110 
1111     /**
1112      * The maximum number of entries in an internal btree node.  This can be
1113      * set per-database using the DatabaseConfig object.
1114      *
1115      * <p><table border="1">
1116      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1117      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1118      * <tr>
1119      * <td>{@value}</td>
1120      * <td>Integer</td>
1121      * <td>No</td>
1122      * <td>128</td>
1123      * <td>4</td>
1124      * <td>32767 (32K)</td>
1125      * </tr>
1126      * </table></p>
1127      */
1128     public static final String NODE_MAX_ENTRIES = "je.nodeMaxEntries";
1129 
1130     /**
1131      * @deprecated this property no longer has any effect; {@link
1132      * DatabaseConfig#setNodeMaxEntries} should be used instead.
1133      */
1134     public static final String NODE_DUP_TREE_MAX_ENTRIES =
1135         "je.nodeDupTreeMaxEntries";
1136 
1137     /**
1138      * After this many deltas, log a full version.
1139      *
1140      * <p><table border="1">
1141      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1142      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1143      * <tr>
1144      * <td>{@value}</td>
1145      * <td>Integer</td>
1146      * <td>No</td>
1147      * <td>10</td>
1148      * <td>0</td>
1149      * <td>100</td>
1150      * </tr>
1151      * </table></p>
1152      *
1153      * @deprecated as of JE 6.0.  The {@link #TREE_BIN_DELTA} param alone now
1154      * determines whether a delta is logged.
1155      */
1156     public static final String TREE_MAX_DELTA = "je.tree.maxDelta";
1157 
1158     /**
1159      * If more than this percentage of entries are changed on a BIN, log a a
1160      * full version instead of a delta.
1161      *
1162      * <p><table border="1">
1163      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1164      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1165      * <tr>
1166      * <td>{@value}</td>
1167      * <td>Integer</td>
1168      * <td>No</td>
1169      * <td>25</td>
1170      * <td>0</td>
1171      * <td>75</td>
1172      * </tr>
1173      * </table></p>
1174      */
1175     public static final String TREE_BIN_DELTA = "je.tree.binDelta";
1176 
1177     /**
1178      * The minimum bytes allocated out of the memory cache to hold Btree data
1179      * including internal nodes and record keys and data.  If the specified
1180      * value is larger than the size initially available in the cache, it will
1181      * be truncated to the amount available.
1182      *
1183      * <p>{@link #TREE_MIN_MEMORY} is the minimum for a single environment.  By
1184      * default, 500 KB or the size initially available in the cache is used,
1185      * whichever is smaller.</p>
1186      *
1187      * <p><table border="1">
1188      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1189      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1190      * <tr>
1191      * <td>{@value}</td>
1192      * <td>Long</td>
1193      * <td>Yes</td>
1194      * <td>512000 (500K)</td>
1195      * <td>51200 (50K)</td>
1196      * <td>-none-</td>
1197      * </tr>
1198      * </table></p>
1199      */
1200     public static final String TREE_MIN_MEMORY = "je.tree.minMemory";
1201 
1202     /**
1203      * Specifies the maximum unprefixed key length for use in the compact
1204      * in-memory key representation.
1205      *
1206      * <p>In the Btree, the JE in-memory cache, the default representation for
1207      * keys uses a byte array object per key.  The per-key object overhead of
1208      * this approach ranges from 20 to 32 bytes, depending on the JVM
1209      * platform.</p>
1210      *
1211      * <p>To reduce memory overhead, a compact representation can instead be
1212      * used where keys will be represented inside a single byte array instead
1213      * of having one byte array per key. Within the single array, all keys are
1214      * assigned a storage size equal to that taken up by the largest key, plus
1215      * one byte to hold the actual key length.  The use of the fixed size array
1216      * reduces Java GC activity as well as memory overhead.</p>
1217      *
1218      * <p>In order for the compact representation to reduce memory usage, all
1219      * keys in a database, or in a Btree internal node, must be roughly the
1220      * same size.  The more fully populated the internal node, the more the
1221      * savings with this representation since the single byte array is sized to
1222      * hold the maximum number of keys in the internal node, regardless of the
1223      * actual number of keys that are present.</p>
1224      *
1225      * <p>It's worth noting that the storage savings of the compact
1226      * representation are realized in addition to the storage benefits of key
1227      * prefixing (if it is configured), since the keys stored in the key array
1228      * are the smaller key values after the prefix has been stripped, reducing
1229      * the length of the key and making it more likely that it's small enough
1230      * for this specialized representation.  This configuration parameter
1231      * ({@code TREE_COMPACT_MAX_KEY_LENGTH}) is the maximum key length, not
1232      * including the common prefix, for the keys in a Btree internal node
1233      * stored using the compact representation.  See {@link
1234      * DatabaseConfig#setKeyPrefixing}.</p>
1235      *
1236      * <p>The compact representation is used automatically when both of the
1237      * following conditions hold.</p>
1238      * <ul>
1239      * <li>All keys in a Btree internal node must have an unprefixed length
1240      * that is less than or equal to the length specified by this parameter
1241      * ({@code TREE_COMPACT_MAX_KEY_LENGTH}).</li>
1242      * <li>If key lengths vary by large amounts within an internal node, the
1243      * wasted space of the fixed length storage may negate the benefits of the
1244      * compact representation and cause more memory to be used than with the
1245      * default representation.  In that case, the default representation will
1246      * be used.</li>
1247      * </ul>
1248      *
1249      * <p>If this configuration parameter is set to zero, the compact
1250      * representation will not be used.</p>
1251      *
1252      * <p>The default value of this configuration parameter is 16 bytes.  The
1253      * potential drawbacks of specifying a larger length are:</p>
1254      * <ul>
1255      * <li>Insertion and deletion for larger keys move bytes proportional to
1256      * the storage length of the keys.</li>
1257      * <li>With the compact representation, all operations create temporary
1258      * byte arrays for each key involved in the operation.  Larger byte arrays
1259      * mean more work for the Java GC, even though these objects are short
1260      * lived.</li>
1261      * </ul>
1262      *
1263      * <p>Mutation of the key representation between the default and compact
1264      * approaches is automatic on a per-Btree internal node basis.  For
1265      * example, if a key that exceeds the configured length is added to a node
1266      * that uses the compact representation, the node is automatically
1267      * mutated to the default representation.  A best effort is made to
1268      * prevent frequent mutations that could increase Java GC activity.</p>
1269      *
1270      * <p>To determine how often the compact representation is used in a
1271      * running application, see {@link EnvironmentStats#getNINCompactKeyIN}.</p>
1272      *
1273      * <p><table border="1">
1274      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1275      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1276      * <tr>
1277      * <td>{@value}</td>
1278      * <td>Integer</td>
1279      * <td>No</td>
1280      * <td>16</td>
1281      * <td>0</td>
1282      * <td>256</td>
1283      * </tr>
1284      * </table></p>
1285      *
1286      * @see DatabaseConfig#setKeyPrefixing
1287      * @see EnvironmentStats#getNINCompactKeyIN
1288      *
1289      * @since 5.0
1290      */
1291     public static final String TREE_COMPACT_MAX_KEY_LENGTH =
1292         "je.tree.compactMaxKeyLength";
1293 
1294     /**
1295      * The compressor thread wakeup interval in microseconds.
1296      *
1297      * <p><table border="1">
1298      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1299      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1300      * <tr>
1301      * <td>{@value}</td>
1302      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
1303      * <td>No</td>
1304      * <td>5 s</td>
1305      * <td>1 s</td>
1306      * <td>75 min</td>
1307      * </tr>
1308      * </table></p>
1309      *
1310      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
1311      * Properties</a>
1312      */
1313     public static final String COMPRESSOR_WAKEUP_INTERVAL =
1314         "je.compressor.wakeupInterval";
1315 
1316     /**
1317      * The number of times to retry a compression run if a deadlock occurs.
1318      *
1319      * <p><table border="1">
1320      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1321      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1322      * <tr>
1323      * <td>{@value}</td>
1324      * <td>Integer</td>
1325      * <td>No</td>
1326      * <td>3</td>
1327      * <td>0</td>
1328      * <td>-none-</td>
1329      * </tr>
1330      * </table></p>
1331      */
1332     public static final String COMPRESSOR_DEADLOCK_RETRY =
1333         "je.compressor.deadlockRetry";
1334 
1335     /**
1336      * The lock timeout for compressor transactions in microseconds.
1337      *
1338      * <p><table border="1">
1339      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1340      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1341      * <tr>
1342      * <td>{@value}</td>
1343      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
1344      * <td>No</td>
1345      * <td>500 ms</td>
1346      * <td>0</td>
1347      * <td>75 min</td>
1348      * </tr>
1349      * </table></p>
1350      *
1351      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
1352      * Properties</a>
1353      */
1354     public static final String COMPRESSOR_LOCK_TIMEOUT =
1355         "je.compressor.lockTimeout";
1356 
1357     /**
1358      * If true, when the compressor encounters an empty database, the root node
1359      * of the Btree is deleted.
1360      *
1361      * <p><table border="1">
1362      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
1363      * <tr>
1364      * <td>{@value}</td>
1365      * <td>Boolean</td>
1366      * <td>No</td>
1367      * <td>false</td>
1368      * </tr>
1369      * </table></p>
1370      *
1371      * @deprecated as of 3.3.87.  Compression of the root node no longer has
1372      * any benefit and this feature has been removed.  This parameter has no
1373      * effect.
1374      */
1375     public static final String COMPRESSOR_PURGE_ROOT =
1376         "je.compressor.purgeRoot";
1377 
1378     /**
1379      * When eviction occurs, the evictor will push memory usage to this number
1380      * of bytes below {@link #MAX_MEMORY}.  No more than 50% of je.maxMemory
1381      * will be evicted per eviction cycle, regardless of this setting.
1382      * <p>
1383      * When using the shared cache feature, the value of this property is
1384      * applied the first time the cache is set up. New environments that
1385      * join the cache do not alter the cache setting.
1386      * <p><table border="1">
1387      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1388      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1389      * <tr>
1390      * <td>{@value}</td>
1391      * <td>Long</td>
1392      * <td>No</td>
1393      * <td>524288 (512K)</td>
1394      * <td>1024 (1K)</td>
1395      * <td>-none-</td>
1396      * </tr>
1397      * </table></p>
1398      */
1399     public static final String EVICTOR_EVICT_BYTES = "je.evictor.evictBytes";
1400 
1401     /**
1402      * @deprecated as of JE 6.0. This parameter is ignored by the new, more
1403      * efficient and more accurate evictor.
1404      * <p>
1405      * The number of nodes in one evictor scan.
1406      * <p>
1407      * When using the shared cache feature, the value of this property is
1408      * applied the first time the cache is set up. New environments that
1409      * join the cache do not alter the cache setting.
1410      *
1411      * <p><table border="1">
1412      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1413      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1414      * <tr>
1415      * <td>{@value}</td>
1416      * <td>Integer</td>
1417      * <td>No</td>
1418      * <td>10</td>
1419      * <td>1</td>
1420      * <td>1000</td>
1421      * </tr>
1422      * </table></p>
1423      */
1424     public static final String EVICTOR_NODES_PER_SCAN =
1425         "je.evictor.nodesPerScan";
1426 
1427     /**
1428      * At this percentage over the allotted cache, critical eviction will
1429      * start.  For example, if this parameter is 5, then when the cache size is
1430      * 5% over its maximum or 105% full, critical eviction will start.
1431      * <p>
1432      * Critical eviction is eviction performed in application threads as part
1433      * of normal database access operations.  Background eviction, on the other
1434      * hand, is performed in JE evictor threads as well as during log cleaning
1435      * and checkpointing.  Background eviction is unconditionally started when
1436      * the cache size exceeds its maximum.  When critical eviction is also
1437      * performed (concurrently with background eviction), it helps to ensure
1438      * that the cache size does not continue to grow, but can have a negative
1439      * impact on operation latency.
1440      * <p>
1441      * By default this parameter is zero, which means that critical eviction
1442      * will start as soon as the cache size exceeds its maximum.  Some
1443      * applications may wish to set this parameter to a non-zero value to
1444      * improve operation latency, when eviction is a significant performance
1445      * factor and latency requirements are not being satisfied.
1446      * <p>
1447      * When setting this parameter to a non-zero value, for example 5, be sure
1448      * to reserve enough heap memory for the cache size to be over its
1449      * configured maximum, for example 105% full.
1450      *
1451      * <p><table border="1">
1452      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1453      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1454      * <tr>
1455      * <td>{@value}</td>
1456      * <td>Integer</td>
1457      * <td>No</td>
1458      * <td>0</td>
1459      * <td>0</td>
1460      * <td>1000</td>
1461      * </tr>
1462      * </table></p>
1463      */
1464     public static final String EVICTOR_CRITICAL_PERCENTAGE =
1465         "je.evictor.criticalPercentage";
1466 
1467     /**
1468      * @deprecated as of JE 4.1, since the single evictor thread has
1469      * been replaced be a more robust thread pool.
1470      * The number of times to retry the evictor if it runs into a deadlock.
1471      * <p>
1472      * When using the shared cache feature, the value of this property is
1473      * applied the first time the cache is set up. New environments that
1474      * join the cache do not alter the cache setting.
1475      *
1476      * <p><table border="1">
1477      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1478      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1479      * <tr>
1480      * <td>{@value}</td>
1481      * <td>Integer</td>
1482      * <td>No</td>
1483      * <td>3</td>
1484      * <td>0</td>
1485      * <td>-none-</td>
1486      * </tr>
1487      * </table></p>
1488      */
1489     public static final String EVICTOR_DEADLOCK_RETRY =
1490         "je.evictor.deadlockRetry";
1491 
1492     /**
1493      * @deprecated  as of JE 6.0. This parameter is ignored by the new,
1494      * more efficient and more accurate evictor.
1495      * <p>
1496      * If true (the default), use an LRU-only policy to select nodes for
1497      * eviction.  If false, select by Btree level first, and then by LRU.
1498      * <p>
1499      * When using the shared cache feature, the value of this property is
1500      * applied the first time the cache is set up. New environments that
1501      * join the cache do not alter the cache setting.
1502      *
1503      * <p><table border="1">
1504      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
1505      * <tr>
1506      * <td>{@value}</td>
1507      * <td>Boolean</td>
1508      * <td>No</td>
1509      * <td>true</td>
1510      * </tr>
1511      * </table></p>
1512      */
1513     public static final String EVICTOR_LRU_ONLY = "je.evictor.lruOnly";
1514 
1515     /**
1516      * Ideally, all nodes managed by an LRU eviction policy should appear in
1517      * a single LRU list, ordered by the "hotness" of each node. However,
1518      * such a list is accessed very frequently by multiple threads, and can
1519      * become a synchronization bottleneck. To avoid this problem, the new
1520      * evictor can employ multiple LRU lists. The nLRULists parameter
1521      * specifies the number of LRU lists to be used. Increasing the number
1522      * of LRU lists alleviates any potential synchronization bottleneck, but
1523      * it also decreases the quality of the LRU approximation.
1524      * <p>
1525      * This parameter applies to the new evictor only.
1526      *
1527      * <p><table border="1">
1528      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1529      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1530      * <tr>
1531      * <td>{@value}</td>
1532      * <td>Integer</td>
1533      * <td>No</td>
1534      * <td>4</td>
1535      * <td>1</td>
1536      * <td>32</td>
1537      * </tr>
1538      * </table></p>
1539      */
1540     public static final String EVICTOR_N_LRU_LISTS = "je.evictor.nLRULists";
1541 
1542     /**
1543      * Call Thread.yield() at each check for cache overflow. This improves GC
1544      * performance on some systems.
1545      * <p>
1546      * When using the shared cache feature, the value of this property is
1547      * applied the first time the cache is set up. New environments that
1548      * join the cache do not alter the cache setting.
1549      *
1550      * <p><table border="1">
1551      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
1552      * <tr>
1553      * <td>{@value}</td>
1554      * <td>Boolean</td>
1555      * <td>No</td>
1556      * <td>false</td>
1557      * </tr>
1558      * </table></p>
1559      */
1560     public static final String EVICTOR_FORCED_YIELD = "je.evictor.forcedYield";
1561 
1562     /**
1563      * The minimum number of threads in the eviction thread pool. These threads
1564      * help keep memory usage within cache bounds, offloading work from
1565      * application threads.
1566      *
1567      * je.evictor.coreThreads, je.evictor.maxThreads and je.evictor.keepAlive
1568      * are used to configure the core, max and keepalive attributes for the
1569      * ThreadPoolExecutor which implements the eviction thread pool.
1570      *
1571      * <p><table border="1">
1572      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1573      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1574      * <tr>
1575      * <td>{@value}</td>
1576      * <td>Integer</td>
1577      * <td>yes</td>
1578      * <td>1</td>
1579      * <td>0</td>
1580      * <td>Integer.MAX_VALUE</td>
1581      * </tr>
1582      * </table></p>
1583      */
1584     public static final String EVICTOR_CORE_THREADS = "je.evictor.coreThreads";
1585 
1586     /**
1587      * The maximum number of threads in the eviction thread pool. These threads
1588      * help keep memory usage within cache bound, offloading work from
1589      * application threads. If the eviction thread pool receives more work, it
1590      * will allocate up to this number of threads. These threads will terminate
1591      * if they are idle for more than the time indicated by je.evictor.keepAlive
1592      *
1593      * je.evictor.coreThreads, je.evictor.maxThreads and je.evictor.keepAlive
1594      * are used to configure the core, max and keepalive attributes for the
1595      * ThreadPoolExecutor which implements the eviction thread pool.
1596      *
1597      * <p><table border="1">
1598      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1599      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1600      * <tr>
1601      * <td>{@value}</td>
1602      * <td>Integer</td>
1603      * <td>yes</td>
1604      * <td>10</td>
1605      * <td>1</td>
1606      * <td>Integer.MAX_VALUE</td>
1607      * </tr>
1608      * </table></p>
1609      */
1610     public static final String EVICTOR_MAX_THREADS = "je.evictor.maxThreads";
1611 
1612     /**
1613      * The duration that excess threads in the eviction thread pool will stay
1614      * idle. After this period, idle threads will terminate.
1615      *
1616      * je.evictor.coreThreads, je.evictor.maxThreads and je.evictor.keepAlive
1617      * are used to configure the core, max and keepalive attributes for the
1618      * ThreadPoolExecutor which implements the eviction thread pool.
1619      * <p><table border="1">
1620      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1621      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1622      * <tr>
1623      * <td>{@value}</td>
1624      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
1625      * <td>Yes</td>
1626      * <td>10 min</td>
1627      * <td>1 s</td>
1628      * <td>1 d</td>
1629      * </tr>
1630      * </table></p>
1631      *
1632      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
1633      * Properties</a>
1634      */
1635     public static final String EVICTOR_KEEP_ALIVE = "je.evictor.keepAlive";
1636 
1637     /**
1638      * Allow Bottom Internal Nodes (BINs) to be written in a delta format
1639      * during eviction.  Using a delta format will improve write and log
1640      * cleaning performance, but may reduce read performance if BINs are not
1641      * maintained in cache memory.
1642      *
1643      * <p><table border="1">
1644      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
1645      * <tr>
1646      * <td>{@value}</td>
1647      * <td>Boolean</td>
1648      * <td>No</td>
1649      * <td>true</td>
1650      * </tr>
1651      * </table></p>
1652      */
1653     public static final String EVICTOR_ALLOW_BIN_DELTAS =
1654         "je.evictor.allowBinDeltas";
1655 
1656     /**
1657      * Ask the checkpointer to run every time we write this many bytes to the
1658      * log. If set, supersedes {@link #CHECKPOINTER_WAKEUP_INTERVAL}. To use
1659      * time based checkpointing, set this to 0.
1660      *
1661      * <p><table border="1">
1662      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1663      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1664      * <tr>
1665      * <td>{@value}</td>
1666      * <td>Long</td>
1667      * <td>No</td>
1668      * <td>20000000 (20M)</td>
1669      * <td>0</td>
1670      * <td>-none-</td>
1671      * </tr>
1672      * </table></p>
1673      */
1674     public static final String CHECKPOINTER_BYTES_INTERVAL =
1675         "je.checkpointer.bytesInterval";
1676 
1677     /**
1678      * The checkpointer wakeup interval in microseconds. By default, this
1679      * is inactive and we wakeup the checkpointer as a function of the
1680      * number of bytes written to the log ({@link
1681      * #CHECKPOINTER_BYTES_INTERVAL}).
1682      *
1683      * <p><table border="1">
1684      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1685      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1686      * <tr>
1687      * <td>{@value}</td>
1688      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
1689      * <td>No</td>
1690      * <td>0</td>
1691      * <td>1 s</td>
1692      * <td>75 min</td>
1693      * </tr>
1694      * </table></p>
1695      *
1696      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
1697      * Properties</a>
1698      */
1699     public static final String CHECKPOINTER_WAKEUP_INTERVAL =
1700         "je.checkpointer.wakeupInterval";
1701 
1702     /**
1703      * The number of times to retry a checkpoint if it runs into a deadlock.
1704      *
1705      * <p><table border="1">
1706      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1707      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1708      * <tr>
1709      * <td>{@value}</td>
1710      * <td>Integer</td>
1711      * <td>No</td>
1712      * <td>3</td>
1713      * <td>0</td>
1714      * <td>-none-</td>
1715      * </tr>
1716      * </table></p>
1717      */
1718     public static final String CHECKPOINTER_DEADLOCK_RETRY =
1719         "je.checkpointer.deadlockRetry";
1720 
1721     /**
1722      * If true, the checkpointer uses more resources in order to complete the
1723      * checkpoint in a shorter time interval.  Btree latches are held and other
1724      * threads are blocked for a longer period.  When set to true, application
1725      * response time may be longer during a checkpoint.
1726      *
1727      * <p><table border"1">
1728      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
1729      * <tr>
1730      * <td>{@value}</td>
1731      * <td>Boolean</td>
1732      * <td>Yes</td>
1733      * <td>false</td>
1734      * </tr>
1735      * </table></p>
1736      */
1737     public static final String CHECKPOINTER_HIGH_PRIORITY =
1738         "je.checkpointer.highPriority";
1739 
1740     /**
1741      * The cleaner will keep the total disk space utilization percentage above
1742      * this value.
1743      *
1744      * <p><table border="1">
1745      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1746      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1747      * <tr>
1748      * <td>{@value}</td>
1749      * <td>Integer</td>
1750      * <td>Yes</td>
1751      * <td>50</td>
1752      * <td>0</td>
1753      * <td>90</td>
1754      * </tr>
1755      * </table></p>
1756      */
1757     public static final String CLEANER_MIN_UTILIZATION =
1758         "je.cleaner.minUtilization";
1759 
1760     /**
1761      * A log file will be cleaned if its utilization percentage is below this
1762      * value, irrespective of total utilization.
1763      *
1764      * <p><table border="1">
1765      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1766      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1767      * <tr>
1768      * <td>{@value}</td>
1769      * <td>Integer</td>
1770      * <td>Yes</td>
1771      * <td>5</td>
1772      * <td>0</td>
1773      * <td>50</td>
1774      * </tr>
1775      * </table></p>
1776      */
1777     public static final String CLEANER_MIN_FILE_UTILIZATION =
1778         "je.cleaner.minFileUtilization";
1779 
1780     /**
1781      * The cleaner checks disk utilization every time we write this many bytes
1782      * to the log.  If zero (and by default) it is set to the {@link
1783      * #LOG_FILE_MAX} value divided by four.
1784      *
1785      * <p><table border="1">
1786      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1787      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1788      * <tr>
1789      * <td>{@value}</td>
1790      * <td>Long</td>
1791      * <td>Yes</td>
1792      * <td>0</td>
1793      * <td>0</td>
1794      * <td>-none-</td>
1795      * </tr>
1796      * </table></p>
1797      */
1798     public static final String CLEANER_BYTES_INTERVAL =
1799         "je.cleaner.bytesInterval";
1800 
1801     /**
1802      * If true, the cleaner will fetch records to determine their size and more
1803      * accurately calculate log utilization.  Normally when a record is updated
1804      * or deleted without first being read (sometimes called a blind
1805      * delete/update), the size of the previous version of the record is
1806      * unknown and therefore the cleaner's utilization calculations may be
1807      * incorrect.  Setting this parameter to true will cause a record to be
1808      * read during a blind delete/update, in order to determine its size.  This
1809      * will ensure that the cleaner's utilization calculations are correct, but
1810      * will cause more (potentially random) IO.
1811      * <p>
1812      * To guarantee that utilization will be calculated accurately for all
1813      * workloads and that automatic adjustments will not interfere, {@link
1814      * #CLEANER_FETCH_OBSOLETE_SIZE} should be set to true and {@link
1815      * #CLEANER_ADJUST_UTILIZATION} should be set to false.
1816      *
1817      * <p><table border="1">
1818      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
1819      * <tr>
1820      * <td>{@value}</td>
1821      * <td>Boolean</td>
1822      * <td>Yes</td>
1823      * <td>false</td>
1824      * </tr>
1825      * </table></p>
1826      *
1827      * @see #CLEANER_ADJUST_UTILIZATION
1828      */
1829     public static final String CLEANER_FETCH_OBSOLETE_SIZE =
1830         "je.cleaner.fetchObsoleteSize";
1831 
1832     /**
1833      * If true, the cleaner will attempt to adjust utilization to account for
1834      * unknown record sizes.
1835      *
1836      * Prior to JE 6.0, this parameter was true by default, because the size of
1837      * the last logged version of each record was not stored in the Btree,
1838      * sometimes resulting in utilization inaccuracies described below. In JE
1839      * 6.0 and later, the last logged size is stored in the Btree BINs (bottom
1840      * internal nodes), so that utilization can be calculated correctly during
1841      * record updates and deletions, while still avoiding a fetch of the old
1842      * version of the record.
1843      * <p>
1844      * Therefore this parameter is false by default.  This config parameter is
1845      * still provided to allow enabling adjustments in particular cases where
1846      * it may benefit a particular application that has written data with
1847      * versions of JE prior to 6.0. However, the need for this parameter is not
1848      * expected to arise, and in our experience the utilization adjustments are
1849      * not beneficial to most applications.  For safety's sake adjustments can
1850      * still be enabled in this release, but they will be completely disabled
1851      * in a future version of JE.
1852      * <p>
1853      * Prior to JE 6.0, when a record is updated or deleted without first
1854      * being read (sometimes called a blind delete/update), the size of the
1855      * previous version of the record is unknown and therefore the cleaner's
1856      * utilization calculations may be incorrect.  To compensate for such
1857      * inaccuracies, JE uses the following approach.
1858      * <ul>
1859      *   <li>
1860      *   When a data file contains obsolete records and the record sizes are
1861      *   unknown, the average record size in a log file is used to estimate the
1862      *   utilization of that file.  However, the average size may not reflect
1863      *   the true size of the obsolete records, if an application creates
1864      *   records of varying sizes and then deletes or updates records of
1865      *   non-average sizes.
1866      *   </li>
1867      *   <li>
1868      *   When a data file is cleaned, statistics are collected about the actual
1869      *   utilization versus the estimated utilization.  Using this information
1870      *   from the 10 most recently cleaned files, the {@link
1871      *   EnvironmentStats#getLNSizeCorrectionFactor} statistic is maintained.
1872      *   This factor can be multiplied by the average record size to obtain the
1873      *   actual obsolete size.
1874      *   </li>
1875      *   <li>
1876      *   When no log cleaning is occurring because the estimated utilization is
1877      *   above the configured threshold (see {@link #CLEANER_MIN_UTILIZATION}),
1878      *   the LNSizeCorrectionFactor cannot be determined.  In this situation,
1879      *   JE will perform trial cleaner runs called <i>probes</i>.  A probe is
1880      *   similar to cleaning a log file in that it collects information about
1881      *   actual utilization, but the file is not actually cleaned -- no records
1882      *   are copied and the file is not deleted.  Probes are performed only
1883      *   when necessary to collect utilization statistics.
1884      *   </li>
1885      *   <li>
1886      *   Once the LNSizeCorrectionFactor is known, it is applied to calculate
1887      *   the total utilization of the log and determine whether cleaning is
1888      *   necessary (see {@link #CLEANER_MIN_UTILIZATION}), and to determine
1889      *   which log files have the lowest utilization and should be selected for
1890      *   cleaning.  The LNSizeCorrectionFactor is also used in the {@link
1891      *   com.sleepycat.je.util.DbSpace} calculations and is printed at the
1892      *   bottom of the report.
1893      * </ul>
1894      * <p>
1895      * When setting this parameter to true, please be aware of the possibility
1896      * that undesired automatic adjustments may occur.  Because the adjustments
1897      * are based on sampled information and application workloads may change
1898      * over time, the adjustments are not always beneficial.  Utilization may
1899      * be adjusted incorrectly, causing undesired over-cleaning or
1900      * under-cleaning.  It is for this reason that the logged size of each
1901      * record is now stored in the Btree BINs (as of JE 6.0 or later) and this
1902      * parameter is false by default.
1903      * <p>
1904      * When this parameter is false (the default), the last two steps above are
1905      * not applied.  The LNSizeCorrectionFactor will still be calculated when
1906      * log files are cleaned and will be available via the {@link
1907      * EnvironmentStats#getLNSizeCorrectionFactor} method.  However, the
1908      * LNSizeCorrectionFactor will not be used to adjust the estimated
1909      * utilization, and cleaner probes will not be performed.  Log files will
1910      * be cleaned based on the estimated utilization alone.  In a future
1911      * version of JE, because the last logged record size is now stored in the
1912      * BINs and the estimated utilization is now accurate, the
1913      * LNSizeCorrectionFactor and related facilities will be removed entirely.
1914      * <p>
1915      * To guarantee that utilization will be calculated accurately for all
1916      * workloads and that automatic adjustments will not interfere, {@link
1917      * #CLEANER_FETCH_OBSOLETE_SIZE} should be set to true and {@link
1918      * #CLEANER_ADJUST_UTILIZATION} should be left set to false.
1919      *
1920      * <p><table border="1">
1921      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
1922      * <tr>
1923      * <td>{@value}</td>
1924      * <td>Boolean</td>
1925      * <td>Yes</td>
1926      * <td>false</td>
1927      * </tr>
1928      * </table></p>
1929      *
1930      * @see #CLEANER_FETCH_OBSOLETE_SIZE
1931      */
1932     public static final String CLEANER_ADJUST_UTILIZATION =
1933         "je.cleaner.adjustUtilization";
1934 
1935     /**
1936      * The number of times to retry cleaning if a deadlock occurs.
1937      *
1938      * <p><table border="1">
1939      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1940      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1941      * <tr>
1942      * <td>{@value}</td>
1943      * <td>Integer</td>
1944      * <td>Yes</td>
1945      * <td>3</td>
1946      * <td>0</td>
1947      * <td>-none-</td>
1948      * </tr>
1949      * </table></p>
1950      */
1951     public static final String CLEANER_DEADLOCK_RETRY =
1952         "je.cleaner.deadlockRetry";
1953 
1954     /**
1955      * The lock timeout for cleaner transactions in microseconds.
1956      *
1957      * <p><table border="1">
1958      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
1959      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
1960      * <tr>
1961      * <td>{@value}</td>
1962      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
1963      * <td>Yes</td>
1964      * <td>500 ms</td>
1965      * <td>0</td>
1966      * <td>75 min</td>
1967      * </tr>
1968      * </table></p>
1969      *
1970      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
1971      * Properties</a>
1972      */
1973     public static final String CLEANER_LOCK_TIMEOUT = "je.cleaner.lockTimeout";
1974 
1975     /**
1976      * If true (the default setting), the cleaner deletes log files after
1977      * successful cleaning.
1978      *
1979      * This parameter may be set to false for diagnosing log cleaning problems.
1980      * For example, if a bug causes a LOG_FILE_NOT_FOUND exception, when
1981      * reproducing the problem it is often necessary to avoid deleting files so
1982      * they can be used for diagnosis. When this parameter is false:
1983      * <ul>
1984      *     <li>
1985      *     Rather than delete files that are successfully cleaned, the cleaner
1986      *     renames them.
1987      *     </li>
1988      *     <li>
1989      *     When renaming a file, its extension is changed from ".jdb" to ".del"
1990      *     and its last modification date is set to the current time.
1991      *     </li>
1992      *     <li>
1993      *     Depending on the setting of the {@link #CLEANER_USE_DELETED_DIR}
1994      *     parameter, the file is either renamed in its current data directory
1995      *     (the default), or moved into the "deleted" sub-directory.
1996      *     </li>
1997      * </ul>
1998      * <p>
1999      * When this parameter is set to false, disk usage may grow without bounds
2000      * and the application is responsible for removing the cleaned files. It
2001      * may be necessary to write a script for deleting the least recently
2002      * cleaned files when disk usage is low. The .del extension and the last
2003      * modification time can be leveraged to write such a script. The "deleted"
2004      * sub-directory can be used to avoid granting write or delete permissions
2005      * for the main data directory to the script.
2006      *
2007      * <p><table border="1">
2008      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2009      * <tr>
2010      * <td>{@value}</td>
2011      * <td>Boolean</td>
2012      * <td>Yes</td>
2013      * <td>true</td>
2014      * </tr>
2015      * </table></p>
2016      */
2017     public static final String CLEANER_EXPUNGE = "je.cleaner.expunge";
2018 
2019     /**
2020      * When {@link #CLEANER_EXPUNGE} is false, the {@code
2021      * CLEANER_USE_DELETED_DIR} parameter determines whether successfully
2022      * cleaned files are moved to the "deleted" sub-directory.
2023      *
2024      * {@code CLEANER_USE_DELETED_DIR} applies only when {@link
2025      * #CLEANER_EXPUNGE} is false. When {@link #CLEANER_EXPUNGE} is true,
2026      * successfully cleaned files are deleted and the {@code
2027      * CLEANER_USE_DELETED_DIR} parameter setting is ignored.
2028      * <p>
2029      * When {@code CLEANER_USE_DELETED_DIR} is true (and {@code
2030      * CLEANER_EXPUNGE} is false), the cleaner will move successfully cleaned
2031      * data files (".jdb" files) to the "deleted" sub-directory of the
2032      * Environment directory, in addition to changing the file extension to
2033      * "*.del". In this case, the "deleted" sub-directory must have been
2034      * created by the application before opening the Environment. This allows
2035      * the application to control permissions on this sub-directory. When
2036      * multiple data directories are used ({@link #LOG_N_DATA_DIRECTORIES}), a
2037      * "deleted" sub-directory must be created under each data directory. Note
2038      * that {@link java.io.File#renameTo(File)} is used to move the file, and
2039      * this method may or may not support moving the file to a different volume
2040      * (when the "deleted" directory is a file system link) on a particular
2041      * platform.
2042      * <p>
2043      * When {@code CLEANER_USE_DELETED_DIR} is false (and {@code
2044      * CLEANER_EXPUNGE} is false), the cleaner will change the file extension
2045      * of successfully cleaned data files from ".jdb" to ".del", but will not
2046      * move the files to a different directory.
2047      *
2048      * <p><table border="1">
2049      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2050      * <tr>
2051      * <td>{@value}</td>
2052      * <td>Boolean</td>
2053      * <td>Yes</td>
2054      * <td>false</td>
2055      * </tr>
2056      * </table></p>
2057      */
2058     public static final String CLEANER_USE_DELETED_DIR =
2059         "je.cleaner.useDeletedDir";
2060 
2061     /**
2062      * The minimum age of a file (number of files between it and the active
2063      * file) to qualify it for cleaning under any conditions.
2064      *
2065      * <p><table border="1">
2066      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2067      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2068      * <tr>
2069      * <td>{@value}</td>
2070      * <td>Integer</td>
2071      * <td>Yes</td>
2072      * <td>2</td>
2073      * <td>1</td>
2074      * <td>1000</td>
2075      * </tr>
2076      * </table></p>
2077      */
2078     public static final String CLEANER_MIN_AGE = "je.cleaner.minAge";
2079 
2080     /**
2081      * The maximum number of log files in the cleaner's backlog, or zero if
2082      * there is no limit.  Changing this property can impact the performance of
2083      * some out-of-memory applications.
2084      *
2085      * <p><table border="1">
2086      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2087      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2088      * <tr>
2089      * <td>{@value}</td>
2090      * <td>Integer</td>
2091      * <td>Yes</td>
2092      * <td>0</td>
2093      * <td>0</td>
2094      * <td>100000</td>
2095      * </tr>
2096      * </table></p>
2097      */
2098     public static final String CLEANER_MAX_BATCH_FILES =
2099         "je.cleaner.maxBatchFiles";
2100 
2101     /**
2102      * The read buffer size for cleaning.  If zero (the default), then {@link
2103      * #LOG_ITERATOR_READ_SIZE} value is used.
2104      *
2105      * <p><table border="1">
2106      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2107      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2108      * <tr>
2109      * <td>{@value}</td>
2110      * <td>Integer</td>
2111      * <td>Yes</td>
2112      * <td>0</td>
2113      * <td>128</td>
2114      * <td>-none-</td>
2115      * </tr>
2116      * </table></p>
2117      */
2118     public static final String CLEANER_READ_SIZE = "je.cleaner.readSize";
2119 
2120     /**
2121      * Tracking of detailed cleaning information will use no more than this
2122      * percentage of the cache.  The default value is 2% of {@link
2123      * #MAX_MEMORY}. If 0 and {@link #SHARED_CACHE} is true, use 2% divided by
2124      * N where N is the number of environments sharing the global cache.
2125      *
2126      * <p><table border="1">
2127      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2128      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2129      * <tr>
2130      * <td>{@value}</td>
2131      * <td>Integer</td>
2132      * <td>Yes</td>
2133      * <td>2</td>
2134      * <td>1</td>
2135      * <td>90</td>
2136      * </tr>
2137      * </table></p>
2138      */
2139     public static final String CLEANER_DETAIL_MAX_MEMORY_PERCENTAGE =
2140         "je.cleaner.detailMaxMemoryPercentage";
2141 
2142     /**
2143      * Specifies a list of files or file ranges to be cleaned at a time when no
2144      * other log cleaning is necessary.  This parameter is intended for use in
2145      * forcing the cleaning of a large number of log files.  File numbers are
2146      * in hex and are comma separated or hyphen separated to specify ranges,
2147      * e.g.: '9,a,b-d' will clean 5 files.
2148      *
2149      * <p><table border="1">
2150      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2151      * <tr>
2152      * <td>{@value}</td>
2153      * <td>String</td>
2154      * <td>No</td>
2155      * <td>""</td>
2156      * </tr>
2157      * </table></p>
2158      */
2159     public static final String CLEANER_FORCE_CLEAN_FILES =
2160         "je.cleaner.forceCleanFiles";
2161 
2162     /**
2163      * All log files having a log version prior to the specified version will
2164      * be cleaned at a time when no other log cleaning is necessary.  Intended
2165      * for use in upgrading old format log files forward to the current log
2166      * format version, e.g., to take advantage of format improvements; note
2167      * that log upgrading is optional.  The default value zero (0) specifies
2168      * that no upgrading will occur.  The value negative one (-1) specifies
2169      * upgrading to the current log version.
2170      *
2171      * <p><table border="1">
2172      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2173      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2174      * <tr>
2175      * <td>{@value}</td>
2176      * <td>Integer</td>
2177      * <td>No</td>
2178      * <td>0</td>
2179      * <td>-1</td>
2180      * <td>-none-</td>
2181      * </tr>
2182      * </table></p>
2183      */
2184     public static final String CLEANER_UPGRADE_TO_LOG_VERSION =
2185         "je.cleaner.upgradeToLogVersion";
2186 
2187     /**
2188      * The number of threads allocated by the cleaner for log file processing.
2189      * If the cleaner backlog becomes large, try increasing this value.
2190      *
2191      * <p><table border="1">
2192      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2193      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2194      * <tr>
2195      * <td>{@value}</td>
2196      * <td>Integer</td>
2197      * <td>Yes</td>
2198      * <td>1</td>
2199      * <td>1</td>
2200      * <td>-none-</td>
2201      * </tr>
2202      * </table></p>
2203      */
2204     public static final String CLEANER_THREADS = "je.cleaner.threads";
2205 
2206     /**
2207      * The look ahead cache size for cleaning in bytes.  Increasing this value
2208      * can reduce the number of Btree lookups.
2209      *
2210      * <p><table border="1">
2211      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2212      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2213      * <tr>
2214      * <td>{@value}</td>
2215      * <td>Integer</td>
2216      * <td>Yes</td>
2217      * <td>8192 (8K)</td>
2218      * <td>0</td>
2219      * <td>-none-</td>
2220      * </tr>
2221      * </table></p>
2222      */
2223     public static final String CLEANER_LOOK_AHEAD_CACHE_SIZE =
2224         "je.cleaner.lookAheadCacheSize";
2225 
2226     /**
2227      * @deprecated This parameter is ignored and proactive migration is no
2228      * longer supported due to its negative impact on eviction and Btree
2229      * splits. To reduce a cleaner backlog, configure more cleaner threads.
2230      */
2231     public static final String CLEANER_FOREGROUND_PROACTIVE_MIGRATION =
2232         "je.cleaner.foregroundProactiveMigration";
2233 
2234     /**
2235      * @deprecated This parameter is ignored and proactive migration is no
2236      * longer supported due to its negative impact on eviction and
2237      * checkpointing. To reduce a cleaner backlog, configure more cleaner
2238      * threads.
2239      */
2240     public static final String CLEANER_BACKGROUND_PROACTIVE_MIGRATION =
2241         "je.cleaner.backgroundProactiveMigration";
2242 
2243     /**
2244      * @deprecated This parameter is ignored and lazy migration is no longer
2245      * supported due to its negative impact on eviction and checkpointing.
2246      * To reduce a cleaner backlog, configure more cleaner threads.
2247      */
2248     public static final String CLEANER_LAZY_MIGRATION =
2249         "je.cleaner.lazyMigration";
2250 
2251     /**
2252      * The timeout for Disk Ordered Scan producer thread queue offers in
2253      * milliseconds.
2254      *
2255      * <p><table border="1">
2256      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2257      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2258      * <tr>
2259      * <td>{@value}</td>
2260      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
2261      * <td>Yes</td>
2262      * <td>10 secs</td>
2263      * <td>0</td>
2264      * <td>75 min</td>
2265      * </tr>
2266      * </table></p>
2267      *
2268      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
2269      * Properties</a>
2270      */
2271     public static final String DOS_PRODUCER_QUEUE_TIMEOUT =
2272         "je.env.diskOrderedScanLockTimeout";
2273 
2274     /**
2275      * Number of Lock Tables.  Set this to a value other than 1 when an
2276      * application has multiple threads performing concurrent JE operations.
2277      * It should be set to a prime number, and in general not higher than the
2278      * number of application threads performing JE operations.
2279      *
2280      * <p><table border="1">
2281      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2282      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2283      * <tr>
2284      * <td>{@value}</td>
2285      * <td>Integer</td>
2286      * <td>No</td>
2287      * <td>1</td>
2288      * <td>1</td>
2289      * <td>32767 (32K)</td>
2290      * </tr>
2291      * </table></p>
2292      */
2293     public static final String LOCK_N_LOCK_TABLES = "je.lock.nLockTables";
2294 
2295     /**
2296      * The {@link #setLockTimeout(long,TimeUnit) LockTimeout} property.
2297      *
2298      * <p><table border="1">
2299      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2300      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2301      * <tr>
2302      * <td>{@value}</td>
2303      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
2304      * <td>No</td>
2305      * <td>500 ms</td>
2306      * <td>0</td>
2307      * <td>75 min</td>
2308      * </tr>
2309      * </table></p>
2310      *
2311      * @see #setLockTimeout(long,TimeUnit)
2312      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
2313      * Properties</a>
2314      */
2315     public static final String LOCK_TIMEOUT = "je.lock.timeout";
2316 
2317     /**
2318      * Whether to throw old-style lock exceptions for compatibility with older
2319      * JE releases.
2320      *
2321      * <p>In JE 3.3 and earlier, {@link DeadlockException} or a subclass of it
2322      * was always thrown when a lock conflict occurred.  Applications typically
2323      * caught {@link DeadlockException} in order to detect lock conflicts and
2324      * determine whether to retry a transaction.  {@link DeadlockException}
2325      * itself was thrown when a lock or transaction timeout occurred and {@link
2326      * LockNotGrantedException} (a subclass of {@link DeadlockException}) was
2327      * thrown when a lock conflict occurred for a no-wait transaction (see
2328      * {@link TransactionConfig#setNoWait}).</p>
2329      *
2330      * <p>In all releases after JE 3.3, new exceptions and the new base class
2331      * {@link LockConflictException} are available.  Now, {@link
2332      * LockConflictException} should be caught to handle lock conflicts in a
2333      * general manner, instead of catching {@link DeadlockException}.  New
2334      * exceptions are now thrown as follows:
2335      * <ul>
2336      * <li>{@link LockTimeoutException} is now thrown when a lock timeout
2337      * occurs, rather than {@link DeadlockException}.</li>
2338      * <li>{@link TransactionTimeoutException} is now thrown when a transaction
2339      * timeout occurs, rather than {@link DeadlockException}.</li>
2340      * <li>{@link LockNotAvailableException} is now thrown when a lock conflict
2341      * occurs for a no-wait transaction, rather than {@link
2342      * LockNotGrantedException}.</li>
2343      * </ul>
2344      * <p>These three new exceptions are subclasses of {@link
2345      * LockConflictException}.  {@link DeadlockException} is also now a
2346      * subclass of {@link LockConflictException}, but is not currently thrown
2347      * by JE because true deadlock detection is not used in JE.  Currently,
2348      * lock timeouts are used instead.  When true deadlock detection is added
2349      * to JE in the future, {@link DeadlockException} will be thrown. {@link
2350      * LockNotGrantedException} has been deprecated and replaced by {@link
2351      * LockNotAvailableException}.</p>
2352      *
2353      * <li>The {@link EnvironmentConfig#LOCK_OLD_LOCK_EXCEPTIONS} configuraton
2354      * parameter may be explicitly set to true to enable the old exception
2355      * behavior.  By default, this parameter is false.</li>
2356      *
2357      * <p>Unless {@link EnvironmentConfig#LOCK_OLD_LOCK_EXCEPTIONS} is set to
2358      * true, the following changes must be made to JE applications that upgrade
2359      * from JE 3.3 or earlier.</p>
2360      * <ol>
2361      * <li>All occurrences of {@link DeadlockException} must be replaced with
2362      * {@link LockConflictException} or one of its non-deprecated subclasses
2363      * ({@link LockTimeoutException}, {@link TransactionTimeoutException}, or
2364      * {@link LockNotAvailableException}).  It is strongly recommended to
2365      * replace it with {@link LockConflictException}, since catching this
2366      * exception will catch true deadlocks in the future and other types of
2367      * lock conflicts.  All lock conflicts all typically handled in the same
2368      * way, which is normally to abort and retry the transaction.</li>
2369      * <li>All occurances of {@link LockNotGrantedException} must be replaced
2370      * with {@link LockNotAvailableException}.  {@link LockNotGrantedException}
2371      * has been deprecated because it misleadingly extends {@link
2372      * DeadlockException}.</li>
2373      * </ol>
2374      *
2375      * <p><table border="1">
2376      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2377      * <tr>
2378      * <td>{@value}</td>
2379      * <td>Boolean</td>
2380      * <td>No</td>
2381      * <td>false</td>
2382      * </tr>
2383      * </table></p>
2384      */
2385     public static final String LOCK_OLD_LOCK_EXCEPTIONS =
2386         "je.lock.oldLockExceptions";
2387 
2388     /**
2389      * The {@link #setTxnTimeout TxnTimeout} property.
2390      *
2391      * <p><table border="1">
2392      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2393      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2394      * <tr>
2395      * <td>{@value}</td>
2396      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
2397      * <td>No</td>
2398      * <td>0</td>
2399      * <td>0</td>
2400      * <td>75 min</td>
2401      * </tr>
2402      * </table></p>
2403      *
2404      * @see #setTxnTimeout
2405      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
2406      * Properties</a>
2407      */
2408     public static final String TXN_TIMEOUT = "je.txn.timeout";
2409 
2410     /**
2411      * The {@link #setTxnSerializableIsolation TxnSerializableIsolation}
2412      * property.
2413      *
2414      * <p><table border="1">
2415      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2416      * <tr>
2417      * <td>{@value}</td>
2418      * <td>Boolean</td>
2419      * <td>No</td>
2420      * <td>false</td>
2421      * </tr>
2422      * </table></p>
2423      *
2424      * @see #setTxnSerializableIsolation
2425      */
2426     public static final String TXN_SERIALIZABLE_ISOLATION =
2427         "je.txn.serializableIsolation";
2428 
2429     /**
2430      * @hidden
2431      * The {@link #setDurability durability} property.
2432      *
2433      * <p><table border="1">
2434      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2435      * <tr>
2436      * <td>{@value}</td>
2437       * <td>String</td>
2438      * <td>Yes</td>
2439      * <td>null</td>
2440      * </tr>
2441      * </table></p>
2442      *
2443      * The format of the durability string is described at
2444      * {@link Durability#parse(String)}
2445      *
2446      * @see Durability
2447      */
2448     public static final String TXN_DURABILITY = "je.txn.durability";
2449 
2450     /**
2451      * Set this parameter to true to add stacktrace information to deadlock
2452      * (lock timeout) exception messages.  The stack trace will show where each
2453      * lock was taken.  The default is false, and true should only be used
2454      * during debugging because of the added memory/processing cost.  This
2455      * parameter is 'static' across all environments.
2456      *
2457      * <p><table border="1">
2458      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2459      * <tr>
2460      * <td>{@value}</td>
2461      * <td>Boolean</td>
2462      * <td>Yes</td>
2463      * <td>false</td>
2464      * </tr>
2465      * </table></p>
2466      */
2467     public static final String TXN_DEADLOCK_STACK_TRACE =
2468         "je.txn.deadlockStackTrace";
2469 
2470     /**
2471      * Dump the lock table when a lock timeout is encountered, for debugging
2472      * assistance.
2473      *
2474      * <p><table border="1">
2475      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2476      * <tr>
2477      * <td>{@value}</td>
2478      * <td>Boolean</td>
2479      * <td>Yes</td>
2480      * <td>false</td>
2481      * </tr>
2482      * </table></p>
2483      */
2484     public static final String TXN_DUMP_LOCKS = "je.txn.dumpLocks";
2485 
2486     /**
2487      * Use FileHandler in logging system.
2488      *
2489      * <p><table border="1">
2490      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2491      * <tr>
2492      * <td>{@value}</td>
2493      * <td>Boolean</td>
2494      * <td>No</td>
2495      * <td>false</td>
2496      * </tr>
2497      * </table></p>
2498      * @deprecated in favor of <code>FILE_LOGGING_LEVEL</code> As of JE 4.0,
2499      * use the standard java.util.logging configuration methodologies. To
2500      * enable logging output to the je.info files, set
2501      * com.sleepycat.je.util.FileHandler.level = {@literal <LEVEL>} through the
2502      * java.util.logging configuration file, or through the
2503      * java.util.logging.LogManager. To set the handler level programmatically,
2504      * set "com.sleepycat.je.util.FileHandler.level" in the EnvironmentConfig
2505      * object.
2506      */
2507     public static final String TRACE_FILE = "java.util.logging.FileHandler.on";
2508 
2509     /**
2510      * Enable ConsoleHandler in logging system.
2511      *
2512      * <p><table border="1">
2513      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2514      * <tr>
2515      * <td>{@value}</td>
2516      * <td>Boolean</td>
2517      * <td>No</td>
2518      * <td>false</td>
2519      * </tr>
2520      * </table></p>
2521      * @deprecated in favor of <code>CONSOLE_LOGGING_LEVEL</code> As of JE
2522      * 4.0, use the standard java.util.logging configuration
2523      * methodologies. To enable console output, set
2524      * com.sleepycat.je.util.ConsoleHandler.level = {@literal <LEVEL>} through
2525      * the java.util.logging configuration file, or through the
2526      * java.util.logging.LogManager. To set the handler level programmatically,
2527      * set "com.sleepycat.je.util.ConsoleHandler.level" in the
2528      * EnvironmentConfig object.
2529      */
2530     public static final String TRACE_CONSOLE =
2531         "java.util.logging.ConsoleHandler.on";
2532 
2533     /**
2534      * Use DbLogHandler in logging system.
2535      *
2536      * <p><table border="1">
2537      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2538      * <tr>
2539      * <td>{@value}</td>
2540      * <td>Boolean</td>
2541      * <td>No</td>
2542      * <td>true</td>
2543      * </tr>
2544      * </table></p>
2545      * @deprecated As of JE 4.0, event tracing to the .jdb files has been
2546      * separated from the java.util.logging mechanism. This parameter has
2547      * no effect.
2548      */
2549     public static final String TRACE_DB = "java.util.logging.DbLogHandler.on";
2550 
2551     /**
2552      * Log file limit for FileHandler.
2553      *
2554      * <p><table border="1">
2555      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2556      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2557      * <tr>
2558      * <td>{@value}</td>
2559      * <td>Integer</td>
2560      * <td>No</td>
2561      * <td>10000000 (10M)</td>
2562      * <td>1000</td>
2563      * <td>1000000000 (1G)</td>
2564      * </tr>
2565      * </table></p>
2566      * @deprecated As of JE 4.0, use the standard java.util.logging
2567      * configuration methodologies. To set the FileHandler output file size,
2568      * set com.sleepycat.je.util.FileHandler.limit = {@literal <NUMBER>}
2569      * through the java.util.logging configuration file, or through the
2570      * java.util.logging.LogManager.
2571      */
2572     public static final String TRACE_FILE_LIMIT =
2573         "java.util.logging.FileHandler.limit";
2574 
2575     /**
2576      * Log file count for FileHandler.
2577      *
2578      * <p><table border="1">
2579      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2580      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2581      * <tr>
2582      * <td>{@value}</td>
2583      * <td>Integer</td>
2584      * <td>No</td>
2585      * <td>10</td>
2586      * <td>1</td>
2587      * <td>-none-</td>
2588      * </tr>
2589      * </table></p>
2590      * @deprecated As of JE 4.0, use the standard java.util.logging
2591      * configuration methodologies. To set the FileHandler output file count,
2592      * set com.sleepycat.je.util.FileHandler.count = {@literal <NUMBER>}
2593      * through the java.util.logging configuration file, or through the
2594      * java.util.logging.LogManager.
2595      */
2596     public static final String TRACE_FILE_COUNT =
2597         "java.util.logging.FileHandler.count";
2598 
2599     /**
2600      * Trace messages equal and above this level will be logged.  Value should
2601      * be one of the predefined java.util.logging.Level values.
2602      *
2603      * <p><table border="1">
2604      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2605      * <tr>
2606      * <td>{@value}</td>
2607      * <td>String</td>
2608      * <td>No</td>
2609      * <td>"INFO"</td>
2610      * </tr>
2611      * </table></p>
2612      * @deprecated As of JE 4.0, use the standard java.util.logging
2613      * configuration methodologies. Set logging levels using class names
2614      * through the java.util.logging configuration file, or through the
2615      * java.util.logging.LogManager.
2616      */
2617     public static final String TRACE_LEVEL = "java.util.logging.level";
2618 
2619     /**
2620      * Trace messages equal and above this level will be logged to the
2621      * console. Value should be one of the predefined
2622      * java.util.logging.Level values.
2623      * <p>
2624      * Setting this parameter in the je.properties file or through {@link
2625      * EnvironmentConfig#setConfigParam} is analogous to setting
2626      * the property in the java.util.logging properties file or MBean.
2627      * It is preferred to use the standard java.util.logging mechanisms for
2628      * configuring java.util.logging.Handler, but this JE parameter is provided
2629      * because the java.util.logging API doesn't provide a method to set
2630      * handler levels programmatically.
2631      *
2632      * <p><table border="1">
2633      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2634      * <tr>
2635      * <td>{@value}</td>
2636      * <td>String</td>
2637      * <td>No</td>
2638      * <td>"OFF"</td>
2639      * </tr>
2640      * </table></p>
2641      * @see <a href="{@docRoot}/../GettingStartedGuide/managelogging.html"
2642      * target="_top">Chapter 12. Logging</a>
2643      */
2644     public static final String CONSOLE_LOGGING_LEVEL =
2645         "com.sleepycat.je.util.ConsoleHandler.level";
2646 
2647     /**
2648      * Trace messages equal and above this level will be logged to the je.info
2649      * file, which is in the Environment home directory.  Value should
2650      * be one of the predefined java.util.logging.Level values.
2651      * <p>
2652      * Setting this parameter in the je.properties file or through {@link
2653      * EnvironmentConfig#setConfigParam} is analogous to setting
2654      * the property in the java.util.logging properties file or MBean.
2655      * It is preferred to use the standard java.util.logging mechanisms for
2656      * configuring java.util.logging.Handler, but this JE parameter is provided
2657      * because the java.util.logging APIs doesn't provide a method to set
2658      * handler levels programmatically.
2659      *
2660      * <p><table border="1">
2661      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2662      * <tr>
2663      * <td>{@value}</td>
2664      * <td>String</td>
2665      * <td>No</td>
2666      * <td>"INFO"</td>
2667      * </tr>
2668      * </table></p>
2669      * @see <a href="{@docRoot}/../GettingStartedGuide/managelogging.html"
2670      * target="_top">Chapter 12. Logging</a>
2671      */
2672     public static final String FILE_LOGGING_LEVEL =
2673         "com.sleepycat.je.util.FileHandler.level";
2674 
2675     /**
2676      * Lock manager specific trace messages will be issued at this level.
2677      * Value should be one of the predefined java.util.logging.Level values.
2678      *
2679      * <p><table border="1">
2680      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2681      * <tr>
2682      * <td>{@value}</td>
2683      * <td>String</td>
2684      * <td>No</td>
2685      * <td>"FINE"</td>
2686      * </tr>
2687      * </table></p>
2688      * @deprecated As of JE 4.0, use the standard java.util.logging
2689      * configuration methodologies. To see locking logging, set
2690      * com.sleepycat.je.txn.level = {@literal <LEVEL>} through the
2691      * java.util.logging configuration file, or through the
2692      * java.util.logging.LogManager.
2693      */
2694     public static final String TRACE_LEVEL_LOCK_MANAGER =
2695         "java.util.logging.level.lockMgr";
2696 
2697     /**
2698      * Recovery specific trace messages will be issued at this level.  Value
2699      * should be one of the predefined java.util.logging.Level values.
2700      *
2701      * <p><table border="1">
2702      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2703      * <tr>
2704      * <td>{@value}</td>
2705      * <td>String</td>
2706      * <td>No</td>
2707      * <td>"FINE"</td>
2708      * </tr>
2709      * </table></p>
2710      * @deprecated As of JE 4.0, use the standard java.util.logging
2711      * configuration methodologies. To see recovery logging, set
2712      * com.sleepycat.je.recovery.level = {@literal <LEVEL>} through the
2713      * java.util.logging configuration file, or through the
2714      * java.util.logging.LogManager.
2715      */
2716     public static final String TRACE_LEVEL_RECOVERY =
2717         "java.util.logging.level.recovery";
2718 
2719     /**
2720      * Evictor specific trace messages will be issued at this level.  Value
2721      * should be one of the predefined java.util.logging.Level values.
2722      *
2723      * <p><table border="1">
2724      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2725      * <tr>
2726      * <td>{@value}</td>
2727      * <td>String</td>
2728      * <td>No</td>
2729      * <td>"FINE"</td>
2730      * </tr>
2731      * </table></p>
2732      * @deprecated As of JE 4.0, use the standard java.util.logging
2733      * configuration methodologies. To see evictor logging, set
2734      * com.sleepycat.je.evictor.level = {@literal <LEVEL>} through the
2735      * java.util.logging configuration file, or through the
2736      * java.util.logging.LogManager.
2737      */
2738     public static final String TRACE_LEVEL_EVICTOR =
2739         "java.util.logging.level.evictor";
2740 
2741     /**
2742      * Cleaner specific detailed trace messages will be issued at this level.
2743      * Value should be one of the predefined java.util.logging.Level values.
2744      *
2745      * <p><table border="1">
2746      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2747      * <tr>
2748      * <td>{@value}</td>
2749      * <td>String</td>
2750      * <td>Yes</td>
2751      * <td>"FINE"</td>
2752      * </tr>
2753      * </table></p>
2754      * @deprecated As of JE 4.0, use the standard java.util.logging
2755      * configuration methodologies. To see cleaner logging, set
2756      * com.sleepycat.je.cleaner.level = {@literal <LEVEL>} through the
2757      * java.util.logging configuration file, or through the
2758      * java.util.logging.LogManager.
2759      */
2760     public static final String TRACE_LEVEL_CLEANER =
2761         "java.util.logging.level.cleaner";
2762 
2763     /**
2764      * If environment startup exceeds this duration, startup statistics are
2765      * logged and can be found in the je.info file.
2766      *
2767      * <p><table border="1">
2768      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2769      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2770      * <tr>
2771      * <td>{@value}</td>
2772      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
2773      * <td>No</td>
2774      * <td>5 min</td>
2775      * <td>0</td>
2776      * <td>none</td>
2777      * </tr>
2778      * </table></p>
2779      *
2780      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
2781      * Properties</a>
2782      */
2783     public static final String STARTUP_DUMP_THRESHOLD =
2784         "je.env.startupThreshold";
2785 
2786     /**
2787      * If true collect and log statistics. The statistics are logged in CSV
2788      * format and written to the log file at a user specified interval.
2789      * The logging occurs per-Environment when the Environment is opened
2790      * in read/write mode. Statistics are written to a filed named je.stat.csv.
2791      * Successively older files are named by adding "0", "1", "2", etc into
2792      * the file name. The file name format is je.stat.[version number].csv.
2793      *
2794      * <p><table border="1">
2795      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2796      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2797      * <tr>
2798      * <td>{@value}</td>
2799      * <td>Boolean</td>
2800      * <td>Yes</td>
2801      * <td>True</td>
2802      * <td>0</td>
2803      * <td>none</td>
2804      * </tr>
2805      * </table></p>
2806      */
2807     public static final String STATS_COLLECT =
2808         "je.stats.collect";
2809 
2810     /**
2811      * Maximum number of statistics log files to retain. The rotating set of
2812      * files, as each file reaches a given size limit, is closed, rotated out,
2813      * and a new file opened. The name of the log file is je.stat.csv.
2814      * Successively older files are named by adding "0", "1", "2", etc into
2815      * the file name. The file name format is je.stat.[version number].csv.
2816      *
2817      * <p><table border="1">
2818      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2819      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2820      * <tr>
2821      * <td>{@value}</td>
2822      * <td>Integer</td>
2823      * <td>Yes</td>
2824      * <td>10</td>
2825      * <td>1</td>
2826      * <td>-none-</td>
2827      * </tr>
2828      * </table></p>
2829      */
2830     public static final String STATS_MAX_FILES =
2831         "je.stats.max.files";
2832 
2833     /**
2834      * Log file maximum row count for Stat collection. When the number of
2835      * rows in the statistics file reaches the maximum row count, the file
2836      * is closed, rotated out, and a new file opened. The name of the log
2837      * file is je.stat.csv. Successively older files are named by adding "0",
2838      * "1", "2", etc into the file name. The file name format is
2839      * je.stat.[version number].csv.
2840      *
2841      * <p><table border="1">
2842      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2843      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2844      * <tr>
2845      * <td>{@value}</td>
2846      * <td>Integer</td>
2847      * <td>Yes</td>
2848      * <td>1440</td>
2849      * <td>1</td>
2850      * <td>-none-</td>
2851      * </tr>
2852      * </table></p>
2853      */
2854     public static final String STATS_FILE_ROW_COUNT =
2855         "je.stats.file.row.count";
2856 
2857     /**
2858      * The duration of the statistics capture interval. Statistics are captured
2859      * and written to the log file at this interval.
2860      *
2861      * <p><table border="1">
2862      * <tr><td>Name</td><td>Type</td><td>Mutable</td>
2863      * <td>Default</td><td>Minimum</td><td>Maximum</td></tr>
2864      * <tr>
2865      * <td>{@value}</td>
2866      * <td>{@link <a href="#timeDuration">Duration</a>}</td>
2867      * <td>Yes</td>
2868      * <td>1 min</td>
2869      * <td>1 s</td>
2870      * <td>24 d</td>
2871      * </tr>
2872      * </table></p>
2873      *
2874      * @see <a href="EnvironmentConfig.html#timeDuration">Time Duration
2875      * Properties</a>
2876      */
2877     public static final String STATS_COLLECT_INTERVAL =
2878         "je.stats.collect.interval";
2879 
2880     /**
2881      * The directory to save the statistics log file.
2882      *
2883      * <p><table border="1">
2884      * <tr><td>Name</td><td>Type</td><td>Mutable</td><td>Default</td></tr>
2885      * <tr>
2886      * <td>{@value}</td>
2887      * <td>String</td>
2888      * <td>No</td>
2889      * <td>"NULL-> Environment home directory"</td>
2890      * </tr>
2891      * </table></p>
2892      */
2893     public static final String STATS_FILE_DIRECTORY =
2894         "je.stats.file.directory";
2895 
2896     /**
2897      * For unit testing, to prevent creating the utilization profile DB.
2898      */
2899     private transient boolean createUP = true;
2900 
2901     /**
2902      * For unit testing, to prevent writing utilization data during checkpoint.
2903      */
2904     private transient boolean checkpointUP = true;
2905 
2906     private boolean allowCreate = false;
2907 
2908     /**
2909      * For unit testing, to set readCommitted as the default.
2910      */
2911     private transient boolean txnReadCommitted = false;
2912 
2913     private String nodeName = null;
2914 
2915     /**
2916      * The loggingHandler is an instance and cannot be serialized.
2917      */
2918     private transient Handler loggingHandler;
2919 
2920     private transient
2921        ProgressListener<RecoveryProgress> recoveryProgressListener;
2922 
2923     private transient ClassLoader classLoader;
2924 
2925     private transient PreloadConfig dupConvertPreloadConfig;
2926 
2927     private CustomStats customStats;
2928 
2929     /**
2930      * Creates an EnvironmentConfig initialized with the system default
2931      * settings.
2932      */
EnvironmentConfig()2933     public EnvironmentConfig() {
2934         super();
2935     }
2936 
2937     /**
2938      * Creates an EnvironmentConfig which includes the properties specified in
2939      * the properties parameter.
2940      *
2941      * @param properties Supported properties are described in this class
2942      *
2943      * @throws IllegalArgumentException If any properties read from the
2944      * properties param are invalid.
2945      */
EnvironmentConfig(Properties properties)2946     public EnvironmentConfig(Properties properties)
2947         throws IllegalArgumentException {
2948 
2949         super(properties);
2950     }
2951 
2952     /**
2953      * If true, creates the database environment if it doesn't already exist.
2954      *
2955      * @param allowCreate If true, the database environment is created if it
2956      * doesn't already exist.
2957      *
2958      * @return this
2959      */
setAllowCreate(boolean allowCreate)2960     public EnvironmentConfig setAllowCreate(boolean allowCreate) {
2961 
2962         setAllowCreateVoid(allowCreate);
2963         return this;
2964     }
2965 
2966     /**
2967      * @hidden
2968      * The void return setter for use by Bean editors.
2969      */
setAllowCreateVoid(boolean allowCreate)2970     public void setAllowCreateVoid(boolean allowCreate) {
2971         this.allowCreate = allowCreate;
2972     }
2973 
2974     /**
2975      * Returns a flag that specifies if we may create this environment.
2976      *
2977      * @return true if we may create this environment.
2978      */
getAllowCreate()2979     public boolean getAllowCreate() {
2980 
2981         return allowCreate;
2982     }
2983 
2984     /**
2985      * Configures the lock timeout.
2986      *
2987      * <p>Equivalent to setting the je.lock.timeout parameter in the
2988      * je.properties file.</p>
2989      *
2990      * @param timeout The lock timeout for all transactional and
2991      * non-transactional operations.  A value of zero disables lock timeouts,
2992      * meaning that no lock wait time limit is enforced and a deadlocked
2993      * operation will block indefinitely.  We strongly recommend that a large
2994      * timeout value, rather than zero, is used when deadlocks are not
2995      * expected.  That way, a timeout exception will be thrown when an
2996      * unexpected deadlock occurs.
2997      *
2998      * @param unit the {@code TimeUnit} of the timeout value. May be null only
2999      * if timeout is zero.
3000      *
3001      * @return this
3002      *
3003      * @throws IllegalArgumentException if the value of timeout is invalid
3004      *
3005      * @see Transaction#setLockTimeout(long,TimeUnit)
3006      */
setLockTimeout(long timeout, TimeUnit unit)3007     public EnvironmentConfig setLockTimeout(long timeout, TimeUnit unit)
3008         throws IllegalArgumentException {
3009 
3010         setLockTimeoutVoid(timeout, unit);
3011         return this;
3012     }
3013 
3014     /**
3015      * @hidden
3016      * The void return setter for use by Bean editors.
3017      */
setLockTimeoutVoid(long timeout, TimeUnit unit)3018     public void setLockTimeoutVoid(long timeout, TimeUnit unit)
3019         throws IllegalArgumentException {
3020 
3021         DbConfigManager.setDurationVal(props, EnvironmentParams.LOCK_TIMEOUT,
3022                                        timeout, unit, validateParams);
3023     }
3024 
3025     /**
3026      * Configures the lock timeout, in microseconds.  This method is equivalent
3027      * to:
3028      *
3029      * <pre>setLockTimeout(long, TimeUnit.MICROSECONDS);</pre>
3030      *
3031      * @deprecated as of 4.0, replaced by {@link #setLockTimeout(long,
3032      * TimeUnit)}.
3033      */
setLockTimeout(long timeout)3034     public EnvironmentConfig setLockTimeout(long timeout)
3035         throws IllegalArgumentException {
3036 
3037         setLockTimeoutVoid(timeout);
3038         return this;
3039     }
3040 
3041     /**
3042      * @hidden
3043      * The void return setter for use by Bean editors.
3044      */
setLockTimeoutVoid(long timeout)3045     public void setLockTimeoutVoid(long timeout)
3046         throws IllegalArgumentException {
3047 
3048         setLockTimeout(timeout, TimeUnit.MICROSECONDS);
3049     }
3050 
3051     /**
3052      * Returns the lock timeout setting.
3053      *
3054      * @param unit the {@code TimeUnit} of the returned value. May not be null.
3055      *
3056      * A value of 0 means no timeout is set.
3057      */
getLockTimeout(TimeUnit unit)3058     public long getLockTimeout(TimeUnit unit) {
3059 
3060         return DbConfigManager.getDurationVal
3061             (props, EnvironmentParams.LOCK_TIMEOUT, unit);
3062     }
3063 
3064     /**
3065      * Returns the lock timeout setting, in microseconds.  This method is
3066      * equivalent to:
3067      *
3068      * <pre>getLockTimeout(TimeUnit.MICROSECONDS);</pre>
3069      *
3070      * @deprecated as of 4.0, replaced by {@link #getLockTimeout(TimeUnit)}.
3071      */
getLockTimeout()3072     public long getLockTimeout() {
3073         return getLockTimeout(TimeUnit.MICROSECONDS);
3074     }
3075 
3076     /**
3077      * Configures the database environment to be read-only, and any attempt to
3078      * modify a database will fail.
3079      *
3080      * <p>A read-only environment has several limitations and is recommended
3081      * only in special circumstances.  Note that there is no performance
3082      * advantage to opening an environment read-only.</p>
3083      *
3084      * <p>The primary reason for opening an environment read-only is to open a
3085      * single environment in multiple JVM processes.  Only one JVM process at a
3086      * time may open the environment read-write.  See {@link
3087      * EnvironmentLockedException}.</p>
3088      *
3089      * <p>When the environment is open read-only, the following limitations
3090      * apply.</p>
3091      * <ul>
3092      * <li>In the read-only environment no writes may be performed, as
3093      * expected, and databases must be opened read-only using {@link
3094      * DatabaseConfig#setReadOnly}.</li>
3095      * <li>The read-only environment receives a snapshot of the data that is
3096      * effectively frozen at the time the environment is opened. If the
3097      * application has the environment open read-write in another JVM process
3098      * and modifies the environment's databases in any way, the read-only
3099      * version of the data will not be updated until the read-only JVM process
3100      * closes and reopens the environment (and by extension all databases in
3101      * that environment).</li>
3102      * <li>If the read-only environment is opened while the environment is in
3103      * use by another JVM process in read-write mode, opening the environment
3104      * read-only (recovery) is likely to take longer than it does after a clean
3105      * shutdown.  This is due to the fact that the read-write JVM process is
3106      * writing and checkpoints are occurring that are not coordinated with the
3107      * read-only JVM process.  The effect is similar to opening an environment
3108      * after a crash.</li>
3109      * <li>In a read-only environment, the JE cache will contain information
3110      * that cannot be evicted because it was reconstructed by recovery and
3111      * cannot be flushed to disk.  This means that the read-only environment
3112      * may not be suitable for operations that use large amounts of memory, and
3113      * poor performance may result if this is attempted.</li>
3114      * <li>In a read-write environment, the log cleaner will be prohibited from
3115      * deleting log files for as long as the environment is open read-only in
3116      * another JVM process.  This may cause disk usage to rise, and for this
3117      * reason it is not recommended that an environment is kept open read-only
3118      * in this manner for long periods.</li>
3119      * </ul>
3120      *
3121      * <p>For these reasons, it is recommended that a read-only environment be
3122      * used only for short periods and for operations that are not performance
3123      * critical or memory intensive.  With few exceptions, all application
3124      * functions that require access to a JE environment should be built into a
3125      * single application so that they can be performed in the JVM process
3126      * where the environment is open read-write.</p>
3127      *
3128      * <p>In most applications, opening an environment read-only can and should
3129      * be avoided.</p>
3130      *
3131      * @param readOnly If true, configure the database environment to be read
3132      * only, and any attempt to modify a database will fail.
3133      *
3134      * @return this
3135      */
setReadOnly(boolean readOnly)3136     public EnvironmentConfig setReadOnly(boolean readOnly) {
3137 
3138         setReadOnlyVoid(readOnly);
3139         return this;
3140     }
3141 
3142     /**
3143      * @hidden
3144      * The void return setter for use by Bean editors.
3145      */
setReadOnlyVoid(boolean readOnly)3146     public void setReadOnlyVoid(boolean readOnly) {
3147 
3148         DbConfigManager.setBooleanVal(props, EnvironmentParams.ENV_RDONLY,
3149                                       readOnly, validateParams);
3150     }
3151 
3152     /**
3153      * Returns true if the database environment is configured to be read only.
3154      *
3155      * <p>This method may be called at any time during the life of the
3156      * application.</p>
3157      *
3158      * @return true if the database environment is configured to be read only.
3159      */
getReadOnly()3160     public boolean getReadOnly() {
3161 
3162         return DbConfigManager.getBooleanVal(props,
3163                                              EnvironmentParams.ENV_RDONLY);
3164     }
3165 
3166     /**
3167      * Configures the database environment for transactions.
3168      *
3169      * <p>This configuration option should be used when transactional
3170      * guarantees such as atomicity of multiple operations and durability are
3171      * important.</p>
3172      *
3173      * @param transactional If true, configure the database environment for
3174      * transactions.
3175      *
3176      * @return this
3177      */
setTransactional(boolean transactional)3178     public EnvironmentConfig setTransactional(boolean transactional) {
3179 
3180         setTransactionalVoid(transactional);
3181         return this;
3182     }
3183 
3184     /**
3185      * @hidden
3186      * The void return setter for use by Bean editors.
3187      */
setTransactionalVoid(boolean transactional)3188     public void setTransactionalVoid(boolean transactional) {
3189 
3190         DbConfigManager.setBooleanVal(props, EnvironmentParams.ENV_INIT_TXN,
3191                                       transactional, validateParams);
3192     }
3193 
3194     /**
3195      * Returns true if the database environment is configured for transactions.
3196      *
3197      * <p>This method may be called at any time during the life of the
3198      * application.</p>
3199      *
3200      * @return true if the database environment is configured for transactions.
3201      */
getTransactional()3202     public boolean getTransactional() {
3203 
3204         return DbConfigManager.getBooleanVal(props,
3205                                              EnvironmentParams.ENV_INIT_TXN);
3206     }
3207 
3208     /**
3209      * Configures the database environment for no locking.
3210      *
3211      * <p>This configuration option should be used when locking guarantees such
3212      * as consistency and isolation are not important.  If locking mode is
3213      * disabled (it is enabled by default), the cleaner is automatically
3214      * disabled.  The user is responsible for invoking the cleaner and ensuring
3215      * that there are no concurrent operations while the cleaner is
3216      * running.</p>
3217      *
3218      * @param locking If false, configure the database environment for no
3219      * locking.  The default is true.
3220      *
3221      * @return this
3222      */
setLocking(boolean locking)3223     public EnvironmentConfig setLocking(boolean locking) {
3224 
3225         setLockingVoid(locking);
3226         return this;
3227     }
3228 
3229     /**
3230      * @hidden
3231      * The void return setter for use by Bean editors.
3232      */
setLockingVoid(boolean locking)3233     public void setLockingVoid(boolean locking) {
3234 
3235         DbConfigManager.setBooleanVal(props,
3236                                       EnvironmentParams.ENV_INIT_LOCKING,
3237                                       locking, validateParams);
3238     }
3239 
3240     /**
3241      * Returns true if the database environment is configured for locking.
3242      *
3243      * <p>This method may be called at any time during the life of the
3244      * application.</p>
3245      *
3246      * @return true if the database environment is configured for locking.
3247      */
getLocking()3248     public boolean getLocking() {
3249 
3250         return DbConfigManager.getBooleanVal
3251             (props, EnvironmentParams.ENV_INIT_LOCKING);
3252     }
3253 
3254     /**
3255      * Configures the transaction timeout.
3256      *
3257      * <p>Equivalent to setting the je.txn.timeout parameter in the
3258      * je.properties file.</p>
3259      *
3260      * @param timeout The transaction timeout. A value of 0 turns off
3261      * transaction timeouts.
3262      *
3263      * @param unit the {@code TimeUnit} of the timeout value. May be null only
3264      * if timeout is zero.
3265      *
3266      * @return this
3267      *
3268      * @throws IllegalArgumentException If the value of timeout is negative
3269      *
3270      * @see Transaction#setTxnTimeout
3271      */
setTxnTimeout(long timeout, TimeUnit unit)3272     public EnvironmentConfig setTxnTimeout(long timeout, TimeUnit unit)
3273         throws IllegalArgumentException {
3274 
3275         setTxnTimeoutVoid(timeout, unit);
3276         return this;
3277     }
3278 
3279     /**
3280      * @hidden
3281      * The void return setter for use by Bean editors.
3282      */
setTxnTimeoutVoid(long timeout, TimeUnit unit)3283     public void setTxnTimeoutVoid(long timeout, TimeUnit unit)
3284         throws IllegalArgumentException {
3285 
3286         DbConfigManager.setDurationVal(props, EnvironmentParams.TXN_TIMEOUT,
3287                                        timeout, unit, validateParams);
3288     }
3289 
3290     /**
3291      * Configures the transaction timeout, in microseconds.  This method is
3292      * equivalent to:
3293      *
3294      * <pre>setTxnTimeout(long, TimeUnit.MICROSECONDS);</pre>
3295      *
3296      * @deprecated as of 4.0, replaced by {@link #setTxnTimeout(long,
3297      * TimeUnit)}.
3298      */
setTxnTimeout(long timeout)3299     public EnvironmentConfig setTxnTimeout(long timeout)
3300         throws IllegalArgumentException {
3301 
3302         setTxnTimeoutVoid(timeout);
3303         return this;
3304     }
3305 
3306     /**
3307      * @hidden
3308      * The void return setter for use by Bean editors.
3309      */
setTxnTimeoutVoid(long timeout)3310     public void setTxnTimeoutVoid(long timeout)
3311         throws IllegalArgumentException {
3312 
3313         setTxnTimeout(timeout, TimeUnit.MICROSECONDS);
3314     }
3315 
3316     /**
3317      * Returns the transaction timeout.
3318      *
3319      * <p>A value of 0 means transaction timeouts are not configured.</p>
3320      *
3321      * @param unit the {@code TimeUnit} of the returned value. May not be null.
3322      *
3323      * @return The transaction timeout.
3324      */
getTxnTimeout(TimeUnit unit)3325     public long getTxnTimeout(TimeUnit unit) {
3326         return DbConfigManager.getDurationVal
3327             (props, EnvironmentParams.TXN_TIMEOUT, unit);
3328     }
3329 
3330     /**
3331      * Returns the transaction timeout, in microseconds.  This method is
3332      * equivalent to:
3333      *
3334      * <pre>getTxnTimeout(TimeUnit.MICROSECONDS);</pre>
3335      *
3336      * @deprecated as of 4.0, replaced by {@link #getTxnTimeout(TimeUnit)}.
3337      */
getTxnTimeout()3338     public long getTxnTimeout() {
3339         return getTxnTimeout(TimeUnit.MICROSECONDS);
3340     }
3341 
3342     /**
3343      * Configures all transactions for this environment to have Serializable
3344      * (Degree 3) isolation.  By setting Serializable isolation, phantoms will
3345      * be prevented.  By default transactions provide Repeatable Read
3346      * isolation.
3347      *
3348      * The default is false for the database environment.
3349      *
3350      * @see LockMode
3351      *
3352      * @return this
3353      */
3354     public EnvironmentConfig
setTxnSerializableIsolation(boolean txnSerializableIsolation)3355         setTxnSerializableIsolation(boolean txnSerializableIsolation) {
3356 
3357         setTxnSerializableIsolationVoid(txnSerializableIsolation);
3358         return this;
3359     }
3360 
3361     /**
3362      * @hidden
3363      * The void return setter for use by Bean editors.
3364      */
3365     public void
setTxnSerializableIsolationVoid(boolean txnSerializableIsolation)3366         setTxnSerializableIsolationVoid(boolean txnSerializableIsolation) {
3367 
3368         DbConfigManager.setBooleanVal
3369             (props, EnvironmentParams.TXN_SERIALIZABLE_ISOLATION,
3370              txnSerializableIsolation, validateParams);
3371     }
3372 
3373     /**
3374      * Returns true if all transactions for this environment has been
3375      * configured to have Serializable (Degree 3) isolation.
3376      *
3377      * @return true if the environment has been configured to have repeatable
3378      * read isolation.
3379      *
3380      * @see LockMode
3381      */
getTxnSerializableIsolation()3382     public boolean getTxnSerializableIsolation() {
3383 
3384         return DbConfigManager.getBooleanVal
3385             (props, EnvironmentParams.TXN_SERIALIZABLE_ISOLATION);
3386     }
3387 
3388     /**
3389      * For unit testing, sets readCommitted as the default.
3390      */
setTxnReadCommitted(boolean txnReadCommitted)3391     void setTxnReadCommitted(boolean txnReadCommitted) {
3392 
3393         this.txnReadCommitted = txnReadCommitted;
3394     }
3395 
3396     /**
3397      * For unit testing, to set readCommitted as the default.
3398      */
getTxnReadCommitted()3399     boolean getTxnReadCommitted() {
3400 
3401         return txnReadCommitted;
3402     }
3403 
3404     /**
3405      * If true, the shared cache is used by this environment.
3406      *
3407      * <p>By default this parameter is false and this environment uses a
3408      * private cache.  If this parameter is set to true, this environment will
3409      * use a cache that is shared with all other open environments in this
3410      * process that also set this parameter to true.  There is a single shared
3411      * cache per process.</p>
3412      *
3413      * <p>By using the shared cache, multiple open environments will make
3414      * better use of memory because the cache LRU algorithm is applied across
3415      * all information in all environments sharing the cache.  For example, if
3416      * one environment is open but not recently used, then it will only use a
3417      * small portion of the cache, leaving the rest of the cache for
3418      * environments that have been recently used.</p>
3419      *
3420      * @param sharedCache If true, the shared cache is used by this
3421      * environment.
3422      *
3423      * @return this
3424      */
setSharedCache(boolean sharedCache)3425     public EnvironmentConfig setSharedCache(boolean sharedCache) {
3426 
3427         setSharedCacheVoid(sharedCache);
3428         return this;
3429     }
3430 
3431     /**
3432      * @hidden
3433      * The void return setter for use by Bean editors.
3434      */
setSharedCacheVoid(boolean sharedCache)3435     public void setSharedCacheVoid(boolean sharedCache) {
3436 
3437         DbConfigManager.setBooleanVal
3438             (props, EnvironmentParams.ENV_SHARED_CACHE, sharedCache,
3439              validateParams);
3440     }
3441 
3442     /**
3443      * Returns true if the shared cache is used by this environment.
3444      *
3445      * @return true if the shared cache is used by this environment. @see
3446      * #setSharedCache
3447      */
getSharedCache()3448     public boolean getSharedCache() {
3449         return DbConfigManager.getBooleanVal
3450             (props, EnvironmentParams.ENV_SHARED_CACHE);
3451     }
3452 
3453     /**
3454      * Sets the user defined nodeName for the Environment.  If set, exception
3455      * messages, logging messages, and thread names will have this nodeName
3456      * included in them.  If a user has multiple Environments in a single JVM,
3457      * setting this to a string unique to each Environment may make it easier
3458      * to diagnose certain exception conditions as well as thread dumps.
3459      *
3460      * @return this
3461      */
setNodeName(String nodeName)3462     public EnvironmentConfig setNodeName(String nodeName) {
3463         setNodeNameVoid(nodeName);
3464         return this;
3465     }
3466 
3467     /**
3468      * @hidden
3469      * The void return setter for use by Bean editors.
3470      */
setNodeNameVoid(String nodeName)3471     public void setNodeNameVoid(String nodeName) {
3472         this.nodeName = nodeName;
3473     }
3474 
3475     /**
3476      * Returns the user defined nodeName for the Environment.
3477      */
getNodeName()3478     public String getNodeName() {
3479         return nodeName;
3480     }
3481 
3482     /**
3483      * Sets the custom statistics object.
3484      *
3485      * @return this
3486      */
setCustomStats(CustomStats customStats)3487     public EnvironmentConfig setCustomStats(CustomStats customStats) {
3488         this.customStats = customStats;
3489         return this;
3490     }
3491 
3492     /**
3493      * @hidden
3494      * The void return setter for use by Bean editors.
3495      */
setCustomStatsVoid(CustomStats customStats)3496     public void setCustomStatsVoid(CustomStats customStats) {
3497         this.customStats = customStats;
3498     }
3499 
3500     /**
3501      * Gets the custom statstics object.
3502      *
3503      * @return customStats
3504      */
getCustomStats()3505     public CustomStats getCustomStats() {
3506         return customStats;
3507     }
3508 
3509     /**
3510      * Set a java.util.logging.Handler which will be used by all
3511      * java.util.logging.Loggers instantiated by this Environment. This lets
3512      * the application specify a handler which
3513      * <ul>
3514      * <li>requires a constructor with arguments</li>
3515      * <li>is specific to this environment, which is important if the
3516      * application is using multiple environments within the same process.
3517      * </ul>
3518      * Note that {@link Handler} is not serializable, and the logging
3519      * handler should be set within the same process.
3520      */
setLoggingHandler(Handler handler)3521     public EnvironmentConfig setLoggingHandler(Handler handler) {
3522         setLoggingHandlerVoid(handler);
3523         return this;
3524     }
3525 
3526     /**
3527      * @hidden
3528      * The void return setter for use by Bean editors.
3529      */
setLoggingHandlerVoid(Handler handler)3530     public void setLoggingHandlerVoid(Handler handler){
3531         loggingHandler = handler;
3532     }
3533 
3534     /**
3535      * Returns the custom java.util.logging.Handler specified by the
3536      * application.
3537      */
getLoggingHandler()3538     public Handler getLoggingHandler() {
3539         return loggingHandler;
3540     }
3541 
3542     /* Documentation inherited from EnvironmentMutableConfig.setConfigParam. */
3543     @Override
setConfigParam(String paramName, String value)3544     public EnvironmentConfig setConfigParam(String paramName, String value)
3545         throws IllegalArgumentException {
3546 
3547         DbConfigManager.setConfigParam(props,
3548                                        paramName,
3549                                        value,
3550                                        false, /* requireMutablity */
3551                                        validateParams,
3552                                        false  /* forReplication */,
3553                                        true   /* verifyForReplication */);
3554         return this;
3555     }
3556 
3557     /**
3558      * Configure the environment to make periodic calls to a ProgressListener to
3559      * provide feedback on environment startup (recovery). The
3560      * ProgressListener.progress() method is called at different stages of
3561      * the recovery process. See {@link RecoveryProgress} for information about
3562      * those stages.
3563      * <p>
3564      * When using progress listeners, review the information at {@link
3565      * ProgressListener#progress} to avoid any unintended disruption to
3566      * environment startup.
3567      * @param progressListener The ProgressListener to callback during
3568      * environment startup (recovery).
3569      */
setRecoveryProgressListener(final ProgressListener<RecoveryProgress> progressListener)3570     public EnvironmentConfig setRecoveryProgressListener
3571         (final ProgressListener<RecoveryProgress> progressListener) {
3572         setRecoveryProgressListenerVoid(progressListener);
3573         return this;
3574     }
3575 
3576     /**
3577      * @hidden
3578      * The void return setter for use by Bean editors.
3579      */
setRecoveryProgressListenerVoid(final ProgressListener<RecoveryProgress> progressListener)3580     public void setRecoveryProgressListenerVoid
3581         (final ProgressListener<RecoveryProgress> progressListener) {
3582         this.recoveryProgressListener = progressListener;
3583     }
3584 
3585     /**
3586      * Return the ProgressListener to be used at this environment startup.
3587      */
getRecoveryProgressListener()3588     public ProgressListener<RecoveryProgress> getRecoveryProgressListener() {
3589         return recoveryProgressListener;
3590     }
3591 
3592     /**
3593      * Configure the environment to use a specified ClassLoader for loading
3594      * user-supplied classes by name.
3595      */
setClassLoader(final ClassLoader classLoader)3596     public EnvironmentConfig setClassLoader(final ClassLoader classLoader) {
3597         setClassLoaderVoid(classLoader);
3598         return this;
3599     }
3600 
3601     /**
3602      * @hidden
3603      * The void return setter for use by Bean editors.
3604      */
setClassLoaderVoid(final ClassLoader classLoader)3605     public void setClassLoaderVoid(final ClassLoader classLoader) {
3606         this.classLoader = classLoader;
3607     }
3608 
3609     /**
3610      * Returns the ClassLoader for loading user-supplied classes by name, or
3611      * null if no specified ClassLoader is configured.
3612      */
getClassLoader()3613     public ClassLoader getClassLoader() {
3614         return classLoader;
3615     }
3616 
3617     /**
3618      * @hidden
3619      * Configure the environment to use a specified PreloadConfig for
3620      * duplicates database conversion.
3621      */
3622     public EnvironmentConfig
setDupConvertPreloadConfig(final PreloadConfig preloadConfig)3623         setDupConvertPreloadConfig(final PreloadConfig preloadConfig) {
3624         setDupConvertPreloadConfigVoid(preloadConfig);
3625         return this;
3626     }
3627 
3628     /**
3629      * @hidden
3630      * The void return setter for use by Bean editors.
3631      */
3632     public void
setDupConvertPreloadConfigVoid(final PreloadConfig preloadConfig)3633         setDupConvertPreloadConfigVoid(final PreloadConfig preloadConfig) {
3634         this.dupConvertPreloadConfig = preloadConfig;
3635     }
3636 
3637     /**
3638      * @hidden
3639      * Returns the PreloadConfig for duplicates database conversion, or
3640      * null if no PreloadConfig is configured.
3641      */
getDupConvertPreloadConfig()3642     public PreloadConfig getDupConvertPreloadConfig() {
3643         return dupConvertPreloadConfig;
3644     }
3645 
3646     /**
3647      * For unit testing, to prevent creating the utilization profile DB.
3648      */
setCreateUP(boolean createUP)3649     void setCreateUP(boolean createUP) {
3650         this.createUP = createUP;
3651     }
3652 
3653     /**
3654      * For unit testing, to prevent creating the utilization profile DB.
3655      */
getCreateUP()3656     boolean getCreateUP() {
3657         return createUP;
3658     }
3659 
3660     /**
3661      * For unit testing, to prevent writing utilization data during checkpoint.
3662      */
setCheckpointUP(boolean checkpointUP)3663     void setCheckpointUP(boolean checkpointUP) {
3664         this.checkpointUP = checkpointUP;
3665     }
3666 
3667     /**
3668      * For unit testing, to prevent writing utilization data during checkpoint.
3669      */
getCheckpointUP()3670     boolean getCheckpointUP() {
3671         return checkpointUP;
3672     }
3673 
3674     /**
3675      * Returns a copy of this configuration object.
3676      */
3677     @Override
clone()3678     public EnvironmentConfig clone() {
3679         return (EnvironmentConfig) super.clone();
3680     }
3681 
3682     /**
3683      * Display configuration values.
3684      */
3685     @Override
toString()3686     public String toString() {
3687         return ("allowCreate=" + allowCreate + "\n" + super.toString());
3688     }
3689 }
3690