зеркало из https://github.com/github/vitess-gh.git
Make more python comment-fixes to address @michael-berlin feedback.
This commit is contained in:
Родитель
f7acc092c4
Коммит
43d3c440f8
|
@ -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):
|
||||
|
|
|
@ -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.
|
||||
"""
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -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.
|
||||
"""
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче