diff options
author | Prashanth Pai <ppai@redhat.com> | 2016-02-23 14:58:06 +0530 |
---|---|---|
committer | Thiago da Silva <thiago@redhat.com> | 2016-04-04 09:24:42 -0700 |
commit | c73037e90c3f551caf18df41efd7fa9750454a10 (patch) | |
tree | 4d9120b70d2e83d7240130522893986aaf9c0118 /gluster/swift/common/constraints.py | |
parent | 539d20e3b13096cfa9107fc2b619943c494c4ab3 (diff) |
Don't fetch metadata for plain container listing
Fetch metadata (xattr) for containers in an account ONLY when the client
asks for it (using content-type indicating JSON or XML response).
This avoids a lot of unnecessarry stat() and getxattr() calls whose
results would anyways be unused. The performance gain is obvious in this
case.
This change is restricted to container listing. The same can be extended
to object listing as well (will be sent as a separate change)
Change-Id: Ibff1c5a90519f11053c0b651d8ea3385dda43a2f
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Reviewed-on: http://review.gluster.org/13497
Reviewed-by: Thiago da Silva <thiago@redhat.com>
Tested-by: Thiago da Silva <thiago@redhat.com>
Diffstat (limited to 'gluster/swift/common/constraints.py')
-rw-r--r-- | gluster/swift/common/constraints.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gluster/swift/common/constraints.py b/gluster/swift/common/constraints.py index 7979b43..98e2a27 100644 --- a/gluster/swift/common/constraints.py +++ b/gluster/swift/common/constraints.py @@ -97,3 +97,8 @@ __Ring = _ring.Ring # Replace the original Ring class _ring.Ring = ring.Ring + +# Monkey patch account_listing_response +import swift.account.utils +from gluster.swift.account.utils import account_listing_response as gf_als +swift.account.utils.account_listing_response = gf_als |