X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=perl%2FAmanda%2FDB%2FCatalog.pm;h=dc849da8d2c62aa90a7428019de07aa7d437c94b;hb=949b8910a5e23c4285d0b1aedacfc82a14dc97a5;hp=8e457ea1c133b433f785655489a5896c0d03e28d;hpb=2627875b7d18858bc1f9f7652811e4d8c15a23eb;p=debian%2Famanda diff --git a/perl/Amanda/DB/Catalog.pm b/perl/Amanda/DB/Catalog.pm index 8e457ea..dc849da 100644 --- a/perl/Amanda/DB/Catalog.pm +++ b/perl/Amanda/DB/Catalog.pm @@ -1,4 +1,4 @@ -# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2008-2012 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -31,7 +31,7 @@ Amanda::DB::Catalog - access to the Amanda catalog: where is that dump? # loop over those timestamps, printing dump info for each one for my $timestamp (@timestamps) { - my @dumpfiles = Amanda::DB::Catalog::get_dumps( + my @dumpfiles = Amanda::DB::Catalog::get_parts( timestamp => $timestamp, ok => 1 ); @@ -42,28 +42,29 @@ Amanda::DB::Catalog - access to the Amanda catalog: where is that dump? } } -=head1 DESCRIPTION +=head1 MODEL -=head2 MODEL +The Amanda catalog is modeled as a set of dumps comprised of parts. A dump is +a complete bytestream received from an application, and is uniquely identified +by the combination of C, C, C, C, +and C. A dump may be partial, or even a complete failure. -The Amanda catalog is a set of dumpfiles, where each dumpfile corresponds to a -single file in a storage volume. On tapes, files are separated by filemarks -and numbered sequentially. This model is preserved on non-tape media such as -the VFS and S3 devices. A dumpfile, then, is completely specified by a volume -label and a file number (I). +A part corresponds to a single file on a volume, containing a portion of the +data for a dump. A part, then, is completely specified by a volume label and a +file number (C). Each part has, among other things, a part number +(C) which gives its relative position within the dump. The bytestream +for a dump is recovered by concatenating all of the successful (C = OK) +parts matching the dump. -The catalog is presented as a single table containing one row per dumpfile. -Each row has the following values: +Files in the holding disk are considered part of the catalog, and are +represented as single-part dumps (holding-disk chunking is ignored, as it is +distinct from split parts). -=over - -=item label +=head2 DUMPS -(string) -- volume label +The dump table contains one row per dump. It has the following columns: -=item filenum - -(integer) -- file on that volume +=over =item dump_timestamp @@ -71,7 +72,8 @@ Each row has the following values: =item write_timestamp -(string) -- timestamp of the run in which the dump was written to this volume +(string) -- timestamp of the run in which the part was written to this volume, +or C<"00000000000000"> for dumps in the holding disk. =item hostname @@ -87,56 +89,121 @@ Each row has the following values: =item status -(string) -- "OK", "PARTIAL" or some other descriptor +(string) -- The status of the dump - "OK", "PARTIAL", or "FAIL". If a disk +failed to dump at all, then it is not part of the catalog and thus will not +have an associated dump row. -=item partnum +=item message -(integer) -- part number of a split dump (1-based) +(string) -- reason for PARTIAL or FAIL status =item nparts -(integer) -- number of parts in this dump (estimated) +(integer) -- number of successful parts in this dump + +=item bytes + +(integer) -- size (in bytes) of the dump on disk, 0 if the size is not known. =item kb -(integer) -- size (in kb) of this dumpfile +(integer) -- size (in kb) of the dump on disk + +=item orig_kb + +(integer) -- size (in kb) of the complete dump (before compression or encryption); undef +if not available =item sec -(integer) -- time (in seconds) spent writing this dumpfile +(integer) -- time (in seconds) spent writing this part + +=item parts + +(arrayref) -- array of parts, indexed by partnum (so C<< $parts->[0] >> is +always C). When multiple partial parts are available, the choice of the +partial that is included in this array is undefined. =back -A dumpfile is represented as a hashref with these keys. +A dump is represented as a hashref with these keys. -The label and filenum serve as a primary key. The dump_timestamp, hostname, -diskname, and level uniquely identify the dump. The write_timestamp gives the -time that the dump was written to this volume. The write_timestamp may differ -from the dump_timestamp if, for example, I wrote the dump to tape -after the initial dump. The remaining fields are informational. +The C gives the time of the amanda run in which the part was +written to this volume. The C may differ from the +C if, for example, I wrote the part to tape after the +initial dump. -=head2 NOTES +=head2 PARTS + +The parts table contains one row per part, and has the following columns: + +=over + +=item label + +(string) -- volume label (not present for holding files) + +=item filenum + +(integer) -- file on that volume (not present for holding files) + +=item holding_file + +(string) -- fully-qualified pathname of the holding file (not present for +on-media dumps) + +=item dump + +(object ref) -- a reference to the dump containing this part + +=item status + +(string) -- The status of the part - "OK", "PARTIAL", or "FAILED". + +=item partnum + +(integer) -- part number of a split part (1-based) + +=item kb + +(integer) -- size (in kb) of this part + +=item sec + +(integer) -- time (in seconds) spent writing this part + +=back + +A part is represented as a hashref with these keys. The C