[Bps-public-commit] r17366 - in sd/trunk/lib/App/SD: .
jesse at bestpractical.com
jesse at bestpractical.com
Thu Dec 25 20:56:02 EST 2008
Author: jesse
Date: Thu Dec 25 20:56:01 2008
New Revision: 17366
Modified:
sd/trunk/lib/App/SD/ForeignReplica.pm
sd/trunk/lib/App/SD/Replica/rt.pm
Log:
* refactoring to improve subclassability
Modified: sd/trunk/lib/App/SD/ForeignReplica.pm
==============================================================================
--- sd/trunk/lib/App/SD/ForeignReplica.pm (original)
+++ sd/trunk/lib/App/SD/ForeignReplica.pm Thu Dec 25 20:56:01 2008
@@ -22,6 +22,26 @@
my $TXN_METATYPE = 'txn-source';
+
+
+sub integrate_change {
+ my $self = shift;
+ my ( $change, $changeset ) = validate_pos(
+ @_,
+ { isa => 'Prophet::Change' },
+ { isa => 'Prophet::ChangeSet' }
+ );
+
+ # don't push internal records
+ return if $change->record_type =~ /^__/;
+
+ Prophet::App->require( $self->push_encoder());
+ my $recoder = $self->push_encoder->new( { sync_source => $self } );
+ $recoder->integrate_change($change,$changeset);
+}
+
+
+
sub _txn_storage {
my $self = shift;
return $self->state_handle->metadata_storage( $TXN_METATYPE,
Modified: sd/trunk/lib/App/SD/Replica/rt.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/rt.pm (original)
+++ sd/trunk/lib/App/SD/Replica/rt.pm Thu Dec 25 20:56:01 2008
@@ -68,23 +68,6 @@
);
}
}
-
-sub _integrate_change {
- my $self = shift;
- my ( $change, $changeset ) = validate_pos(
- @_,
- { isa => 'Prophet::Change' },
- { isa => 'Prophet::ChangeSet' }
- );
-
- # don't push internal records
- return if $change->record_type =~ /^__/;
-
- require App::SD::Replica::rt::PushEncoder;
- my $recoder = App::SD::Replica::rt::PushEncoder->new( { sync_source => $self } );
- $recoder->integrate_change($change,$changeset);
-}
-
=head2 uuid
Return the replica's UUID
More information about the Bps-public-commit
mailing list