File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,26 +71,12 @@ class _repl_status(enum.Enum): # noqa: N801
7171
7272
7373def REPLICA_NUMBER_SORT_KEY_FN (row ): # noqa: N802
74- """Key function to sort replica on replica number (numerically).
75-
76- Args:
77- row - an element within a collection to be sorted. This row represents a replica query result from the database.
78-
79- Returns:
80- A key for the "row" which conforms to the same ordering as its replica_number attribute, considered as an integer.
81- """
74+ """Key function to sort replica results on replica number."""
8275 return row [DataObject .replica_number ]
8376
8477
8578def REPLICA_FITNESS_SORT_KEY_FN (row ): # noqa: N802
86- """Key function to sort replica results according to a "fitness" strategy; with the most recent good replicas first in the order.
87-
88- Args:
89- row - an element within a collection to be sorted. This row represents a replica query result from the database.
90-
91- Returns:
92- A key for the "row" which conforms to the same ordering as the tuple: (replica_goodness(row), age_of_last_modification(row)).
93- """
79+ """Key function to sort replica results first on replica quality, then on age of modification timestamp ."""
9480 repl_status = int (row [DataObject .replica_status ])
9581
9682 repl_status_rank = _REPL_STATUSES .index (repl_status ) if _REPL_STATUSES .count (repl_status ) else sys .maxsize
You can’t perform that action at this time.
0 commit comments