|
Revision 79, 1.6 kB
(checked in by bradfitz, 3 years ago)
|
|
clean up tree
|
| Line | |
|---|
| 1 | Chunk has: |
|---|
| 2 | |
|---|
| 3 | -- raw digest (always) |
|---|
| 4 | |
|---|
| 5 | -- file (many) |
|---|
| 6 | -- offset (many) |
|---|
| 7 | -- length (many) |
|---|
| 8 | |
|---|
| 9 | -- enc digest (many) |
|---|
| 10 | |
|---|
| 11 | Chunk description in .bracup file: |
|---|
| 12 | Chunks: offset;raw_length;stored_length;typed_digest |
|---|
| 13 | |
|---|
| 14 | Proposal to change: |
|---|
| 15 | Chunks: offset;raw_length;stored_length;typed_digest(stored);typed_digest(raw);flags |
|---|
| 16 | |
|---|
| 17 | Where flags is comma separate list of \w+. e.g. "gz" for gzip compression |
|---|
| 18 | |
|---|
| 19 | ---- |
|---|
| 20 | |
|---|
| 21 | PositionedChunk (subclass of RawChunk) |
|---|
| 22 | - has a: |
|---|
| 23 | file |
|---|
| 24 | offset |
|---|
| 25 | RawChunk |
|---|
| 26 | - used by: |
|---|
| 27 | $file->foreach_chunk(sub { my $poschunk = shift; }); |
|---|
| 28 | restoring stuff? |
|---|
| 29 | - can: |
|---|
| 30 | write back to disk? |
|---|
| 31 | |
|---|
| 32 | RawChunk |
|---|
| 33 | - has a: |
|---|
| 34 | length |
|---|
| 35 | digest |
|---|
| 36 | contents |
|---|
| 37 | - used by: |
|---|
| 38 | positionedchunk. |
|---|
| 39 | |
|---|
| 40 | ChunkHandle |
|---|
| 41 | - has a: |
|---|
| 42 | digest of stored chunk |
|---|
| 43 | - used by: |
|---|
| 44 | return value from asking target if it has a raw chunk, |
|---|
| 45 | or after it stores a raw chunk. |
|---|
| 46 | |
|---|
| 47 | StoredChunk |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | ------ |
|---|
| 55 | |
|---|
| 56 | Document: purpose of chunks named by their final digest is twofold: |
|---|
| 57 | 1) can verify integrity of storage medium. is it corrupt? |
|---|
| 58 | 2) hides proof of ownership of contents (when encrypted) |
|---|
| 59 | side-effect: |
|---|
| 60 | -- when we do compression, we'll be consistent and store it as its |
|---|
| 61 | compressed digest, even if not encrypted as well. |
|---|
| 62 | |
|---|
| 63 | Maybe we don't need per-chunk meta files: |
|---|
| 64 | -- can get it all from .brackup (meta)files on the server. |
|---|
| 65 | (TODO: abstract out parser for multiple users) |
|---|
| 66 | |
|---|
| 67 | --- |
|---|
| 68 | |
|---|
| 69 | smart chunk-sizing on certain files w/ metadata and data separate: |
|---|
| 70 | like mp3 files and their id3. have a smart chunker that's the data |
|---|
| 71 | part vs. the id3 part, so updating id3 later doesn't reupload the |
|---|
| 72 | entire data part. :-) |
|---|
| 73 | |
|---|