[Bps-public-commit] SD - A distributed issue tracker branch, master, updated. 9d5880914f5a28613ac75cc3342e06f81f4ff746

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


The branch, master has been updated
       via  9d5880914f5a28613ac75cc3342e06f81f4ff746 (commit)
      from  6db0f12c5c99ea7afde41bb42a5fce3174fe1865 (commit)

Summary of changes:
 lib/App/SD/ForeignReplica.pm |   18 +++++++-----------
 lib/App/SD/Server/View.pm    |    2 +-
 2 files changed, 8 insertions(+), 12 deletions(-)

- Log -----------------------------------------------------------------
commit 9d5880914f5a28613ac75cc3342e06f81f4ff746
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sun Jan 18 20:10:03 2009 -0500

    Switch to using the new metadata storage engine in Prophet

diff --git a/lib/App/SD/ForeignReplica.pm b/lib/App/SD/ForeignReplica.pm
index 5008196..698bb53 100644
--- a/lib/App/SD/ForeignReplica.pm
+++ b/lib/App/SD/ForeignReplica.pm
@@ -36,12 +36,6 @@ sub integrate_change {
 
 
 
-my $TXN_METATYPE = 'txns-pushed-to-foreign-dbs';
-sub _foreign_txn_id_storage {
-    my $self = shift;
-    return $self->state_handle->metadata_storage( $TXN_METATYPE, 'prophet-txn-source' );
-}
-
 =head2 record_pushed_transaction $foreign_transaction_id, $changeset
 
 Record that this replica was the original source of $foreign_transaction_id (with changeset $changeset)
@@ -53,8 +47,8 @@ sub record_pushed_transaction {
     my %args = validate( @_,
         { transaction => 1, changeset => { isa => 'Prophet::ChangeSet' }, record => 1 } );
 
-    $self->_foreign_txn_id_storage->(
-        $self->uuid . '-record-'.$args{record}. '-txn-' . $args{transaction},
+    $self->state_handle->store_local_metadata(
+        "foreign-txn-from-".$self->uuid . '-record-'.$args{record}. '-txn-' . $args{transaction} => 
         join( ':',
             $args{changeset}->original_source_uuid,
             $args{changeset}->original_sequence_no )
@@ -82,7 +76,7 @@ remote replica when doing a subsequent pull
 sub foreign_transaction_originated_locally {
     my $self = shift;
     my ($id, $record) = validate_pos( @_, 1, 1);
-    return $self->_foreign_txn_id_storage->( $self->uuid .'-record-'.$record. '-txn-' .$id );
+    return $self->state_handle->fetch_local_metadata("foreign-txn-from-". $self->uuid .'-record-'.$record. '-txn-' .$id );
 }
 
 sub traverse_changesets {
@@ -124,7 +118,9 @@ sub _lookup_uuid_for_remote_id {
     my $self = shift;
     my ($id) = validate_pos( @_, 1 );
 
-    return $self->_remote_record_id_storage(
+
+
+    return $self->state_handle->fetch_local_metadata('local_uuid_for_'.  
         $self->uuid_for_url( $self->remote_url . $self->remote_uri_path_for_id($id))
     );
 }
@@ -132,7 +128,7 @@ sub _lookup_uuid_for_remote_id {
 sub _set_uuid_for_remote_id {
     my $self = shift;
     my %args = validate( @_, { uuid => 1, remote_id => 1 } );
-    return $self->_remote_record_id_storage(
+    return $self->state_handle->store_local_metadata('local_uuid_for_'.
         $self->uuid_for_url(
                   $self->remote_url
                 . $self->remote_uri_path_for_id( $args{'remote_id'} )
diff --git a/lib/App/SD/Server/View.pm b/lib/App/SD/Server/View.pm
index ef4951d..624197d 100644
--- a/lib/App/SD/Server/View.pm
+++ b/lib/App/SD/Server/View.pm
@@ -449,7 +449,7 @@ outs("SD $App::SD::VERSION - Issue tracking for the distributed age - ".
 template header => sub {
     my $self = shift;
     my $title = shift;
-    outs_raw($self->nav->render_as_menubar);
+    outs_raw($self->nav->render_as_menubar) if ($self->nav);
     div { class is 'project-name';
             "SD for ".$self->app_handle->setting( label => 'project_name' )->get()->[0]};
     h1 { $title };

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



More information about the Bps-public-commit mailing list