Commit a9695828 by Don Mitchell

Remove LocMapperStore

LMS-2918
parent a71919ef
......@@ -14,7 +14,6 @@ import django.utils
import re
import threading
from xmodule.modulestore.loc_mapper_store import LocMapperStore
from xmodule.util.django import get_current_request_hostname
import xmodule.modulestore # pylint: disable=unused-import
from xmodule.contentstore.django import contentstore
......@@ -102,36 +101,8 @@ def clear_existing_modulestores():
This is useful for flushing state between unit tests.
"""
global _MIXED_MODULESTORE, _loc_singleton # pylint: disable=global-statement
global _MIXED_MODULESTORE # pylint: disable=global-statement
_MIXED_MODULESTORE = None
# pylint: disable=W0603
cache = getattr(_loc_singleton, "cache", None)
if cache:
cache.clear()
_loc_singleton = None
# singleton instance of the loc_mapper
_loc_singleton = None
def loc_mapper():
"""
Get the loc mapper which bidirectionally maps Locations to Locators. Used like modulestore() as
a singleton accessor.
"""
# pylint: disable=W0603
global _loc_singleton
# pylint: disable=W0212
if _loc_singleton is None:
try:
loc_cache = get_cache('loc_cache')
except InvalidCacheBackendError:
loc_cache = get_cache('default')
# instantiate
_loc_singleton = LocMapperStore(loc_cache, **settings.DOC_STORE_CONFIG)
return _loc_singleton
class ModuleI18nService(object):
......
......@@ -173,7 +173,7 @@ class SplitMigrator(object):
"""
def get_translation(location):
"""
Convert the location and add to loc mapper
Convert the location
"""
return new_course_key.make_usage_key(
location.category,
......@@ -207,7 +207,7 @@ class SplitMigrator(object):
"""
def get_translation(location):
"""
Convert the location and add to loc mapper
Convert the location
"""
return new_course_key.make_usage_key(
location.category,
......
......@@ -5,10 +5,8 @@ Modulestore configuration for test cases.
from uuid import uuid4
from django.test import TestCase
from django.contrib.auth.models import User
from xmodule.modulestore.django import (
modulestore, clear_existing_modulestores, loc_mapper
)
from xmodule.contentstore.django import _CONTENTSTORE
from xmodule.modulestore.django import modulestore, clear_existing_modulestores
from xmodule.modulestore import ModuleStoreEnum
......@@ -197,11 +195,6 @@ class ModuleStoreTestCase(TestCase):
module_store._drop_database() # pylint: disable=protected-access
_CONTENTSTORE.clear()
location_mapper = loc_mapper()
if location_mapper.db:
location_mapper.location_map.drop()
location_mapper.db.connection.close()
@classmethod
def setUpClass(cls):
"""
......
......@@ -33,10 +33,6 @@ Modulestore Helpers
These packages provide utilities for easier use of modulestores,
and migrating data between modulestores.
.. automodule:: xmodule.modulestore.loc_mapper_store
:members:
:show-inheritance:
.. automodule:: xmodule.modulestore.search
:members:
:show-inheritance:
......
......@@ -12,14 +12,6 @@ db.collection_name
```
as in ```db.location_map.ensureIndex({'course_id': 1}{background: true})```
location_map:
=============
```
ensureIndex({'org': 1, 'offering': 1})
ensureIndex({'schema': 1})
```
fs.files:
=========
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment