wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r18571: LJSUP-8192. Change memcache keys.

Committer: gprochaev
LJSUP-8192. Change memcache keys.

U   trunk/cgi-bin/LJ/Browse.pm
U   trunk/cgi-bin/LJ/Vertical.pm
Modified: trunk/cgi-bin/LJ/Browse.pm
===================================================================
--- trunk/cgi-bin/LJ/Browse.pm	2011-03-16 05:21:48 UTC (rev 18570)
+++ trunk/cgi-bin/LJ/Browse.pm	2011-03-16 05:28:52 UTC (rev 18571)
@@ -117,7 +117,7 @@
     if ($parent) {
         $parent->clear_props_memcache;
     } else {
-        LJ::MemCache::delete("category_top");
+        LJ::MemCache::delete("category_top2");
     }
 
     $self = $class->new( catid => $catid );
@@ -152,7 +152,7 @@
         $parent->clear_props_memcache;
     # if top-level category clear top-level category cache
     } else {
-        LJ::MemCache::delete("category_top");
+        LJ::MemCache::delete("category_top2");
     }
 
     # clear memcache of the category and its props
@@ -287,7 +287,7 @@
 
     my @cats;
     # check memcache for data
-    my $memval = LJ::MemCache::get("category_top");
+    my $memval = LJ::MemCache::get("category_top2");
     if ($memval) {
         foreach my $id (@$memval) {
             my $c = $class->new( catid => $id );
@@ -314,7 +314,7 @@
         push @{$catids}, $row->{catid};
         push @cats, $c if $c;
     }
-    LJ::MemCache::set("category_top", $catids);
+    LJ::MemCache::set("category_top2", $catids);
 
     # Subcategories
     #
@@ -454,39 +454,39 @@
 
     my $v = $args{'vertical'};
 
-    return [ $v, "catall:".$v->vert_id ] if $v;
-    return "cat:all";
+    return [ $v, "catall2:".$v->vert_id ] if $v;
+    return "cat:all2";
 }
 
 sub memkey_catid {
     my $self = shift;
     my $id = shift;
 
-    return [ $id, "cat:$id" ] if $id;
-    return [ $self->{catid}, "cat:$self->{catid}" ];
+    return [ $id, "cat2:$id" ] if $id;
+    return [ $self->{catid}, "cat2:$self->{catid}" ];
 }
 
 sub memkey_catid_props {
     my $self = shift;
     my $id = shift;
 
-    return [ $id, "cat:props:$id" ] if $id;
-    return [ $self->{catid}, "cat:props:$self->{catid}" ];
+    return [ $id, "cat2:props:$id" ] if $id;
+    return [ $self->{catid}, "cat2:props:$self->{catid}" ];
 }
 
 sub memkey_catid_journals {
     my $self = shift;
     my $id = shift;
 
-    return [ $id, "cat:journals:$id" ] if $id;
-    return [ $self->{catid}, "cat:journals:$self->{catid}" ];
+    return [ $id, "cat2:journals:$id" ] if $id;
+    return [ $self->{catid}, "cat2:journals:$self->{catid}" ];
 }
 
 sub memkey_caturi {
     my $self = shift;
     my $uri = shift;
 
-    return "caturi:$uri";
+    return "caturi2:$uri";
 }
 
 sub set_memcache {
@@ -593,7 +593,7 @@
 
     # now which of the objects to load did we get a memcache key for?
     foreach my $obj (@to_load) {
-        my $row = $memc->{"cat:$obj->{catid}"};
+        my $row = $memc->{"cat2:$obj->{catid}"};
         next unless $row;
 
         $obj->absorb_row($row);
@@ -674,7 +674,7 @@
 
     # now which of the objects to load did we get a memcache key for?
     foreach my $obj (@to_load) {
-        my $row = $memc->{"cat:props:$obj->{catid}"};
+        my $row = $memc->{"cat2:props:$obj->{catid}"};
         next unless $row;
 
         $obj->absorb_prop_row($row);

Modified: trunk/cgi-bin/LJ/Vertical.pm
===================================================================
--- trunk/cgi-bin/LJ/Vertical.pm	2011-03-16 05:21:48 UTC (rev 18570)
+++ trunk/cgi-bin/LJ/Vertical.pm	2011-03-16 05:28:52 UTC (rev 18571)
@@ -868,39 +868,39 @@
 sub memkey_vertall {
     my $class = shift;
 
-    return "vert:all";
+    return "vert3:all";
 }
 
 sub memkey_vertid {
     my $self = shift;
     my $id = shift;
 
-    return [ $id, "vert2:$id" ] if $id;
-    return [ $self->{vert_id}, "vert2:$self->{vert_id}" ];
+    return [ $id, "vert3:$id" ] if $id;
+    return [ $self->{vert_id}, "vert3:$self->{vert_id}" ];
 }
 
 sub memkey_vertname {
     my $self = shift;
     my $name = shift;
 
-    return "vertname2:$name" if $name;
-    return "vertname2:$self->{name}";
+    return "vertname3:$name" if $name;
+    return "vertname3:$self->{name}";
 }
 
 sub memkey_verturl {
     my $self = shift;
     my $url = shift;
 
-    return "vertname2:$url" if $url;
-    return "vertname2:$self->{url}";
+    return "vertname3:$url" if $url;
+    return "vertname3:$self->{url}";
 }
 
 sub memkey_rules {
     my $self = shift;
     my $id = shift;
 
-    return [ $id, "vertrules2:$id" ] if $id;
-    return [ $self->{vertid}, "vertrules2:$self->{vertid}" ];
+    return [ $id, "vertrules3:$id" ] if $id;
+    return [ $self->{vertid}, "vertrules3:$self->{vertid}" ];
 }
 
 sub set_memcache {
@@ -928,7 +928,7 @@
 
 sub entries_memkey {
     my $self = shift;
-    return [ $self->{vertid}, "vertentries2:$self->{vertid}" ];
+    return [ $self->{vertid}, "vertentries3:$self->{vertid}" ];
 }
 
 sub clear_entries_memcache {
@@ -1007,7 +1007,7 @@
     my $memc = LJ::MemCache::get_multi(@mem_keys);
     # now which of the objects to load did we get a memcache key for?
     foreach my $obj (@to_load) {
-        my $row = $memc->{"vert2:$obj->{vert_id}"};
+        my $row = $memc->{"vert3:$obj->{vert_id}"};
         next unless $row;
 
         $obj->absorb_row($row);

Tags: livejournal, pm, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments