55 |
} elsif ( ! defined $pid ) { |
} elsif ( ! defined $pid ) { |
56 |
warn "can't fork $host $port"; |
warn "can't fork $host $port"; |
57 |
return; |
return; |
58 |
|
} elsif ( $host =~ m/^(127.0.0.1|localhost)$/ ) { |
59 |
|
warn "# localhost, just execute node\n"; |
60 |
|
exec $node_path, $port, $listen_port; |
61 |
} else { |
} else { |
62 |
# child |
# child |
63 |
warn "[$port] cpio last version\n"; |
warn "[$port] cpio last version\n"; |
139 |
|
|
140 |
warn ">>>> [$port] bulk_load ", $#shards + 1, " shards\n"; |
warn ">>>> [$port] bulk_load ", $#shards + 1, " shards\n"; |
141 |
Storable::store_fd( { bulk_load => [ @shards ] }, $sock ); |
Storable::store_fd( { bulk_load => [ @shards ] }, $sock ); |
142 |
|
my $current = 0; |
143 |
|
my $total = $#shards + 1; |
144 |
foreach my $s ( @shards ) { |
foreach my $s ( @shards ) { |
145 |
warn ">>>> [$port] bulk_load $s\n"; |
warn ">>>> [$port] bulk_load $s $current/$total\n"; |
146 |
Storable::store_fd( Storable::retrieve( $s ), $sock ); |
Storable::store_fd( Storable::retrieve( $s ), $sock ); |
147 |
|
$current++; |
148 |
} |
} |
149 |
warn ">>>> [$port] bulk_load finished\n"; |
warn ">>>> [$port] bulk_load finished, $current shards\n"; |
150 |
exit; |
exit; |
151 |
} |
} |
152 |
|
|