App-MtAws
view release on metacpan or search on metacpan
594595596597598599600601602603604605606607608609610611612613
`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
949596979899100101102103104105106107108109110
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
303132333435363738394041424344454647484950{
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.525 second using v1.01-cache-2.11-cpan-5f2e87ce722 )