Changeset View
Changeset View
Standalone View
Standalone View
swh/objstorage/multiplexer/striping_objstorage.py
# Copyright (C) 2018-2020 The Software Heritage developers | # Copyright (C) 2018-2020 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 collections import defaultdict | from collections import defaultdict | ||||
import queue | import queue | ||||
from .multiplexer_objstorage import ObjStorageThread, MultiplexerObjStorage | from swh.objstorage.multiplexer.multiplexer_objstorage import ( | ||||
ObjStorageThread, | |||||
MultiplexerObjStorage, | |||||
) | |||||
class StripingObjStorage(MultiplexerObjStorage): | class StripingObjStorage(MultiplexerObjStorage): | ||||
"""Stripes objects across multiple objstorages | """Stripes objects across multiple objstorages | ||||
This objstorage implementation will write objects to objstorages in a | This objstorage implementation will write objects to objstorages in a | ||||
predictable way: it takes the modulo of the last 8 bytes of the object | predictable way: it takes the modulo of the last 8 bytes of the object | ||||
identifier with the number of object storages passed, which will yield an | identifier with the number of object storages passed, which will yield an | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |