17 |
my $view = 'views/00.demo.pl'; |
my $view = 'views/00.demo.pl'; |
18 |
my $offset = 0; |
my $offset = 0; |
19 |
my $limit = 5000; |
my $limit = 5000; |
20 |
my $cloud_file = 'etc/lib'; |
my $cloud_file; |
21 |
|
|
22 |
|
|
23 |
GetOptions( |
GetOptions( |
37 |
|
|
38 |
my $lorry = Sack::Lorry->new; |
my $lorry = Sack::Lorry->new; |
39 |
|
|
40 |
my @cloud = read_file $cloud_file; |
my @cloud = -e $cloud_file ? read_file $cloud_file : ( 'localhost' ); |
41 |
warn "bring up cloud ",dump @cloud; |
warn "bring up cloud ",dump @cloud; |
42 |
|
|
43 |
my $from = Sack::From->new( |
my $from = Sack::From->new( |
75 |
|
|
76 |
warn "load status ", dump( $lorry->get_from_all ); |
warn "load status ", dump( $lorry->get_from_all ); |
77 |
|
|
78 |
|
our $out; |
79 |
|
|
80 |
while ( $view ) { |
while ( $view ) { |
|
warn dump( $lorry->view( $view ) ); |
|
|
duration 'view'; |
|
81 |
print "sack> "; |
print "sack> "; |
82 |
my $cmd = <STDIN>; |
my $cmd = <STDIN>; |
83 |
last unless defined $cmd; # CTRL+D |
last unless defined $cmd; # CTRL+D |
|
chomp($cmd); |
|
84 |
duration 'repl wait'; |
duration 'repl wait'; |
85 |
|
chomp($cmd); |
86 |
|
if ( $cmd =~ m{^v} ) { |
87 |
|
$out = $lorry->view( $view ); |
88 |
|
duration 'view'; |
89 |
|
} elsif ( $cmd =~ m{^d} ) { |
90 |
|
warn dump $out; |
91 |
|
duration 'dump'; |
92 |
|
} else { |
93 |
|
warn "unknown $cmd\n"; |
94 |
|
} |
95 |
} |
} |
96 |
|
|
97 |
warn "exit all nodes\n"; |
warn "exit all nodes\n"; |