Changeset 23352 for branches/cnb_branches/cnb_branch_20090301/Nebulous
- Timestamp:
- Mar 17, 2009, 12:08:50 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 1 deleted
- 6 edited
- 9 copied
-
. (modified) (1 prop)
-
Nebulous/Build.PL (modified) (2 diffs)
-
Nebulous/MANIFEST (modified) (1 diff)
-
Nebulous/docs (deleted)
-
Nebulous/nebclient/src (modified) (1 prop)
-
Nebulous/nebclient/src/nebulous.h (copied) (copied from trunk/Nebulous/nebclient/src/nebulous.h )
-
Nebulous/nebclient/src/soapC.c (copied) (copied from trunk/Nebulous/nebclient/src/soapC.c )
-
Nebulous/nebclient/src/soapClient.c (copied) (copied from trunk/Nebulous/nebclient/src/soapClient.c )
-
Nebulous/nebclient/src/soapClientLib.c (copied) (copied from trunk/Nebulous/nebclient/src/soapClientLib.c )
-
Nebulous/nebclient/src/soapH.h (copied) (copied from trunk/Nebulous/nebclient/src/soapH.h )
-
Nebulous/nebclient/src/soapServer.c (copied) (copied from trunk/Nebulous/nebclient/src/soapServer.c )
-
Nebulous/nebclient/src/soapServerLib.c (copied) (copied from trunk/Nebulous/nebclient/src/soapServerLib.c )
-
Nebulous/nebclient/src/soapStub.h (copied) (copied from trunk/Nebulous/nebclient/src/soapStub.h )
-
Nebulous/nebclient/tests/tap/src (modified) (1 prop)
-
Nebulous/scripts/ptest.pl (modified) (3 diffs)
-
Nebulous/scripts/stats.pl (copied) (copied from trunk/Nebulous/scripts/stats.pl )
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk merged eligible /branches/eam_branches/eam_branch_20090303 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/Nebulous/Build.PL
r20131 r23352 11 11 my $pkg_dir = "./nebclient"; 12 12 13 sub ACTION_code { 14 my $self = shift; 15 16 $self->SUPER::ACTION_code(@_); 17 18 my $old_pwd = getcwd(); 19 chdir $pkg_dir; 20 21 unless (-e "configure") { 22 system("./autogen.sh") == 0 or die "install failed: $?"; 23 } 24 25 chdir $old_pwd; 26 } 27 28 sub ACTION_build { 29 my $self = shift; 30 31 $self->SUPER::ACTION_build(@_); 32 33 my $old_pwd = getcwd(); 34 chdir $pkg_dir; 35 36 unless (-e "Makefile") { 37 system("sh ./configure") == 0 or die "build failed: $?"; 38 } 39 40 system("make") == 0 or die "build failed: $?"; 41 42 chdir $old_pwd; 43 } 44 45 # Do not attempt to install nebclient. It is bundled in this package for 46 # testing only. 47 # 13 # sub ACTION_code { 14 # my $self = shift; 15 # 16 # $self->SUPER::ACTION_code(@_); 17 # 18 # my $old_pwd = getcwd(); 19 # chdir $pkg_dir; 20 # 21 # unless (-e "configure") { 22 # system("./autogen.sh") == 0 or die "install failed: $?"; 23 # } 24 # 25 # chdir $old_pwd; 26 # } 27 # 28 # sub ACTION_build { 29 # my $self = shift; 30 # 31 # $self->SUPER::ACTION_build(@_); 32 # 33 # my $old_pwd = getcwd(); 34 # chdir $pkg_dir; 35 # 36 # unless (-e "Makefile") { 37 # system("sh ./configure") == 0 or die "build failed: $?"; 38 # } 39 # 40 # system("make") == 0 or die "build failed: $?"; 41 # 42 # chdir $old_pwd; 43 # } 44 # 48 45 # sub ACTION_install { 49 46 # my $self = shift; … … 58 55 # chdir $old_pwd; 59 56 # } 60 61 sub ACTION_clean {62 my $self = shift;63 64 $self->SUPER::ACTION_clean(@_);65 66 my $old_pwd = getcwd();67 chdir $pkg_dir;68 69 system("make clean") == 0 or die "install failed: $?";70 71 chdir $old_pwd;72 }57 # 58 # sub ACTION_clean { 59 # my $self = shift; 60 # 61 # $self->SUPER::ACTION_clean(@_); 62 # 63 # my $old_pwd = getcwd(); 64 # chdir $pkg_dir; 65 # 66 # system("make clean") == 0 or die "install failed: $?"; 67 # 68 # chdir $old_pwd; 69 # } 73 70 EOF 74 71 -
branches/cnb_branches/cnb_branch_20090301/Nebulous/MANIFEST
r20131 r23352 20 20 bin/neb-touch 21 21 bin/neb-xattr 22 docs/c_api.h23 docs/database_setup.txt24 docs/design.txt25 docs/requirements.txt26 docs/setup.txt27 docs/tmp.txt28 22 examples/Makefile 29 23 examples/nebexample.c -
branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/src
- Property svn:ignore
-
old new 1 Makefile.in 1 2 .deps 3 Makefile 4 soapClientLib.c 5 nebulous.h 6 soapClient.c 7 soapStub.h 8 soapC.c 9 soapH.h 10 soapServerLib.c 11 soapServer.c 2 12 .libs 3 Makefile4 Makefile.in5 SOAP.nsmap6 libnebclient.la7 nebclient.lo8 nebulous.h9 soapC.c10 soapC.lo11 soapClient.c12 soapClient.lo13 soapClientLib.c14 soapH.h15 soapServer.c16 soapServerLib.c17 soapStub.h18 stdsoap2.lo19 xmalloc.lo
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/src
- Property svn:ignore
-
old new 6 6 .deps 7 7 Makefile 8 .libs
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090301/Nebulous/scripts/ptest.pl
r21545 r23352 5 5 6 6 use lib "./lib"; 7 package main; 7 8 8 use Nebulous::Client;9 #use Nebulous::Client; 9 10 use IO::Select; 10 11 use IO::Socket; 12 use POSIX qw(:DEFAULT :sys_wait_h); 13 use Hook::LexWrap; 14 use Sys::Hostname; 11 15 12 my $neb = Nebulous::Client->new( 13 # proxy => 'http://localhost:80/nebulous' 14 proxy => 'http://alala:80/nebulous' 15 ); 16 my $print_stdout = undef; 17 18 $| = 1; 16 19 17 20 my $key = shift || 'foobar'; 18 21 my $kids = shift || 1; 19 22 20 my $s = IO::Select->new(); 23 $key = "/tmp/" . $key; 24 25 #my $s = IO::Select->new(); 21 26 22 27 foreach my $id ( 1..$kids ) { 23 my ($sock_parent, $sock_child) = IO::Socket->socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC);24 $s->add($sock_parent);28 # my ($sock_parent, $sock_child) = IO::Socket->socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC); 29 # $s->add($sock_parent); 25 30 26 31 my $pid = fork; 27 32 28 33 unless ( $pid ) { 34 # child 35 my $sock_child = \*STDOUT; 29 36 child($sock_child, $id); 37 shutdown($sock_child, 2); 30 38 exit 0; 31 39 } … … 33 41 } 34 42 35 while ($kids) { 36 foreach my $child ($s->can_read(1)) { 37 my $string = <$child>; 38 my @events = split(/\n/, $string) if $string; 39 print join("\n", @events), "\n" if scalar @events; 43 $SIG{CHLD} = \&REAPER; 44 45 sub REAPER { 46 while ((my $pid = waitpid(-1,WNOHANG)) > 0) { 47 $kids--; 48 # delete $children{$pid}; 40 49 } 50 $SIG{CHLD} = \&REAPER; 41 51 } 42 52 43 #while ( $kids ) {44 # wait();45 # $kids --;46 #}47 53 48 our $my_sock; 54 while ($kids) { 55 # foreach my $child ($s->can_read(0)) { 56 # my $string = do { local $/; <$child>}; 57 # my @events = split(/\n/, $string) if $string; 58 # print join("\n", @events), "\n" if scalar @events; 59 # } 60 } 49 61 50 62 sub child 51 63 { 52 my ($sock _child, $id) = @_;64 my ($sock, $id) = @_; 53 65 54 $my_sock = $sock_child; 66 unless ($print_stdout) { 67 my $filename = hostname() . "." . $$ . ".txt"; 68 open my $fh, ">$filename" or die "can't open $filename: $!"; 69 70 open STDOUT, ">&", $fh or die "can't reopen STDOUT: $!"; 71 autoflush STDOUT 1; 72 } 73 74 # select $sock; 75 # $| = 1; 55 76 56 77 # child 57 78 my $fname = "${key}_$id"; 58 print $sock_child "$$ : i'm a little tea pot using key: $fname\n";59 my $fh = $neb->open_create( $fname );60 child_die("can't create file $fname") unless $fh;61 79 62 print $fh "fooby\n"; 80 my $neb = Nebulous::Client::Bench->new( 81 # proxy => 'http://localhost:80/nebulous' 82 proxy => 'http://alala:80/nebulous', 83 # sock => \*STDOUT, 84 ); 63 85 64 close $fh;65 86 66 $fh = $neb->open( $fname, 'read' ) or child_die("can't open file"); 67 close $fh; 87 while (1) { 88 # print $sock "$$ : i'm a little tea pot using key: $fname\n"; 89 my $fh = $neb->open_create( $fname ) 90 or child_die($sock, "can't create file $fname"); 91 close $fh; 68 92 69 $neb->lock( $fname, 'read' ); 70 $neb->unlock( $fname, 'read' ); 71 $neb->replicate( $fname ); 72 $neb->cull( $fname ); 93 $fh = $neb->open( $fname, 'read' ) 94 or child_die("can't open file"); 95 close $fh; 73 96 74 print $sock_child "$$ : half way\n"; 97 $neb->lock( $fname, 'read' ); 98 $neb->unlock( $fname, 'read' ); 99 $neb->replicate( $fname ); 100 $neb->cull( $fname ); 101 $neb->find( $fname ); 102 $neb->copy( $fname, $fname . "_copy" ); 103 $neb->move( $fname, $fname . "_move" ); 104 $neb->delete( $fname . "_copy" ); 105 $neb->delete( $fname . "_move" ); 75 106 76 $neb->find( $fname ); 77 $neb->copy( $fname, $fname . "_copy" ); 78 $neb->move( $fname, $fname . "_move" ); 79 $neb->delete( $fname . "_copy" ); 80 $neb->delete( $fname . "_move" ); 81 82 print $sock_child "$$ : all done!\n"; 83 84 $sock_child->flush; 85 sleep 10; 107 # print $sock "$$ : all done!\n"; 108 } 86 109 87 110 return 1; … … 90 113 sub child_die 91 114 { 92 print $my_sock $@; 93 shutdown($my_sock, 2); 115 my $sock = shift; 116 print $sock @_; 117 shutdown($sock, 2); 94 118 exit 1; 95 119 } 120 121 package Nebulous::Client::Bench; 122 123 use base qw( Nebulous::Client ); 124 125 #sub new 126 #{ 127 # my $class = shift; 128 # my %p = @_; 129 # 130 # my $sock = delete $p{sock}; 131 # my $self = $class->SUPER::new(%p); 132 # $self->{sock} = $sock; 133 # 134 # return $self; 135 #} 136 137 BEGIN { 138 sub make_wrapper 139 { 140 my $method = shift; 141 142 eval "sub $method {" 143 .' my $self = shift;' 144 .' my $smark = Time::HiRes::time();' 145 .' my $ret = $self->SUPER::' . "$method" .'(@_);' 146 .' my $emark = Time::HiRes::time();' 147 .' printf "%-17s %-17s %s\n", $emark, " ' . "$method" . ' ", ($emark - $smark), "\n";' 148 .' return $ret;' 149 .'}'; 150 151 } 152 153 make_wrapper("create"); 154 make_wrapper("open_create"); 155 make_wrapper("replicate"); 156 make_wrapper("cull"); 157 make_wrapper("lock"); 158 make_wrapper("unlock"); 159 make_wrapper("setxattr"); 160 make_wrapper("getxattr"); 161 make_wrapper("listxattr"); 162 make_wrapper("removexattr"); 163 make_wrapper("find_objects"); 164 make_wrapper("find_instances"); 165 #make_wrapper("find"); 166 #make_wrapper("open"); 167 #make_wrapper("delete"); 168 #make_wrapper("copy"); 169 make_wrapper("move"); 170 make_wrapper("swap"); 171 make_wrapper("delete_instance"); 172 make_wrapper("stat"); 173 make_wrapper("mounts"); 174 175 } 176 177 1;
Note:
See TracChangeset
for help on using the changeset viewer.
