Crate rzbackup [] [src]

RZBackup is a library, and a collection of binaries, implementing a partial clone of ZBackup.

The main class is Repository, which has static methods for opening and accessing data from a ZBackup repository. The restore method will restore a backup to a provided Writer.

Repository implements Clone and is fully thread-safe. It performs parallel decompression operations using a background thread pool and it has a three-layer cache. The parameters for cache sizes and number of threads are fully configurable.

There is also a RandomAccess class which implements Seek and Read, and can be constructed from a Repository and the name of a backup.

Structs

CryptoReader

This provides a reader for an encrypted ZBackup file. It is used internally, but also made available publicly, since it may be useful in some cases.

RandomAccess

This struct implements both Seek and Read and can be used to easily and efficiently access the contents of a backup using these idiomatic APIs.

Repository

This is the main struct which implements the ZBackup restore functionality. It is multi-threaded, using a cpu pool internally, and it is fully thread safe.

RepositoryConfig

This controls the configuration of a repository, and is passed to the open constructor.

Constants

BUFFER_SIZE

The size of the buffers used when reading and decompressing ZBackup data

FILESYSTEM_CACHE_PATH

The default location for the filesystem cache.

HMAC_SIZE

The size of a ZBackup HMAC, in bytes

IV_SIZE

The size of a ZBackup initialisation vector, in bytes

KEY_SIZE

The size of a ZBackup encryption key, in bytes

MAX_COMPRESSED_FILESYSTEM_CACHE_ENTRIES

The default number of compressed filesystem cache entries. This number of chunks will be stored in a temporary directory after LZO-compression.

MAX_COMPRESSED_MEMORY_CACHE_ENTRIES

The default number of uncompressed memory cache entries. This number of chunks will be kept in memory after LZO-compression, in an LRU cache.

MAX_UNCOMPRESSED_MEMORY_CACHE_ENTRIES

The default number of uncompressed memory cache entries. This number of chunks will be kept in memory uncompressed, in an LRU cache.

VERSION
WORK_JOBS_BATCH

The batch size for adding and removing jobs from the work queue. By doing this in batches, we can avoid a certain amount of unnecessary locking.

WORK_JOBS_TOTAL

The default number of total jobs to queue up during a restore operation. Since many chunks can be stored in a single bundle, and we can only use a single thread to decompress one bundle, this needs to be high enough to guarantee that we will always have enough jobs in the queue to make use of all of the threads available.

Functions

run_server

Type Definitions

BundleId

A ZBackup bundle ID

ChunkData

A ZBackup chunk's data

ChunkId

A ZBackup chunk ID

EncryptionKey

A ZBackup encryption key

IndexEntry

A ZBackup index entry. This combined the header with the bundle info, since generally both of these are needed to make use of the data.

IndexId

A ZBackup index ID