Project

General

Profile

Task #3431

Design a util to Generate File Manifests

Added by Michael Sweatt over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Start date:
01/25/2016
Due date:
% Done:

100%

Estimated time:

Description

Given the:
name of the name prefix (directory name),
the name of the file (absolute or relative path),
the size of the data segments,
the size of each data packet in each data segment,
and the digest type.

Implement a utility to generate a file manifest.

#1

Updated by Michael Sweatt over 4 years ago

  • Status changed from New to In Progress

Redesigned as a class method in FileManifest:

  /**
   * \brief Generates the FileManifest(s) for the file at the specified 'filePath'
   *
   * @param filePath The path to the file for which we are to create a manifest
   * @param manifestPrefix The prefix to be used for the name of this manifest
   * @param subManifestSize The maximum number of data packets to be included in a sub-manifest
   * @param dataPacketSize The maximum number of bytes per Data packet
   *
   * @throws Error if there is any I/O issue when trying to read the filePath.
   *
   * Generates the FileManfiest(s) for the file at the specified 'filePath', splitting the manifest
   * into sub-manifests of size at most the specified 'subManifestSize'. Each sub-manifest is
   * composed of a  catalog of Data packets of at most the specified 'dataPacketSize'. Returns all
   * of the manifests that were created in order. The behavior is undefined unless the
   * manifestPrefix and the filePath share trailing name components.
   */
  static std::list<FileManifest>
  generate(const std::string& filePath,
           const ndn::Name&   manifestPrefix,
           size_t             subManifestSize,
           size_t             dataPacketSize);
#2

Updated by Michael Sweatt over 4 years ago

Complete initial draft of implementation, changed return type to include a collection of the data packets produced.

#3

Updated by Michael Sweatt over 4 years ago

Still need to confirm signatures are working correctly and write negative tests.

#4

Updated by Michael Sweatt over 4 years ago

Cannot tests that asserts fine since I do not believe Boost Unit Test supports this behavior. Could potentially implement a signal handler for SIGABRT that throws an exception, which is then caught the test case. But again this is over complicated, and potentially may not work due to call stack unwinding anyway (interaction between signals and exceptions is a bit sophisticated.

#5

Updated by Michael Sweatt over 4 years ago

Must still add ability to store data packets on disk

#6

Updated by Spyros Mastorakis over 4 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 90
#7

Updated by Spyros Mastorakis over 4 years ago

  • Status changed from Code review to Closed
  • % Done changed from 90 to 100

Also available in: Atom PDF