Repo deletion process makes use of the PubSub package.
The repo subscribes to the topic
The client publishes a message to the topic
/<repo_name>/delete. The message payload is
RepoCommandParameterwith the following fields:
name: either a Data packet name, or a name prefix of Data packets.
start_block_id(Optional): inclusive start segment number.
end_block_id(Optional): inclusive end segment number.
register_prefix(Optional): if repo doesn’t register the root prefix (Configuration
register_rootis disabled), client can tell repo to unregister this prefix.
check_prefix: a prefix of status check topic name. See Check.
process_id: a random byte string to identify this deletion process.
The repo deletes Data packets according to given parameters.
end_block_idare omitted, the repo deletes a single packet identified in
nameparameter. The deletion process succeeds when this packet is deleted.
start_block_idis specified but
end_block_idis omitted, the repo starts deleting segments starting from
/name/start_block_id, and increments segment number after each packet. When a name query does not find an existing segment, the deletion process stops and is considered successful.
Otherwise, the repo fetches all segments between
start_block_idis omitted, it defaults to 0. The deletion process succeeds when all packets are deleted.
Segment numbers are encoded in accordance with NDN naming conventions rev2.
Delete status check¶
The client can use the Check protocol to check the progress of a deletion process.
The deletion check response message payload is
RepoCommandResponse with the following fields:
status_code: status code, as defined on Check.
delete_num: number of Data packets deleted by the repo so far.