Repo insertion process makes use of the PubSub package.
The repo subscribes to the topic
The client publishes a message to the topic
/<repo_name>/insert. 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.
forwarding_hint(Optional): forwarding hint for Data fetching. This is useful in two scenarios:
The producer choose not to announce its name prefix, but only allow the repo to reach it via forwarding hint.
The name prefix is already announced by repo node(s), but the producer in another node wants to insert to the repo.
register_prefix(Optional): if repo doesn’t register the root prefix (Configuration
register_rootis disabled), client can tell repo to register this prefix.
check_prefix: a prefix of status check topic name. See Check.
process_id: a random byte string to identify this insertion process.
The repo fetches and inserts Data packets according to given parameters.
end_block_idare omitted, the repo fetches a single packet identified in
nameparameter. The insertion process succeeds when this packet is received.
start_block_idis specified but
end_block_idis omitted, the repo starts fetching segments starting from
/name/start_block_id, and increments segment number after each packet. When an Interest receives timeout or nack 3 times, the insertion process stops and is considered successful.
Otherwise, the repo fetches all segments between
start_block_idis omitted, it defaults to 0. The insertion process succeeds when all packets are received.
Segment numbers are encoded in accordance with NDN naming conventions rev2.
Insert status check¶
The client can use the Check protocol to check the progress of an insertion process.
The insertion check response message payload is
RepoCommandResponse with the following fields:
status_code: status code, as defined on Check.
insert_num: number of Data packets received by the repo so far.