diff --git a/py/vtdb/db_object_lookup.py b/py/vtdb/db_object_lookup.py index c435044ccc..54abdb9c90 100644 --- a/py/vtdb/db_object_lookup.py +++ b/py/vtdb/db_object_lookup.py @@ -10,7 +10,7 @@ from vtdb import db_object_unsharded class LookupDBObject(db_object_unsharded.DBObjectUnsharded): - """A example implementation of a lookup class stored in an unsharded db.""" + """An implementation of a lookup class stored in an unsharded db.""" @classmethod def get(class_, cursor, entity_id_column, entity_id): diff --git a/py/vtdb/db_object_range_sharded.py b/py/vtdb/db_object_range_sharded.py index f4e97533cb..2f94272a3a 100644 --- a/py/vtdb/db_object_range_sharded.py +++ b/py/vtdb/db_object_range_sharded.py @@ -117,7 +117,7 @@ class DBObjectRangeSharded(db_object.DBObjectBase): entity_id_col = entity_id_map.keys()[0] entity_id = entity_id_map[entity_id_col] - #TODO: the current api means that if a table doesn't have the + # TODO: the current api means that if a table doesn't have the # sharding key column name then it cannot pass in sharding key for # routing purposes. Will this cause extra load on lookup db/cache # ? This is cleaner from a design perspective. @@ -179,6 +179,7 @@ class DBObjectRangeSharded(db_object.DBObjectBase): @classmethod def get_lookup_column_name(class_, column_name): """Return the lookup column name for a column name from this table. + If the entry doesn't exist it is assumed that the column_name is same. """ if class_.column_lookup_name_map is None: @@ -432,13 +433,15 @@ class DBObjectEntityRangeSharded(DBObjectRangeSharded): def insert(class_, cursor_method, **bind_vars): """Creates the lookup relationship and inserts in the primary table. - The creation of the lookup entry also creates the primary key for + The creation of the lookup entry also creates the primary key for the row in the primary table. The lookup relationship is determined by class_.column_lookup_name_map - and the bind variables passed in. There are two types of entities - + and the bind variables passed in. There are two types of entities: + 1. Table for which the entity that is also the primary sharding key for this keyspace. + 2. Entity table that creates a new entity and needs to create a lookup between that entity and sharding key. """ diff --git a/py/vtdb/update_stream.py b/py/vtdb/update_stream.py index 1dfde73491..becdd1a4d4 100644 --- a/py/vtdb/update_stream.py +++ b/py/vtdb/update_stream.py @@ -61,7 +61,7 @@ class StreamEvent(object): class UpdateStreamConnection(object): - """Te interface for the update stream client implementations. + """The interface for the update stream client implementations. All implementations must implement all these methods. If something goes wrong with the connection, this object will be thrown out. diff --git a/py/vtdb/vtgate_cursor.py b/py/vtdb/vtgate_cursor.py index ad56f92ae2..e374e46c6c 100644 --- a/py/vtdb/vtgate_cursor.py +++ b/py/vtdb/vtgate_cursor.py @@ -79,7 +79,7 @@ class VTGateCursor(object): return write_query = bool(write_sql_pattern.match(sql)) - # NOTE: This check may also be done at high-layers but adding it + # NOTE: This check may also be done at higher layers but adding it # here for completion. if write_query: if not self.is_writable(): diff --git a/py/zk/zkjson.py b/py/zk/zkjson.py index 935a72edaf..d316bd0409 100644 --- a/py/zk/zkjson.py +++ b/py/zk/zkjson.py @@ -1,4 +1,4 @@ -"""Implement a sensible wrapper that treats python objects as dictionaries. +"""A sensible wrapper that treats python objects as dictionaries. Has sensible restrictions on serialization. """ diff --git a/py/zk/zkns_query.py b/py/zk/zkns_query.py index 1ed39f2e2a..5ad1c48c16 100644 --- a/py/zk/zkns_query.py +++ b/py/zk/zkns_query.py @@ -1,4 +1,4 @@ -"""zkns - naming service. +"""Zkns naming service. This uses zookeeper to resolve a list of servers to answer a particular query type. @@ -44,7 +44,7 @@ def _sorted_by_srv_priority(entries): priority_map[entry.priority].append(entry) shuffled_entries = [] - for unused_priority, priority_entries in sorted(priority_map.iteritems()): + for _, priority_entries in sorted(priority_map.iteritems()): if len(priority_entries) <= 1: shuffled_entries.extend(priority_entries) continue