public class DbVerifyLog
extends java.lang.Object
This class may be instantiated and used programmatically, or used as a command line utility as described below.
usage: java { com.sleepycat.je.util.DbVerifyLog | -jar je-<version>.jar DbVerifyLog } [-h <dir>] # environment home directory [-s <file>] # starting (minimum) file number [-e <file>] # ending (one past the maximum) file number [-d <millis>] # delay in ms between reads (default is zero) [-V] # print JE version number"
All arguments are optional. The current directory is used if -h
is not specified. File numbers may be specified in hex (preceded by 0x
) or decimal format. For convenience when copy/pasting from other
output, LSN format (<file>/<offset>) is also allowed.
Constructor and Description |
---|
DbVerifyLog(Environment env)
Creates a utility object for verifying the checksums in log files.
|
DbVerifyLog(Environment env,
int readBufferSize)
Creates a utility object for verifying log files.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] argv) |
void |
setReadDelay(long delay,
java.util.concurrent.TimeUnit unit)
Configures the delay between file reads during verification.
|
void |
verify(long startFile,
long endFile)
Verifies the given range of log files in the environment.
|
void |
verifyAll()
Verifies all log files in the environment.
|
public DbVerifyLog(Environment env)
The read buffer size is EnvironmentConfig.LOG_ITERATOR_READ_SIZE
.
env
- the Environment
associated with the log.EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.public DbVerifyLog(Environment env, int readBufferSize)
env
- the Environment
associated with the log.readBufferSize
- is the buffer size to use. If a value less than
or equal to zero is specified, EnvironmentConfig.LOG_ITERATOR_READ_SIZE
is used.EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.public void verifyAll() throws LogVerificationException, java.io.IOException
LogVerificationException
- if a checksum cannot be verified or a
log entry is determined to be invalid by examining its contents.java.io.IOException
- if an IOException occurs while reading a log file.EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.public void verify(long startFile, long endFile) throws LogVerificationException, java.io.IOException
startFile
- is the lowest numbered log file to be verified.endFile
- is one greater than the highest numbered log file to be
verified.LogVerificationException
- if a checksum cannot be verified or a
log entry is determined to be invalid by examining its contents.java.io.IOException
- if an IOException occurs while reading a log file.EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.public static void main(java.lang.String[] argv)
public void setReadDelay(long delay, java.util.concurrent.TimeUnit unit)
By default there is no read delay (it is zero).
Note that when using the background data verifier
, the delay between reads is
EnvironmentConfig.VERIFY_LOG_READ_DELAY
.
delay
- the delay between reads or zero for no delay.unit
- the TimeUnit
of the delay value. May be
null only if delay is zero.Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.