public class EnvironmentImpl extends Object implements EnvConfigObserver
| Modifier and Type | Class and Description |
|---|---|
static interface |
EnvironmentImpl.MBeanRegistrar
To support platforms that do not have any javax.management classes, we
load JEMonitor dynamically to ensure that there are no explicit
references to com.sleepycat.je.jmx.*.
|
| Modifier and Type | Field and Description |
|---|---|
protected DbConfigManager |
configManager |
protected DbTree |
dbMapTree |
protected Environment |
envInternal |
protected Logger |
envLogger |
protected Formatter |
formatter |
protected boolean |
needRepConvert |
protected StartupTracker |
startupTracker |
protected Integer |
statKey |
protected StatManager |
statManager |
static boolean |
USE_JAVA5_ADLER32 |
| Modifier | Constructor and Description |
|---|---|
|
EnvironmentImpl(File envHome,
EnvironmentConfig envConfig,
EnvironmentImpl sharedCacheEnv) |
protected |
EnvironmentImpl(File envHome,
EnvironmentConfig envConfig,
EnvironmentImpl sharedCacheEnv,
RepConfigProxy repConfigProxy)
Create a database environment to represent the data in envHome.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abnormalClose()
Used by error handling to forcibly close an environment, and by tests to
close an environment to simulate a crash.
|
void |
addConfigObserver(EnvConfigObserver o)
Adds an observer of mutable config changes.
|
boolean |
addDbBackup(DbBackup backup)
For replicated environments only; just return true for a standalone
environment.
|
void |
addToCompressorQueue(BIN bin)
Tells the asynchronous IN compressor thread about a BIN with a deleted
entry.
|
void |
addToCompressorQueue(Collection<BINReference> binRefs)
Tells the asynchronous IN compressor thread about a collections of
BINReferences with deleted entries.
|
boolean |
allowBlindOps() |
boolean |
allowBlindPuts() |
protected void |
appendException(PrintWriter pw,
Exception e,
String doingWhat) |
VLSN |
assignVLSNs(LogEntry entry)
Computes and assigns VLSNs as needed to this log item for a replicated
log record.
|
void |
awaitVLSNConsistency()
Ensure that the in-memory vlsn index encompasses all logged entries
before it is flushed to disk.
|
void |
checkDiskLimitViolation()
Uses cached disk usage info to determine whether disk space limits are
currently violated.
|
void |
checkIfInvalid() |
void |
checkImmutablePropsForEquality(Properties handleConfigProps)
Throws an exception if an immutable property is changed.
|
void |
checkOpen() |
void |
checkRecordExtinctionAvailable()
Checks that using the record extinction feature.
|
void |
checkRulesForExistingEnv(boolean dbTreeReplicatedBit,
boolean dbTreePreserveVLSN)
Check whether this environment can be opened on an existing environment
directory.
|
void |
checkTTLAvailable()
Checks that writing records with a TTL is allowed.
|
void |
clearedCachedFileChecksum(String fileName)
Clears the cached checksum for a file when it may be overwritten
(e.g., entries may be erased).
|
EnvironmentConfig |
cloneConfig()
Clones the current configuration.
|
EnvironmentMutableConfig |
cloneMutableConfig()
Clones the current mutable configuration.
|
void |
close()
Decrements the reference count and closes the environment when it
reaches zero.
|
void |
close(boolean doCheckpoint)
Decrements the reference count and closes the environment when it
reaches zero.
|
void |
closeAfterInvalid() |
void |
closeHandlers() |
Provisional |
coordinateWithCheckpoint(DatabaseImpl dbImpl,
int targetLevel,
IN parent)
Coordinates an eviction with an in-progress checkpoint and returns
whether provisional logging is needed.
|
OperationFailureException |
createDatabasePreemptedException(String msg,
String dbName,
Database db)
For replicated environments only; only the overridden method should
ever be called.
|
protected Environment |
createInternalEnvironment()
Is overridden in RepImpl to create a ReplicatedEnvironment.
|
OperationFailureException |
createLockPreemptedException(Locker locker,
Throwable cause)
For replicated environments only; only the overridden method should
ever be called.
|
OperationFailureException |
createLogOverwriteException(String msg)
For replicated environments only; only the overridden method should
ever be called.
|
Txn |
createReplayTxn(long txnId)
For replicated environments only; only the overridden method should
ever be called.
|
ThreadLocker |
createRepThreadLocker()
For replicated environments only; only the overridden method should
ever be called.
|
Txn |
createRepTxn(TransactionConfig config,
long mandatedId)
For replicated environments only; only the overridden method should
ever be called.
|
Txn |
createRepUserTxn(TransactionConfig config)
For replicated environments only; only the overridden method should
ever be called.
|
StatManager |
createStatManager() |
void |
criticalEviction(boolean backgroundIO)
Performs critical eviction if necessary.
|
void |
daemonEviction(boolean backgroundIO)
Do eviction if the memory budget is over.
|
static void |
decThreadLocalReferenceCount() |
void |
doCloseAfterInvalid()
This method must be called while synchronized on DbEnvPool.
|
void |
envConfigUpdate(DbConfigManager mgr,
EnvironmentMutableConfig newConfig)
Respond to config updates.
|
boolean |
expiresWithin(int expiration,
boolean hours,
long withinMs)
Returns whether a given expiration time precedes the current system time
plus withinMs, i.e., the expiration time will pass within withinMs, or
earlier.
|
boolean |
expiresWithin(long expirationTime,
long withinMs)
Same as
expiresWithin(int, boolean, long) but with a single
expirationTime param. |
boolean |
finishInit(EnvironmentConfig envConfig)
Initialize the environment, including running recovery, if it is not
already initialized.
|
void |
flushLog(boolean fsync)
Flush the log buffers and write to the log, and optionally fsync.
|
long |
forceLogFileFlip()
Flip the log to a new file, forcing an fsync.
|
void |
fullyInitialized()
Called after initialization is fully complete, including joinGroup in a
replicated environment.
|
static int |
getAdler32ChunkSize() |
boolean |
getAllowRepConvert()
True if ReplicationConfig set allowConvert as true.
|
protected int |
getAppOpenCount()
Returns the count of environment handles that were opened explicitly by
the application.
|
protected int |
getBackupCount()
Returns a count of the number of in-progress DbBackups.
|
BackupManager |
getBackupManager() |
boolean |
getCacheVLSN()
Returns true if the VLSN is both preserved and cached.
|
Checkpointer |
getCheckpointer() |
ClassLoader |
getClassLoader() |
Cleaner |
getCleaner() |
int |
getCompactMaxKeyLength()
Returns EnvironmentConfig.TREE_COMPACT_MAX_KEY_LENGTH.
|
DbConfigManager |
getConfigManager()
Returns the config manager for the current base configuration.
|
Handler |
getConfiguredHandler() |
ReplicaConsistencyPolicy |
getConsistencyPolicy(String propValue)
Allows standalone JE code to construct a consistency policy using the
CONSISTENCY_POLICY property value format.
|
ConsoleHandler |
getConsoleHandler() |
DataEraser |
getDataEraser() |
DataVerifier |
getDataVerifier() |
boolean |
getDbEviction()
Returns whether DB/MapLN eviction is enabled.
|
DbTree |
getDbTree() |
boolean |
getDeadlockDetection() |
long |
getDeadlockDetectionDelay() |
ReplicaConsistencyPolicy |
getDefaultConsistencyPolicy()
Returns the default consistency policy for this EnvironmentImpl.
|
protected String |
getDiagnosticsClassName() |
boolean |
getDidFullThreadDump() |
String |
getDiskLimitViolation()
Uses cached disk usage info to determine whether disk space limits are
currently violated.
|
PreloadConfig |
getDupConvertPreloadConfig() |
long |
getEndOfLog()
Returns the end of the log.
|
File |
getEnvironmentHome()
Get the environment home directory.
|
Evictor |
getEvictor() |
ExceptionListener |
getExceptionListener() |
ExpirationProfile |
getExpirationProfile()
Returns the ExpirationProfile.
|
boolean |
getExposeUserData() |
ExtinctionScanner |
getExtinctionScanner() |
ExtinctionFilter.ExtinctionStatus |
getExtinctionState(DatabaseImpl db,
byte[] key)
Returns whether the given key in the given DB is extinct (can be purged
by the cleaner) according to the extinction filter.
|
ExtinctionFilter.ExtinctionStatus |
getExtinctionState(String dbName,
boolean dups,
boolean isInternalDb,
byte[] key) |
static ExtinctionFilter.ExtinctionStatus |
getExtinctionStatus(DatabaseImpl priDb,
DatabaseEntry priKey)
Returns the extinction status for the purpose of adding to an
exception message.
|
FileHandler |
getFileHandler() |
FileManager |
getFileManager() |
FileProtector |
getFileProtector()
Returns the FileProtector.
|
INCompressor |
getINCompressor()
Return the incompressor.
|
int |
getINCompressorQueueSize() |
INList |
getInMemoryINs() |
Environment |
getInternalEnvHandle() |
EnvironmentFailureException |
getInvalidatingException() |
AtomicReference<EnvironmentFailureException> |
getInvalidatingExceptionReference() |
boolean |
getIsMaster()
Returns whether this is a replicated environment that is the master,
else false.
|
int |
getLatchTimeoutMs()
Returns EnvironmentConfig.ENV_LATCH_TIMEOUT.
|
long |
getLockTimeout() |
LogFlusher |
getLogFlusher() |
Logger |
getLogger() |
LogManager |
getLogManager() |
int |
getMaxEmbeddedLN() |
MemoryBudget |
getMemoryBudget() |
MetadataStore |
getMetadataStore() |
protected String |
getMonitorClassName() |
String |
getName()
Get an environment name, for tagging onto logging and debug message.
|
boolean |
getNoComparators() |
String |
getNodeName()
Get the node name if this is a replicated environment or else return
null.
|
NodeSequence |
getNodeSequence() |
OffHeapCache |
getOffHeapCache() |
String |
getOptionalNodeName()
Named "optional" because the nodeName property in EnvironmentConfig is
optional may be null.
|
boolean |
getPreserveVLSN()
Returns true if the VLSN is preserved as the record version.
|
ProgressListener<RecoveryProgress> |
getRecoveryProgressListener() |
int |
getReplayFreeDiskPercent()
Returns the deprecated HA REPLAY_FREE_DISK_PERCENT parameter, or zero
if this is not an HA env.
|
long |
getReplayTxnTimeout() |
Collection<StatGroup> |
getRepStatGroups(StatsConfig config,
Integer statkey) |
ReservedFilesAutoRepair |
getReservedFilesAutoRepair() |
long |
getRootLsn() |
ReentrantReadWriteLock |
getSecondaryAssociationLock()
Returns the shared secondary association latch.
|
boolean |
getSharedCache() |
StartupTracker |
getStartupTracker() |
SortedSet<String> |
getStatCaptureProjections() |
static int |
getThreadLocalReferenceCount() |
AtomicLongStat |
getThroughputStat(StatDefinition def) |
int |
getTtlClockTolerance()
|
int |
getTtlLnPurgeDelay()
|
int |
getTtlMaxTxnTime()
|
TxnManager |
getTxnManager() |
long |
getTxnTimeout() |
UtilizationProfile |
getUtilizationProfile()
Returns the UtilizationProfile.
|
UtilizationTracker |
getUtilizationTracker()
Returns the UtilizationTracker.
|
VLSNRecoveryProxy |
getVLSNProxy() |
void |
handleRestoreRequired(RestoreRequired restoreRequired)
Recovery encountered a RestoreRequired marker file, so recovery is
halted and some intervention must be taken.
|
boolean |
hasExtinctionFilter() |
void |
incBinDeltaDeletes() |
void |
incBinDeltaGets() |
void |
incBinDeltaInserts() |
void |
incBinDeltaUpdates() |
void |
incDeleteFailOps(DatabaseImpl dbImpl) |
void |
incDeleteOps(DatabaseImpl dbImpl) |
void |
incInsertFailOps(DatabaseImpl dbImpl) |
void |
incInsertOps(DatabaseImpl dbImpl) |
void |
incPositionOps(DatabaseImpl dbImpl) |
void |
incRelatchesRequired() |
void |
incRootSplits() |
void |
incSearchFailOps(DatabaseImpl dbImpl) |
void |
incSearchOps(DatabaseImpl dbImpl) |
static void |
incThreadLocalReferenceCount() |
void |
incUpdateOps(DatabaseImpl dbImpl) |
protected DbConfigManager |
initConfigManager(EnvironmentConfig envConfig,
RepConfigProxy repParams)
Create a config manager that holds the configuration properties that
have been passed in.
|
protected void |
initConfigParams(EnvironmentConfig envConfig,
RepConfigProxy repConfigProxy)
Init configuration params during environment creation.
|
protected Formatter |
initFormatter() |
void |
invalidate(EnvironmentFailureException e)
Invalidate the environment.
|
void |
invalidate(Error e)
Invalidate the environment when a Java Error is thrown.
|
void |
invokeCheckpoint(CheckpointConfig config,
String invokingSource)
Invoke a checkpoint programmatically.
|
int |
invokeCleaner(boolean cleanMultipleFiles) |
void |
invokeCompressor()
Invoke a compress programmatically.
|
void |
invokeEvictor() |
boolean |
isArbiter()
Return true if this environment is used as an Arbiter.
|
boolean |
isClosed() |
boolean |
isClosing() |
boolean |
isDbLoggingDisabled() |
boolean |
isExpirationEnabled()
|
boolean |
isExpired(int expiration,
boolean hours)
Returns whether a given expiration time precedes the current system
time, i.e., the expiration time has passed.
|
boolean |
isExpired(long expirationTime)
Returns whether a given expiration time precedes the current system
time, i.e., the expiration time has passed.
|
boolean |
isInInit() |
boolean |
isMaster() |
boolean |
isMemOnly() |
boolean |
isNoLocking() |
boolean |
isReadOnly() |
boolean |
isRepConverted()
True if this environment is converted from non-replicated to
replicated.
|
boolean |
isReplicated()
Return true if this environment is part of a replication group.
|
boolean |
isTransactional() |
boolean |
isValid() |
void |
lazyCompress(IN in) |
void |
lazyCompress(IN in,
boolean compressDirtySlots) |
EnvironmentStats |
loadStats(StatsConfig config)
Retrieve and return stat information.
|
EnvironmentStats |
loadStatsInternal(StatsConfig config)
Retrieve and return stat information.
|
LockStats |
lockStat(StatsConfig config)
Retrieve lock statistics
|
void |
logMapTreeRoot()
Logs the map tree root and saves the LSN.
|
void |
logMapTreeRoot(long ifBeforeLsn)
Logs the map tree root, but only if its current LSN is before the
ifBeforeLsn parameter or ifBeforeLsn is NULL_LSN.
|
String |
makeDaemonThreadName(String daemonName) |
static boolean |
maybeForceYield()
For stress testing.
|
boolean |
mayNotWrite()
When a EnvironmentFailureException occurs or the environment is closed,
further writing can cause log corruption.
|
boolean |
needRepConvert() |
void |
noteBackupCopyFilesCount(int count)
Note the number of files copied to the archive by the most recent
automatic backup.
|
void |
noteBackupCopyFilesMs(long timeMs)
Note the total amount of time in milliseconds taken to copy files to the
archive by the most recent automatic backup.
|
void |
open()
Not much to do, mark state.
|
protected void |
postCheckpointClose(boolean checkpointed)
Release any resources from a subclass that need to be released after
the closing checkpoint.
|
protected void |
postRecoveryConversion()
Called after recovery but before any other initialization.
|
void |
preCheckpointEndFlush()
Do any work that must be done before the checkpoint end is written, as
as part of the checkpoint process.
|
PreloadStats |
preload(DatabaseImpl[] dbImpls,
PreloadConfig config) |
void |
preRecoveryCheckpointInit(RecoveryInfo recoveryInfo) |
void |
readMapTreeFromLog(long rootLsn)
Set the mapping tree from the log.
|
void |
registerMBean(Environment env)
JE MBean registration is performed during Environment creation so that
the MBean has access to the Environment API which is not available from
EnvironmentImpl.
|
void |
registerVLSN(LogItem logItem) |
void |
removeConfigObserver(EnvConfigObserver o)
Removes an observer of mutable config changes.
|
void |
removeDbBackup(DbBackup backup)
For replicated environments only; do nothing for a standalone
environment.
|
void |
requestShutdownDaemons() |
protected DbConfigManager |
resetConfigManager(EnvironmentConfig newConfig)
Make a new config manager that has all the properties needed.
|
void |
resetLoggingLevel(String changedLoggerName,
Level level)
Reset the logging level for specified loggers in a JE environment.
|
void |
rewriteMapTreeRoot(long cleanerTargetLsn)
Force a rewrite of the map tree root if required.
|
void |
setBackgroundSleepHook(TestHook<?> hook) |
void |
setDidFullThreadDump(boolean val) |
void |
setLockTimeout(long timeout) |
void |
setMutableConfig(EnvironmentMutableConfig config)
Changes the mutable config properties that are present in the given
config, and notifies all config observer.
|
void |
setReplicaLatestVLSNSeq(long seq) |
protected void |
setupClose(PrintWriter errors)
Release any resources from a subclass that need to be released before
close is called on regular environment components.
|
void |
shutdownDaemons()
Ask all daemon threads to shut down.
|
void |
sleepAfterBackgroundIO()
If the sleep backlog is non-zero (set by updateBackgroundReads or
updateBackgroundWrites), sleep for the configured interval and decrement
the backlog.
|
long |
specialEviction()
Performs special eviction (eviction other than standard IN eviction)
for this environment.
|
boolean |
tryTruncateVlsnHead(VLSN deleteEnd,
long deleteFileNum)
Truncate the head of the VLSNIndex to unprotect the given file, if
possible.
|
boolean |
tryVlsnHeadTruncate(long bytesNeeded)
Truncate the head of the VLSNIndex to allow file deletion, if possible.
|
Txn |
txnBegin(Transaction parent,
TransactionConfig txnConfig)
Transactional services.
|
TransactionStats |
txnStat(StatsConfig config)
Retrieve txn statistics
|
void |
updateBackgroundReads(int nReads)
If a background read limit has been configured and that limit is
exceeded when the cumulative total is incremented by the given number of
reads, increment the sleep backlog to cause a sleep to occur.
|
void |
updateBackgroundWrites(int writeSize,
int logBufferSize)
If a background write limit has been configured and that limit is
exceeded when the given amount written is added to the cumulative total,
increment the sleep backlog to cause a sleep to occur.
|
boolean |
useOffHeapChecksums() |
void |
verify(VerifyConfig config) |
void |
verifyCursors() |
boolean |
wasInvalidated()
Returns true if the environment is currently invalid or was invalidated
and closed.
|
protected boolean needRepConvert
protected DbTree dbMapTree
protected DbConfigManager configManager
protected final Logger envLogger
protected final StatManager statManager
protected final StartupTracker startupTracker
public static final boolean USE_JAVA5_ADLER32
protected final Formatter formatter
protected Environment envInternal
protected Integer statKey
public EnvironmentImpl(File envHome, EnvironmentConfig envConfig, EnvironmentImpl sharedCacheEnv) throws EnvironmentNotFoundException, EnvironmentLockedException
protected EnvironmentImpl(File envHome, EnvironmentConfig envConfig, EnvironmentImpl sharedCacheEnv, RepConfigProxy repConfigProxy) throws EnvironmentNotFoundException, EnvironmentLockedException
envHome - absolute path of the database environment home directoryenvConfig - is the configuration to be used. It's already had
the je.properties file applied, and has been validated.sharedCacheEnv - if non-null, is another environment that is
sharing the cache with this environment; if null, this environment is
not sharing the cache or is the first environment to share the cache.DatabaseException - on all other failuresIllegalArgumentException - via Environment ctor.EnvironmentNotFoundExceptionEnvironmentLockedExceptionprotected DbConfigManager initConfigManager(EnvironmentConfig envConfig, RepConfigProxy repParams)
envConfig - is the environment configuration to userepParams - are the replication configurations to use. In this
case, the Properties bag has been extracted from the configuration
instance, to avoid crossing the compilation firewall.protected void initConfigParams(EnvironmentConfig envConfig, RepConfigProxy repConfigProxy)
repConfigProxy - unusedpublic boolean finishInit(EnvironmentConfig envConfig) throws DatabaseException
DatabaseExceptionpublic void fullyInitialized()
protected Environment createInternalEnvironment()
public void registerMBean(Environment env) throws DatabaseException
DatabaseExceptionprotected String getMonitorClassName()
protected String getDiagnosticsClassName()
public ReplicaConsistencyPolicy getDefaultConsistencyPolicy()
public ReplicaConsistencyPolicy getConsistencyPolicy(String propValue)
public long getEndOfLog()
public Collection<StatGroup> getRepStatGroups(StatsConfig config, Integer statkey)
public StatManager createStatManager()
public void envConfigUpdate(DbConfigManager mgr, EnvironmentMutableConfig newConfig)
envConfigUpdate in interface EnvConfigObserverpublic INCompressor getINCompressor()
public FileProtector getFileProtector()
public UtilizationTracker getUtilizationTracker()
public UtilizationProfile getUtilizationProfile()
public ExpirationProfile getExpirationProfile()
public int getCompactMaxKeyLength()
public int getLatchTimeoutMs()
public int getTtlClockTolerance()
public int getTtlMaxTxnTime()
public int getTtlLnPurgeDelay()
public void updateBackgroundReads(int nReads)
sleepAfterBackgroundIO()public void updateBackgroundWrites(int writeSize,
int logBufferSize)
The number of writes is estimated by dividing the bytes written by the log buffer size. Since the log write buffer is shared by all writers, this is the best approximation possible.
sleepAfterBackgroundIO()public void sleepAfterBackgroundIO()
If two threads call this method and the first call causes a sleep, the call by the second thread will block until the first thread's sleep interval is over. When the call by the second thread is unblocked, if another sleep is needed then the second thread will sleep again. In other words, when lots of sleeps are needed, background threads may backup. This is intended to give foreground threads a chance to "catch up" when background threads are doing a lot of IO.
public void setBackgroundSleepHook(TestHook<?> hook)
public void logMapTreeRoot()
throws DatabaseException
DatabaseExceptionpublic void logMapTreeRoot(long ifBeforeLsn)
throws DatabaseException
DatabaseExceptionpublic void rewriteMapTreeRoot(long cleanerTargetLsn)
throws DatabaseException
DatabaseExceptionpublic long getRootLsn()
public void readMapTreeFromLog(long rootLsn)
throws DatabaseException
DatabaseExceptionpublic void addToCompressorQueue(BIN bin)
public void addToCompressorQueue(Collection<BINReference> binRefs)
public void lazyCompress(IN in)
public void lazyCompress(IN in, boolean compressDirtySlots)
public void resetLoggingLevel(String changedLoggerName, Level level)
IllegalArgumentException - via JEDiagnostics.OP_RESET_LOGGINGprotected Formatter initFormatter()
public ConsoleHandler getConsoleHandler()
public FileHandler getFileHandler()
public Handler getConfiguredHandler()
public void closeHandlers()
public void open()
public void invalidate(EnvironmentFailureException e)
public EnvironmentFailureException getInvalidatingException()
public AtomicReference<EnvironmentFailureException> getInvalidatingExceptionReference()
public void invalidate(Error e)
public boolean wasInvalidated()
public boolean isValid()
public boolean isInInit()
public boolean isClosing()
public boolean isClosed()
public boolean mayNotWrite()
public void checkIfInvalid()
throws EnvironmentFailureException
EnvironmentFailureExceptionpublic void checkOpen()
throws DatabaseException
DatabaseExceptionpublic void close()
throws DatabaseException
DatabaseExceptionpublic void close(boolean doCheckpoint)
throws DatabaseException
DatabaseExceptionpublic void abnormalClose()
throws DatabaseException
DatabaseExceptionprotected void appendException(PrintWriter pw, Exception e, String doingWhat)
protected void setupClose(PrintWriter errors) throws DatabaseException
DatabaseExceptionprotected void postCheckpointClose(boolean checkpointed)
throws DatabaseException
checkpointed - if true, a checkpoint as issued before the closeDatabaseExceptionprotected void postRecoveryConversion()
public void closeAfterInvalid()
throws DatabaseException
DatabaseExceptionpublic void doCloseAfterInvalid()
protected int getAppOpenCount()
protected int getBackupCount()
public static int getThreadLocalReferenceCount()
public static void incThreadLocalReferenceCount()
public static void decThreadLocalReferenceCount()
public boolean getDidFullThreadDump()
public void setDidFullThreadDump(boolean val)
public boolean getNoComparators()
public void invokeCheckpoint(CheckpointConfig config, String invokingSource)
public Provisional coordinateWithCheckpoint(DatabaseImpl dbImpl, int targetLevel, IN parent)
public void flushLog(boolean fsync)
public long forceLogFileFlip()
throws DatabaseException
DatabaseExceptionpublic void invokeCompressor()
public void invokeEvictor()
public int invokeCleaner(boolean cleanMultipleFiles)
UnsupportedOperationException - if read-only or mem-only.public void requestShutdownDaemons()
public void shutdownDaemons()
public boolean isNoLocking()
public boolean isTransactional()
public boolean isReadOnly()
public boolean isMemOnly()
public String getOptionalNodeName()
getName() should almost always be used
instead for messages, exceptions, etc.public boolean getDbEviction()
public static int getAdler32ChunkSize()
public boolean getSharedCache()
public boolean allowBlindOps()
public boolean allowBlindPuts()
public int getMaxEmbeddedLN()
public Txn txnBegin(Transaction parent, TransactionConfig txnConfig) throws DatabaseException
DatabaseExceptionpublic LogManager getLogManager()
public LogFlusher getLogFlusher()
public DataVerifier getDataVerifier()
public FileManager getFileManager()
public DbTree getDbTree()
public MetadataStore getMetadataStore()
public DbConfigManager getConfigManager()
The configuration can change, but changes are made by replacing the config manager object with a enw one. To use a consistent set of properties, call this method once and query the returned manager repeatedly for each property, rather than getting the config manager via this method for each property individually.
public NodeSequence getNodeSequence()
public EnvironmentConfig cloneConfig()
public EnvironmentMutableConfig cloneMutableConfig()
public void checkImmutablePropsForEquality(Properties handleConfigProps) throws IllegalArgumentException
IllegalArgumentExceptionpublic void setMutableConfig(EnvironmentMutableConfig config) throws DatabaseException
DatabaseExceptionprotected DbConfigManager resetConfigManager(EnvironmentConfig newConfig)
public ExceptionListener getExceptionListener()
public void addConfigObserver(EnvConfigObserver o)
public void removeConfigObserver(EnvConfigObserver o)
public INList getInMemoryINs()
public TxnManager getTxnManager()
public Checkpointer getCheckpointer()
public Cleaner getCleaner()
public DataEraser getDataEraser()
public BackupManager getBackupManager()
public ReservedFilesAutoRepair getReservedFilesAutoRepair()
public MemoryBudget getMemoryBudget()
public String getDiskLimitViolation()
public void checkDiskLimitViolation()
throws DiskLimitException
DiskLimitException - if a disk limit is currently violated.public Logger getLogger()
public boolean isDbLoggingDisabled()
public void verify(VerifyConfig config) throws DatabaseException
DatabaseExceptionpublic void verifyCursors()
throws DatabaseException
DatabaseExceptionpublic boolean getExposeUserData()
public EnvironmentStats loadStats(StatsConfig config) throws DatabaseException
DatabaseExceptionpublic EnvironmentStats loadStatsInternal(StatsConfig config) throws DatabaseException
DatabaseExceptionpublic void incSearchOps(DatabaseImpl dbImpl)
public void incSearchFailOps(DatabaseImpl dbImpl)
public void incPositionOps(DatabaseImpl dbImpl)
public void incInsertOps(DatabaseImpl dbImpl)
public void incInsertFailOps(DatabaseImpl dbImpl)
public void incUpdateOps(DatabaseImpl dbImpl)
public void incDeleteOps(DatabaseImpl dbImpl)
public void incDeleteFailOps(DatabaseImpl dbImpl)
public void incRootSplits()
public void incRelatchesRequired()
public void incBinDeltaGets()
public void incBinDeltaInserts()
public void incBinDeltaUpdates()
public void incBinDeltaDeletes()
public boolean addDbBackup(DbBackup backup)
public void removeDbBackup(DbBackup backup)
public void noteBackupCopyFilesCount(int count)
count - the number of files copiedpublic void noteBackupCopyFilesMs(long timeMs)
timeMs - the total copy time in millisecondspublic LockStats lockStat(StatsConfig config) throws DatabaseException
DatabaseExceptionpublic TransactionStats txnStat(StatsConfig config)
public int getINCompressorQueueSize()
public StartupTracker getStartupTracker()
public File getEnvironmentHome()
public Environment getInternalEnvHandle()
public String getName()
public String getNodeName()
public boolean getIsMaster()
public long getTxnTimeout()
public long getLockTimeout()
public void setLockTimeout(long timeout)
public boolean getDeadlockDetection()
public long getDeadlockDetectionDelay()
public long getReplayTxnTimeout()
public ReentrantReadWriteLock getSecondaryAssociationLock()
public OffHeapCache getOffHeapCache()
public boolean useOffHeapChecksums()
public boolean isExpirationEnabled()
public boolean isExpired(int expiration,
boolean hours)
public boolean isExpired(long expirationTime)
public boolean expiresWithin(int expiration,
boolean hours,
long withinMs)
public boolean expiresWithin(long expirationTime,
long withinMs)
expiresWithin(int, boolean, long) but with a single
expirationTime param.public ExtinctionScanner getExtinctionScanner()
public static ExtinctionFilter.ExtinctionStatus getExtinctionStatus(DatabaseImpl priDb, DatabaseEntry priKey)
public ExtinctionFilter.ExtinctionStatus getExtinctionState(DatabaseImpl db, byte[] key)
public ExtinctionFilter.ExtinctionStatus getExtinctionState(String dbName, boolean dups, boolean isInternalDb, byte[] key)
public boolean hasExtinctionFilter()
public Evictor getEvictor()
public void criticalEviction(boolean backgroundIO)
public void daemonEviction(boolean backgroundIO)
public long specialEviction()
public static boolean maybeForceYield()
public boolean isReplicated()
public boolean isArbiter()
public boolean getPreserveVLSN()
public boolean getCacheVLSN()
public boolean getAllowRepConvert()
public boolean isRepConverted()
public boolean needRepConvert()
public VLSN assignVLSNs(LogEntry entry)
entry - the log entry, an in/out argument: the entry is
modified with an updated DTVLSN for commit and abort log entries.public VLSNRecoveryProxy getVLSNProxy()
public boolean isMaster()
public void preRecoveryCheckpointInit(RecoveryInfo recoveryInfo)
public void registerVLSN(LogItem logItem)
public boolean tryVlsnHeadTruncate(long bytesNeeded)
public boolean tryTruncateVlsnHead(VLSN deleteEnd, long deleteFileNum)
public void clearedCachedFileChecksum(String fileName)
public void preCheckpointEndFlush()
public Txn createReplayTxn(long txnId)
public ThreadLocker createRepThreadLocker()
public Txn createRepUserTxn(TransactionConfig config)
public Txn createRepTxn(TransactionConfig config, long mandatedId)
public OperationFailureException createLockPreemptedException(Locker locker, Throwable cause)
public OperationFailureException createDatabasePreemptedException(String msg, String dbName, Database db)
public OperationFailureException createLogOverwriteException(String msg)
public int getReplayFreeDiskPercent()
public void checkRulesForExistingEnv(boolean dbTreeReplicatedBit,
boolean dbTreePreserveVLSN)
throws UnsupportedOperationException
dbTreePreserveVLSN - UnsupportedOperationException - via Environment ctor.public void awaitVLSNConsistency()
public AtomicLongStat getThroughputStat(StatDefinition def)
public PreloadStats preload(DatabaseImpl[] dbImpls, PreloadConfig config) throws DatabaseException
DatabaseExceptionpublic ProgressListener<RecoveryProgress> getRecoveryProgressListener()
public ClassLoader getClassLoader()
public PreloadConfig getDupConvertPreloadConfig()
public void checkTTLAvailable()
IllegalStateException - if any node in the group is less than
TTL.MIN_JE_VERSION.public void checkRecordExtinctionAvailable()
IllegalStateException - if any node in the group is less than
ExtinctionScanner.MIN_JE_VERSION.public void handleRestoreRequired(RestoreRequired restoreRequired)
restoreRequired - getFailureType() is used to indicate the how
the environment can be healed.public void setReplicaLatestVLSNSeq(long seq)
Copyright © 2024. All rights reserved.