/[Sack]/trunk/bin/sack.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/sack.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 17 by dpavlin, Tue Sep 22 13:40:02 2009 UTC revision 19 by dpavlin, Tue Sep 22 15:14:00 2009 UTC
# Line 11  use IO::Socket::INET; Line 11  use IO::Socket::INET;
11  use Storable qw/freeze thaw/;  use Storable qw/freeze thaw/;
12    
13    
14    my $debug  = 0;
15  my $path   = '/data/isi/full.txt';  my $path   = '/data/isi/full.txt';
16  my $limit  = 5000;  my $limit  = 5000;
17  my $offset = 0;  my $offset = 0;
# Line 26  GetOptions( Line 27  GetOptions(
27          'view=s'   => \@views,          'view=s'   => \@views,
28          'listen|port=i' => \$listen,          'listen|port=i' => \$listen,
29          'connect=s'   => \@nodes,          'connect=s'   => \@nodes,
30            'debug!'   => \$debug,
31  ) or die $!;  ) or die $!;
32    
33  my $t = time;  my $t = time;
# Line 120  sub send_sock { Line 122  sub send_sock {
122  sub merge_out {  sub merge_out {
123          my $new = shift;          my $new = shift;
124    
         warn "## merge $new\n";  
   
125          foreach my $k1 ( keys %$new ) {          foreach my $k1 ( keys %$new ) {
126    
127                  foreach my $k2 ( keys %{ $new->{$k1} } ) {                  foreach my $k2 ( keys %{ $new->{$k1} } ) {
# Line 132  sub merge_out { Line 132  sub merge_out {
132                          if ( ! defined $out->{$k1}->{$k2} ) {                          if ( ! defined $out->{$k1}->{$k2} ) {
133                                  $out->{$k1}->{$k2} = $n;                                  $out->{$k1}->{$k2} = $n;
134                          } elsif ( $k1 =~ m{\+} ) {                          } elsif ( $k1 =~ m{\+} ) {
135                                  warn "# agregate $k1 $k2";  #                               warn "## agregate $k1 $k2";
136                                  $out->{$k1}->{$k2} += $n;                                  $out->{$k1}->{$k2} += $n;
137                          } elsif ( $ref eq 'ARRAY' ) {                          } elsif ( $ref eq 'ARRAY' ) {
138                                  push @{ $out->{$k1}->{$k2} }, $n;                                  push @{ $out->{$k1}->{$k2} }, $n;
# Line 144  sub merge_out { Line 144  sub merge_out {
144                  }                  }
145          }          }
146    
147          warn "## merge out ", dump $out;          warn "## merge out ", dump $out if $debug;
148  }  }
149    
150  sub run_code {  sub run_code {

Legend:
Removed from v.17  
changed lines
  Added in v.19

  ViewVC Help
Powered by ViewVC 1.1.26