31 |
debug => $debug, |
debug => $debug, |
32 |
); |
); |
33 |
|
|
34 |
|
unless(eval{ $to_n->name }) { |
35 |
|
if ($to =~ m#^(http://.+)/node/([^/]+)$#) { |
36 |
|
my ($url,$name) = ($1,$2); |
37 |
|
print "Creating '$name' on $url\n"; |
38 |
|
$to_n->shuttle_url( $url . '/master?action=nodeadd', |
39 |
|
'application/x-www-form-urlencoded', |
40 |
|
'name=' . uri_escape($name) . '&label=' . uri_escape( $name ), |
41 |
|
undef, |
42 |
|
); |
43 |
|
} else { |
44 |
|
die "can't extract node name from $to\n"; |
45 |
|
} |
46 |
|
} |
47 |
|
|
48 |
print "Copy from ",$from_n->name," (",$from_n->label,") to ",$to_n->name," (",$to_n->label,") - ",$from_n->doc_num," documents (",$from_n->word_num," words, ",$from_n->size," bytes)\n"; |
print "Copy from ",$from_n->name," (",$from_n->label,") to ",$to_n->name," (",$to_n->label,") - ",$from_n->doc_num," documents (",$from_n->word_num," words, ",$from_n->size," bytes)\n"; |
49 |
|
|
50 |
my $doc_num = $from_n->doc_num || 1; |
my $doc_num = $from_n->doc_num || 1; |
76 |
|
|
77 |
$i++; |
$i++; |
78 |
} |
} |
79 |
warn "$prev\n"; |
warn "$prev\n" if ($debug); |
80 |
|
|
81 |
my $rate = ( $i / (time() - $t) ); |
my $rate = ( $i / (time() - $t) ); |
82 |
printf("%d records, %1.2f%% [%1.2f rec/s] estimated finish: %s\n", |
printf("%d records, %1.2f%% [%1.2f rec/s] estimated finish: %s\n", |