public class LDiff
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
LDiff.MismatchException
The exception that is thrown when a database diff detects differences.
|
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,
java.net.InetSocketAddress addr)
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,
java.net.InetSocketAddress addr)
A mechanism for efficiently comparing two quiescent environments, one
local and one on a remote machine.
|
java.util.List<MismatchedRegion> |
getDiffRegions() |
java.util.Iterator<Block> |
iterator(Database db) |
static void |
main(java.lang.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(java.lang.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 java.lang.Exception
env1
- a valid, open Environment handleenv2
- a valid, open Environment handlejava.lang.Exception
public boolean diff(Database db1, Database db2) throws java.lang.Exception
db1
- a valid, open Database handledb2
- a valid, open Database handlejava.lang.Exception
public boolean diff(Environment env, java.net.InetSocketAddress addr) throws java.io.IOException, BinaryProtocol.ProtocolException, ServiceDispatcher.ServiceConnectFailedException, java.lang.Exception
env
- a valid, open Environment handleaddr
- the address of the remote machinejava.io.IOException
- if a network error occursBinaryProtocol.ProtocolException
- if an unexpected message is receivedServiceDispatcher.ServiceConnectFailedException
- if the remote service was busyjava.lang.Exception
public boolean diff(Database db, java.net.InetSocketAddress addr) throws java.io.IOException, BinaryProtocol.ProtocolException, ServiceDispatcher.ServiceConnectFailedException, java.lang.Exception
db
- a valid, open Database handleaddr
- the address of the remote hostjava.io.IOException
- if a network error occursBinaryProtocol.ProtocolException
- if the remote database does not existServiceDispatcher.ServiceConnectFailedException
- if the remote service is busyjava.lang.Exception
public boolean diff(Database db, BlockBag blkBag) throws java.lang.Exception
db
- a valid, open Database handleblkBag
- a bag of blocks to diff against db.java.lang.Exception
public java.util.List<MismatchedRegion> getDiffRegions()
public BlockBag createBlockBag(Database db)
db
- the database from which to create the bag of blocksCopyright (c) 2004-2012 Oracle. All rights reserved.