[Bps-public-commit] r12437 - in Prophet/trunk: .

jesse at bestpractical.com jesse at bestpractical.com
Sat May 17 05:30:30 EDT 2008


Author: jesse
Date: Sat May 17 05:30:27 2008
New Revision: 12437

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/Replica/Native.pm

Log:
 r31102 at dhcp113 (orig r12371):  sartak | 2008-05-16 18:05:14 +0900
  r55957 at onn:  sartak | 2008-05-16 05:05:06 -0400
  Implement find_or_create_luid for Native replicas
 


Modified: Prophet/trunk/lib/Prophet/Replica/Native.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/Native.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/Native.pm	Sat May 17 05:30:27 2008
@@ -653,4 +653,22 @@
     return $self->_file_exists( $self->_record_type_root( $args{'type'} ) );
 }
 
+sub _guid2luid_file { "local-id-cache" }
+
+sub _read_guid2luid_mappings {
+    my $self = shift;
+    return from_json($self->_read_file($self->_guid2luid_file), { utf8 => 1 });
+}
+
+sub _write_guid2luid_mappings {
+    my $self = shift;
+    my $map  = shift;
+    my $content = to_json($map, { canonical => 1, pretty => 0, utf8 => 1 });
+
+    $self->_write_file(
+        path    => $self->_guid2luid_file,
+        content => $content,
+    );
+}
+
 1;



More information about the Bps-public-commit mailing list