Keep manifest format » History » Version 7

Tom Clegg, 06/01/2016 02:19 PM

1 3 Tom Clegg
{{toc}}
2 3 Tom Clegg
3 1 Tom Clegg
h1. Keep manifest format
4 1 Tom Clegg
5 1 Tom Clegg
h2. Manifest v1
6 1 Tom Clegg
7 6 Tom Clegg
A manifest is utf-8 encoded text, consisting of zero or more newline-terminated streams.
8 1 Tom Clegg
9 1 Tom Clegg
Each stream consists of three or more space-delimited tokens:
10 5 Tom Clegg
* The first token is a stream name, consisting of one or more path components, delimited by @"/"@.
11 5 Tom Clegg
** The first path component is always @"."@.
12 5 Tom Clegg
** No path component is empty.
13 5 Tom Clegg
** No path component is "." or "..".
14 5 Tom Clegg
** The stream name never begins or ends with @"/"@.
15 7 Tom Clegg
* The second token is a data blob locator (see [[Keep locator format]]).
16 1 Tom Clegg
* ...possibly followed by more data blob locators...
17 1 Tom Clegg
* The first token that is not a block locator, and all subsequent tokens, are file tokens.
18 1 Tom Clegg
** A file token has three parts, delimited by @":"@: position, size, filename.
19 1 Tom Clegg
** Position and size are given in decimal, and are counted from the beginning of the first data blob.
20 1 Tom Clegg
** Filename may contain @"/"@ characters, but must not start or end with @"/"@, and must not contain @"//"@.
21 5 Tom Clegg
** Filename components (delimited by @"/"@) must not be @"."@ or @".."@.
22 5 Tom Clegg
23 1 Tom Clegg
A manifest contains no TAB characters, nor other ASCII whitespace characters other than the spaces or newline delimiters specified above.
24 6 Tom Clegg
25 6 Tom Clegg
A manifest always ends with a newline -- except the empty (zero-length) string, which is a valid manifest.
26 1 Tom Clegg
27 1 Tom Clegg
h2. Normalized manifest v1
28 1 Tom Clegg
29 1 Tom Clegg
A normalized manifest has the following additional restrictions.
30 1 Tom Clegg
* Streams are in alphanumeric order.
31 1 Tom Clegg
* Each stream name is unique within the manifest.
32 1 Tom Clegg
* Files within a stream are in alphanumeric order.
33 1 Tom Clegg
* -Concatenation @stream_name/filename@ is unique within the manifest.- (This can be impossible to accomplish without rewriting blobs.)
34 1 Tom Clegg
* Filename must not contain @"/"@.
35 1 Tom Clegg
36 1 Tom Clegg
An API call -exists- will exist to normalize a manifest.
37 1 Tom Clegg
38 1 Tom Clegg
Request:
39 1 Tom Clegg
* @POST /arvados/v1/collections/{hash}/normalize@
40 1 Tom Clegg
* request body: @{"collection":{"manifest_text":"...."}}@
41 1 Tom Clegg
42 1 Tom Clegg
Response:
43 1 Tom Clegg
* @{"uuid":"...","manifest_text":"..."}@
44 1 Tom Clegg
45 1 Tom Clegg
Notes:
46 1 Tom Clegg
* POST despite no side effects.
47 1 Tom Clegg
* Returns object with uuid even though no object was stored.
48 3 Tom Clegg
49 3 Tom Clegg
h2. Manifest v2
50 3 Tom Clegg
51 3 Tom Clegg
(Early design stages)
52 3 Tom Clegg
53 3 Tom Clegg
Should probably include:
54 3 Tom Clegg
* Structured format (JSON?)
55 3 Tom Clegg
* More than one level of indirection (e.g., manifest references block X, which references data blocks A,B,C)
56 3 Tom Clegg
* Specify hash algorithm with block hashes