/[cvs]/nfo/perl/libs/Data/Transfer/Sync/API.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Transfer/Sync/API.pm

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

revision 1.5 by joko, Tue Feb 11 05:26:04 2003 UTC revision 1.8 by joko, Thu Mar 27 15:31:15 2003 UTC
# Line 6  Line 6 
6  ##  ##
7  ##    ----------------------------------------------------------------------------------------  ##    ----------------------------------------------------------------------------------------
8  ##    $Log$  ##    $Log$
9    ##    Revision 1.8  2003/03/27 15:31:15  joko
10    ##    fixes to modules regarding new namespace(s) below Data::Mungle::*
11    ##
12    ##    Revision 1.7  2003/02/21 08:00:24  joko
13    ##    debugging
14    ##
15    ##    Revision 1.6  2003/02/14 12:58:47  joko
16    ##    + re-enabled the erase-mechanism
17    ##
18  ##    Revision 1.5  2003/02/11 05:26:04  joko  ##    Revision 1.5  2003/02/11 05:26:04  joko
19  ##    + sub _tellWhatIWillDo  ##    + sub _tellWhatIWillDo
20  ##    + re-enabled "branch to execution path for special targets" mechanism  ##    + re-enabled "branch to execution path for special targets" mechanism
# Line 42  use mixin::with qw( Data::Transfer::Sync Line 51  use mixin::with qw( Data::Transfer::Sync
51  use Data::Dumper;  use Data::Dumper;
52  use Hash::Merge qw( merge );  use Hash::Merge qw( merge );
53    
54  use Data::Compare::Struct qw( isEmpty );  use Data::Mungle::Compare::Struct qw( isEmpty );
55    
56  # get logger instance  # get logger instance
57  my $logger = Log::Dispatch::Config->instance;  my $logger = Log::Dispatch::Config->instance;
# Line 148  sub syncNodes { Line 157  sub syncNodes {
157    my $self = shift;    my $self = shift;
158    my $args = shift;    my $args = shift;
159    
160      #$logger->notice( "==========================   " . __PACKAGE__ . "->syncNodes   ==============");
161    $logger->debug( __PACKAGE__ . "->syncNodes: starting" );    $logger->debug( __PACKAGE__ . "->syncNodes: starting" );
162    
163  #print Dumper($self);  #print Dumper($self);
# Line 156  sub syncNodes { Line 166  sub syncNodes {
166  #print Dumper($self->{options});  #print Dumper($self->{options});
167    $self->_prepareOptions();    $self->_prepareOptions();
168    
169  #print Dumper($self->{options});    # trace
170        #print Dumper($self->{options});
171        #exit;
172    
173    if (!$self->checkOptions()) {    if (!$self->checkOptions()) {
174      $logger->critical( __PACKAGE__ . "->syncNodes: 'Data::Transfer::Sync::checkOptions' failed.");      $logger->critical( __PACKAGE__ . "->syncNodes: 'Data::Transfer::Sync::checkOptions' failed.");
# Line 179  sub syncNodes { Line 191  sub syncNodes {
191    # hash to sum up results    # hash to sum up results
192    # TODO: re-implement! (sync-statistics???)    # TODO: re-implement! (sync-statistics???)
193    
194      #print Dumper($self->{options}->{process});
195    
196    # detect synchronization method to determine which optical symbol (directed arrow) to use    # detect synchronization method to determine which optical symbol (directed arrow) to use
197    my $mode = $self->{args}->{mode};   # V1    my $mode = $self->{args}->{mode};   # V1
198    $mode ||= $self->{options}->{process}->{mode};    # V2    $mode ||= $self->{options}->{process}->{mode};    # V2
# Line 219  sub syncNodes { Line 233  sub syncNodes {
233          #print Dumper($self->{__bridge});          #print Dumper($self->{__bridge});
234          # just take the global application instance and          # just take the global application instance and
235          # throw it into the context of the mapping module - this is heavy!  ;-) (but again, who cares...)          # throw it into the context of the mapping module - this is heavy!  ;-) (but again, who cares...)
236          # TODO: handle this more abstract *sometimes*          # TODO: handle this more abstract *sometime*
237          #$self->{options}->{handler}->($self->{__bridge}->{parent}->{app}, $self->{options});          #$self->{options}->{handler}->($self->{__bridge}->{parent}->{app}, $self->{options});
238          $self->{options}->{handler}->($self->{__bridge}->{parent}->{process}, $self->{options});          $self->{options}->{handler}->($self->{__bridge}->{parent}->{process}, $self->{options});
239                
# Line 234  sub syncNodes { Line 248  sub syncNodes {
248      #print Dumper($self);      #print Dumper($self);
249      #exit;      #exit;
250    
251    $logger->info( __PACKAGE__ . "->syncNodes: source=$self->{meta}->{source}->{dbKey}/$self->{meta}->{source}->{nodeName} [$self->{meta}->{source}->{nodeType}] $direction_arrow target=$self->{meta}->{target}->{dbKey}/$self->{meta}->{target}->{nodeName} [$self->{meta}->{target}->{nodeType}]" );    # V1:
252      $logger->debug( __PACKAGE__ . "->syncNodes: source=$self->{meta}->{source}->{dbKey}/$self->{meta}->{source}->{nodeName} [$self->{meta}->{source}->{nodeType}] $direction_arrow target=$self->{meta}->{target}->{dbKey}/$self->{meta}->{target}->{nodeName} [$self->{meta}->{target}->{nodeType}]" );
253      
254      # V2:
255      my $what = "$self->{meta}->{source}->{dbKey}/$self->{meta}->{source}->{nodeName} [$self->{meta}->{source}->{nodeType}] $direction_arrow $self->{meta}->{target}->{dbKey}/$self->{meta}->{target}->{nodeName} [$self->{meta}->{target}->{nodeType}]";
256      #my $header = ("~.." x 7) . "  " . $what . "  " . ("~.." x 4);
257      #my $header = ("= " x 7) . "  " . $what . "  " . ("= " x 4);
258      #my $header = ("~=-_-=" x 3) . "  " . $what . "  " . ("~=-_-=" x 4);
259      my $header = ("_-=~=-" x 4) . "  " . $what . "  " . ("_-=~=-" x 4);
260      $logger->notice($header);
261    
262    
263    return if !$self->buildFieldmapping();    return if !$self->buildFieldmapping();
264    return if !$self->_touchNodeSet();    return if !$self->_touchNodeSet();
# Line 301  sub _tellWhatIWillDo { Line 325  sub _tellWhatIWillDo {
325  EOT  EOT
326        
327        
328    $logger->notice( $ql );    chomp($ql);
329      $logger->info($ql);
330        
331    #exit;    #exit;
332    return;    return;
# Line 520  sub _prepare_sync { Line 545  sub _prepare_sync {
545    
546    # import flag means: prepare the source node to be syncable    # import flag means: prepare the source node to be syncable
547    # this is useful if there are e.g. no "ident" or "checksum" columns yet inside a DBI like (row-based) storage    # this is useful if there are e.g. no "ident" or "checksum" columns yet inside a DBI like (row-based) storage
548    if ($self->{args}->{prepare}) {    if ($self->{options}->{process}->{prepare}) {
549      $self->_prepareNode_MetaProperties('source');      $self->_prepareNode_MetaProperties('source');
550      $self->_prepareNode_DummyIdent('source');      $self->_prepareNode_DummyIdent('source');
551      #return;      #return;
# Line 529  sub _prepare_sync { Line 554  sub _prepare_sync {
554        
555    # erase flag means: erase the target    # erase flag means: erase the target
556    #if ($opts->{erase}) {    #if ($opts->{erase}) {
557    if ($self->{args}->{erase}) {    if ($self->{options}->{process}->{erase}) {
558      # TODO: move this method to the scope of the synchronization core and wrap it around different handlers      # TODO: move this method to the scope of the synchronization core and wrap it around different handlers
559      #print "ERASE", "\n";      #print "ERASE", "\n";
560      $self->_erase_all('target');      $self->_erase_all('target');

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.8

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed