Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/in_memory.py
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | def reset(self): | ||||
self._metadata_fetchers: Dict[FetcherKey, MetadataFetcher] = {} | self._metadata_fetchers: Dict[FetcherKey, MetadataFetcher] = {} | ||||
self._metadata_authorities: Dict[Hashable, MetadataAuthority] = {} | self._metadata_authorities: Dict[Hashable, MetadataAuthority] = {} | ||||
self._objects = defaultdict(list) | self._objects = defaultdict(list) | ||||
self._sorted_sha1s = SortedList[bytes, bytes]() | self._sorted_sha1s = SortedList[bytes, bytes]() | ||||
self.objstorage = ObjStorage({"cls": "memory", "args": {}}) | self.objstorage = ObjStorage({"cls": "memory", "args": {}}) | ||||
def check_config(self, *, check_write): | def check_config(self, *, check_write: bool) -> bool: | ||||
return True | return True | ||||
def _content_add(self, contents: List[Content], with_data: bool) -> Dict: | def _content_add(self, contents: List[Content], with_data: bool) -> Dict: | ||||
self.journal_writer.content_add(contents) | self.journal_writer.content_add(contents) | ||||
content_add = 0 | content_add = 0 | ||||
if with_data: | if with_data: | ||||
summary = self.objstorage.content_add( | summary = self.objstorage.content_add( | ||||
▲ Show 20 Lines • Show All 1,077 Lines • Show Last 20 Lines |