NAME
File::Rsync::Mirror::Recentfile::Done - intervals of already rsynced timespans
SYNOPSIS
my $done = File::Rsync::Mirror::Recentfile::Done->new;
$done->register ( $recent_events, [3,4,5,9] ); # registers elements 3-5 and 9
my $boolean = $done->covered ( $epoch );
DESCRIPTION
Keeping track of already rsynced timespans.
EXPORT
No exports.
CONSTRUCTORS
my $obj = CLASS->new(%hash)
Constructor. On every argument pair the key is a method name and the value is an argument to that method name.
ACCESSORS
- verbose
-
Boolean to turn on a bit verbosity.
METHODS
$boolean = $obj->covered ( $epoch1, $epoch2 )
$boolean = $obj->covered ( $epoch )
The first form returns true if both timestamps $epoch1 and $epoch2 in floating point notation have been registered within one interval, otherwise false.
The second form returns true if this timestamp has been registered.
(void) $obj1->merge ( $obj2 )
Integrates all intervals in $obj2 into $obj1. Overlapping intervals are conflated/folded/consolidated. Sort order is preserved as decreasing.
(void) $obj->register ( $recent_events_arrayref, $register_arrayref )
(void) $obj->register ( $recent_events_arrayref )
The first arrayref is a list of hashes that contain a key called epoch
which is a string looking like a number. The second arrayref is a list if integers which point to elements in the first arrayref to be registered.
The second form registers all events in $recent_events_arrayref.
reset
Forgets everything ever done and gives way for a new round of mirroring. Usually called when the dirtymark on upstream has changed.
PRIVATE METHODS
_intervals
COPYRIGHT & LICENSE
Copyright 2008, 2009 Andreas König.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.