📄 databaseconfig.java
字号:
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2002-2006 * Oracle Corporation. All rights reserved. * * $Id: DatabaseConfig.java,v 12.6 2006/08/24 14:46:07 bostic Exp $ */package com.sleepycat.db;import com.sleepycat.db.internal.Db;import com.sleepycat.db.internal.DbConstants;import com.sleepycat.db.internal.DbEnv;import com.sleepycat.db.internal.DbTxn;import com.sleepycat.db.internal.DbUtil;public class DatabaseConfig implements Cloneable { /* * For internal use, final to allow null as a valid value for * the config parameter. */ public static final DatabaseConfig DEFAULT = new DatabaseConfig(); /* package */ static DatabaseConfig checkNull(DatabaseConfig config) { return (config == null) ? DEFAULT : config; } /* Parameters */ private DatabaseType type = DatabaseType.UNKNOWN; private int mode = 0644; private int btMinKey = 0; private int byteOrder = 0; private long cacheSize = 0L; private int cacheCount = 0; private java.io.OutputStream errorStream = null; private String errorPrefix = null; private int hashFillFactor = 0; private int hashNumElements = 0; private java.io.OutputStream messageStream = null; private int pageSize = 0; private String password = null; private int queueExtentSize = 0; private int recordDelimiter = 0; private int recordLength = 0; private int recordPad = -1; // Zero is a valid, non-default value. private java.io.File recordSource = null; /* Flags */ private boolean allowCreate = false; private boolean btreeRecordNumbers = false; private boolean checksum = false; private boolean readUncommitted = false; private boolean encrypted = false; private boolean exclusiveCreate = false; private boolean multiversion = false; private boolean noMMap = false; private boolean queueInOrder = false; private boolean readOnly = false; private boolean renumbering = false; private boolean reverseSplitOff = false; private boolean sortedDuplicates = false; private boolean snapshot = false; private boolean unsortedDuplicates = false; private boolean transactional = false; private boolean transactionNotDurable = false; private boolean truncate = false; private boolean xaCreate = false; private java.util.Comparator btreeComparator = null; private BtreePrefixCalculator btreePrefixCalculator = null; private java.util.Comparator duplicateComparator = null; private FeedbackHandler feedbackHandler = null; private ErrorHandler errorHandler = null; private MessageHandler messageHandler = null; private Hasher hasher = null; private RecordNumberAppender recnoAppender = null; private PanicHandler panicHandler = null; public DatabaseConfig() { } public void setAllowCreate(final boolean allowCreate) { this.allowCreate = allowCreate; } public boolean getAllowCreate() { return allowCreate; } public void setBtreeComparator(final java.util.Comparator btreeComparator) { this.btreeComparator = btreeComparator; } public java.util.Comparator getBtreeComparator() { return btreeComparator; } public void setBtreeMinKey(final int btMinKey) { this.btMinKey = btMinKey; } public int getBtreeMinKey() { return btMinKey; } public void setByteOrder(final int byteOrder) { this.byteOrder = byteOrder; } public int getByteOrder() { return byteOrder; } public boolean getByteSwapped() { return byteOrder != 0 && byteOrder != DbUtil.default_lorder(); } public void setBtreePrefixCalculator( final BtreePrefixCalculator btreePrefixCalculator) { this.btreePrefixCalculator = btreePrefixCalculator; } public BtreePrefixCalculator getBtreePrefixCalculator() { return btreePrefixCalculator; } public void setCacheSize(final long cacheSize) { this.cacheSize = cacheSize; } public long getCacheSize() { return cacheSize; } public void setCacheCount(final int cacheCount) { this.cacheCount = cacheCount; } public int getCacheCount() { return cacheCount; } public void setChecksum(final boolean checksum) { this.checksum = checksum; } public boolean getChecksum() { return checksum; } public void setReadUncommitted(final boolean readUncommitted) { this.readUncommitted = readUncommitted; } public boolean getReadUncommitted() { return readUncommitted; } /** @deprecated */ public void setDirtyRead(final boolean dirtyRead) { setReadUncommitted(dirtyRead); } /** @deprecated */ public boolean getDirtyRead() { return getReadUncommitted(); } public void setDuplicateComparator( final java.util.Comparator duplicateComparator) { this.duplicateComparator = duplicateComparator; } public java.util.Comparator getDuplicateComparator() { return duplicateComparator; } public void setEncrypted(final String password) { this.password = password; } public boolean getEncrypted() { return (password != null); } public void setErrorHandler(final ErrorHandler errorHandler) { this.errorHandler = errorHandler; } public ErrorHandler getErrorHandler() { return errorHandler; } public void setErrorPrefix(final String errorPrefix) { this.errorPrefix = errorPrefix; } public String getErrorPrefix() { return errorPrefix; } public void setErrorStream(final java.io.OutputStream errorStream) { this.errorStream = errorStream; } public java.io.OutputStream getErrorStream() { return errorStream; } public void setExclusiveCreate(final boolean exclusiveCreate) { this.exclusiveCreate = exclusiveCreate; } public boolean getExclusiveCreate() { return exclusiveCreate; } public void setFeedbackHandler(final FeedbackHandler feedbackHandler) { this.feedbackHandler = feedbackHandler; } public FeedbackHandler getFeedbackHandler() { return feedbackHandler; } public void setHashFillFactor(final int hashFillFactor) { this.hashFillFactor = hashFillFactor; } public int getHashFillFactor() { return hashFillFactor; } public void setHasher(final Hasher hasher) { this.hasher = hasher; } public Hasher getHasher() { return hasher; } public void setHashNumElements(final int hashNumElements) { this.hashNumElements = hashNumElements; } public int getHashNumElements() { return hashNumElements; } public void setMessageHandler(final MessageHandler messageHandler) { this.messageHandler = messageHandler; } public MessageHandler getMessageHandler() { return messageHandler; } public void setMessageStream(final java.io.OutputStream messageStream) { this.messageStream = messageStream; } public java.io.OutputStream getMessageStream() { return messageStream; } public void setMode(final int mode) { this.mode = mode; } public long getMode() { return mode; } public void setMultiversion(final boolean Multiversion) { this.multiversion = multiversion; } public boolean getMultiversion() { return multiversion; } public void setNoMMap(final boolean noMMap) { this.noMMap = noMMap; } public boolean getNoMMap() { return noMMap; } public void setPageSize(final int pageSize) { this.pageSize = pageSize; } public int getPageSize() { return pageSize; } public void setPanicHandler(final PanicHandler panicHandler) { this.panicHandler = panicHandler; } public PanicHandler getPanicHandler() { return panicHandler; } public void setQueueExtentSize(final int queueExtentSize) { this.queueExtentSize = queueExtentSize; } public int getQueueExtentSize() { return queueExtentSize; } public void setQueueInOrder(final boolean queueInOrder) { this.queueInOrder = queueInOrder; } public boolean getQueueInOrder() { return queueInOrder; } public void setReadOnly(final boolean readOnly) { this.readOnly = readOnly; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -