[Bps-public-commit] Prophet - A disconnected, replicated p2p database branch, master, updated. 75430ca4ba0c0a08c5f746a81866485d01f6bda9

jesse jesse at bestpractical.com
Sun Jan 18 20:10:35 EST 2009


The branch, master has been updated
       via  75430ca4ba0c0a08c5f746a81866485d01f6bda9 (commit)
      from  0ddf25873263a6294225f86ecf7badc7cfc8d941 (commit)

Summary of changes:
 lib/Prophet/ForeignReplica.pm |    6 ---
 lib/Prophet/Replica.pm        |   76 -----------------------------------------
 2 files changed, 0 insertions(+), 82 deletions(-)

- Log -----------------------------------------------------------------
commit 75430ca4ba0c0a08c5f746a81866485d01f6bda9
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sun Jan 18 19:36:35 2009 -0500

    More moving of local state out of replicated datastore

diff --git a/lib/Prophet/ForeignReplica.pm b/lib/Prophet/ForeignReplica.pm
index 3caaa91..552c4bc 100644
--- a/lib/Prophet/ForeignReplica.pm
+++ b/lib/Prophet/ForeignReplica.pm
@@ -90,12 +90,6 @@ sub prompt_for_login {
     return ( $username, $password );
 }
 
-our $REMOTE_ID_METATYPE = "_remote_id_map";
-
-sub _remote_record_id_storage {
-    my $self = shift;
-    return $self->state_handle->metadata_storage( $REMOTE_ID_METATYPE, 'prophet-uuid' )->(@_);
-}
 
 =head2 has_seen_changeset Prophet::ChangeSet
 
diff --git a/lib/Prophet/Replica.pm b/lib/Prophet/Replica.pm
index 44a0663..fd6ab52 100644
--- a/lib/Prophet/Replica.pm
+++ b/lib/Prophet/Replica.pm
@@ -519,7 +519,6 @@ sub _check_db_uuids_on_merge {
     }
 }
 
-
 =head3 should_send_changeset { to => L<Prophet::Replica>, changeset => L<Prophet::ChangeSet> }
 
 Returns true if the replica C<to> hasn't yet seen the changeset C<changeset>.
@@ -941,81 +940,6 @@ sub record_integration_of_changeset {
     return $self->store_local_metadata('last-changeset-from-'.  $changeset->original_source_uuid => $changeset->original_sequence_no); 
 
 }
-
-=head2 metadata storage routines
-
-=head3 metadata_storage $RECORD_TYPE, $PROPERTY_NAME
-
-Returns a function which takes a UUID and an optional value to get (or set)
-metadata rows in a metadata table. We use this to record things like merge
-tickets.
-
-=cut
-
-sub metadata_storage {
-    my $self = shift;
-    my ( $type, $prop_name ) = validate_pos( @_, 1, 1 );
-    return sub {
-        my $uuid = shift;
-        if (@_) {
-            return $self->_record_metadata_for( $type, $uuid, $prop_name, @_ );
-        }
-        return $self->_retrieve_metadata_for( $type, $uuid, $prop_name );
-
-    };
-}
-
-=head3 _retrieve_metadata_for $RECORD_TYPE, $UUID, $PROPERTY_NAME
-
-Takes a record type, a UUID, and a metadata property name, and returns the
-value of C<$PROPERTY_NAME> for that record. Intended for use with
-metadata / state replicas.
-
-Returns undef if the record cannot be loaded.
-
-=cut
-
-sub _retrieve_metadata_for {
-    my $self = shift;
-    my ( $name, $source_uuid, $prop_name ) = validate_pos( @_, 1, 1, 1 );
-
-    require Prophet::Record;
-    my $entry = Prophet::Record->new( handle => $self, type => $name );
-    unless ( $entry->load( uuid => $source_uuid )) {
-        return undef;
-    }
-    return $entry->prop($prop_name);
-}
-
-=head3 _record_metadata_for NAME, UUID, PROP, CONTENT
-
-Stores CONTENT in the record UUID's PROP property. Intended for storing
-metadata in metadata / state replicas.
-
-=cut
-
-sub _record_metadata_for {
-    my $self = shift;
-    my ( $name, $source_uuid, $prop_name, $content )
-        = validate_pos( @_, 1, 1, 1, 1 );
-    $self->log_debug( "Storing $content in $prop_name for $name " . substr( $source_uuid, 0, 6 ) );
-
-    if ( !$self->record_exists( type => $name, uuid => $source_uuid ) ) {
-        $self->log_debug( "I don't have a $name for " . substr( $source_uuid, 0, 6 ) . "Creating it" );
-        $self->create_record(
-            uuid => $source_uuid,
-            type => $name, props => { $prop_name => $content }
-        );
-    } else {
-        $self->log_debug( "Setting $prop_name to $content for $name for " . substr( $source_uuid, 0, 6 ) );
-        $self->set_record_props(
-            uuid  => $source_uuid,
-            type  => $name,
-            props => { $prop_name => $content }
-        );
-    }
-}
-
 =head2 routines which need to be implemented by any Prophet backend store
 
 =head3 uuid

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list