public class LDiff extends Object
| Constructor and Description |
|---|
LDiff(LDiffConfig cfg)
Configure a new object with which to compare two databases.
|
| Modifier and Type | Method and Description |
|---|---|
BlockBag |
createBlockBag(Database db)
Create a bag of blocks from the records in a given database, using the
configuration parameters specified when the LDiff object was created.
|
boolean |
diff(Database db,
BlockBag blkBag)
A mechanism for efficiently comparing two quiescent databases, typically
residing on different machines connected by a network.
|
boolean |
diff(Database db1,
Database db2)
A mechanism for efficiently comparing two quiescent databases.
|
boolean |
diff(Database db,
InetSocketAddress addr,
DataChannelFactory dcFactory)
A mechanism for efficiently comparing two quiescent databases, one of
which resides on a remote machine.
|
boolean |
diff(Environment env1,
Environment env2)
A mechanism for efficiently comparing all databases in two quiescent
environments.
|
boolean |
diff(Environment env,
InetSocketAddress addr)
A mechanism for efficiently comparing two quiescent environments, one
local and one on a remote machine.
|
boolean |
diff(Environment env,
InetSocketAddress addr,
DataChannelFactory dcFactory)
A mechanism for efficiently comparing two quiescent environments, one
local and one on a remote machine.
|
List<MismatchedRegion> |
getDiffRegions() |
Iterator<Block> |
iterator(Database db) |
static void |
main(String[] args)
The main used by the LDiff utility.
|
public LDiff(LDiffConfig cfg)
cfg - the configuration parameters for the new object.public static void main(String[] args)
args - The arguments accepted by the LDiff utility.
usage: java com.sleepycat.je.rep.util.ldiff.LDiff
[-s database1,database2] -h dbEnvHome1[,dbEnvHome2]
[-a] [-b blockSize] [-m maxErrors] [-q]
-a - generate an analysis of the differences
-b blockSize - the number of records to compare at one time
-h dbEnvHome - the directory or directories containing environment(s) in
which to perform the ldiff
-m maxErrors - the maximum number of errors to detect before declaring
the databases different and ending the operation.
-s database1,database2 - the databases to ldiff.
-q - be quiet, do not write to stdout
If ldiff-ing a specific database, two database names must be specified. If no database names are given, two environments must be specified. If two database names and two environments are specified, the first database is opened in the first environment and the second database is opened in the second environment.
public boolean diff(Environment env1, Environment env2) throws Exception
env1 - a valid, open Environment handleenv2 - a valid, open Environment handleExceptionpublic boolean diff(Database db1, Database db2) throws Exception
db1 - a valid, open Database handledb2 - a valid, open Database handleExceptionpublic boolean diff(Environment env, InetSocketAddress addr) throws IOException, BinaryProtocol.ProtocolException, ServiceDispatcher.ServiceConnectFailedException, Exception
env - a valid, open Environment handleaddr - the address of the remote machineIOException - if a network error occursBinaryProtocol.ProtocolException - if an unexpected message is receivedServiceDispatcher.ServiceConnectFailedException - if the remote service was busyExceptionpublic boolean diff(Environment env, InetSocketAddress addr, DataChannelFactory dcFactory) throws IOException, BinaryProtocol.ProtocolException, ServiceDispatcher.ServiceConnectFailedException, Exception
env - a valid, open Environment handleaddr - the address of the remote machinedcFactory - the channel factory for connection creationIOException - if a network error occursBinaryProtocol.ProtocolException - if an unexpected message is receivedServiceDispatcher.ServiceConnectFailedException - if the remote service was busyExceptionpublic boolean diff(Database db, InetSocketAddress addr, DataChannelFactory dcFactory) throws IOException, BinaryProtocol.ProtocolException, ServiceDispatcher.ServiceConnectFailedException, Exception
db - a valid, open Database handleaddr - the address of the remote hostdcFactory - the channel factory for connection creationIOException - if a network error occursBinaryProtocol.ProtocolException - if the remote database does not existServiceDispatcher.ServiceConnectFailedException - if the remote service is busyExceptionpublic boolean diff(Database db, BlockBag blkBag) throws Exception
db - a valid, open Database handleblkBag - a bag of blocks to diff against db.Exceptionpublic List<MismatchedRegion> getDiffRegions()
public BlockBag createBlockBag(Database db)
db - the database from which to create the bag of blocksCopyright © 2024. All rights reserved.