|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.rep.util.ldiff.LDiff
public class LDiff
LDiff provides a mechanism for efficiently comparing two quiescent databases, typically residing on different machines connected by a network. The comparison is done at the logical level rather than the physical level, so that we can compare the contents of replicated databases where the logical contents may be identical, but the physical logs may be very different. If the databases are found to be different, it provides information that would help identify the specific nature of the differences. This class provides the external API used to initiate a comparison. For details, please review the document at:
Nested Class Summary | |
---|---|
(package private) class |
LDiff.MismatchException
The exception that is thrown when a database diff detects differences. |
Constructor Summary | |
---|---|
LDiff(LDiffConfig cfg)
Configure a new object with which to compare two databases. |
Method Summary | |
---|---|
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)
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. |
List<MismatchedRegion> |
getDiffRegions()
|
Iterator<Block> |
iterator(Database db)
|
static void |
main(String[] args)
The main used by the LDiff utility. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LDiff(LDiffConfig cfg)
cfg
- the configuration parameters for the new object.Method Detail |
---|
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 handle
LDiff.MismatchException
Exception
public boolean diff(Database db1, Database db2) throws Exception
db1
- a valid, open Database handledb2
- a valid, open Database handle
LDiff.MismatchException
Exception
public boolean diff(Environment env, InetSocketAddress addr) throws IOException, BinaryProtocol.ProtocolException, ServiceDispatcher.ServiceConnectFailedException, Exception
env
- a valid, open Environment handleaddr
- the address of the remote machine
IOException
- if a network error occurs
BinaryProtocol.ProtocolException
- if an unexpected message is received
ServiceDispatcher.ServiceConnectFailedException
- if the remote service was busy
LDiff.MismatchException
Exception
public boolean diff(Database db, InetSocketAddress addr) throws IOException, BinaryProtocol.ProtocolException, ServiceDispatcher.ServiceConnectFailedException, Exception
db
- a valid, open Database handleaddr
- the address of the remote host
IOException
- if a network error occurs
BinaryProtocol.ProtocolException
- if the remote database does not exist
ServiceDispatcher.ServiceConnectFailedException
- if the remote service is busy
LDiff.MismatchException
Exception
public boolean diff(Database db, BlockBag blkBag) throws Exception
db
- a valid, open Database handleblkBag
- a bag of blocks to diff against db.
LDiff.MismatchException
Exception
public List<MismatchedRegion> getDiffRegions()
public BlockBag createBlockBag(Database db)
db
- the database from which to create the bag of blocks
public Iterator<Block> iterator(Database db)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |