Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/storage.py
# Copyright (C) 2015 The Software Heritage developers | # Copyright (C) 2015 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 datetime | import datetime | ||||
import functools | import functools | ||||
import itertools | import itertools | ||||
import dateutil.parser | import dateutil.parser | ||||
import psycopg2 | import psycopg2 | ||||
from . import converters | from . import converters | ||||
from .db import Db | from .db import Db | ||||
from .objstorage import PathSlicingObjStorage | from .exc import StorageDBError | ||||
from .exc import ObjNotFoundError, StorageDBError | |||||
from swh.core.hashutil import ALGORITHMS | from swh.core.hashutil import ALGORITHMS | ||||
from swh.objstorage import PathSlicingObjStorage | |||||
from swh.objstorage.exc import ObjNotFoundError | |||||
# Max block size of contents to return | # Max block size of contents to return | ||||
BULK_BLOCK_CONTENT_LEN_MAX = 10000 | BULK_BLOCK_CONTENT_LEN_MAX = 10000 | ||||
def db_transaction(meth): | def db_transaction(meth): | ||||
"""decorator to execute Storage methods within DB transactions | """decorator to execute Storage methods within DB transactions | ||||
▲ Show 20 Lines • Show All 1,069 Lines • Show Last 20 Lines |