1 8 9 package com.sleepycat.je.config; 10 11 import java.io.File ; 12 import java.io.FileWriter ; 13 import java.util.HashMap ; 14 import java.util.Iterator ; 15 import java.util.Map ; 16 import java.util.TreeSet ; 17 18 22 public class EnvironmentParams { 23 24 29 public final static Map SUPPORTED_PARAMS = new HashMap (); 30 31 34 public static final LongConfigParam MAX_MEMORY = 35 new LongConfigParam("je.maxMemory", 36 null, null, new Long (0), true, false, "# Specify the cache size in bytes, as an absolute number. The system\n"+ 42 "# attempts to stay within this budget and will evict database\n" + 43 "# objects when it comes within a prescribed margin of the limit.\n" + 44 "# By default, this parameter is 0 and JE instead sizes the cache\n" + 45 "# proportionally to the memory available to the JVM, based on\n"+ 46 "# je.maxMemoryPercent."); 47 48 public static final IntConfigParam MAX_MEMORY_PERCENT = 49 new IntConfigParam("je.maxMemoryPercent", 50 new Integer (1), new Integer (90), new Integer (60), true, false, "# By default, JE sizes the cache as a percentage of the maximum\n" + 56 "# memory available to the JVM. For example, if the JVM is\n" + 57 "# started with -Xmx128M, the cache size will be\n" + 58 "# (je.maxMemoryPercent * 128M) / 100\n" + 59 "# Setting je.maxMemory to an non-zero value will override\n" + 60 "# je.maxMemoryPercent"); 61 62 public static final BooleanConfigParam ENV_RECOVERY = 63 new BooleanConfigParam("je.env.recovery", 64 true, false, false, "# If true, an environment is created with recovery and the related\n" + 68 "# daemons threads enabled."); 69 70 public static final BooleanConfigParam ENV_RECOVERY_FORCE_CHECKPOINT = 71 new BooleanConfigParam("je.env.recoveryForceCheckpoint", 72 false, false, false, "# If true, a checkpoint is forced following recovery, even if the\n" + 76 "# log ends with a checkpoint."); 77 78 public static final BooleanConfigParam ENV_RUN_INCOMPRESSOR = 79 new BooleanConfigParam("je.env.runINCompressor", 80 true, true, false, "# If true, starts up the INCompressor.\n" + 84 "# This parameter is true by default"); 85 86 87 public static final BooleanConfigParam ENV_RUN_EVICTOR = 88 new BooleanConfigParam("je.env.runEvictor", 89 false, true, false, "# If true, starts up the evictor.\n" + 93 "# This parameter is false by default\n" + 94 "# (deprecated, eviction is performed in-line"); 95 96 public static final BooleanConfigParam ENV_RUN_CHECKPOINTER = 97 new BooleanConfigParam("je.env.runCheckpointer", 98 true, true, false, "# If true, starts up the checkpointer.\n" + 102 "# This parameter is true by default"); 103 104 public static final BooleanConfigParam ENV_RUN_CLEANER = 105 new BooleanConfigParam("je.env.runCleaner", 106 true, true, false, "# If true, starts up the cleaner.\n" + 110 "# This parameter is true by default"); 111 112 public static final IntConfigParam ENV_BACKGROUND_READ_LIMIT = 113 new IntConfigParam("je.env.backgroundReadLimit", 114 new Integer (0), new Integer (Integer.MAX_VALUE), new Integer (0), true, false, "# The maximum number of read operations performed by JE background\n" + 120 "# activities (e.g., cleaning) before sleeping to ensure that\n" + 121 "# application threads can perform I/O.\n" + 122 "# If zero (the default) then no limitation on I/O is enforced.\n" + 123 "# See je.env.backgroundSleepInterval."); 124 125 public static final IntConfigParam ENV_BACKGROUND_WRITE_LIMIT = 126 new IntConfigParam("je.env.backgroundWriteLimit", 127 new Integer (0), new Integer (Integer.MAX_VALUE), new Integer (0), true, false, "# The maximum number of write operations performed by JE background\n" + 133 "# activities (e.g., checkpointing and eviction) before sleeping to\n" + 134 "# ensure that application threads can perform I/O.\n" + 135 "# If zero (the default) then no limitation on I/O is enforced.\n" + 136 "# See je.env.backgroundSleepInterval."); 137 138 public static final LongConfigParam ENV_BACKGROUND_SLEEP_INTERVAL = 139 new LongConfigParam("je.env.backgroundSleepInterval", 140 new Long (1000), new Long (Long.MAX_VALUE), new Long (1000), true, false, "# The number of microseconds that JE background activities will\n" + 146 "# sleep when the je.env.backgroundWriteLimit or backgroundReadLimit\n" + 147 "# is reached. If je.env.backgroundWriteLimit and\n" + 148 "# backgroundReadLimit are zero, this setting is not used.\n" + 149 "# By default this setting is 1000 or 1 millisecond."); 150 151 public static final BooleanConfigParam ENV_CHECK_LEAKS = 152 new BooleanConfigParam("je.env.checkLeaks", 153 true, false, false, "# Debugging support: check leaked locks and txns at env close."); 157 158 public static final BooleanConfigParam ENV_FORCED_YIELD = 159 new BooleanConfigParam("je.env.forcedYield", 160 false, false, false, "# Debugging support: call Thread.yield() at strategic points."); 164 165 public static final BooleanConfigParam ENV_INIT_TXN = 166 new BooleanConfigParam("je.env.isTransactional", 167 false, false, false, "# If true, create the environment w/ transactions."); 171 172 public static final BooleanConfigParam ENV_INIT_LOCKING = 173 new BooleanConfigParam("je.env.isLocking", 174 true, false, false, "# If true, create the environment with locking."); 178 179 public static final BooleanConfigParam ENV_RDONLY = 180 new BooleanConfigParam("je.env.isReadOnly", 181 false, false, false, "# If true, create the environment read only."); 185 186 public static final BooleanConfigParam ENV_FAIR_LATCHES = 187 new BooleanConfigParam("je.env.fairLatches", 188 false, false, false, "# If true, use latches instead of synchronized blocks to\n" + 192 "# implement the lock table and log write mutexes. Latches require\n" + 193 "# that threads queue to obtain the mutex in question and\n" + 194 "# therefore guarantee that there will be no mutex starvation, but \n" + 195 "# do incur a performance penalty. Latches should not be necessary in\n"+ 196 "# most cases, so synchronized blocks are the default. An application\n" + 197 "# that puts heavy load on JE with threads with different thread\n"+ 198 "# priorities might find it useful to use latches. In a Java 5 JVM,\n" + 199 "# where java.util.concurrent.locks.ReentrantLock is used for the\n" + 200 "# latch implementation, this parameter will determine whether they\n" + 201 "# are 'fair' or not. This parameter is 'static' across all\n" + 202 "# environments.\n"); 203 204 public static final BooleanConfigParam ENV_SHARED_LATCHES = 205 new BooleanConfigParam("je.env.sharedLatches", 206 false, false, false, "# If true, use shared latches for Internal Nodes (INs).\n"); 210 211 public static final IntConfigParam ADLER32_CHUNK_SIZE = 212 new IntConfigParam("je.adler32.chunkSize", 213 new Integer (0), new Integer (1 << 20), new Integer (0), true, false, "# By default, JE passes an entire log record to the Adler32 class\n" + 219 "# for checksumming. This can cause problems with the GC in some\n" + 220 "# cases if the records are large and there is concurrency. Setting\n" + 221 "# this parameter will cause JE to pass chunks of the log record to\n" + 222 "# the checksumming class so that the GC does not block. 0 means\n" + 223 "# do not chunk.\n"); 224 225 228 229 public static final int MIN_LOG_BUFFER_SIZE = 2048; 230 private static final int NUM_LOG_BUFFERS_DEFAULT = 3; 231 public static final long LOG_MEM_SIZE_MIN = 232 NUM_LOG_BUFFERS_DEFAULT * MIN_LOG_BUFFER_SIZE; 233 public static final String LOG_MEM_SIZE_MIN_STRING = 234 Long.toString(LOG_MEM_SIZE_MIN); 235 236 public static final LongConfigParam LOG_MEM_SIZE = 237 new LongConfigParam("je.log.totalBufferBytes", 238 new Long (LOG_MEM_SIZE_MIN), null, new Long (0), false, false, "# The total memory taken by log buffers, in bytes. If 0, use\n" + 245 "# 7% of je.maxMemory"); 246 247 public static final IntConfigParam NUM_LOG_BUFFERS = 248 new IntConfigParam("je.log.numBuffers", 249 new Integer (2), null, new Integer (NUM_LOG_BUFFERS_DEFAULT), false, false, "# The number of JE log buffers"); 255 256 public static final IntConfigParam LOG_BUFFER_MAX_SIZE = 257 new IntConfigParam("je.log.bufferSize", 258 new Integer (1<<10), null, new Integer (1<<20), false, false, "# maximum starting size of a JE log buffer"); 264 265 public static final IntConfigParam LOG_FAULT_READ_SIZE = 266 new IntConfigParam("je.log.faultReadSize", 267 new Integer (32), null, new Integer (2048), false, false, "# The buffer size for faulting in objects from disk, in bytes."); 273 274 public static final IntConfigParam LOG_ITERATOR_READ_SIZE = 275 new IntConfigParam("je.log.iteratorReadSize", 276 new Integer (128), null, new Integer (8192), false, false, "# The read buffer size for log iterators, which are used when\n" + 282 "# scanning the log during activities like log cleaning and\n" + 283 "# environment open, in bytes. This may grow as the system encounters\n" + 284 "# larger log entries"); 285 286 public static final IntConfigParam LOG_ITERATOR_MAX_SIZE = 287 new IntConfigParam("je.log.iteratorMaxSize", 288 new Integer (128), null, new Integer (16777216), false, false, "# The maximum read buffer size for log iterators, which are used\n" + 294 "# when scanning the log during activities like log cleaning\n" + 295 "# and environment open, in bytes."); 296 297 public static final LongConfigParam LOG_FILE_MAX = 298 new LongConfigParam("je.log.fileMax", 299 new Long (1000000), new Long (4294967296L), new Long (10000000), false, false, "# The maximum size of each individual JE log file, in bytes."); 305 306 public static final BooleanConfigParam LOG_CHECKSUM_READ = 307 new BooleanConfigParam("je.log.checksumRead", 308 true, false, false, "# If true, perform a checksum check when reading entries from log."); 312 313 public static final BooleanConfigParam LOG_MEMORY_ONLY = 314 new BooleanConfigParam("je.log.memOnly", 315 false, false, false, "# If true, operates in an in-memory test mode without flushing\n" + 319 "# the log to disk. An environment directory must be specified, but\n" + 320 "# it need not exist and no files are written. The system operates\n" + 321 "# until it runs out of memory, at which time an OutOfMemoryError\n" + 322 "# is thrown. Because the entire log is kept in memory, this mode\n" + 323 "# is normally useful only for testing."); 324 325 public static final IntConfigParam LOG_FILE_CACHE_SIZE = 326 new IntConfigParam("je.log.fileCacheSize", 327 new Integer (3), null, new Integer (100), false, false, "# The size of the file handle cache."); 333 334 public static final LongConfigParam LOG_FSYNC_TIMEOUT = 335 new LongConfigParam("je.log.fsyncTimeout", 336 new Long (10000L), null, new Long (500000L), false, false, "# Timeout limit for group file sync, in microseconds."); 342 343 public static final BooleanConfigParam LOG_USE_NIO = 344 new BooleanConfigParam("je.log.useNIO", 345 false, false, false, "# If true (default is false) NIO is used for all file I/O."); 349 350 public static final BooleanConfigParam LOG_DIRECT_NIO = 351 new BooleanConfigParam("je.log.directNIO", 352 false, false, false, "# If true (default is false) direct NIO buffers are used.\n" + 356 "# This setting is only used if je.log.useNIO=true."); 357 358 public static final LongConfigParam LOG_CHUNKED_NIO = 359 new LongConfigParam("je.log.chunkedNIO", 360 new Long (0L), new Long (1 << 26), new Long (0L), false, false, "# If non-0 (default is 0) break all IO into chunks of this size.\n" + 366 "# This setting is only used if je.log.useNIO=true."); 367 368 public static final BooleanConfigParam LOG_DEFERREDWRITE_TEMP = 369 new BooleanConfigParam("je.deferredWrite.temp", 370 false, false, false, "# If true, assume that deferred write database will never be\n" + 374 "# used after an environment is closed. This permits a more efficient\n" + 375 "# form of logging of deferred write objects that overflow to disk\n" + 376 "# through cache eviction or Database.sync() and reduces log cleaner\n" + 377 "# overhead."); 378 379 382 public static final IntConfigParam NODE_MAX = 383 new IntConfigParam("je.nodeMaxEntries", 384 new Integer (4), new Integer (32767), new Integer (128), false, false, "# The maximum number of entries in an internal btree node.\n" + 390 "# This can be set per-database using the DatabaseConfig object."); 391 392 public static final IntConfigParam NODE_MAX_DUPTREE = 393 new IntConfigParam("je.nodeDupTreeMaxEntries", 394 new Integer (4), new Integer (32767), new Integer (128), false, false, "# The maximum number of entries in an internal dup btree node.\n" + 400 "# This can be set per-database using the DatabaseConfig object."); 401 402 public static final IntConfigParam BIN_MAX_DELTAS = 403 new IntConfigParam("je.tree.maxDelta", 404 new Integer (0), new Integer (100), new Integer (10), false, false, "# After this many deltas, logs a full version."); 410 411 public static final IntConfigParam BIN_DELTA_PERCENT = 412 new IntConfigParam("je.tree.binDelta", 413 new Integer (0), new Integer (75), new Integer (25), false, false, "# If less than this percentage of entries are changed on a BIN,\n" + 419 "# logs a delta instead of a full version."); 420 421 424 public static final LongConfigParam COMPRESSOR_WAKEUP_INTERVAL = 425 new LongConfigParam("je.compressor.wakeupInterval", 426 new Long (1000000), new Long (4294967296L), new Long (5000000), false, false, "# The compressor wakeup interval in microseconds."); 432 433 public static final IntConfigParam COMPRESSOR_RETRY = 434 new IntConfigParam("je.compressor.deadlockRetry", 435 new Integer (0), new Integer (Integer.MAX_VALUE), new Integer (3), false, false, "# Number of times to retry a compression run if a deadlock occurs."); 441 442 public static final LongConfigParam COMPRESSOR_LOCK_TIMEOUT = 443 new LongConfigParam("je.compressor.lockTimeout", 444 new Long (0), new Long (4294967296L), new Long (500000L), false, false, "# The lock timeout for compressor transactions in microseconds."); 450 451 public static final BooleanConfigParam COMPRESSOR_PURGE_ROOT = 452 new BooleanConfigParam("je.compressor.purgeRoot", 453 false, false, false, "# If true, when the compressor encounters an empty tree, the root\n" + 457 "# node of the tree is deleted."); 458 459 462 public static final LongConfigParam EVICTOR_EVICT_BYTES = 463 new LongConfigParam("je.evictor.evictBytes", 464 new Long (1024), null, new Long (524288), false, false, "# When eviction happens, the evictor will push memory usage to this\n" + 470 "# number of bytes below je.maxMemory. The default is 512KB and the\n" + 471 "# minimum is 1 KB (1024)."); 472 473 474 public static final IntConfigParam EVICTOR_USEMEM_FLOOR = 475 new IntConfigParam("je.evictor.useMemoryFloor", 476 new Integer (50), new Integer (100), new Integer (95), false, false, "# When eviction happens, the evictor will push memory usage to this\n" + 482 "# percentage of je.maxMemory." + 483 "# (deprecated in favor of je.evictor.evictBytes"); 484 485 486 public static final IntConfigParam EVICTOR_NODE_SCAN_PERCENTAGE = 487 new IntConfigParam("je.evictor.nodeScanPercentage", 488 new Integer (1), new Integer (100), new Integer (10), false, false, "# The evictor percentage of total nodes to scan per wakeup.\n" + 494 "# (deprecated in favor of je.evictor.nodesPerScan"); 495 496 497 public static final 498 IntConfigParam EVICTOR_EVICTION_BATCH_PERCENTAGE = 499 new IntConfigParam("je.evictor.evictionBatchPercentage", 500 new Integer (1), new Integer (100), new Integer (10), false, false, "# The evictor percentage of scanned nodes to evict per wakeup.\n" + 506 "# (deprecated)"); 507 508 public static final IntConfigParam EVICTOR_NODES_PER_SCAN = 509 new IntConfigParam("je.evictor.nodesPerScan", 510 new Integer (1), new Integer (1000), new Integer (10), false, false, "# The number of nodes in one evictor scan"); 516 517 518 public static final 519 IntConfigParam EVICTOR_CRITICAL_PERCENTAGE = 520 new IntConfigParam("je.evictor.criticalPercentage", 521 new Integer (0), new Integer (1000), new Integer (0), false, false, "# At this percentage over the allotted cache, critical eviction\n" + 527 "# will start." + 528 "# (deprecated, eviction is performed in-line"); 529 530 public static final IntConfigParam EVICTOR_RETRY = 531 new IntConfigParam("je.evictor.deadlockRetry", 532 new Integer (0), new Integer (Integer.MAX_VALUE), new Integer (3), false, false, "# The number of times to retry the evictor if it runs into a deadlock."); 538 539 public static final BooleanConfigParam EVICTOR_LRU_ONLY = 540 new BooleanConfigParam("je.evictor.lruOnly", 541 true, false, false, "# If true (the default), use an LRU-only policy to select nodes for\n" + 545 "# eviction. If false, select by Btree level first, and then by LRU."); 546 547 550 public static final LongConfigParam CHECKPOINTER_BYTES_INTERVAL = 551 new LongConfigParam("je.checkpointer.bytesInterval", 552 new Long (0), new Long (Long.MAX_VALUE), new Long (20000000), false, false, "# Ask the checkpointer to run every time we write this many bytes\n" + 558 "# to the log. If set, supercedes je.checkpointer.wakeupInterval. To\n" + 559 "# use time based checkpointing, set this to 0."); 560 561 public static final LongConfigParam CHECKPOINTER_WAKEUP_INTERVAL = 562 new LongConfigParam("je.checkpointer.wakeupInterval", 563 new Long (1000000), new Long (4294967296L), new Long (0), false, false, "# The checkpointer wakeup interval in microseconds. By default, this\n"+ 569 "# is inactive and we wakeup the checkpointer as a function of the\n" + 570 "# number of bytes written to the log. (je.checkpointer.bytesInterval)"); 571 572 public static final IntConfigParam CHECKPOINTER_RETRY = 573 new IntConfigParam("je.checkpointer.deadlockRetry", 574 new Integer (0), new Integer (Integer.MAX_VALUE), new Integer (3), false, false, "# The number of times to retry a checkpoint if it runs into a deadlock."); 580 583 public static final IntConfigParam CLEANER_MIN_UTILIZATION = 584 new IntConfigParam("je.cleaner.minUtilization", 585 new Integer (0), new Integer (90), new Integer (50), true, false, "# The cleaner will keep the total disk space utilization percentage\n" + 591 "# above this value. The default is set to 50 percent."); 592 593 public static final IntConfigParam CLEANER_MIN_FILE_UTILIZATION = 594 new IntConfigParam("je.cleaner.minFileUtilization", 595 new Integer (0), new Integer (50), new Integer (5), true, false, "# A log file will be cleaned if its utilization percentage is below\n" + 601 "# this value, irrespective of total utilization. The default is\n" + 602 "# set to 5 percent."); 603 604 public static final LongConfigParam CLEANER_BYTES_INTERVAL = 605 new LongConfigParam("je.cleaner.bytesInterval", 606 new Long (0), new Long (Long.MAX_VALUE), new Long (0), true, false, "# The cleaner checks disk utilization every time we write this many\n" + 612 "# bytes to the log. If zero (and by default) it is set to the\n" + 613 "# je.log.fileMax value divided by four."); 614 615 public static final BooleanConfigParam CLEANER_FETCH_OBSOLETE_SIZE = 616 new BooleanConfigParam("je.cleaner.fetchObsoleteSize", 617 false, true, false, "# If true, the cleaner will fetch records to determine their size\n" + 621 "# to more accurately calculate log utilization. This setting is\n" + 622 "# used during DB truncation/removal and during recovery, and will\n" + 623 "# cause more I/O during those operations when set to true."); 624 625 public static final IntConfigParam CLEANER_DEADLOCK_RETRY = 626 new IntConfigParam("je.cleaner.deadlockRetry", 627 new Integer (0), new Integer (Integer.MAX_VALUE), new Integer (3), true, false, "# The number of times to retry cleaning if a deadlock occurs.\n" + 633 "# The default is set to 3."); 634 635 public static final LongConfigParam CLEANER_LOCK_TIMEOUT = 636 new LongConfigParam("je.cleaner.lockTimeout", 637 new Long (0), new Long (4294967296L), new Long (500000L), true, false, "# The lock timeout for cleaner transactions in microseconds.\n" + 643 "# The default is set to 0.5 seconds."); 644 645 public static final BooleanConfigParam CLEANER_REMOVE = 646 new BooleanConfigParam("je.cleaner.expunge", 647 true, true, false, "# If true, the cleaner deletes log files after successful cleaning.\n" + 651 "# If false, the cleaner changes log file extensions to .DEL\n" + 652 "# instead of deleting them. The default is set to true."); 653 654 655 public static final IntConfigParam CLEANER_MIN_FILES_TO_DELETE = 656 new IntConfigParam("je.cleaner.minFilesToDelete", 657 new Integer (1), new Integer (1000000), new Integer (5), false, false, "# (deprecated, no longer used"); 663 664 665 public static final IntConfigParam CLEANER_RETRIES = 666 new IntConfigParam("je.cleaner.retries", 667 new Integer (0), new Integer (1000), new Integer (10), false, false, "# (deprecated, no longer used"); 673 674 675 public static final IntConfigParam CLEANER_RESTART_RETRIES = 676 new IntConfigParam("je.cleaner.restartRetries", 677 new Integer (0), new Integer (1000), new Integer (5), false, false, "# (deprecated, no longer used"); 683 684 public static final IntConfigParam CLEANER_MIN_AGE = 685 new IntConfigParam("je.cleaner.minAge", 686 new Integer (1), new Integer (1000), new Integer (2), true, false, "# The minimum age of a file (number of files between it and the\n" + 692 "# active file) to qualify it for cleaning under any conditions.\n" + 693 "# The default is set to 2."); 694 695 public static final BooleanConfigParam CLEANER_CLUSTER = 696 new BooleanConfigParam("je.cleaner.cluster", 697 false, true, false, "# *** Experimental and may be removed in a future release. ***\n" + 701 "# If true, eviction and checkpointing will cluster records by key\n" + 702 "# value, migrating them from low utilization files if they are\n" + 703 "# resident.\n" + 704 "# The cluster and clusterAll properties may not both be set to true."); 705 706 public static final BooleanConfigParam CLEANER_CLUSTER_ALL = 707 new BooleanConfigParam("je.cleaner.clusterAll", 708 false, true, false, "# *** Experimental and may be removed in a future release. ***\n" + 712 "# If true, eviction and checkpointing will cluster records by key\n" + 713 "# value, migrating them from low utilization files whether or not\n" + 714 "# they are resident.\n" + 715 "# The cluster and clusterAll properties may not both be set to true."); 716 717 public static final IntConfigParam CLEANER_MAX_BATCH_FILES = 718 new IntConfigParam("je.cleaner.maxBatchFiles", 719 new Integer (0), new Integer (100000), new Integer (0), true, false, "# The maximum number of log files in the cleaner's backlog, or\n" + 725 "# zero if there is no limit. Changing this property can impact the\n" + 726 "# performance of some out-of-memory applications."); 727 728 public static final IntConfigParam CLEANER_READ_SIZE = 729 new IntConfigParam("je.cleaner.readSize", 730 new Integer (128), null, new Integer (0), true, false, "# The read buffer size for cleaning. If zero (the default), then\n" + 736 "# je.log.iteratorReadSize value is used."); 737 738 public static final BooleanConfigParam CLEANER_TRACK_DETAIL = 739 new BooleanConfigParam("je.cleaner.trackDetail", 740 true, false, false, "# If true, the cleaner tracks and stores detailed information that\n" + 744 "# is used to decrease the cost of cleaning."); 745 746 public static final IntConfigParam CLEANER_DETAIL_MAX_MEMORY_PERCENTAGE = 747 new IntConfigParam("je.cleaner.detailMaxMemoryPercentage", 748 new Integer (1), new Integer (90), new Integer (2), true, false, "# Tracking of detailed cleaning information will use no more than\n" + 754 "# this percentage of the cache. The default value is two percent.\n" + 755 "# This setting is only used if je.cleaner.trackDetail=true."); 756 757 public static final BooleanConfigParam CLEANER_RMW_FIX = 758 new BooleanConfigParam("je.cleaner.rmwFix", 759 true, false, false, "# If true, detail information is discarded that was added by earlier\n" + 763 "# versions of JE if it may be invalid. This may be set to false\n" + 764 "# for increased performance, but only if LockMode.RMW was never used."); 765 766 public static final ConfigParam CLEANER_FORCE_CLEAN_FILES = 767 new ConfigParam("je.cleaner.forceCleanFiles", 768 "", false, false, "# Specifies a list of files or file ranges to force clean. This is\n" + 772 "# intended for use in forcing the cleaning of a large number of log\n" + 773 "# files. File numbers are in hex and are comma separated or hyphen\n" + 774 "# separated to specify ranges, e.g.: '9,a,b-d' will clean 5 files."); 775 776 public static final IntConfigParam CLEANER_THREADS = 777 new IntConfigParam("je.cleaner.threads", 778 new Integer (1), null, new Integer (1), true, false, "# The number of threads allocated by the cleaner for log file\n" + 784 "# processing. If the cleaner backlog becomes large, increase this\n" + 785 "# value. The default is set to 1."); 786 787 public static final IntConfigParam CLEANER_LOOK_AHEAD_CACHE_SIZE = 788 new IntConfigParam("je.cleaner.lookAheadCacheSize", 789 new Integer (0), null, new Integer (8192), true, false, "# The look ahead cache size for cleaning in bytes. Increasing this\n" + 795 "# value can reduce the number of Btree lookups."); 796 797 800 public static final IntConfigParam N_LOCK_TABLES = 801 new IntConfigParam("je.lock.nLockTables", 802 new Integer (1), new Integer (32767), new Integer (1), false, false, "# Number of Lock Tables. Set this to a value other than 1 when\n" + 808 "# an application has multiple threads performing concurrent JE\n" + 809 "# operations. It should be set to a prime number, and in general\n" + 810 "# not higher than the number of application threads performing JE\n" + 811 "# operations."); 812 813 public static final LongConfigParam LOCK_TIMEOUT = 814 new LongConfigParam("je.lock.timeout", 815 new Long (0), new Long (4294967296L), new Long (500000L), false, false, "# The lock timeout in microseconds."); 821 822 public static final LongConfigParam TXN_TIMEOUT = 823 new LongConfigParam("je.txn.timeout", 824 new Long (0), new Long (4294967296L), new Long (0), false, false, "# The transaction timeout, in microseconds. A value of 0 means no limit."); 830 831 public static final BooleanConfigParam TXN_SERIALIZABLE_ISOLATION = 832 new BooleanConfigParam("je.txn.serializableIsolation", 833 false, false, false, "# Transactions have the Serializable (Degree 3) isolation level. The\n" + 837 "# default is false, which implies the Repeatable Read isolation level."); 838 839 public static final BooleanConfigParam TXN_DEADLOCK_STACK_TRACE = 840 new BooleanConfigParam("je.txn.deadlockStackTrace", 841 false, true, false, "# Set this parameter to true to add stacktrace information to deadlock\n" + 845 "# (lock timeout) exception messages. The stack trace will show where\n" + 846 "# each lock was taken. The default is false, and true should only be\n" + 847 "# used during debugging because of the added memory/processing cost.\n" + 848 "# This parameter is 'static' across all environments."); 849 850 public static final BooleanConfigParam TXN_DUMPLOCKS = 851 new BooleanConfigParam("je.txn.dumpLocks", 852 false, true, false, "# Dump the lock table when a lock timeout is encountered, for\n" + 856 "# debugging assistance."); 857 858 861 public static final BooleanConfigParam JE_LOGGING_FILE = 862 new BooleanConfigParam("java.util.logging.FileHandler.on", 863 false, false, false, "# Use FileHandler in logging system."); 867 868 public static final BooleanConfigParam JE_LOGGING_CONSOLE = 869 new BooleanConfigParam("java.util.logging.ConsoleHandler.on", 870 false, false, false, "# Use ConsoleHandler in logging system."); 874 875 public static final BooleanConfigParam JE_LOGGING_DBLOG = 876 new BooleanConfigParam("java.util.logging.DbLogHandler.on", 877 true, false, false, "# Use DbLogHandler in logging system."); 881 882 public static final IntConfigParam JE_LOGGING_FILE_LIMIT = 883 new IntConfigParam("java.util.logging.FileHandler.limit", 884 new Integer (1000), new Integer (1000000000), new Integer (10000000), false, false, "# Log file limit for FileHandler."); 890 891 public static final IntConfigParam JE_LOGGING_FILE_COUNT = 892 new IntConfigParam("java.util.logging.FileHandler.count", 893 new Integer (1), null, new Integer (10), false, false, "# Log file count for FileHandler."); 899 900 public static final ConfigParam JE_LOGGING_LEVEL = 901 new ConfigParam("java.util.logging.level", 902 "INFO", 903 false, false, "# Trace messages equal and above this level will be logged.\n" + 906 "# Value should be one of the predefined java.util.logging.Level values"); 907 908 public static final ConfigParam JE_LOGGING_LEVEL_LOCKMGR = 909 new ConfigParam("java.util.logging.level.lockMgr", 910 "FINE", 911 false, false, "# Lock manager specific trace messages will be issued at this level.\n"+ 914 "# Value should be one of the predefined java.util.logging.Level values"); 915 916 public static final ConfigParam JE_LOGGING_LEVEL_RECOVERY = 917 new ConfigParam("java.util.logging.level.recovery", 918 "FINE", 919 false, false, "# Recovery specific trace messages will be issued at this level.\n"+ 922 "# Value should be one of the predefined java.util.logging.Level values"); 923 924 public static final ConfigParam JE_LOGGING_LEVEL_EVICTOR = 925 new ConfigParam("java.util.logging.level.evictor", 926 "FINE", 927 false, false, "# Evictor specific trace messages will be issued at this level.\n"+ 930 "# Value should be one of the predefined java.util.logging.Level values"); 931 932 public static final ConfigParam JE_LOGGING_LEVEL_CLEANER = 933 new ConfigParam("java.util.logging.level.cleaner", 934 "FINE", 935 true, false, "# Cleaner specific detailed trace messages will be issued at this\n" + 938 "# level. The Value should be one of the predefined \n" + 939 "# java.util.logging.Level values"); 940 941 944 945 946 949 public static void main(String argv[]) { 950 if (argv.length != 2) { 951 throw new IllegalArgumentException ("Usage: EnvironmentParams " + 952 "<includeReplicationParams, true|false> " + 953 "<samplePropertyFile>"); 954 } 955 956 try { 957 boolean includeRepParams = Boolean.valueOf(argv[0]).booleanValue(); 958 FileWriter exampleFile = new FileWriter (new File (argv[1])); 959 TreeSet paramNames = new TreeSet (SUPPORTED_PARAMS.keySet()); 960 Iterator iter = paramNames.iterator(); 961 exampleFile.write 962 ("####################################################\n" + 963 "# Example Berkeley DB, Java Edition property file\n" + 964 "# Each parameter is set to its default value\n" + 965 "####################################################\n\n"); 966 967 while (iter.hasNext()) { 968 String paramName =(String ) iter.next(); 969 ConfigParam param = 970 (ConfigParam) SUPPORTED_PARAMS.get(paramName); 971 972 976 if (!includeRepParams && 977 param.isForReplication()) { 978 continue; 979 } 980 981 exampleFile.write(param.getDescription() + "\n"); 982 String extraDesc = param.getExtraDescription(); 983 if (extraDesc != null) { 984 exampleFile.write(extraDesc + "\n"); 985 } 986 exampleFile.write("# " + param.getName() + "=" + 987 param.getDefault() + 988 "\n# (mutable at run time: " + 989 param.isMutable() + 990 ")\n\n"); 991 } 992 exampleFile.close(); 993 } catch (Exception e) { 994 e.printStackTrace(); 995 System.exit(-1); 996 } 997 } 998 999 1003 public static void addSupportedParam(ConfigParam param) { 1004 SUPPORTED_PARAMS.put(param.getName(), param); 1005 } 1006} 1007 | Popular Tags |