Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Issue 10828235: Extensions Docs Server: Efficient MemcacheFileSystem (Closed)

Created:
8 years, 4 months ago by cduvall
Modified:
8 years, 4 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip-chromium-reviews_chromium.org
Visibility:
Public.

Description

Extensions Docs Server: Efficient MemcacheFileSystem MemcacheFileSystem will now use viewvc for statting, and will stat all the children of a directory. BUG=140262 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=151513

Patch Set 1 : #

Total comments: 8

Patch Set 2 : Tests! #

Total comments: 35

Patch Set 3 : fixes #

Total comments: 6

Patch Set 4 : fixes and comments #

Messages

Total messages: 10 (0 generated)
cduvall
I wanted you to look at this CL, just to make sure I'm on the ...
8 years, 4 months ago (2012-08-09 20:56:17 UTC) #1
not at google - send to devlin
yep, looking good. http://codereview.chromium.org/10828235/diff/2001/chrome/common/extensions/docs/server2/file_system.py File chrome/common/extensions/docs/server2/file_system.py (right): http://codereview.chromium.org/10828235/diff/2001/chrome/common/extensions/docs/server2/file_system.py#newcode45 chrome/common/extensions/docs/server2/file_system.py:45: of the directory. This would be ...
8 years, 4 months ago (2012-08-10 06:42:24 UTC) #2
not at google - send to devlin
(that was easier than I thought it would be. nice)
8 years, 4 months ago (2012-08-10 06:42:47 UTC) #3
cduvall
Tests are in, this ones ready. https://chromiumcodereview.appspot.com/10828235/diff/2001/chrome/common/extensions/docs/server2/file_system.py File chrome/common/extensions/docs/server2/file_system.py (right): https://chromiumcodereview.appspot.com/10828235/diff/2001/chrome/common/extensions/docs/server2/file_system.py#newcode45 chrome/common/extensions/docs/server2/file_system.py:45: of the directory. ...
8 years, 4 months ago (2012-08-11 00:15:23 UTC) #4
not at google - send to devlin
sweet https://chromiumcodereview.appspot.com/10828235/diff/5002/chrome/common/extensions/docs/server2/fake_url_fetcher.py File chrome/common/extensions/docs/server2/fake_url_fetcher.py (right): https://chromiumcodereview.appspot.com/10828235/diff/5002/chrome/common/extensions/docs/server2/fake_url_fetcher.py#newcode25 chrome/common/extensions/docs/server2/fake_url_fetcher.py:25: return self._ReadFile(directory[:-1]) How can _ListDir be passed something ...
8 years, 4 months ago (2012-08-13 05:34:15 UTC) #5
cduvall
https://chromiumcodereview.appspot.com/10828235/diff/5002/chrome/common/extensions/docs/server2/fake_url_fetcher.py File chrome/common/extensions/docs/server2/fake_url_fetcher.py (right): https://chromiumcodereview.appspot.com/10828235/diff/5002/chrome/common/extensions/docs/server2/fake_url_fetcher.py#newcode25 chrome/common/extensions/docs/server2/fake_url_fetcher.py:25: return self._ReadFile(directory[:-1]) On 2012/08/13 05:34:15, kalman wrote: > How ...
8 years, 4 months ago (2012-08-13 19:45:44 UTC) #6
not at google - send to devlin
lgtm but please look at the pickle thing. http://codereview.chromium.org/10828235/diff/5002/chrome/common/extensions/docs/server2/memcache_file_system.py File chrome/common/extensions/docs/server2/memcache_file_system.py (right): http://codereview.chromium.org/10828235/diff/5002/chrome/common/extensions/docs/server2/memcache_file_system.py#newcode31 chrome/common/extensions/docs/server2/memcache_file_system.py:31: stat_info ...
8 years, 4 months ago (2012-08-13 23:02:14 UTC) #7
not at google - send to devlin
http://codereview.chromium.org/10828235/diff/1013/chrome/common/extensions/docs/server2/subversion_file_system.py File chrome/common/extensions/docs/server2/subversion_file_system.py (right): http://codereview.chromium.org/10828235/diff/1013/chrome/common/extensions/docs/server2/subversion_file_system.py#newcode56 chrome/common/extensions/docs/server2/subversion_file_system.py:56: break On 2012/08/13 23:02:14, kalman wrote: > Exceptions aren't ...
8 years, 4 months ago (2012-08-14 04:00:08 UTC) #8
cduvall
https://chromiumcodereview.appspot.com/10828235/diff/5002/chrome/common/extensions/docs/server2/memcache_file_system.py File chrome/common/extensions/docs/server2/memcache_file_system.py (right): https://chromiumcodereview.appspot.com/10828235/diff/5002/chrome/common/extensions/docs/server2/memcache_file_system.py#newcode31 chrome/common/extensions/docs/server2/memcache_file_system.py:31: stat_info = self.StatInfo(version, {}) On 2012/08/13 23:02:14, kalman wrote: ...
8 years, 4 months ago (2012-08-14 18:15:00 UTC) #9
not at google - send to devlin
8 years, 4 months ago (2012-08-15 05:24:05 UTC) #10
https://chromiumcodereview.appspot.com/10828235/diff/5002/chrome/common/exten...
File chrome/common/extensions/docs/server2/memcache_file_system.py (right):

https://chromiumcodereview.appspot.com/10828235/diff/5002/chrome/common/exten...
chrome/common/extensions/docs/server2/memcache_file_system.py:31: stat_info =
self.StatInfo(version, {})
On 2012/08/14 18:15:00, cduvall wrote:
> On 2012/08/13 23:02:14, kalman wrote:
> > On 2012/08/13 19:45:45, cduvall wrote:
> > > On 2012/08/13 05:34:15, kalman wrote:
> > > > memcache can store arbitrary objects, I believe. If you store the
StatInfo
> > > > object in memcache rather than just the version then you won't need to
> > > construct
> > > > this fake (and incorrect) {} object.
> > > 
> > > Memcache can store dictionaries, but not objects. They need to have a
pickle
> > > method I believe. I changed this to use None instead of {}, which I think
is
> a
> > > little less confusing.
> > 
> > I just checked and it looks like pickle can handle at least simple objects
(I
> > tested objects with simple and list fields). So... let's at least try it.
> > 
> > Here is my output from the python console, by the way:
> > 
> > > python
> > Python 2.7.3 (default, Apr 13 2012, 00:05:08) 
> > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> class Foo(object):
> > ...   def __init__(self, x, xs):
> > ...     self.x = x
> > ...     self.xs = xs
> > ... 
> > >>> f1 = Foo(10, [1,2,3])
> > >>> import pickle
> > >>> f2 = pickle.loads(pickle.dumps(f1))
> > >>> f1 == f2
> > False
> > >>> f2.x
> > 10
> > >>> f2.xs
> > [1, 2, 3]
> > >>> 
> 
> Aha! The problem with pickle was nested classes. It can't pickle a nested
class.
> Here's my output:
> "PicklingError: Can't pickle <class 'file_system.StatInfo'>: attribute lookup
> file_system.StatInfo failed"
> 
> I'm going to leave this just storing the version for now, and I can change it
> later if we want.

Ok, let's un-nest StatInfo then (or figure out how to make pickle work).

Powered by Google App Engine
This is Rietveld 408576698