public class BackupTask extends Task
Task to perform and/or control hot (concurrent) backup. Generally the process of copying large data files is best done by third party utility software. This class provides built-in ability to copy database files, but production configurations will likely use only the control mechanisms of this class and will run external programs to perform data compression and copying.
To perform a concurrent backup, Persistit needs to ensure that the state of
copied volume files plus journal files is sufficient to ensure a consistent,
fast recovery process. This is done by setting Persistit to
appendOnly
mode, which causes Persistit not to modify its Volume
files and not to delete any journal files. A snapshot of the journal file and
volume provides a reliable source for recovery.
This class provides a Task
implementation that sets and resets the
appendOnly
flag, provides a list a files needing to be copied to
form a complete backup, and as a convenience, a mechanism to compress and
copy them.
_culledMessageCount, _description, _expirationTime, _finishTime, _lastException, _maxMessageLogSize, _messageLog, _messageLogVerbosity, _messageWriter, _owner, _persistit, _startTime, _state, _stop, _suspend, _suspendedDuration, _taskId, _thread, DEFAULT_MAX_MESSAGE_LOG_SIZE, LOG_NORMAL, LOG_VERBOSE, STATE_DONE, STATE_ENDED, STATE_EXPIRED, STATE_FAILED, STATE_NAMES, STATE_NOT_STARTED, STATE_RUNNING, STATE_SUSPENDED
Constructor and Description |
---|
BackupTask() |
Modifier and Type | Method and Description |
---|---|
void |
doRestore(String path)
A convenience method for unit tests to unzip a backup created by
doBackup() . |
List<String> |
getFileList() |
String |
getStatus()
Returns a short String message describing the current state of this
Task . |
protected void |
postMessage(String message,
int level)
Posts a message (typically to denote progress, error or other interim
information) to the message log.
|
protected void |
runTask()
Called by a newly created
Thread to perform the task. |
appendMessage, cullMessages, endMessage, getMessageLogSize, getMessageLogVerbosity, getMessages, getMessageWriter, getRemainingTime, getStatusDetail, isImmediate, now, parseTreeList, poll, populateTaskStatus, resume, run, setMaximumTime, setMessageLogVerbosity, setMessageWriter, setPersistit, setup, start, stop, suspend
protected void runTask() throws Exception
Task
Thread
to perform the task.protected void postMessage(String message, int level)
Task
postMessage
in class Task
message
- The messagelevel
- Indicates the verbosity level. The message is posted only if
the level of the message is below the current verbosity
threshhold set through Task.setMessageLogVerbosity(int)
.public void doRestore(String path) throws Exception
doBackup()
. In production it is expected a backup produced by
doBackup()
will be restored via an external unzip utility.Exception
public String getStatus()
Task
Task
. It should convey a measurement of progress to the
end-user.Copyright © 2025 Open Identity Platform Community. All rights reserved.