[Bps-public-commit] r12371 - in Prophet/branches/luid: lib/Prophet/Replica

sartak at bestpractical.com sartak at bestpractical.com
Fri May 16 05:05:15 EDT 2008


Author: sartak
Date: Fri May 16 05:05:14 2008
New Revision: 12371

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

Log:
 r55957 at onn:  sartak | 2008-05-16 05:05:06 -0400
 Implement find_or_create_luid for Native replicas


Modified: Prophet/branches/luid/lib/Prophet/Replica/Native.pm
==============================================================================
--- Prophet/branches/luid/lib/Prophet/Replica/Native.pm	(original)
+++ Prophet/branches/luid/lib/Prophet/Replica/Native.pm	Fri May 16 05:05:14 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