App-MtAws
view release on metacpan or search on metacpan
`mtime-and-treehash` is mnemonic for *File is modified if mtime differs AND treehash differs*. Words
*AND* and *OR* means here logical operators with [short-circuit evaluation](http://en.wikipedia.org/wiki/Short-circuit_evaluation)
i.e. with `mtime-and-treehash` treehash never checked if mtime not differs. And with `mtime-or-treehash` treehash never checked if mtime differs.
NOTE: files with zero sizes are not supported by Amazon Glacier API, thus considered non-existing for consistency, for all `sync` modes.
NOTE: `sync` does not upload empty directories, there is no such thing as directory in Amazon Glacier.
NOTE: With `--dry-run` option TreeHash will not be calculated, instead *Will VERIFY treehash and upload...* message will be displayed.
NOTE: TreeHash calculation performed in parallel, so some of workers (defined with `--concurrency`) might be busy calculating treehash instead
of network IO.
### `restore`
Initiate Amazon Glacier RETRIEVE oparation for files listed in Journal, which don't *exist* on local filesystem and for
which RETRIEVE was not initiated during last 24 hours (that information obtained from *Journal* too - each retrieval logged
into journal together with timestamp)
### `restore-completed`
lib/App/MtAws/QueueEngine.pm view on Meta::CPAN
return $job
} else {
confess;
}
} else {
$self->wait_worker();
}
}
}
sub get_busy_workers_ids
{
my ($self) = @_;
grep { $self->{workers}{$_}{task} } keys %{ $self->{workers}};
}
1;
t/lib/MyQueueEngine.pm view on Meta::CPAN
{
my ($self, %args) = @_;
$self->add_worker($_) for (1..$args{n});
}
sub queue { }
sub wait_worker
{
my ($self) = @_;
my @possible = $self->get_busy_workers_ids;
confess unless @possible;
my $worker_id = $possible[lcg_irand(0, @possible-1)];
my $task = $self->unqueue_task($worker_id);
my $method = "on_$task->{action}";
no strict 'refs';
my @r = $self->$method(%{$task->{args}});
$task->{cb_task_proxy}->(@r);
( run in 0.319 second using v1.01-cache-2.11-cpan-00829025b61 )