summaryrefslogtreecommitdiffstats
path: root/gluster/swift/common/DiskDir.py
diff options
context:
space:
mode:
authorLuis Pabon <lpabon@redhat.com>2013-07-26 15:56:26 -0400
committerPeter Portante <pportant@redhat.com>2013-07-29 08:21:10 -0700
commit5c69ad3da1375635a068ec0d7b1ea7103abd5d44 (patch)
treeda61801034646ca5cbc0c74421e116a0f633773d /gluster/swift/common/DiskDir.py
parent81bb4c40724030c34d817a8a47b4e4d0cbea0312 (diff)
perf: Container and account performance inc
* Container and accounts performance increase by removing the need to update either the object count or the container count, respectively. New hidden configuratoins added to re-enable the functionality. * object_only configuratoin removed from fs.conf and replaced with a hidden configuration. The new hidden configuration reports gratuituosly crated directories as objects, to support a compatibility behavior with previous version 1.4.8 (even though it was incorrect). BUG 988969: https://bugzilla.redhat.com/show_bug.cgi?id=988969 Change-Id: Idca20b8629ec38606ff5692fe62bc2cadabffc86 Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5403 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
Diffstat (limited to 'gluster/swift/common/DiskDir.py')
-rw-r--r--gluster/swift/common/DiskDir.py21
1 files changed, 4 insertions, 17 deletions
diff --git a/gluster/swift/common/DiskDir.py b/gluster/swift/common/DiskDir.py
index b4a8341..77e87dc 100644
--- a/gluster/swift/common/DiskDir.py
+++ b/gluster/swift/common/DiskDir.py
@@ -373,7 +373,7 @@ class DiskDir(DiskCommon):
# test cases working for now.
if e.errno != errno.ENOENT:
raise
- if Glusterfs.OBJECT_ONLY and metadata \
+ if not Glusterfs._implicit_dir_objects and metadata \
and metadata[X_CONTENT_TYPE] == DIR_TYPE \
and not dir_is_object(metadata):
continue
@@ -412,16 +412,8 @@ class DiskDir(DiskCommon):
reported_put_timestamp, reported_delete_timestamp,
reported_object_count, and reported_bytes_used.
"""
- if self._dir_exists:
- if not Glusterfs.OBJECT_ONLY:
- # If we are not configured for object only environments,
- # we should update the object counts in case they changed
- # behind our back.
- self._update_object_count()
- else:
- # FIXME: to facilitate testing, we need to update all
- # the time
- self._update_object_count()
+ if self._dir_exists and Glusterfs._container_update_object_count:
+ self._update_object_count()
data = {'account': self.account, 'container': self.container,
'object_count': self.metadata.get(
@@ -697,12 +689,7 @@ class DiskAccount(DiskCommon):
delete_timestamp, container_count, object_count,
bytes_used, hash, id
"""
- if not Glusterfs.OBJECT_ONLY:
- # If we are not configured for object only environments, we should
- # update the container counts in case they changed behind our back.
- self._update_container_count()
- else:
- # FIXME: to facilitate testing, we need to update all the time
+ if Glusterfs._account_update_container_count:
self._update_container_count()
data = {'account': self.account, 'created_at': '1',