[openstack-dev] [Swift] code changes feedback

Pecoraro, Alex Alex.Pecoraro at emc.com
Wed Jun 12 20:38:05 UTC 2013


I think I did the patch format correctly this time. So sending again.

Alex

From: Pecoraro, Alex [mailto:Alex.Pecoraro at emc.com]
Sent: Wednesday, June 12, 2013 11:04 AM
To: OpenStack Development Mailing List
Subject: [openstack-dev] [Swift] code changes feedback

Forgot to put the [Swift] on the subject of this email - resubmitting so it doesn't get missed.

From: Pecoraro, Alex
Sent: Wednesday, June 12, 2013 11:02 AM
To: OpenStack Development Mailing List
Subject: code changes feedback

Hi, I've been working on some changes to Swift that I'm not quite done with, but I wanted to request some feedback on the path I'm taking to make sure it is correct/acceptable. My changes don't add any new features per se, their purpose is to make the code a little more flexible so that it is easier to add custom behavior by subclassing base Swift classes and overriding key functions. The reason that I want to do this is so that I can create extensions to Swift either through monkey-patching or some other method that make it possible for Swift to work with Isilon storage devices. The main change that I needed to make was to how nodes are iterated in the proxy server, replicators, updaters, and the container synchronizer. So I created a class called NodeIterator and another class called NodeIteratorFactory, which are used for iterating the primary and handoff nodes rather than simply iterating the list of nodes returned by ring.get_nodes(), ring.get_more_nodes(), etc. So for example, the proxy server the code for iterating through nodes to satisfy a GET request  changes from this:

def GETorHEAD_base(self, req, server_type, ring, partition, path):
...
for node in self.iter_nodes(ring, partition):

to (more or less) this:

def GETorHEAD_base(self, req, server_type, ring, partition, path):
...
node_iter = self.node_iterator_factory.create(ring, part)
for node in node_iter:

My plan is to create a subclass of NodeIteratorFactory and override the create function to have it return a subclass of NodeIterator that iterates the nodes in a way that is compatible with Isilon devices.

I've attached a patch file showing what I've done so far. Please take a look and let me know what you think.

Also, I'm not sure if I created the patch file correctly, it seems to show every change that I've committed rather than just my most recent changes (this is my first time using git). I've been committing locally and then pulling in changes from the origin/source as I go in order to lessen the chance of conflicts. Hopefully that's not too confusing.

Thanks.

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130612/0f804af5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: node_iterator_changes.patch
Type: application/octet-stream
Size: 104380 bytes
Desc: node_iterator_changes.patch
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130612/0f804af5/attachment.obj>


More information about the OpenStack-dev mailing list