Move storage classes into a main "data store".

This is in preparation for having multiple data stores that offer
different functionality, e.g. splitting out state or event storage.
This commit is contained in:
Erik Johnston 2019-10-21 12:56:42 +01:00
parent 1ee97cbd01
commit c66a06ac6b
266 changed files with 4509 additions and 4331 deletions

View file

@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from synapse import storage
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.storage.data_stores.main import stats
from tests import unittest
@ -87,10 +87,10 @@ class StatsRoomTests(unittest.HomeserverTestCase):
)
def _get_current_stats(self, stats_type, stat_id):
table, id_col = storage.stats.TYPE_TO_TABLE[stats_type]
table, id_col = stats.TYPE_TO_TABLE[stats_type]
cols = list(storage.stats.ABSOLUTE_STATS_FIELDS[stats_type]) + list(
storage.stats.PER_SLICE_FIELDS[stats_type]
cols = list(stats.ABSOLUTE_STATS_FIELDS[stats_type]) + list(
stats.PER_SLICE_FIELDS[stats_type]
)
end_ts = self.store.quantise_stats_time(self.reactor.seconds() * 1000)

View file

@ -24,7 +24,7 @@ from twisted.internet import defer
from synapse.appservice import ApplicationService, ApplicationServiceState
from synapse.config._base import ConfigError
from synapse.storage.appservice import (
from synapse.storage.data_stores.main.appservice import (
ApplicationServiceStore,
ApplicationServiceTransactionStore,
)

View file

@ -50,6 +50,8 @@ class CleanupExtremBackgroundUpdateStoreTestCase(HomeserverTestCase):
schema_path = os.path.join(
prepare_database.dir_path,
"data_stores",
"main",
"schema",
"delta",
"54",

View file

@ -16,7 +16,7 @@
from twisted.internet import defer
from synapse.storage.profile import ProfileStore
from synapse.storage.data_stores.main.profile import ProfileStore
from synapse.types import UserID
from tests import unittest

View file

@ -15,7 +15,7 @@
from twisted.internet import defer
from synapse.storage import UserDirectoryStore
from synapse.storage.data_stores.main.user_directory import UserDirectoryStore
from tests import unittest
from tests.utils import setup_test_homeserver