Changeset View
Changeset View
Standalone View
Standalone View
swh/objstorage/__init__.py
# Copyright (C) 2016 The Software Heritage developers | # Copyright (C) 2016 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from .objstorage import ObjStorage | from swh.objstorage.objstorage import ObjStorage, ID_HASH_LENGTH # noqa | ||||
from .objstorage_pathslicing import PathSlicingObjStorage | from swh.objstorage.backends.pathslicing import PathSlicingObjStorage | ||||
from .objstorage_in_memory import InMemoryObjStorage | from swh.objstorage.backends.in_memory import InMemoryObjStorage | ||||
from .api.client import RemoteObjStorage | from swh.objstorage.api.client import RemoteObjStorage | ||||
from .multiplexer import MultiplexerObjStorage, StripingObjStorage | from swh.objstorage.multiplexer import ( | ||||
from .multiplexer.filter import add_filters | MultiplexerObjStorage, StripingObjStorage) | ||||
from swh.objstorage.multiplexer.filter import add_filters | |||||
from swh.objstorage.objstorage_weed import WeedObjStorage | from swh.objstorage.backends.seaweed import WeedObjStorage | ||||
__all__ = ['get_objstorage', 'ObjStorage'] | __all__ = ['get_objstorage', 'ObjStorage'] | ||||
_STORAGE_CLASSES = { | _STORAGE_CLASSES = { | ||||
'pathslicing': PathSlicingObjStorage, | 'pathslicing': PathSlicingObjStorage, | ||||
'remote': RemoteObjStorage, | 'remote': RemoteObjStorage, | ||||
'memory': InMemoryObjStorage, | 'memory': InMemoryObjStorage, | ||||
'weed': WeedObjStorage, | 'weed': WeedObjStorage, | ||||
} | } | ||||
_STORAGE_CLASSES_MISSING = { | _STORAGE_CLASSES_MISSING = { | ||||
} | } | ||||
try: | try: | ||||
from swh.objstorage.cloud.objstorage_azure import ( | from swh.objstorage.backends.azure import ( | ||||
AzureCloudObjStorage, | AzureCloudObjStorage, | ||||
PrefixedAzureCloudObjStorage, | PrefixedAzureCloudObjStorage, | ||||
) | ) | ||||
_STORAGE_CLASSES['azure'] = AzureCloudObjStorage | _STORAGE_CLASSES['azure'] = AzureCloudObjStorage | ||||
_STORAGE_CLASSES['azure-prefixed'] = PrefixedAzureCloudObjStorage | _STORAGE_CLASSES['azure-prefixed'] = PrefixedAzureCloudObjStorage | ||||
except ImportError as e: | except ImportError as e: | ||||
_STORAGE_CLASSES_MISSING['azure'] = e.args[0] | _STORAGE_CLASSES_MISSING['azure'] = e.args[0] | ||||
_STORAGE_CLASSES_MISSING['azure-prefixed'] = e.args[0] | _STORAGE_CLASSES_MISSING['azure-prefixed'] = e.args[0] | ||||
try: | try: | ||||
from swh.objstorage.objstorage_rados import RADOSObjStorage | from swh.objstorage.backends.rados import RADOSObjStorage | ||||
_STORAGE_CLASSES['rados'] = RADOSObjStorage | _STORAGE_CLASSES['rados'] = RADOSObjStorage | ||||
except ImportError as e: | except ImportError as e: | ||||
_STORAGE_CLASSES_MISSING['rados'] = e.args[0] | _STORAGE_CLASSES_MISSING['rados'] = e.args[0] | ||||
try: | try: | ||||
from swh.objstorage.cloud.objstorage_cloud import ( | from swh.objstorage.backends.libcloud import ( | ||||
AwsCloudObjStorage, | AwsCloudObjStorage, | ||||
OpenStackCloudObjStorage, | OpenStackCloudObjStorage, | ||||
) | ) | ||||
_STORAGE_CLASSES['s3'] = AwsCloudObjStorage | _STORAGE_CLASSES['s3'] = AwsCloudObjStorage | ||||
_STORAGE_CLASSES['swift'] = OpenStackCloudObjStorage | _STORAGE_CLASSES['swift'] = OpenStackCloudObjStorage | ||||
except ImportError as e: | except ImportError as e: | ||||
_STORAGE_CLASSES_MISSING['s3'] = e.args[0] | _STORAGE_CLASSES_MISSING['s3'] = e.args[0] | ||||
_STORAGE_CLASSES_MISSING['swift'] = e.args[0] | _STORAGE_CLASSES_MISSING['swift'] = e.args[0] | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |