public class NetworkBackup
extends java.lang.Object
The log files that are retrieved over the network are placed in a directory that can serve as an environment directory for a JE stand alone or HA environment. If log files are already present in the target directory, it will try reuse them, if they are really consistent with those on the server. Extant log files that are no longer part of the current backup file set are deleted or are renamed, depending on how the backup operation was configured.
Renamed backup files have the following syntax:
NNNNNNNN.bup.
The implementation tries to be resilient in the face of network failures and
minimizes the amount of work that might need to be done if the client or
server were to fail and had to be restarted. Users of this API must be
careful to ensure that the execute() completes successfully before accessing
the environment. [Sam: should we create a je.lck file to ensure that this is
the case?]
Modifier and Type | Class and Description |
---|---|
protected static class |
NetworkBackup.DigestException
Exception indicating that the digest sent by the server did not match
the digest computed by the client, that is, the log file was corrupted
during transit.
|
static class |
NetworkBackup.InsufficientVLSNRangeException
Exception indicating that the server vlsn range did not cover the VLSN
of interest.
|
static class |
NetworkBackup.LoadThresholdExceededException |
Modifier and Type | Field and Description |
---|---|
(package private) java.security.MessageDigest |
messageDigest |
(package private) int |
serverLoadThreshold |
Constructor and Description |
---|
NetworkBackup(java.net.InetSocketAddress serverSocket,
java.io.File envDir,
NameIdPair clientNameId,
boolean retainLogfiles,
FileManager fileManager)
Convenience overloading.
|
NetworkBackup(java.net.InetSocketAddress serverSocket,
int receiveBufferSize,
java.io.File envDir,
NameIdPair clientNameId,
boolean retainLogfiles,
int serverLoadThreshold,
VLSN minVLSN,
RepImpl repImpl,
FileManager fileManager)
Creates a configured backup instance which when executed will backup the
files to the environment directory.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
execute()
Execute the backup.
|
protected void |
getFile(java.io.File file)
Requests and obtains the specific log file from the server.
|
StatGroup |
getStats()
Returns statistics associated with the NetworkBackup execution.
|
void |
setTestBarrier(java.util.concurrent.CyclicBarrier testBarrier) |
final int serverLoadThreshold
final java.security.MessageDigest messageDigest
public NetworkBackup(java.net.InetSocketAddress serverSocket, int receiveBufferSize, java.io.File envDir, NameIdPair clientNameId, boolean retainLogfiles, int serverLoadThreshold, VLSN minVLSN, RepImpl repImpl, FileManager fileManager) throws java.lang.IllegalArgumentException
serverSocket
- the socket on which to contact the serverreceiveBufferSize
- the receive buffer size to be associated with
the socket used for the log file transfers.envDir
- the directory in which to place the log filesclientNameId
- the id used to identify this clientretainLogfiles
- determines whether obsolete log files should be
retained by renaming them, instead of deleting them.serverLoadThreshold
- only backup from this server if it has fewer
than this number of feeders active.minVLSN
- the VLSN that should be covered by the server. It ensures
that the log files are sufficiently current for this client's needs.java.lang.IllegalArgumentException
- if the environment directory is not
valid. When used internally, this should be caught appropriately.public NetworkBackup(java.net.InetSocketAddress serverSocket, java.io.File envDir, NameIdPair clientNameId, boolean retainLogfiles, FileManager fileManager) throws DatabaseException
public StatGroup getStats()
public java.lang.String[] execute() throws java.io.IOException, DatabaseException, ServiceDispatcher.ServiceConnectFailedException, NetworkBackup.LoadThresholdExceededException, NetworkBackup.InsufficientVLSNRangeException
protected void getFile(java.io.File file) throws java.io.IOException, BinaryProtocol.ProtocolException, NetworkBackup.DigestException
java.io.IOException
BinaryProtocol.ProtocolException
NetworkBackup.DigestException
public void setTestBarrier(java.util.concurrent.CyclicBarrier testBarrier)
Copyright (c) 2004-2012 Oracle. All rights reserved.