summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-03-01 16:20:57 +0000
committerErik Johnston <erik@matrix.org>2018-03-01 16:20:57 +0000
commit1b2af116502e6ebcd2ae24178754145e59ee7c24 (patch)
tree32f36e3df9874953d941747b60a2afed18d9e1ee
parentSplit out stream store (diff)
downloadsynapse-1b2af116502e6ebcd2ae24178754145e59ee7c24.tar.xz
Document abstract class and method better
-rw-r--r--synapse/storage/stream.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index 057f30db33..a2527d2a36 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -148,6 +148,11 @@ def filter_to_clause(event_filter):
 
 
 class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
+    """This is an abstract base class where subclasses must implement
+    `get_room_max_stream_ordering` and `get_room_min_stream_ordering`
+    which can be called in the initializer.
+    """
+
     __metaclass__ = abc.ABCMeta
 
     def __init__(self, db_conn, hs):
@@ -170,6 +175,14 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
 
         self._stream_order_on_start = self.get_room_max_stream_ordering()
 
+    @abc.abstractmethod
+    def get_room_max_stream_ordering(self):
+        raise NotImplementedError()
+
+    @abc.abstractmethod
+    def get_room_min_stream_ordering(self):
+        raise NotImplementedError()
+
     @defer.inlineCallbacks
     def get_room_events_stream_for_rooms(self, room_ids, from_key, to_key, limit=0,
                                          order='DESC'):
@@ -421,14 +434,6 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
             )
             defer.returnValue("t%d-%d" % (topo, token))
 
-    @abc.abstractmethod
-    def get_room_max_stream_ordering(self):
-        raise NotImplementedError()
-
-    @abc.abstractmethod
-    def get_room_min_stream_ordering(self):
-        raise NotImplementedError()
-
     def get_stream_token_for_event(self, event_id):
         """The stream token for an event
         Args: