• R/O
  • SSH
  • HTTPS

globalbase: コミット


コミットメタ情報

リビジョン5419 (tree)
日時2014-08-25 15:55:11
作者joshua

ログメッセージ

2014.8.25 mori

変更サマリ

差分

--- gbs/branches/bra-xul-js/trunk/www/gs/control/classes/plugins/RDF/methods.pl (revision 5418)
+++ gbs/branches/bra-xul-js/trunk/www/gs/control/classes/plugins/RDF/methods.pl (revision 5419)
@@ -757,7 +757,7 @@
757757 {
758758 my $path = $_[1];
759759 my $type = $_[3];
760- my $inp = $_[5];
760+ my $inp = $_[5];
761761 if ( $type eq "para_stdout" ) {
762762 print "$inp\n";
763763 }
@@ -770,7 +770,7 @@
770770 elsif ( $type eq "rebootWait" ) {
771771 return "doACT_FRONT_PLUGIN_SLAVE:3=";
772772 }
773- return;
773+ return "";
774774 }
775775
776776 #===================================================================
--- gbs/branches/bra-xul-js/trunk/www/gs/control/classes/DB/methods.pl (revision 5418)
+++ gbs/branches/bra-xul-js/trunk/www/gs/control/classes/DB/methods.pl (revision 5419)
@@ -366,6 +366,27 @@
366366 }
367367
368368
369+sub i_fileconfig
370+{
371+ my $filename = $_[0];
372+ my $retptr = $_[1];
373+ local(*IN);
374+ if ( -e $filename ) {
375+ open(IN,"<$filename");
376+ while(<IN>) {
377+ my $line = $_;
378+ $line =~ s/[\n\r]//g;
379+ if ( $line =~ m/^ts[ \t]*\=[ \t]*(.*)$/ ) {
380+ $$retptr{"ts"} = $1;
381+ }
382+ elsif ( $line =~ m/^trdir[ \t]*\=[ \t]*(.*)$/ ) {
383+ $$retptr{"trdir"} = $1;
384+ }
385+ }
386+ close(IN);
387+ }
388+}
389+
369390 sub d_make_orginfo
370391 {
371392 my $path = $_[0];
@@ -375,6 +396,14 @@
375396 # for ( ; !flock(DB_LOCKFILE,2) ; ) {
376397 # sleep(1);
377398 # }
399+ my $db_path = "$path/class/DB_state";
400+ my ($orgdbobj,$orgdb) = OBJECT::d_objtie($db_path,"w");
401+ my $data_dir = $orgdb{"data_dir"};
402+
403+ my %config = ();
404+ i_fileconfig("$data_dir/select.txt",\%config);
405+
406+
378407 my %orgfiles = ();
379408 my $db_path = "$path/orginfo.db";
380409 my ($orgdbobj,$orgdb) = OBJECT::d_objtie($db_path,"w");
@@ -505,7 +534,11 @@
505534 $root_tr = DB::d_transaction();
506535 }
507536 #print STDERR "TRANSACTION-DO - $back\n";
508- OBJECT::op("set_transaction",$back,$frompath,$root_tr);
537+ if ( $config{"ts"} eq "off" ) {
538+ }
539+ else {
540+ OBJECT::op("set_transaction",$back,$frompath,$root_tr);
541+ }
509542 }
510543 }
511544 foreach ( @front_list ) {
@@ -841,8 +874,12 @@
841874 }
842875
843876 # OBJECT::op("destroy","$path/transaction",$ENV{"PWD"});
844- OBJECT::op("commit_transaction","$path/transaction",$ENV{"PWD"},$tr_key);
845-
877+# OBJECT::op("commit_transaction","$path/transaction",$ENV{"PWD"},$tr_key);
878+
879+ my $db_path = "$path/class/DB_state";
880+ my ($dbobj,$db_state) = OBJECT::d_objtie($db_path,"w");
881+ $$db_state{"commit.".$tr_key} = 1;
882+ OBJECT::op("event_handler",$path,$path);
846883 OBJECT::d_op_unlock($lock_cnt);
847884 return "";
848885 }
@@ -1109,8 +1146,26 @@
11091146 if ( $$db_state{"dbmode"} =~ m/^auto/ ) {
11101147 return "doACT_DB_AUTO";
11111148 }
1112- return "doACT_DB_ORGINFO";
1149+ return "doACT_COMMIT";
11131150 }
1151+
1152+sub is_ACT_COMMIT
1153+{
1154+ my $path = $_[1];
1155+
1156+ my $db_path = "$path/class/DB_state";
1157+ my ($dbobj,$info) = OBJECT::d_objtie($db_path,"w");
1158+ my $orgkey = "commit.";
1159+ my $key = $orgkey;
1160+ my $value;
1161+ my $keylength = length($orgkey);
1162+ my $st = $dbobj->seq($key,$value,R_CURSOR);
1163+
1164+ if ( $st == 0 && substr($key,0,$keylength) eq $orgkey ) {
1165+ return "doACT_COMMIT_DO";
1166+ }
1167+ return "doACT_DB_ORGINFO";
1168+}
11141169 sub is_ACT_DB_AUTO
11151170 {
11161171 my $path = $_[1];
@@ -1131,7 +1186,7 @@
11311186 if ( !(defined $interval_invoke) || $interval_invoke <= time ) {
11321187 return "doACT_DB_AUTO_EXECUTION";
11331188 }
1134- return "doACT_DB_ORGINFO";
1189+ return "doACT_COMMIT";
11351190 }
11361191 sub is_ACT_DB_ORGINFO
11371192 {
@@ -1504,7 +1559,57 @@
15041559 }
15051560 return "";
15061561 }
1562+sub is_ACT_COMMIT_DO
1563+{
1564+ my $path = $_[1];
15071565
1566+ my $db_path = "$path/class/DB_state";
1567+ my ($dbobj,$info) = OBJECT::d_objtie($db_path,"w");
1568+ my $orgkey = "commit.";
1569+ my $key = $orgkey;
1570+ my $value;
1571+ my $keylength = length($orgkey);
1572+ my $st = $dbobj->seq($key,$value,R_CURSOR);
1573+
1574+ if ( $st == 0 && substr($key,0,$keylength) eq $orgkey ) {
1575+ $key =~ m/^commit\.(.*)$/;
1576+ my $tr_key = $1;
1577+ delete $$info{$key};
1578+
1579+ OBJECT::op("listen","$path/transaction",$path,"zom");
1580+ my $ret = OBJECT::op("commit_transaction",
1581+ "$path/transaction",
1582+ $path,
1583+ $tr_key);
1584+ if ( $ret =~ m/^ERROR/ ) {
1585+ return "doACT_COMMIT_DO";
1586+ }
1587+ return "ACT_COMMIT_WAIT";
1588+ }
1589+ return "doACT_OBJECT_FINISH";
1590+}
1591+sub is_ACT_COMMIT_WAIT
1592+{
1593+ my $path = $_[1];
1594+ my $type = $_[3];
1595+ my $inp = $_[5];
1596+ my $state = OBJECT::d_state("state","$path/transaction",$path);
1597+ if ( $state eq "ZOM" ) {
1598+ return "doACT_COMMIT_DO";
1599+ }
1600+ if ( $type eq "para_stdout" ) {
1601+ print "$inp\n";
1602+ }
1603+ elsif ( $type eq "para_finished" ) {
1604+ if ( $inp eq "destroy" ) {
1605+ return "";
1606+ }
1607+ return "doACT_COMMIT_DO";
1608+ }
1609+ return "";
1610+}
1611+
1612+
15081613 sub is_FIN_OBJECT_MIDIUM
15091614 {
15101615
--- gbs/branches/bra-xul-js/trunk/www/gs/control/classes/TRANSACTION/methods.pl (revision 5418)
+++ gbs/branches/bra-xul-js/trunk/www/gs/control/classes/TRANSACTION/methods.pl (revision 5419)
@@ -114,33 +114,39 @@
114114 my $path = $_[0];
115115 my $frompath = $_[1];
116116 my $tr_key = $_[2];
117+ my @plist;
117118
119+ my $lock_cnt = OBJECT::d_op_lock();
118120 print STDERR "RESET_TRANSACTION --- $path -- $frompath -- $tr_key\n";
119- my $db_path = "$path/class/TRANSACTION_state";
120- my ($dbobj,$info) = OBJECT::d_objtie($db_path,"w");
121- my $orgkey = "TRKEY.".$tr_key."++++";
122- my $klen = length($orgkey);
123- my $key = $orgkey;
124- $st = $dbobj->seq($key,$value,R_CURSOR);
125- my @plist = ();
126- for ( ; $st == 0 ; ) {
127- if ( substr($key,0,$klen) ne $orgkey ) {
128- last;
121+ {
122+ my $db_path = "$path/class/TRANSACTION_state";
123+ my ($dbobj,$info) = OBJECT::d_objtie($db_path,"w");
124+ my $orgkey = "TRKEY.".$tr_key."++++";
125+ my $klen = length($orgkey);
126+ my $key = $orgkey;
127+ $st = $dbobj->seq($key,$value,R_CURSOR);
128+ @plist = ();
129+ for ( ; $st == 0 ; ) {
130+ if ( substr($key,0,$klen) ne $orgkey ) {
131+ last;
132+ }
133+ push(@plist,$key);
134+ $st = $dbobj->seq($key,$value,R_NEXT);
129135 }
130- push(@plist,$key);
131- $st = $dbobj->seq($key,$value,R_NEXT);
136+ foreach ( @plist ) {
137+ my $pp = $_;
138+ delete $$info{$pp};
139+ }
132140 }
141+ OBJECT::d_op_unlock($lock_cnt);
133142 foreach ( @plist ) {
134143 my $pp = $_;
135- delete $$info{$pp};
136- }
137- foreach ( @plist ) {
138- my $pp = $_;
139144 print STDERR "RESET_TRANSACTION --- $pp\n";
140145 $pp =~ m/\+\+\+\+(.*)$/;
141146 my $ppp = $1;
142147 OBJECT::op("reset_transaction",$ppp,$frompath,$path);
143148 }
149+ my $lock_cnt = OBJECT::d_op_lock();
144150 my $db_path = "$path/class/TRANSACTION_state";
145151 my ($dbobj,$info) = OBJECT::d_objtie($db_path,"w");
146152 delete $$info{"TRKEY.".$tr_key};
@@ -148,9 +154,17 @@
148154 my ($dbobj,$info) = OBJECT::d_objtie($db_path,"w");
149155 if ( !$$info{"listen.destroyed.count"} ||
150156 $$info{"listen.destroyed.count"} == 0 ) {
151-
157+
152158 OBJECT::op("destroy",$path,$frompath);
159+ OBJECT::d_op_unlock($lock_cnt);
160+ OBJECT::op("event_handler",$frompath,$path,"para_finished",
161+ "async_commit_transaction","destroy");
162+ return "destroy";
153163 }
164+ OBJECT::op("event_handler",$frompath,$path,"para_finished",
165+ "async_commit_transaction","normal");
166+ OBJECT::d_op_unlock($lock_cnt);
167+ return "";
154168 }
155169
156170 sub commit_transaction
@@ -162,16 +176,17 @@
162176 print STDERR "COMMIT_TRANSACTION $path -- $frompath -- $tr_key\n";
163177 if ( !$tr_key ) {
164178 OBJECT::op("destroy",$path,$frompath);
165- return;
179+ return "destroy";
166180 }
167181 my $db_path = "$path/class/TRANSACTION_state";
168182 my ($dbobj,$info) = OBJECT::d_objtie($db_path,"w");
169183 if ( $$info{"TRKEY.".$tr_key} eq "LOCK" ) {
170- return;
184+ return "locked";
171185 }
172186 $$info{"TRKEY.".$tr_key} = "LOCK";
173187 OBJECT::d_system("function",
174188 "TRANSACTION::async_commit_transaction $path $frompath $tr_key");
189+ return "async";
175190 }
176191
177192 #===================================================================
--- gbs/branches/bra-xul-js/trunk/www/gs/control/classes/OBJECT/methods.pl (revision 5418)
+++ gbs/branches/bra-xul-js/trunk/www/gs/control/classes/OBJECT/methods.pl (revision 5419)
@@ -1648,10 +1648,10 @@
16481648 print STDERR "MOVE $move_type $counter $m ==> $path\n";
16491649
16501650 if ( $move_type eq "inherit") {
1651- i_priority("i_priority",$path,$ENV{"PWD"},"inherit");
1651+ i_priority("i_priority",$path,$ENV{"PWD"},"inherit-move");
16521652 }
16531653 elsif ( $move_type eq "force" ) {
1654- i_priority("i_priority",$path,$ENV{"PWD"},"inherit","force_priority",$given_pri);
1654+ i_priority("i_priority",$path,$ENV{"PWD"},"inherit-move","force_priority",$given_pri);
16551655 }
16561656 else {
16571657 print "invalid move_type $move_type\n";
@@ -1950,13 +1950,16 @@
19501950 d_op_unlock($lock_cnt);
19511951 return 0;
19521952 }
1953- elsif ( $action eq "inherit" ) {
1953+ elsif ( $action eq "inherit" || $action eq "inherit-move" ) {
19541954 my $proceed = $_[4];
19551955 my $given_pri = $_[5];
19561956 my $fpri;
19571957 my $fmaster;
19581958 my $bh = 0;
1959- my $pm_flag = 0;
1959+ my $move_flag = 0;
1960+ if ( $action eq "inherit-move" ) {
1961+ $move_flag = 1;
1962+ }
19601963 #if ( $proceed ne "off_priority" ) {
19611964 #print STDERR "i_priority $frompath --> $path $proceed\n";
19621965 #}
@@ -2010,7 +2013,6 @@
20102013 }
20112014 $fmaster = $priority_master.":".$priority_master_time;
20122015 $bh = 1;
2013- $pm_flag = 1;
20142016 }
20152017 else {
20162018 d_op_unlock($lock_cnt);
@@ -2036,10 +2038,10 @@
20362038 $priority_mhash{$path} = $pmaster;
20372039 }
20382040 my $poffset = $$object_state{"priority_offset"};
2039-# if ( $pm_flag == 1 ) {
2041+ if ( $move_flag == 1 ) {
20402042 $poffset += i_pri_offset($path);
20412043 #print STDERR "PRIOFFSET-1 $poffset\n";
2042-# }
2044+ }
20432045 if ( $ie_flag eq "invoke_exe" ) {
20442046 my $db_path = $PARAMS::objdir."/OBJECT/global";
20452047 my ($gobj,$ginfo) = d_objtie($db_path,"w","err");
@@ -3255,6 +3257,37 @@
32553257 }
32563258 #===================================================================
32573259
3260+sub d_send_event_handler
3261+{
3262+ my $lock_cnt = d_op_lock();
3263+ my $base_path = $PARAMS::objdir."/OBJECT";
3264+ my $db_path = $base_path."/global";
3265+ my ($dbobj,$info) = OBJECT::d_objtie($db_path,"r");
3266+ my $keyorg = "priority_counter_path2.";
3267+ my $key = $keyorg;
3268+ my $keylen = length($key);
3269+ my $st = 0;
3270+ my $value;
3271+ my @target_path;
3272+ print STDERR "d_send_event_handler\n";
3273+ $st = $dbobj->seq($key,$value,R_CURSOR);
3274+ for ( ; $st == 0 ; ) {
3275+ if ( substr($key,0,$keylen) ne $keyorg ) {
3276+ last;
3277+ }
3278+ $key =~ m/^priority_counter_path2\.(.*)$/;
3279+ my $kkey = $1;
3280+ push(@target_path,$kkey);
3281+ $st = $dbobj->seq($key,$value,R_NEXT);
3282+ }
3283+ foreach ( @target_path ) {
3284+ my $path = $_;
3285+ print STDERR "SEND event_handler $path\n";
3286+ OBJECT::op("event_handler",$path,$path);
3287+ }
3288+ d_op_unlock($lock_cnt);
3289+}
3290+
32583291 sub d_state_statistics
32593292 {
32603293 my $force = $_[0];
--- gbs/branches/bra-xul-js/trunk/www/gs/control/classes/BACK/methods.pl (revision 5418)
+++ gbs/branches/bra-xul-js/trunk/www/gs/control/classes/BACK/methods.pl (revision 5419)
@@ -56,7 +56,7 @@
5656 # OBJECT::op("listen",$path,$path,"inserted_child","ichild_handler");
5757 OBJECT::op("listen",$path,$path,"index_updated");
5858
59- OBJECT::op("trace",$path,$path,"BACK-new");
59+# OBJECT::op("trace",$path,$path,"BACK-new");
6060
6161
6262 return 0;
旧リポジトリブラウザで表示