Changeset View
Changeset View
Standalone View
Standalone View
swh/objstorage/replayer/replay.py
Show First 20 Lines • Show All 200 Lines • ▼ Show 20 Lines | Args: | ||||
dst: An object storage (see :py:func:`swh.objstorage.get_objstorage`) | dst: An object storage (see :py:func:`swh.objstorage.get_objstorage`) | ||||
exclude_fn: Determines whether an object should be copied. | exclude_fn: Determines whether an object should be copied. | ||||
check_dst: Determines whether we should check the destination | check_dst: Determines whether we should check the destination | ||||
objstorage before copying. | objstorage before copying. | ||||
Example: | Example: | ||||
>>> from swh.objstorage.factory import get_objstorage | >>> from swh.objstorage.factory import get_objstorage | ||||
>>> src = get_objstorage('memory', {}) | >>> src = get_objstorage('memory') | ||||
>>> dst = get_objstorage('memory', {}) | >>> dst = get_objstorage('memory') | ||||
>>> id1 = src.add(b'foo bar') | >>> id1 = src.add(b'foo bar') | ||||
>>> id2 = src.add(b'baz qux') | >>> id2 = src.add(b'baz qux') | ||||
>>> kafka_partitions = { | >>> kafka_partitions = { | ||||
... 'content': [ | ... 'content': [ | ||||
... { | ... { | ||||
... 'sha1': id1, | ... 'sha1': id1, | ||||
... 'status': 'visible', | ... 'status': 'visible', | ||||
... }, | ... }, | ||||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |