diff --git a/chunkadditionalinfo.go b/chunkadditionalinfo.go new file mode 100644 index 0000000..22daffd --- /dev/null +++ b/chunkadditionalinfo.go @@ -0,0 +1,10 @@ +package desync + +// ChunkAdditionalInfo contains detailed information about a particular chunk. +// Some of those info, e.g. CompressedSize, are only exact for the store used when +// generating it. Because other stores could potentially use different compression levels. +type ChunkAdditionalInfo struct { + ID ChunkID `json:"id"` + UncompressedSize uint64 `json:"uncompressed_size"` + CompressedSize int64 `json:"compressed_size,omitempty"` +} diff --git a/chunker_test.go b/chunker_test.go index 0755e00..af2040b 100644 --- a/chunker_test.go +++ b/chunker_test.go @@ -57,7 +57,8 @@ func TestChunkerLargeFile(t *testing.T) { if err != nil { t.Fatal(err) } - hash := ChunkID(sha512.Sum512_256(buf)).String() + chunkID := ChunkID(sha512.Sum512_256(buf)) + hash := (&chunkID).String() if hash != e.ID { t.Fatalf("chunk #%d, unexpected hash %s, expected %s", i+1, hash, e.ID) } diff --git a/cmd/desync/info.go b/cmd/desync/info.go index 7bfcb81..ea5298c 100644 --- a/cmd/desync/info.go +++ b/cmd/desync/info.go @@ -2,7 +2,9 @@ package main import ( "context" + "encoding/json" "fmt" + "os" "sync" "sync/atomic" @@ -16,6 +18,7 @@ type infoOptions struct { seeds []string cache string printFormat string + chunksInfo string } func newInfoCommand(ctx context.Context) *cobra.Command { @@ -27,10 +30,13 @@ func newInfoCommand(ctx context.Context) *cobra.Command { Long: `Displays information about the provided index, such as the number of chunks and the total size of unique chunks that are not available in the seed. If a store is provided, it'll also show how many of the chunks are present in the -store. If one or more seed indexes are provided, the number of chunks available +store. By providing a chunks info file, generated by 'inspect-chunks', additional +information will be shown, like the size of compressed chunks not in the seed nor cache. +If one or more seed indexes are provided, the number of chunks available in the seeds are also shown. Use '-' to read the index from STDIN.`, - Example: ` desync info -s /path/to/local --format=json file.caibx`, - Args: cobra.ExactArgs(1), + Example: ` desync info -s /path/to/local --format=json file.caibx +desync info --seed http://192.168.1.1/rootfs2.caibx --chunks-info chunks.json --format=json rootfs.caibx`, + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { return runInfo(ctx, opt, args) }, @@ -41,6 +47,7 @@ in the seeds are also shown. Use '-' to read the index from STDIN.`, flags.StringSliceVar(&opt.seeds, "seed", nil, "seed indexes") flags.StringVarP(&opt.cache, "cache", "c", "", "store to be used as cache") flags.StringVarP(&opt.printFormat, "format", "f", "json", "output format, plain or json") + flags.StringVar(&opt.chunksInfo, "chunks-info", "", "json file with additional chunks info") addStoreOptions(&opt.cmdStoreOptions, flags) return cmd } @@ -57,18 +64,37 @@ func runInfo(ctx context.Context, opt infoOptions, args []string) error { } var results struct { - Total int `json:"total"` - Unique int `json:"unique"` - InStore uint64 `json:"in-store"` - InSeed uint64 `json:"in-seed"` - InCache uint64 `json:"in-cache"` - NotInSeedNorCache uint64 `json:"not-in-seed-nor-cache"` - Size uint64 `json:"size"` - SizeNotInSeed uint64 `json:"dedup-size-not-in-seed"` - SizeNotInSeedNorCache uint64 `json:"dedup-size-not-in-seed-nor-cache"` - ChunkSizeMin uint64 `json:"chunk-size-min"` - ChunkSizeAvg uint64 `json:"chunk-size-avg"` - ChunkSizeMax uint64 `json:"chunk-size-max"` + Total int `json:"total"` + Unique int `json:"unique"` + InStore uint64 `json:"in-store"` + InSeed uint64 `json:"in-seed"` + InCache uint64 `json:"in-cache"` + NotInSeedNorCache uint64 `json:"not-in-seed-nor-cache"` + Size uint64 `json:"size"` + SizeNotInSeed uint64 `json:"dedup-size-not-in-seed"` + SizeNotInSeedNorCache uint64 `json:"dedup-size-not-in-seed-nor-cache"` + SizeNotInSeedNorCacheCompressed uint64 `json:"dedup-size-not-in-seed-nor-cache-compressed"` + ChunkSizeMin uint64 `json:"chunk-size-min"` + ChunkSizeAvg uint64 `json:"chunk-size-avg"` + ChunkSizeMax uint64 `json:"chunk-size-max"` + } + + var estimateCompressedSize = opt.chunksInfo != "" + var chunksInfo []desync.ChunkAdditionalInfo + if opt.chunksInfo != "" { + b, err := os.ReadFile(opt.chunksInfo) + if err != nil { + return err + } + err = json.Unmarshal(b, &chunksInfo) + if err != nil { + return err + } + } + + chunkIDMap := make(map[desync.ChunkID]desync.ChunkAdditionalInfo) + for _, info := range chunksInfo { + chunkIDMap[info.ID] = info } dedupedSeeds := make(map[desync.ChunkID]struct{}) @@ -145,6 +171,26 @@ func runInfo(ctx context.Context, opt infoOptions, args []string) error { if !inSeed && !inCache { results.NotInSeedNorCache++ results.SizeNotInSeedNorCache += chunk.Size + if estimateCompressedSize { + if chunkInfo, found := chunkIDMap[chunk.ID]; found { + results.SizeNotInSeedNorCacheCompressed += uint64(chunkInfo.CompressedSize) + if chunkInfo.CompressedSize == 0 { + // We don't have the compressed info for at least one chunk. We shouldn't print that info + // because it would not be accurate. + estimateCompressedSize = false + results.SizeNotInSeedNorCacheCompressed = 0 + } + if chunkInfo.UncompressedSize != chunk.Size { + return fmt.Errorf("the chunks info file has an unexpected size for the chunk %s: %d instead of %d", + chunk.ID, chunkInfo.UncompressedSize, chunk.Size) + } + } else { + // If the provided chunks info file is missing some chunks we stop estimating the size. + // Otherwise, the shown value at the end could end up being wrong. + estimateCompressedSize = false + results.SizeNotInSeedNorCacheCompressed = 0 + } + } } } results.Unique = len(deduped) @@ -191,6 +237,7 @@ func runInfo(ctx context.Context, opt infoOptions, args []string) error { fmt.Println("Chunks in seed:", results.InSeed) fmt.Println("Chunks in cache:", results.InCache) fmt.Println("Chunks not in seed nor cache:", results.NotInSeedNorCache) + fmt.Println("Compressed chunks not in seed nor cache:", results.SizeNotInSeedNorCacheCompressed) fmt.Println("Chunk size min:", results.ChunkSizeMin) fmt.Println("Chunk size avg:", results.ChunkSizeAvg) fmt.Println("Chunk size max:", results.ChunkSizeMax) diff --git a/cmd/desync/info_test.go b/cmd/desync/info_test.go index 79ab0f1..ac84bf8 100644 --- a/cmd/desync/info_test.go +++ b/cmd/desync/info_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/require" ) - func TestInfoCommand(t *testing.T) { for _, test := range []struct { name string @@ -29,6 +28,7 @@ func TestInfoCommand(t *testing.T) { "size": 2097152, "dedup-size-not-in-seed": 1114112, "dedup-size-not-in-seed-nor-cache": 1114112, + "dedup-size-not-in-seed-nor-cache-compressed": 0, "chunk-size-min": 2048, "chunk-size-avg": 8192, "chunk-size-max": 32768 @@ -45,12 +45,13 @@ func TestInfoCommand(t *testing.T) { "size": 2097152, "dedup-size-not-in-seed": 80029, "dedup-size-not-in-seed-nor-cache": 80029, + "dedup-size-not-in-seed-nor-cache-compressed": 0, "chunk-size-min": 2048, "chunk-size-avg": 8192, "chunk-size-max": 32768 }`)}, {"info command with seed and cache", - []string{"-s", "testdata/blob2.store", "--seed", "testdata/blob1.caibx", "--cache", "testdata/blob2.cache", "testdata/blob2.caibx"}, + []string{"-s", "testdata/blob2.store", "--seed", "testdata/blob1.caibx", "--cache", "testdata/blob2.cache", "--chunks-info", "testdata/blob2_chunks_info.json", "testdata/blob2.caibx"}, []byte(`{ "total": 161, "unique": 131, @@ -61,12 +62,13 @@ func TestInfoCommand(t *testing.T) { "size": 2097152, "dedup-size-not-in-seed": 80029, "dedup-size-not-in-seed-nor-cache": 80029, + "dedup-size-not-in-seed-nor-cache-compressed": 76000, "chunk-size-min": 2048, "chunk-size-avg": 8192, "chunk-size-max": 32768 }`)}, {"info command with cache", - []string{"-s", "testdata/blob2.store", "--cache", "testdata/blob2.cache", "testdata/blob2.caibx"}, + []string{"-s", "testdata/blob2.store", "--cache", "testdata/blob2.cache", "--chunks-info", "testdata/blob2_chunks_info.json", "testdata/blob2.caibx"}, []byte(`{ "total": 161, "unique": 131, @@ -77,6 +79,24 @@ func TestInfoCommand(t *testing.T) { "size": 2097152, "dedup-size-not-in-seed": 1114112, "dedup-size-not-in-seed-nor-cache": 853943, + "dedup-size-not-in-seed-nor-cache-compressed": 818145, + "chunk-size-min": 2048, + "chunk-size-avg": 8192, + "chunk-size-max": 32768 + }`)}, + {"info command with chunks info that doesn't have the compressed size for all chunk", + []string{"-s", "testdata/blob2.store", "--chunks-info", "testdata/blob2_chunks_info_missing.json", "testdata/blob2.caibx"}, + []byte(`{ + "total": 161, + "unique": 131, + "in-store": 131, + "in-seed": 0, + "in-cache": 0, + "not-in-seed-nor-cache": 131, + "size": 2097152, + "dedup-size-not-in-seed": 1114112, + "dedup-size-not-in-seed-nor-cache": 1114112, + "dedup-size-not-in-seed-nor-cache-compressed": 0, "chunk-size-min": 2048, "chunk-size-avg": 8192, "chunk-size-max": 32768 diff --git a/cmd/desync/inspectchunks.go b/cmd/desync/inspectchunks.go new file mode 100644 index 0000000..21da5e5 --- /dev/null +++ b/cmd/desync/inspectchunks.go @@ -0,0 +1,106 @@ +package main + +import ( + "context" + "fmt" + "github.com/folbricht/desync" + "github.com/spf13/cobra" + "io" + "os" +) + +type inspectChunksOptions struct { + cmdStoreOptions + store string +} + +func newinspectChunksCommand(ctx context.Context) *cobra.Command { + var opt inspectChunksOptions + + cmd := &cobra.Command{ + Use: "inspect-chunks []", + Short: "Inspect chunks from an index and an optional local store", + Long: `Prints a detailed JSON with information about chunks stored in an index file. +By using the '--store' option to provide a local store, the generated JSON will include, if +available, the chunks compressed size info from that particular store.`, + Example: ` desync inspect-chunks file.caibx +desync inspect-chunks --store /mnt/store file.caibx inspect_result.json`, + Args: cobra.RangeArgs(1, 2), + RunE: func(cmd *cobra.Command, args []string) error { + return runInspectChunks(ctx, opt, args) + }, + SilenceUsage: true, + } + flags := cmd.Flags() + flags.StringVarP(&opt.store, "store", "s", "", "local source store") + addStoreOptions(&opt.cmdStoreOptions, flags) + return cmd +} + +func runInspectChunks(ctx context.Context, opt inspectChunksOptions, args []string) error { + if err := opt.cmdStoreOptions.validate(); err != nil { + return err + } + + var ( + outFile io.Writer + err error + ) + if len(args) == 2 { + outFileName := args[1] + outFile, err = os.Create(outFileName) + if err != nil { + return err + } + } else { + outFile = stdout + } + + // Read the input + c, err := readCaibxFile(args[0], opt.cmdStoreOptions) + if err != nil { + return err + } + + var ( + chunksInfo []desync.ChunkAdditionalInfo + s desync.LocalStore + ) + + if opt.store != "" { + sr, err := storeFromLocation(opt.store, opt.cmdStoreOptions) + if err != nil { + return err + } + + // We expect a local store, it is an error to provide something different + var ok bool + s, ok = sr.(desync.LocalStore) + + if !ok { + return fmt.Errorf("'%s' is not a local store", opt.store) + } + } + + for _, chunk := range c.Chunks { + var size int64 = 0 + // Get the compressed size only if the store actually has compressed chunks + if opt.store != "" && !s.Opt.Uncompressed { + size, _ = s.GetChunkSize(chunk.ID) + } + + chunksInfo = append(chunksInfo, desync.ChunkAdditionalInfo{ + ID: chunk.ID, + UncompressedSize: chunk.Size, + CompressedSize: size, + }) + // See if we're meant to stop + select { + case <-ctx.Done(): + return nil + default: + } + } + + return printJSON(outFile, chunksInfo) +} diff --git a/cmd/desync/inspectchunks_test.go b/cmd/desync/inspectchunks_test.go new file mode 100644 index 0000000..9ad7361 --- /dev/null +++ b/cmd/desync/inspectchunks_test.go @@ -0,0 +1,58 @@ +package main + +import ( + "bytes" + "context" + "encoding/json" + "io/ioutil" + "os" + "testing" + + "github.com/folbricht/desync" + "github.com/stretchr/testify/require" +) + +func TestInspectChunksCommand(t *testing.T) { + for _, test := range []struct { + name string + args []string + expectedOutputJSON string + }{ + {"inspect the chunks info with a local store", + []string{"-s", "testdata/blob2.store", "testdata/blob2.caibx"}, + "testdata/blob2_chunks_info.json", + }, + {"run inspect with a seed that doesn't have all the compressed chunks", + []string{"-s", "testdata/blob2.cache", "testdata/blob2.caibx"}, + "testdata/blob2_chunks_info_missing.json", + }, + {"inspect the chunks info without any stores", + []string{"testdata/blob2.caibx"}, + "testdata/blob2_chunks_info_no_store.json", + }, + } { + t.Run(test.name, func(t *testing.T) { + var exp []desync.ChunkAdditionalInfo + be, err := os.ReadFile(test.expectedOutputJSON) + require.NoError(t, err) + err = json.Unmarshal(be, &exp) + require.NoError(t, err) + + cmd := newinspectChunksCommand(context.Background()) + cmd.SetArgs(test.args) + b := new(bytes.Buffer) + + // Redirect the command's output + stdout = b + cmd.SetOutput(ioutil.Discard) + _, err = cmd.ExecuteC() + require.NoError(t, err) + + // Decode the output and compare to what's expected + var got []desync.ChunkAdditionalInfo + err = json.Unmarshal(b.Bytes(), &got) + require.NoError(t, err) + require.Equal(t, exp, got) + }) + } +} diff --git a/cmd/desync/main.go b/cmd/desync/main.go index 469414f..d384f4a 100644 --- a/cmd/desync/main.go +++ b/cmd/desync/main.go @@ -51,6 +51,7 @@ func main() { newChopCommand(ctx), newChunkCommand(ctx), newInfoCommand(ctx), + newinspectChunksCommand(ctx), newListCommand(ctx), newMountIndexCommand(ctx), newPruneCommand(ctx), diff --git a/cmd/desync/testdata/blob2_chunks_info.json b/cmd/desync/testdata/blob2_chunks_info.json new file mode 100644 index 0000000..561386a --- /dev/null +++ b/cmd/desync/testdata/blob2_chunks_info.json @@ -0,0 +1,807 @@ +[ + { + "id": "d2e3762144a126b641b7757bf5dee95c43b1de3b9b3e1e9c3fea623096fb0cf4", + "uncompressed_size": 3505, + "compressed_size": 3515 + }, + { + "id": "e702c5963bff441d2e234f73090ba9c83d5fe9702909ac64fcd5fb134c325ea5", + "uncompressed_size": 9493, + "compressed_size": 9503 + }, + { + "id": "6de3e3ea133c960c7cc89e0087681f8d375292ac433de386ea37d88c45501778", + "uncompressed_size": 6084, + "compressed_size": 6094 + }, + { + "id": "517b522b5db27b73425e5977a4516326174b0bc7ae91578065c7745293706b49", + "uncompressed_size": 17147, + "compressed_size": 17157 + }, + { + "id": "fafc5d97d401a2cfa8e542f146a2af0d8f2364294dbcd37073451b3cd489884c", + "uncompressed_size": 7561, + "compressed_size": 7571 + }, + { + "id": "e5e0a38afb58feac768ad4919d1e762ed582eb46ee91080cff8ce09450b5d704", + "uncompressed_size": 7479, + "compressed_size": 7489 + }, + { + "id": "12ac2ff1fff70ee61e54476925696048d36ffaebe7697f342b65a6877c68363b", + "uncompressed_size": 2429, + "compressed_size": 2439 + }, + { + "id": "233901dd45db80875c342a91aec7bdc4b0ba420b13ceb3dddee2db341da73b3b", + "uncompressed_size": 6716, + "compressed_size": 6726 + }, + { + "id": "b70ae32356e3db0ca63558400464a74c901ff115c9052446ae1426b97e11b94f", + "uncompressed_size": 10742, + "compressed_size": 10752 + }, + { + "id": "ae66892b1ef96c9fb41d4b8fc547651a2e07fdba0ffac08d4061287291f7467b", + "uncompressed_size": 7535, + "compressed_size": 7545 + }, + { + "id": "43fece6af6b1a221ac8a2c91cb85a794b20c249a0e25c1ac1f9114919ed13808", + "uncompressed_size": 10790, + "compressed_size": 10800 + }, + { + "id": "8005399850d2d3b7c0342f962cdfc6db3c5e1c56f4cfd79c208c6f226a57722e", + "uncompressed_size": 9324, + "compressed_size": 9334 + }, + { + "id": "e8f57d8b756e7e26de504db4e651e4beaca4cd8d913ab076b5792dd28c4b5d83", + "uncompressed_size": 6333, + "compressed_size": 6343 + }, + { + "id": "8ed9dfbb39964137fb57dd8750c691667f4cf9a3ef833b6600b105ca526cbc45", + "uncompressed_size": 14555, + "compressed_size": 14565 + }, + { + "id": "941cbf16c0e1e2087e74a48509e5e38093980050ceb9d44614c4a652d9a70780", + "uncompressed_size": 5925, + "compressed_size": 5935 + }, + { + "id": "16cf178d36470db634478d5757dc83dfefd539719019ba087b87ffc5cd9bf451", + "uncompressed_size": 2583, + "compressed_size": 2593 + }, + { + "id": "4428693eb91fef01af5ff205199aa66b263b6a84555ca42411cbdb04308c9329", + "uncompressed_size": 2289, + "compressed_size": 2299 + }, + { + "id": "4b9ec671c0f38fc5c98d240ea17fdab8f45f8c6c0b038295ab2282c2426ca41c", + "uncompressed_size": 11596, + "compressed_size": 11606 + }, + { + "id": "b26e0621f4095dbd24d2eb2fd2d90e73e7d16f62f2187dd39dab4f3f583a9934", + "uncompressed_size": 17373, + "compressed_size": 17383 + }, + { + "id": "eff03ad852bf628e98b1c2315e2c6761039ff3325debb6a0dd2bb922729d71a6", + "uncompressed_size": 4156, + "compressed_size": 4166 + }, + { + "id": "4ec40ccbafd604f2fc4901a0499021d724b9beb88c111dd3206ed95aebeea107", + "uncompressed_size": 5433, + "compressed_size": 5443 + }, + { + "id": "f8b06183ec82b67b27cc2ca7920c4c368c413a90b4a22717b132a589bb5b6cd8", + "uncompressed_size": 3840, + "compressed_size": 3850 + }, + { + "id": "23d6616332ed4874bb9eeefab8ddc341749b974a5a05f4498409d625b308fee3", + "uncompressed_size": 3218, + "compressed_size": 3228 + }, + { + "id": "428ecd563456ca8e46445b703c7b218a798a5e8642ecd4d78d74f64f4f9e1928", + "uncompressed_size": 6947, + "compressed_size": 6957 + }, + { + "id": "91944c6d8e9ff59afe57191d17a914cdc17a9716bc31d9ad265a878dbac4dbca", + "uncompressed_size": 7630, + "compressed_size": 7640 + }, + { + "id": "21c98b35fd4e985936176a3a59b6a7fe19eef836b9d88b304422e1b883367db9", + "uncompressed_size": 6580, + "compressed_size": 6590 + }, + { + "id": "db5c65c2dc056d7b99d5c5ba3a81911c649278d1f855be13bbb888887c4fe7a3", + "uncompressed_size": 6573, + "compressed_size": 6583 + }, + { + "id": "79b34da61f331086f14e3e0e385a5faabc139da42c20d5694296967a830164be", + "uncompressed_size": 26731, + "compressed_size": 26741 + }, + { + "id": "13f074f217b3a4ecf9c628535fac8f8df71468bc4c2ad5965ff9593b41b5905e", + "uncompressed_size": 6021, + "compressed_size": 6031 + }, + { + "id": "3d14b34541510c93ab1117665dfcf47961a8b47270695f2c1cf4096340b69d38", + "uncompressed_size": 7038, + "compressed_size": 7048 + }, + { + "id": "20bfe5969582ebbc266cc8271f17dbaadb6a9825c9c0750f9292d556c322975b", + "uncompressed_size": 16871, + "compressed_size": 16881 + }, + { + "id": "b416f357a8fb32632369769f0cc977003c72245f02529f4e62dd34124df1c10b", + "uncompressed_size": 5351, + "compressed_size": 5361 + }, + { + "id": "c71a45d5eb09c39201166e06f68aa854c61a6f5b619fda01e4ddaeeea1c52145", + "uncompressed_size": 30823, + "compressed_size": 30833 + }, + { + "id": "3e743f498c346ba239148821fd01e826ea89a619856ec969663dbb6228de2401", + "uncompressed_size": 13387, + "compressed_size": 13397 + }, + { + "id": "e45417f34ca8ac1f873986e9b370b5b26e00d101ddfab1801519569e073c66c4", + "uncompressed_size": 6594, + "compressed_size": 6604 + }, + { + "id": "3a1e0c3ce74489ca872f4c197cc8837561403f361e62ba080dfdc232cc1a9f44", + "uncompressed_size": 3272, + "compressed_size": 3282 + }, + { + "id": "3f85dbefac8e408f8cf4b1113e75283e0bed9bcade97e2b58d8716dc9c16c00a", + "uncompressed_size": 5396, + "compressed_size": 5406 + }, + { + "id": "b725b4091f398468212f13556af497a4c331a1140ebc24698f2385710a6bf673", + "uncompressed_size": 24984, + "compressed_size": 24994 + }, + { + "id": "6fd1812485ddeaee65c8d1f7e1357870d4997c04d329eb7625989b3ce4ff7fe2", + "uncompressed_size": 5297, + "compressed_size": 5307 + }, + { + "id": "f65ae9f509c87b5fbda4229e4f14e3d76bcbb73408e5b400f7b1cdb736e76f46", + "uncompressed_size": 9253, + "compressed_size": 9263 + }, + { + "id": "fe80908e0986a86574172731bb57c08305881418d4023ca64c66ca7c57af79f2", + "uncompressed_size": 2196, + "compressed_size": 2206 + }, + { + "id": "df0e343380e43ecf7ad7f94afaef8eb7f5b2d95a514cd20f74ebdbffcf62af41", + "uncompressed_size": 4435, + "compressed_size": 4445 + }, + { + "id": "5d274122b4bfb50e42bd748432b31c0ce916fc1bc713cff10f4d6d08752a5236", + "uncompressed_size": 16604, + "compressed_size": 16614 + }, + { + "id": "483314148c355efd3b3834bb118469c52778309c5382cc031b1603a054535a00", + "uncompressed_size": 7509, + "compressed_size": 7519 + }, + { + "id": "f616a8077fb0d1ba3028566b5be884653448d6ca9de54ab1805c32f2d955ce28", + "uncompressed_size": 8199, + "compressed_size": 8209 + }, + { + "id": "cd36ea979295c6358bec58a04971aedad3cfe71ba1fa06fb4d1d17a2c7d39ec0", + "uncompressed_size": 3835, + "compressed_size": 3845 + }, + { + "id": "69a1c274ab9f76d264943d0f82a32fda55a620f74ae513da64af83d0913c861e", + "uncompressed_size": 8030, + "compressed_size": 8040 + }, + { + "id": "d44a8f5501a6efb23acbcfb529da684c9d547eb048f535dff6365e8bf258edd0", + "uncompressed_size": 8190, + "compressed_size": 8200 + }, + { + "id": "949c6bb3d457c245208e6ea67dc2ca93feca0d0b115013da43e4c8b60a0118b0", + "uncompressed_size": 5965, + "compressed_size": 5975 + }, + { + "id": "6c99c678b0d39fa3ab3552d90f3bf75dc56a3fb42fdc9a7bb6d2a373f37ff93f", + "uncompressed_size": 4716, + "compressed_size": 4726 + }, + { + "id": "db607e47cb3ed3992914b5205a68777397790ed85ec99487556e769a1dd9e867", + "uncompressed_size": 11275, + "compressed_size": 11285 + }, + { + "id": "4d381c664f29a74e27cb736b4ebcc6f3c2e415816d7899ca91324bfab478df96", + "uncompressed_size": 18257, + "compressed_size": 18267 + }, + { + "id": "78c32f74a201ef42f0a4fb40249c06f41ae7689c2cfcc4558a747a8e46c07b59", + "uncompressed_size": 10008, + "compressed_size": 10018 + }, + { + "id": "e16becd8b4d7eed84236c59257660dd491f32f51f7669745b8c7e48bd4c849c2", + "uncompressed_size": 3378, + "compressed_size": 3388 + }, + { + "id": "38bf0dd5954eb9021f6ec26d9c4f34c2a6fd92cb1cc4ad1ce670f4f866859ecd", + "uncompressed_size": 2950, + "compressed_size": 2960 + }, + { + "id": "9a75d52a06769bde595c47dda2bcc0559e57cb20fe346e87c12d68d2bbab67bb", + "uncompressed_size": 4167, + "compressed_size": 4177 + }, + { + "id": "3b96dda633ff88025ad87d4d32c5e0a4bd688f50810c877fbdf5a64159a23492", + "uncompressed_size": 3814, + "compressed_size": 3824 + }, + { + "id": "231e4a2df532cb913fbbc9e0a2a6ff8582ea1d79593c65ef964160ce71ed0aee", + "uncompressed_size": 3050, + "compressed_size": 3060 + }, + { + "id": "15cc115dc5d8bef2fea4cb8ec58fa86d86f5bebb47577670154e625e67ac9e42", + "uncompressed_size": 20234, + "compressed_size": 20244 + }, + { + "id": "1e0000e37470d0dd91e99870d55a73b7da77b106e35cbc7be9d984256117b752", + "uncompressed_size": 24349, + "compressed_size": 24359 + }, + { + "id": "b107f0641e84a97c2793db7393d5d64be78a6687ae9c868f1ac5ec9e5ea670fc", + "uncompressed_size": 18490, + "compressed_size": 18500 + }, + { + "id": "1ea441aee6d76c8e6883238331c325d7023e640f03d4e3d15b3ddb5145cf403a", + "uncompressed_size": 22148, + "compressed_size": 22158 + }, + { + "id": "dda036db05bc2b99b6b9303d28496000c34b246457ae4bbf00fe625b5cabd7cd", + "uncompressed_size": 12438, + "compressed_size": 12448 + }, + { + "id": "06b727fda4024fbf864090e62fb66597ed6ddf265b428601e4bbf1a3b51851bd", + "uncompressed_size": 3947, + "compressed_size": 3957 + }, + { + "id": "ce9f9d4acac16288909bdb38098d01758e79392576d86fd619f087c75a235487", + "uncompressed_size": 9563, + "compressed_size": 9573 + }, + { + "id": "56599127c27298e718c06d5b9a20e87f8352b3465ec21f9c02ee973615e66538", + "uncompressed_size": 2899, + "compressed_size": 2909 + }, + { + "id": "9350cae7c6e456287014ed0d93659e8ce921a72e8128cc70e96e0652d682ca39", + "uncompressed_size": 7081, + "compressed_size": 7091 + }, + { + "id": "3c1a2f81236e8e396a7cbbb7e608f4f91f6ec0a1043558733a56354b3e843447", + "uncompressed_size": 32768, + "compressed_size": 32778 + }, + { + "id": "3bd5965865d888bb32744678ed2e50eaed96f36c615b0c8cc052a8aeeeea7647", + "uncompressed_size": 4737, + "compressed_size": 4747 + }, + { + "id": "3195dd72158802ef625883ed4f233a8f010cbf222dc415605b3d4ab1ea97dcd6", + "uncompressed_size": 6434, + "compressed_size": 6444 + }, + { + "id": "a017728934f681c33e198399152595a85ddf331272a9156ad471f8199ef9077b", + "uncompressed_size": 4627, + "compressed_size": 4637 + }, + { + "id": "4a4ebf42f9ff30957240f940a6edf4e384625d1aca283ac0830d9860a0c6f1a9", + "uncompressed_size": 3474, + "compressed_size": 3484 + }, + { + "id": "33b4e86b46d6bb7943626d2754547afaf0acaa266af14116a4d202fdceb6dc46", + "uncompressed_size": 14567, + "compressed_size": 14577 + }, + { + "id": "59ecf31c61d03edf609bd0de5f23393a7c15f16711906e85dc09fb6495c71716", + "uncompressed_size": 2079, + "compressed_size": 2089 + }, + { + "id": "9b45b1dfa92f6f7f0bd918441cc9f63c7077307cd9d8d268acc0ae565bd267c3", + "uncompressed_size": 9533, + "compressed_size": 9543 + }, + { + "id": "1588898492b6e2aacb72a042b2e414887f79ebe5dd98d906c6532789f19fb848", + "uncompressed_size": 4314, + "compressed_size": 4324 + }, + { + "id": "3d22c99f10f78c4464254a4a644009aec8b9a6298b1b25b141d404506911a7d8", + "uncompressed_size": 3827, + "compressed_size": 3837 + }, + { + "id": "b5d5d4b652032ebfa5af34ebcc1b1c4a282e517e2e0d1985e731e7a4f23e87fe", + "uncompressed_size": 5132, + "compressed_size": 5142 + }, + { + "id": "df74e4a1db4bbf988591fe46387fd008b898a35f7322fe9a88499e904ba75c26", + "uncompressed_size": 5399, + "compressed_size": 5409 + }, + { + "id": "76f8b379dc3dc6925ed685c9e1ade230c2c4772678d96a17f9dc864e68130688", + "uncompressed_size": 2525, + "compressed_size": 2535 + }, + { + "id": "4f1e2f567fe2bb6238cb72d6a703cd4a21c0930b7f1520ea2901860136a18327", + "uncompressed_size": 6918, + "compressed_size": 6928 + }, + { + "id": "12123a0e8253bc9573936c5ee3682843f74d017113f5163897bcd6203c04529b", + "uncompressed_size": 2253, + "compressed_size": 2263 + }, + { + "id": "f0fb63ab00505789523727a6f9bd03c1e5e8e77ffe6403bb4d24ca61ba535ede", + "uncompressed_size": 2522, + "compressed_size": 2532 + }, + { + "id": "478f1358d61b5c7d060e9708dda3819ae272cddedb192aaf2b21e7feee45bea9", + "uncompressed_size": 4026, + "compressed_size": 4036 + }, + { + "id": "7ac0f766f2ddbe36523dc7e30f897f9e535557403fcec8fae4746ce1c7bc82d1", + "uncompressed_size": 13797, + "compressed_size": 13807 + }, + { + "id": "c370cd3fa64c752e3c3d1fc6fd6019a69fe8c03853686645ff3b0cfa59fa7a07", + "uncompressed_size": 5636, + "compressed_size": 5646 + }, + { + "id": "cfae4fdc791644d202cd95f35494d5ec2e8e4dd89831d5a7478351473f97838b", + "uncompressed_size": 2897, + "compressed_size": 2907 + }, + { + "id": "c945782661970af43eeefc5765b0f071533514c838e277de804a544c9b4b27c7", + "uncompressed_size": 8203, + "compressed_size": 8213 + }, + { + "id": "089e58577e81aabc20ed4179e143c22235bc3a986b9d6ec5cb4208939866b489", + "uncompressed_size": 6909, + "compressed_size": 6919 + }, + { + "id": "931465ab10bb2ba577d4c38c1160a2554d322a08ebfb4e838196414da0de3d6d", + "uncompressed_size": 8394, + "compressed_size": 8404 + }, + { + "id": "6709811d1097670e5e2096e5fb41787bff80130abe17650af451af3ef31aba11", + "uncompressed_size": 12134, + "compressed_size": 12144 + }, + { + "id": "1f592a09dcc63a0bead5787876afbbaef734235e5025ce17c91d1b0180d687d5", + "uncompressed_size": 2750, + "compressed_size": 2760 + }, + { + "id": "4a2e9f8b881068295cf539094c25cf609165c717d6bff95a38159ec2082af8b8", + "uncompressed_size": 2870, + "compressed_size": 2880 + }, + { + "id": "0d44b9fa2e55177e14e7cd1badad5c8e39d2f51027c9358cf2b08ac2d3163942", + "uncompressed_size": 6176, + "compressed_size": 6186 + }, + { + "id": "172fbb94647981287ef92273b840901711540d8f22d9e016c7d9be3dbe15253f", + "uncompressed_size": 7855, + "compressed_size": 7865 + }, + { + "id": "3fba59861aa7ea797285b88c0bb3dd4676276bd29d8e471cab834f32117d8b47", + "uncompressed_size": 7928, + "compressed_size": 7938 + }, + { + "id": "89d1b5112ef335d1dd36e915ba0b1cd4a950542d5cbe2b47daccf257ee4a3f9b", + "uncompressed_size": 4587, + "compressed_size": 4597 + }, + { + "id": "37fa8682c19d1f4dc584f70c8b122b954eb8abae1cdb5ce9679040f01d20c66e", + "uncompressed_size": 4822, + "compressed_size": 4832 + }, + { + "id": "b3409d4a9fcdec6e399d12c2b64d0cf7786484f1c2a31436ec1326062da149b1", + "uncompressed_size": 2727, + "compressed_size": 2737 + }, + { + "id": "dde6cb93dfac2aac6789826afc79f1d39e58e507199251adea3457df0ddab23e", + "uncompressed_size": 11307, + "compressed_size": 11317 + }, + { + "id": "27bf7a49aa9073498f42e90809c7f18758b393aa7e84444f2dee5bb812178fdc", + "uncompressed_size": 5798, + "compressed_size": 5808 + }, + { + "id": "afc1b09ab628beb2f7dc7898288926fe90781cd9c585d30cac991b23debeaba5", + "uncompressed_size": 3437, + "compressed_size": 3447 + }, + { + "id": "4c15e039cf1bb4b65c38c817a44f7098774629d7963c722c9afc56fdfded1516", + "uncompressed_size": 9322, + "compressed_size": 9332 + }, + { + "id": "df90db1cdcb03e41dda52b5db865be5efa0844d1d12bc0776d62f16305c990d6", + "uncompressed_size": 2271, + "compressed_size": 2281 + }, + { + "id": "3bd38e17912b4dc1b58e730e02d26b52ce61c2dd6d608215b9984241a37c5632", + "uncompressed_size": 8366, + "compressed_size": 8376 + }, + { + "id": "2f00447fdec253959286341965cdb408ebb584968c1df40aff832815b871500a", + "uncompressed_size": 2619, + "compressed_size": 2629 + }, + { + "id": "e03384213f0cf21d0bffc11a608be7e8030325dc0e4b096ef88c07eaf3fd61bd", + "uncompressed_size": 6646, + "compressed_size": 6656 + }, + { + "id": "ab06a02fa04beccb823877f03f316281e31caf4569cc79325d2b8cd2e555dcb5", + "uncompressed_size": 5252, + "compressed_size": 5262 + }, + { + "id": "4c6640dd18eb6b9fbcd3d44b5132748b8fc04f1f60bb9771d77e8352f9df535e", + "uncompressed_size": 16332, + "compressed_size": 16342 + }, + { + "id": "942816746bd720b8472a0ac5842bdfc9e2ff952562b7ce21bf5c3e951ba65c25", + "uncompressed_size": 3968, + "compressed_size": 3978 + }, + { + "id": "3600ac465e51bb8824d65b0a923e290564bad2cf82c994c730e47c02d997c4c9", + "uncompressed_size": 3883, + "compressed_size": 3893 + }, + { + "id": "2c7ef388e76dd322fff557f2b3411969ecbb84e1647670d2b1875d0aa2dbb57a", + "uncompressed_size": 5862, + "compressed_size": 5872 + }, + { + "id": "15766c58113b2461d6b3d49e9851b3c9d3481f0ad18bee88d4ba938517818b84", + "uncompressed_size": 23871, + "compressed_size": 23881 + }, + { + "id": "4beab041e270eea4c63003058f22fa326dd3df80b85fe937571ed5383b2677bd", + "uncompressed_size": 6850, + "compressed_size": 6860 + }, + { + "id": "2fd7fa2bf16ae9e0a980a464f00c946eeecf663e8f986f9f4a0e26e69f545edb", + "uncompressed_size": 4263, + "compressed_size": 4273 + }, + { + "id": "a01b1bea33a69851870b1e8a2904ae7d59fb93567fa8b4deb83ce09f109953a7", + "uncompressed_size": 2588, + "compressed_size": 2598 + }, + { + "id": "768529d605f3f127501e138b7e3ee572791491c0e8b06601bef9b04bad32f54d", + "uncompressed_size": 11934, + "compressed_size": 11944 + }, + { + "id": "52248de891079acad594a9151476d05f22447ddb4a221cfb537398ad32d81960", + "uncompressed_size": 2963, + "compressed_size": 2973 + }, + { + "id": "c4107e9922804ae0fa230a4d43e69fb870b704af21f48ef1a3c6838ed453e655", + "uncompressed_size": 14311, + "compressed_size": 14321 + }, + { + "id": "c547bdb4672d6601110bb157299000db11279f039e39cbd01605734b439d8d61", + "uncompressed_size": 11661, + "compressed_size": 11671 + }, + { + "id": "f9dac3f258e5e1599532495a2f50962f37acb9dacacc2cecbc369da6266661be", + "uncompressed_size": 7836, + "compressed_size": 7846 + }, + { + "id": "468cf73300c4ae8a3583f7d2cf2d4275334f203f0069ef849b3bc42093360b7c", + "uncompressed_size": 3788, + "compressed_size": 3798 + }, + { + "id": "564c338bb087cc1dc59a54ee41157ec633738e1315f63c922c58cfb96c3d0456", + "uncompressed_size": 6219, + "compressed_size": 6229 + }, + { + "id": "cfaccfbf4eff62e6fd699de3d52ca2f2f64774b7931874377e5414bc847134f6", + "uncompressed_size": 4703, + "compressed_size": 4713 + }, + { + "id": "87115b6732091d6c020e876792d00af0ee9488af0dea678e818af0ceca9f6449", + "uncompressed_size": 2420, + "compressed_size": 2430 + }, + { + "id": "8726865ee019d8594d65c6cbb984c13354348f7f69ef1a4911d34d92c601d369", + "uncompressed_size": 24082, + "compressed_size": 24092 + }, + { + "id": "91e7c49577ba5f04d6b80911e8ea8f8e08a5c1b2ec90cb2a3dcd9e0c2615416c", + "uncompressed_size": 2836, + "compressed_size": 2846 + }, + { + "id": "c42207d61e7a62a2af6e61dd92ed3569c7c8919df85001b32af68bbcc5be3e10", + "uncompressed_size": 3678, + "compressed_size": 3688 + }, + { + "id": "4b195544c4087551b3bbe6431cbd39a651e5838be81a64b4a72568c367158f8b", + "uncompressed_size": 32768, + "compressed_size": 4146 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768, + "compressed_size": 19 + }, + { + "id": "c63df6475b38c773015a674bfbab1ff8ff8f0e6b7dfc7ba9428e9b21e5deacb9", + "uncompressed_size": 4109, + "compressed_size": 20 + } +] diff --git a/cmd/desync/testdata/blob2_chunks_info_missing.json b/cmd/desync/testdata/blob2_chunks_info_missing.json new file mode 100644 index 0000000..d026141 --- /dev/null +++ b/cmd/desync/testdata/blob2_chunks_info_missing.json @@ -0,0 +1,671 @@ +[ + { + "id": "d2e3762144a126b641b7757bf5dee95c43b1de3b9b3e1e9c3fea623096fb0cf4", + "uncompressed_size": 3505 + }, + { + "id": "e702c5963bff441d2e234f73090ba9c83d5fe9702909ac64fcd5fb134c325ea5", + "uncompressed_size": 9493 + }, + { + "id": "6de3e3ea133c960c7cc89e0087681f8d375292ac433de386ea37d88c45501778", + "uncompressed_size": 6084 + }, + { + "id": "517b522b5db27b73425e5977a4516326174b0bc7ae91578065c7745293706b49", + "uncompressed_size": 17147 + }, + { + "id": "fafc5d97d401a2cfa8e542f146a2af0d8f2364294dbcd37073451b3cd489884c", + "uncompressed_size": 7561 + }, + { + "id": "e5e0a38afb58feac768ad4919d1e762ed582eb46ee91080cff8ce09450b5d704", + "uncompressed_size": 7479 + }, + { + "id": "12ac2ff1fff70ee61e54476925696048d36ffaebe7697f342b65a6877c68363b", + "uncompressed_size": 2429 + }, + { + "id": "233901dd45db80875c342a91aec7bdc4b0ba420b13ceb3dddee2db341da73b3b", + "uncompressed_size": 6716 + }, + { + "id": "b70ae32356e3db0ca63558400464a74c901ff115c9052446ae1426b97e11b94f", + "uncompressed_size": 10742 + }, + { + "id": "ae66892b1ef96c9fb41d4b8fc547651a2e07fdba0ffac08d4061287291f7467b", + "uncompressed_size": 7535 + }, + { + "id": "43fece6af6b1a221ac8a2c91cb85a794b20c249a0e25c1ac1f9114919ed13808", + "uncompressed_size": 10790 + }, + { + "id": "8005399850d2d3b7c0342f962cdfc6db3c5e1c56f4cfd79c208c6f226a57722e", + "uncompressed_size": 9324 + }, + { + "id": "e8f57d8b756e7e26de504db4e651e4beaca4cd8d913ab076b5792dd28c4b5d83", + "uncompressed_size": 6333 + }, + { + "id": "8ed9dfbb39964137fb57dd8750c691667f4cf9a3ef833b6600b105ca526cbc45", + "uncompressed_size": 14555 + }, + { + "id": "941cbf16c0e1e2087e74a48509e5e38093980050ceb9d44614c4a652d9a70780", + "uncompressed_size": 5925 + }, + { + "id": "16cf178d36470db634478d5757dc83dfefd539719019ba087b87ffc5cd9bf451", + "uncompressed_size": 2583 + }, + { + "id": "4428693eb91fef01af5ff205199aa66b263b6a84555ca42411cbdb04308c9329", + "uncompressed_size": 2289 + }, + { + "id": "4b9ec671c0f38fc5c98d240ea17fdab8f45f8c6c0b038295ab2282c2426ca41c", + "uncompressed_size": 11596, + "compressed_size": 11610 + }, + { + "id": "b26e0621f4095dbd24d2eb2fd2d90e73e7d16f62f2187dd39dab4f3f583a9934", + "uncompressed_size": 17373 + }, + { + "id": "eff03ad852bf628e98b1c2315e2c6761039ff3325debb6a0dd2bb922729d71a6", + "uncompressed_size": 4156 + }, + { + "id": "4ec40ccbafd604f2fc4901a0499021d724b9beb88c111dd3206ed95aebeea107", + "uncompressed_size": 5433 + }, + { + "id": "f8b06183ec82b67b27cc2ca7920c4c368c413a90b4a22717b132a589bb5b6cd8", + "uncompressed_size": 3840 + }, + { + "id": "23d6616332ed4874bb9eeefab8ddc341749b974a5a05f4498409d625b308fee3", + "uncompressed_size": 3218 + }, + { + "id": "428ecd563456ca8e46445b703c7b218a798a5e8642ecd4d78d74f64f4f9e1928", + "uncompressed_size": 6947 + }, + { + "id": "91944c6d8e9ff59afe57191d17a914cdc17a9716bc31d9ad265a878dbac4dbca", + "uncompressed_size": 7630 + }, + { + "id": "21c98b35fd4e985936176a3a59b6a7fe19eef836b9d88b304422e1b883367db9", + "uncompressed_size": 6580 + }, + { + "id": "db5c65c2dc056d7b99d5c5ba3a81911c649278d1f855be13bbb888887c4fe7a3", + "uncompressed_size": 6573 + }, + { + "id": "79b34da61f331086f14e3e0e385a5faabc139da42c20d5694296967a830164be", + "uncompressed_size": 26731 + }, + { + "id": "13f074f217b3a4ecf9c628535fac8f8df71468bc4c2ad5965ff9593b41b5905e", + "uncompressed_size": 6021 + }, + { + "id": "3d14b34541510c93ab1117665dfcf47961a8b47270695f2c1cf4096340b69d38", + "uncompressed_size": 7038, + "compressed_size": 7052 + }, + { + "id": "20bfe5969582ebbc266cc8271f17dbaadb6a9825c9c0750f9292d556c322975b", + "uncompressed_size": 16871 + }, + { + "id": "b416f357a8fb32632369769f0cc977003c72245f02529f4e62dd34124df1c10b", + "uncompressed_size": 5351 + }, + { + "id": "c71a45d5eb09c39201166e06f68aa854c61a6f5b619fda01e4ddaeeea1c52145", + "uncompressed_size": 30823 + }, + { + "id": "3e743f498c346ba239148821fd01e826ea89a619856ec969663dbb6228de2401", + "uncompressed_size": 13387, + "compressed_size": 13401 + }, + { + "id": "e45417f34ca8ac1f873986e9b370b5b26e00d101ddfab1801519569e073c66c4", + "uncompressed_size": 6594 + }, + { + "id": "3a1e0c3ce74489ca872f4c197cc8837561403f361e62ba080dfdc232cc1a9f44", + "uncompressed_size": 3272, + "compressed_size": 3286 + }, + { + "id": "3f85dbefac8e408f8cf4b1113e75283e0bed9bcade97e2b58d8716dc9c16c00a", + "uncompressed_size": 5396, + "compressed_size": 5410 + }, + { + "id": "b725b4091f398468212f13556af497a4c331a1140ebc24698f2385710a6bf673", + "uncompressed_size": 24984 + }, + { + "id": "6fd1812485ddeaee65c8d1f7e1357870d4997c04d329eb7625989b3ce4ff7fe2", + "uncompressed_size": 5297 + }, + { + "id": "f65ae9f509c87b5fbda4229e4f14e3d76bcbb73408e5b400f7b1cdb736e76f46", + "uncompressed_size": 9253 + }, + { + "id": "fe80908e0986a86574172731bb57c08305881418d4023ca64c66ca7c57af79f2", + "uncompressed_size": 2196 + }, + { + "id": "df0e343380e43ecf7ad7f94afaef8eb7f5b2d95a514cd20f74ebdbffcf62af41", + "uncompressed_size": 4435 + }, + { + "id": "5d274122b4bfb50e42bd748432b31c0ce916fc1bc713cff10f4d6d08752a5236", + "uncompressed_size": 16604 + }, + { + "id": "483314148c355efd3b3834bb118469c52778309c5382cc031b1603a054535a00", + "uncompressed_size": 7509 + }, + { + "id": "f616a8077fb0d1ba3028566b5be884653448d6ca9de54ab1805c32f2d955ce28", + "uncompressed_size": 8199 + }, + { + "id": "cd36ea979295c6358bec58a04971aedad3cfe71ba1fa06fb4d1d17a2c7d39ec0", + "uncompressed_size": 3835 + }, + { + "id": "69a1c274ab9f76d264943d0f82a32fda55a620f74ae513da64af83d0913c861e", + "uncompressed_size": 8030 + }, + { + "id": "d44a8f5501a6efb23acbcfb529da684c9d547eb048f535dff6365e8bf258edd0", + "uncompressed_size": 8190 + }, + { + "id": "949c6bb3d457c245208e6ea67dc2ca93feca0d0b115013da43e4c8b60a0118b0", + "uncompressed_size": 5965 + }, + { + "id": "6c99c678b0d39fa3ab3552d90f3bf75dc56a3fb42fdc9a7bb6d2a373f37ff93f", + "uncompressed_size": 4716 + }, + { + "id": "db607e47cb3ed3992914b5205a68777397790ed85ec99487556e769a1dd9e867", + "uncompressed_size": 11275 + }, + { + "id": "4d381c664f29a74e27cb736b4ebcc6f3c2e415816d7899ca91324bfab478df96", + "uncompressed_size": 18257, + "compressed_size": 18271 + }, + { + "id": "78c32f74a201ef42f0a4fb40249c06f41ae7689c2cfcc4558a747a8e46c07b59", + "uncompressed_size": 10008 + }, + { + "id": "e16becd8b4d7eed84236c59257660dd491f32f51f7669745b8c7e48bd4c849c2", + "uncompressed_size": 3378 + }, + { + "id": "38bf0dd5954eb9021f6ec26d9c4f34c2a6fd92cb1cc4ad1ce670f4f866859ecd", + "uncompressed_size": 2950 + }, + { + "id": "9a75d52a06769bde595c47dda2bcc0559e57cb20fe346e87c12d68d2bbab67bb", + "uncompressed_size": 4167 + }, + { + "id": "3b96dda633ff88025ad87d4d32c5e0a4bd688f50810c877fbdf5a64159a23492", + "uncompressed_size": 3814, + "compressed_size": 3828 + }, + { + "id": "231e4a2df532cb913fbbc9e0a2a6ff8582ea1d79593c65ef964160ce71ed0aee", + "uncompressed_size": 3050 + }, + { + "id": "15cc115dc5d8bef2fea4cb8ec58fa86d86f5bebb47577670154e625e67ac9e42", + "uncompressed_size": 20234 + }, + { + "id": "1e0000e37470d0dd91e99870d55a73b7da77b106e35cbc7be9d984256117b752", + "uncompressed_size": 24349, + "compressed_size": 24363 + }, + { + "id": "b107f0641e84a97c2793db7393d5d64be78a6687ae9c868f1ac5ec9e5ea670fc", + "uncompressed_size": 18490 + }, + { + "id": "1ea441aee6d76c8e6883238331c325d7023e640f03d4e3d15b3ddb5145cf403a", + "uncompressed_size": 22148, + "compressed_size": 22162 + }, + { + "id": "dda036db05bc2b99b6b9303d28496000c34b246457ae4bbf00fe625b5cabd7cd", + "uncompressed_size": 12438 + }, + { + "id": "06b727fda4024fbf864090e62fb66597ed6ddf265b428601e4bbf1a3b51851bd", + "uncompressed_size": 3947 + }, + { + "id": "ce9f9d4acac16288909bdb38098d01758e79392576d86fd619f087c75a235487", + "uncompressed_size": 9563 + }, + { + "id": "56599127c27298e718c06d5b9a20e87f8352b3465ec21f9c02ee973615e66538", + "uncompressed_size": 2899 + }, + { + "id": "9350cae7c6e456287014ed0d93659e8ce921a72e8128cc70e96e0652d682ca39", + "uncompressed_size": 7081 + }, + { + "id": "3c1a2f81236e8e396a7cbbb7e608f4f91f6ec0a1043558733a56354b3e843447", + "uncompressed_size": 32768, + "compressed_size": 32782 + }, + { + "id": "3bd5965865d888bb32744678ed2e50eaed96f36c615b0c8cc052a8aeeeea7647", + "uncompressed_size": 4737, + "compressed_size": 4751 + }, + { + "id": "3195dd72158802ef625883ed4f233a8f010cbf222dc415605b3d4ab1ea97dcd6", + "uncompressed_size": 6434 + }, + { + "id": "a017728934f681c33e198399152595a85ddf331272a9156ad471f8199ef9077b", + "uncompressed_size": 4627 + }, + { + "id": "4a4ebf42f9ff30957240f940a6edf4e384625d1aca283ac0830d9860a0c6f1a9", + "uncompressed_size": 3474, + "compressed_size": 3488 + }, + { + "id": "33b4e86b46d6bb7943626d2754547afaf0acaa266af14116a4d202fdceb6dc46", + "uncompressed_size": 14567 + }, + { + "id": "59ecf31c61d03edf609bd0de5f23393a7c15f16711906e85dc09fb6495c71716", + "uncompressed_size": 2079 + }, + { + "id": "9b45b1dfa92f6f7f0bd918441cc9f63c7077307cd9d8d268acc0ae565bd267c3", + "uncompressed_size": 9533 + }, + { + "id": "1588898492b6e2aacb72a042b2e414887f79ebe5dd98d906c6532789f19fb848", + "uncompressed_size": 4314 + }, + { + "id": "3d22c99f10f78c4464254a4a644009aec8b9a6298b1b25b141d404506911a7d8", + "uncompressed_size": 3827, + "compressed_size": 3841 + }, + { + "id": "b5d5d4b652032ebfa5af34ebcc1b1c4a282e517e2e0d1985e731e7a4f23e87fe", + "uncompressed_size": 5132 + }, + { + "id": "df74e4a1db4bbf988591fe46387fd008b898a35f7322fe9a88499e904ba75c26", + "uncompressed_size": 5399 + }, + { + "id": "76f8b379dc3dc6925ed685c9e1ade230c2c4772678d96a17f9dc864e68130688", + "uncompressed_size": 2525 + }, + { + "id": "4f1e2f567fe2bb6238cb72d6a703cd4a21c0930b7f1520ea2901860136a18327", + "uncompressed_size": 6918 + }, + { + "id": "12123a0e8253bc9573936c5ee3682843f74d017113f5163897bcd6203c04529b", + "uncompressed_size": 2253 + }, + { + "id": "f0fb63ab00505789523727a6f9bd03c1e5e8e77ffe6403bb4d24ca61ba535ede", + "uncompressed_size": 2522 + }, + { + "id": "478f1358d61b5c7d060e9708dda3819ae272cddedb192aaf2b21e7feee45bea9", + "uncompressed_size": 4026 + }, + { + "id": "7ac0f766f2ddbe36523dc7e30f897f9e535557403fcec8fae4746ce1c7bc82d1", + "uncompressed_size": 13797 + }, + { + "id": "c370cd3fa64c752e3c3d1fc6fd6019a69fe8c03853686645ff3b0cfa59fa7a07", + "uncompressed_size": 5636 + }, + { + "id": "cfae4fdc791644d202cd95f35494d5ec2e8e4dd89831d5a7478351473f97838b", + "uncompressed_size": 2897 + }, + { + "id": "c945782661970af43eeefc5765b0f071533514c838e277de804a544c9b4b27c7", + "uncompressed_size": 8203 + }, + { + "id": "089e58577e81aabc20ed4179e143c22235bc3a986b9d6ec5cb4208939866b489", + "uncompressed_size": 6909 + }, + { + "id": "931465ab10bb2ba577d4c38c1160a2554d322a08ebfb4e838196414da0de3d6d", + "uncompressed_size": 8394 + }, + { + "id": "6709811d1097670e5e2096e5fb41787bff80130abe17650af451af3ef31aba11", + "uncompressed_size": 12134 + }, + { + "id": "1f592a09dcc63a0bead5787876afbbaef734235e5025ce17c91d1b0180d687d5", + "uncompressed_size": 2750, + "compressed_size": 2764 + }, + { + "id": "4a2e9f8b881068295cf539094c25cf609165c717d6bff95a38159ec2082af8b8", + "uncompressed_size": 2870, + "compressed_size": 2884 + }, + { + "id": "0d44b9fa2e55177e14e7cd1badad5c8e39d2f51027c9358cf2b08ac2d3163942", + "uncompressed_size": 6176, + "compressed_size": 6190 + }, + { + "id": "172fbb94647981287ef92273b840901711540d8f22d9e016c7d9be3dbe15253f", + "uncompressed_size": 7855 + }, + { + "id": "3fba59861aa7ea797285b88c0bb3dd4676276bd29d8e471cab834f32117d8b47", + "uncompressed_size": 7928, + "compressed_size": 7942 + }, + { + "id": "89d1b5112ef335d1dd36e915ba0b1cd4a950542d5cbe2b47daccf257ee4a3f9b", + "uncompressed_size": 4587 + }, + { + "id": "37fa8682c19d1f4dc584f70c8b122b954eb8abae1cdb5ce9679040f01d20c66e", + "uncompressed_size": 4822 + }, + { + "id": "b3409d4a9fcdec6e399d12c2b64d0cf7786484f1c2a31436ec1326062da149b1", + "uncompressed_size": 2727 + }, + { + "id": "dde6cb93dfac2aac6789826afc79f1d39e58e507199251adea3457df0ddab23e", + "uncompressed_size": 11307 + }, + { + "id": "27bf7a49aa9073498f42e90809c7f18758b393aa7e84444f2dee5bb812178fdc", + "uncompressed_size": 5798 + }, + { + "id": "afc1b09ab628beb2f7dc7898288926fe90781cd9c585d30cac991b23debeaba5", + "uncompressed_size": 3437 + }, + { + "id": "4c15e039cf1bb4b65c38c817a44f7098774629d7963c722c9afc56fdfded1516", + "uncompressed_size": 9322, + "compressed_size": 9336 + }, + { + "id": "df90db1cdcb03e41dda52b5db865be5efa0844d1d12bc0776d62f16305c990d6", + "uncompressed_size": 2271 + }, + { + "id": "3bd38e17912b4dc1b58e730e02d26b52ce61c2dd6d608215b9984241a37c5632", + "uncompressed_size": 8366, + "compressed_size": 8380 + }, + { + "id": "2f00447fdec253959286341965cdb408ebb584968c1df40aff832815b871500a", + "uncompressed_size": 2619, + "compressed_size": 2633 + }, + { + "id": "e03384213f0cf21d0bffc11a608be7e8030325dc0e4b096ef88c07eaf3fd61bd", + "uncompressed_size": 6646 + }, + { + "id": "ab06a02fa04beccb823877f03f316281e31caf4569cc79325d2b8cd2e555dcb5", + "uncompressed_size": 5252 + }, + { + "id": "4c6640dd18eb6b9fbcd3d44b5132748b8fc04f1f60bb9771d77e8352f9df535e", + "uncompressed_size": 16332, + "compressed_size": 16346 + }, + { + "id": "942816746bd720b8472a0ac5842bdfc9e2ff952562b7ce21bf5c3e951ba65c25", + "uncompressed_size": 3968 + }, + { + "id": "3600ac465e51bb8824d65b0a923e290564bad2cf82c994c730e47c02d997c4c9", + "uncompressed_size": 3883 + }, + { + "id": "2c7ef388e76dd322fff557f2b3411969ecbb84e1647670d2b1875d0aa2dbb57a", + "uncompressed_size": 5862, + "compressed_size": 5876 + }, + { + "id": "15766c58113b2461d6b3d49e9851b3c9d3481f0ad18bee88d4ba938517818b84", + "uncompressed_size": 23871 + }, + { + "id": "4beab041e270eea4c63003058f22fa326dd3df80b85fe937571ed5383b2677bd", + "uncompressed_size": 6850, + "compressed_size": 6864 + }, + { + "id": "2fd7fa2bf16ae9e0a980a464f00c946eeecf663e8f986f9f4a0e26e69f545edb", + "uncompressed_size": 4263, + "compressed_size": 4277 + }, + { + "id": "a01b1bea33a69851870b1e8a2904ae7d59fb93567fa8b4deb83ce09f109953a7", + "uncompressed_size": 2588 + }, + { + "id": "768529d605f3f127501e138b7e3ee572791491c0e8b06601bef9b04bad32f54d", + "uncompressed_size": 11934 + }, + { + "id": "52248de891079acad594a9151476d05f22447ddb4a221cfb537398ad32d81960", + "uncompressed_size": 2963 + }, + { + "id": "c4107e9922804ae0fa230a4d43e69fb870b704af21f48ef1a3c6838ed453e655", + "uncompressed_size": 14311 + }, + { + "id": "c547bdb4672d6601110bb157299000db11279f039e39cbd01605734b439d8d61", + "uncompressed_size": 11661 + }, + { + "id": "f9dac3f258e5e1599532495a2f50962f37acb9dacacc2cecbc369da6266661be", + "uncompressed_size": 7836 + }, + { + "id": "468cf73300c4ae8a3583f7d2cf2d4275334f203f0069ef849b3bc42093360b7c", + "uncompressed_size": 3788 + }, + { + "id": "564c338bb087cc1dc59a54ee41157ec633738e1315f63c922c58cfb96c3d0456", + "uncompressed_size": 6219 + }, + { + "id": "cfaccfbf4eff62e6fd699de3d52ca2f2f64774b7931874377e5414bc847134f6", + "uncompressed_size": 4703 + }, + { + "id": "87115b6732091d6c020e876792d00af0ee9488af0dea678e818af0ceca9f6449", + "uncompressed_size": 2420 + }, + { + "id": "8726865ee019d8594d65c6cbb984c13354348f7f69ef1a4911d34d92c601d369", + "uncompressed_size": 24082 + }, + { + "id": "91e7c49577ba5f04d6b80911e8ea8f8e08a5c1b2ec90cb2a3dcd9e0c2615416c", + "uncompressed_size": 2836 + }, + { + "id": "c42207d61e7a62a2af6e61dd92ed3569c7c8919df85001b32af68bbcc5be3e10", + "uncompressed_size": 3678 + }, + { + "id": "4b195544c4087551b3bbe6431cbd39a651e5838be81a64b4a72568c367158f8b", + "uncompressed_size": 32768, + "compressed_size": 4168 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "c63df6475b38c773015a674bfbab1ff8ff8f0e6b7dfc7ba9428e9b21e5deacb9", + "uncompressed_size": 4109 + } +] diff --git a/cmd/desync/testdata/blob2_chunks_info_no_store.json b/cmd/desync/testdata/blob2_chunks_info_no_store.json new file mode 100644 index 0000000..1a90925 --- /dev/null +++ b/cmd/desync/testdata/blob2_chunks_info_no_store.json @@ -0,0 +1,646 @@ +[ + { + "id": "d2e3762144a126b641b7757bf5dee95c43b1de3b9b3e1e9c3fea623096fb0cf4", + "uncompressed_size": 3505 + }, + { + "id": "e702c5963bff441d2e234f73090ba9c83d5fe9702909ac64fcd5fb134c325ea5", + "uncompressed_size": 9493 + }, + { + "id": "6de3e3ea133c960c7cc89e0087681f8d375292ac433de386ea37d88c45501778", + "uncompressed_size": 6084 + }, + { + "id": "517b522b5db27b73425e5977a4516326174b0bc7ae91578065c7745293706b49", + "uncompressed_size": 17147 + }, + { + "id": "fafc5d97d401a2cfa8e542f146a2af0d8f2364294dbcd37073451b3cd489884c", + "uncompressed_size": 7561 + }, + { + "id": "e5e0a38afb58feac768ad4919d1e762ed582eb46ee91080cff8ce09450b5d704", + "uncompressed_size": 7479 + }, + { + "id": "12ac2ff1fff70ee61e54476925696048d36ffaebe7697f342b65a6877c68363b", + "uncompressed_size": 2429 + }, + { + "id": "233901dd45db80875c342a91aec7bdc4b0ba420b13ceb3dddee2db341da73b3b", + "uncompressed_size": 6716 + }, + { + "id": "b70ae32356e3db0ca63558400464a74c901ff115c9052446ae1426b97e11b94f", + "uncompressed_size": 10742 + }, + { + "id": "ae66892b1ef96c9fb41d4b8fc547651a2e07fdba0ffac08d4061287291f7467b", + "uncompressed_size": 7535 + }, + { + "id": "43fece6af6b1a221ac8a2c91cb85a794b20c249a0e25c1ac1f9114919ed13808", + "uncompressed_size": 10790 + }, + { + "id": "8005399850d2d3b7c0342f962cdfc6db3c5e1c56f4cfd79c208c6f226a57722e", + "uncompressed_size": 9324 + }, + { + "id": "e8f57d8b756e7e26de504db4e651e4beaca4cd8d913ab076b5792dd28c4b5d83", + "uncompressed_size": 6333 + }, + { + "id": "8ed9dfbb39964137fb57dd8750c691667f4cf9a3ef833b6600b105ca526cbc45", + "uncompressed_size": 14555 + }, + { + "id": "941cbf16c0e1e2087e74a48509e5e38093980050ceb9d44614c4a652d9a70780", + "uncompressed_size": 5925 + }, + { + "id": "16cf178d36470db634478d5757dc83dfefd539719019ba087b87ffc5cd9bf451", + "uncompressed_size": 2583 + }, + { + "id": "4428693eb91fef01af5ff205199aa66b263b6a84555ca42411cbdb04308c9329", + "uncompressed_size": 2289 + }, + { + "id": "4b9ec671c0f38fc5c98d240ea17fdab8f45f8c6c0b038295ab2282c2426ca41c", + "uncompressed_size": 11596 + }, + { + "id": "b26e0621f4095dbd24d2eb2fd2d90e73e7d16f62f2187dd39dab4f3f583a9934", + "uncompressed_size": 17373 + }, + { + "id": "eff03ad852bf628e98b1c2315e2c6761039ff3325debb6a0dd2bb922729d71a6", + "uncompressed_size": 4156 + }, + { + "id": "4ec40ccbafd604f2fc4901a0499021d724b9beb88c111dd3206ed95aebeea107", + "uncompressed_size": 5433 + }, + { + "id": "f8b06183ec82b67b27cc2ca7920c4c368c413a90b4a22717b132a589bb5b6cd8", + "uncompressed_size": 3840 + }, + { + "id": "23d6616332ed4874bb9eeefab8ddc341749b974a5a05f4498409d625b308fee3", + "uncompressed_size": 3218 + }, + { + "id": "428ecd563456ca8e46445b703c7b218a798a5e8642ecd4d78d74f64f4f9e1928", + "uncompressed_size": 6947 + }, + { + "id": "91944c6d8e9ff59afe57191d17a914cdc17a9716bc31d9ad265a878dbac4dbca", + "uncompressed_size": 7630 + }, + { + "id": "21c98b35fd4e985936176a3a59b6a7fe19eef836b9d88b304422e1b883367db9", + "uncompressed_size": 6580 + }, + { + "id": "db5c65c2dc056d7b99d5c5ba3a81911c649278d1f855be13bbb888887c4fe7a3", + "uncompressed_size": 6573 + }, + { + "id": "79b34da61f331086f14e3e0e385a5faabc139da42c20d5694296967a830164be", + "uncompressed_size": 26731 + }, + { + "id": "13f074f217b3a4ecf9c628535fac8f8df71468bc4c2ad5965ff9593b41b5905e", + "uncompressed_size": 6021 + }, + { + "id": "3d14b34541510c93ab1117665dfcf47961a8b47270695f2c1cf4096340b69d38", + "uncompressed_size": 7038 + }, + { + "id": "20bfe5969582ebbc266cc8271f17dbaadb6a9825c9c0750f9292d556c322975b", + "uncompressed_size": 16871 + }, + { + "id": "b416f357a8fb32632369769f0cc977003c72245f02529f4e62dd34124df1c10b", + "uncompressed_size": 5351 + }, + { + "id": "c71a45d5eb09c39201166e06f68aa854c61a6f5b619fda01e4ddaeeea1c52145", + "uncompressed_size": 30823 + }, + { + "id": "3e743f498c346ba239148821fd01e826ea89a619856ec969663dbb6228de2401", + "uncompressed_size": 13387 + }, + { + "id": "e45417f34ca8ac1f873986e9b370b5b26e00d101ddfab1801519569e073c66c4", + "uncompressed_size": 6594 + }, + { + "id": "3a1e0c3ce74489ca872f4c197cc8837561403f361e62ba080dfdc232cc1a9f44", + "uncompressed_size": 3272 + }, + { + "id": "3f85dbefac8e408f8cf4b1113e75283e0bed9bcade97e2b58d8716dc9c16c00a", + "uncompressed_size": 5396 + }, + { + "id": "b725b4091f398468212f13556af497a4c331a1140ebc24698f2385710a6bf673", + "uncompressed_size": 24984 + }, + { + "id": "6fd1812485ddeaee65c8d1f7e1357870d4997c04d329eb7625989b3ce4ff7fe2", + "uncompressed_size": 5297 + }, + { + "id": "f65ae9f509c87b5fbda4229e4f14e3d76bcbb73408e5b400f7b1cdb736e76f46", + "uncompressed_size": 9253 + }, + { + "id": "fe80908e0986a86574172731bb57c08305881418d4023ca64c66ca7c57af79f2", + "uncompressed_size": 2196 + }, + { + "id": "df0e343380e43ecf7ad7f94afaef8eb7f5b2d95a514cd20f74ebdbffcf62af41", + "uncompressed_size": 4435 + }, + { + "id": "5d274122b4bfb50e42bd748432b31c0ce916fc1bc713cff10f4d6d08752a5236", + "uncompressed_size": 16604 + }, + { + "id": "483314148c355efd3b3834bb118469c52778309c5382cc031b1603a054535a00", + "uncompressed_size": 7509 + }, + { + "id": "f616a8077fb0d1ba3028566b5be884653448d6ca9de54ab1805c32f2d955ce28", + "uncompressed_size": 8199 + }, + { + "id": "cd36ea979295c6358bec58a04971aedad3cfe71ba1fa06fb4d1d17a2c7d39ec0", + "uncompressed_size": 3835 + }, + { + "id": "69a1c274ab9f76d264943d0f82a32fda55a620f74ae513da64af83d0913c861e", + "uncompressed_size": 8030 + }, + { + "id": "d44a8f5501a6efb23acbcfb529da684c9d547eb048f535dff6365e8bf258edd0", + "uncompressed_size": 8190 + }, + { + "id": "949c6bb3d457c245208e6ea67dc2ca93feca0d0b115013da43e4c8b60a0118b0", + "uncompressed_size": 5965 + }, + { + "id": "6c99c678b0d39fa3ab3552d90f3bf75dc56a3fb42fdc9a7bb6d2a373f37ff93f", + "uncompressed_size": 4716 + }, + { + "id": "db607e47cb3ed3992914b5205a68777397790ed85ec99487556e769a1dd9e867", + "uncompressed_size": 11275 + }, + { + "id": "4d381c664f29a74e27cb736b4ebcc6f3c2e415816d7899ca91324bfab478df96", + "uncompressed_size": 18257 + }, + { + "id": "78c32f74a201ef42f0a4fb40249c06f41ae7689c2cfcc4558a747a8e46c07b59", + "uncompressed_size": 10008 + }, + { + "id": "e16becd8b4d7eed84236c59257660dd491f32f51f7669745b8c7e48bd4c849c2", + "uncompressed_size": 3378 + }, + { + "id": "38bf0dd5954eb9021f6ec26d9c4f34c2a6fd92cb1cc4ad1ce670f4f866859ecd", + "uncompressed_size": 2950 + }, + { + "id": "9a75d52a06769bde595c47dda2bcc0559e57cb20fe346e87c12d68d2bbab67bb", + "uncompressed_size": 4167 + }, + { + "id": "3b96dda633ff88025ad87d4d32c5e0a4bd688f50810c877fbdf5a64159a23492", + "uncompressed_size": 3814 + }, + { + "id": "231e4a2df532cb913fbbc9e0a2a6ff8582ea1d79593c65ef964160ce71ed0aee", + "uncompressed_size": 3050 + }, + { + "id": "15cc115dc5d8bef2fea4cb8ec58fa86d86f5bebb47577670154e625e67ac9e42", + "uncompressed_size": 20234 + }, + { + "id": "1e0000e37470d0dd91e99870d55a73b7da77b106e35cbc7be9d984256117b752", + "uncompressed_size": 24349 + }, + { + "id": "b107f0641e84a97c2793db7393d5d64be78a6687ae9c868f1ac5ec9e5ea670fc", + "uncompressed_size": 18490 + }, + { + "id": "1ea441aee6d76c8e6883238331c325d7023e640f03d4e3d15b3ddb5145cf403a", + "uncompressed_size": 22148 + }, + { + "id": "dda036db05bc2b99b6b9303d28496000c34b246457ae4bbf00fe625b5cabd7cd", + "uncompressed_size": 12438 + }, + { + "id": "06b727fda4024fbf864090e62fb66597ed6ddf265b428601e4bbf1a3b51851bd", + "uncompressed_size": 3947 + }, + { + "id": "ce9f9d4acac16288909bdb38098d01758e79392576d86fd619f087c75a235487", + "uncompressed_size": 9563 + }, + { + "id": "56599127c27298e718c06d5b9a20e87f8352b3465ec21f9c02ee973615e66538", + "uncompressed_size": 2899 + }, + { + "id": "9350cae7c6e456287014ed0d93659e8ce921a72e8128cc70e96e0652d682ca39", + "uncompressed_size": 7081 + }, + { + "id": "3c1a2f81236e8e396a7cbbb7e608f4f91f6ec0a1043558733a56354b3e843447", + "uncompressed_size": 32768 + }, + { + "id": "3bd5965865d888bb32744678ed2e50eaed96f36c615b0c8cc052a8aeeeea7647", + "uncompressed_size": 4737 + }, + { + "id": "3195dd72158802ef625883ed4f233a8f010cbf222dc415605b3d4ab1ea97dcd6", + "uncompressed_size": 6434 + }, + { + "id": "a017728934f681c33e198399152595a85ddf331272a9156ad471f8199ef9077b", + "uncompressed_size": 4627 + }, + { + "id": "4a4ebf42f9ff30957240f940a6edf4e384625d1aca283ac0830d9860a0c6f1a9", + "uncompressed_size": 3474 + }, + { + "id": "33b4e86b46d6bb7943626d2754547afaf0acaa266af14116a4d202fdceb6dc46", + "uncompressed_size": 14567 + }, + { + "id": "59ecf31c61d03edf609bd0de5f23393a7c15f16711906e85dc09fb6495c71716", + "uncompressed_size": 2079 + }, + { + "id": "9b45b1dfa92f6f7f0bd918441cc9f63c7077307cd9d8d268acc0ae565bd267c3", + "uncompressed_size": 9533 + }, + { + "id": "1588898492b6e2aacb72a042b2e414887f79ebe5dd98d906c6532789f19fb848", + "uncompressed_size": 4314 + }, + { + "id": "3d22c99f10f78c4464254a4a644009aec8b9a6298b1b25b141d404506911a7d8", + "uncompressed_size": 3827 + }, + { + "id": "b5d5d4b652032ebfa5af34ebcc1b1c4a282e517e2e0d1985e731e7a4f23e87fe", + "uncompressed_size": 5132 + }, + { + "id": "df74e4a1db4bbf988591fe46387fd008b898a35f7322fe9a88499e904ba75c26", + "uncompressed_size": 5399 + }, + { + "id": "76f8b379dc3dc6925ed685c9e1ade230c2c4772678d96a17f9dc864e68130688", + "uncompressed_size": 2525 + }, + { + "id": "4f1e2f567fe2bb6238cb72d6a703cd4a21c0930b7f1520ea2901860136a18327", + "uncompressed_size": 6918 + }, + { + "id": "12123a0e8253bc9573936c5ee3682843f74d017113f5163897bcd6203c04529b", + "uncompressed_size": 2253 + }, + { + "id": "f0fb63ab00505789523727a6f9bd03c1e5e8e77ffe6403bb4d24ca61ba535ede", + "uncompressed_size": 2522 + }, + { + "id": "478f1358d61b5c7d060e9708dda3819ae272cddedb192aaf2b21e7feee45bea9", + "uncompressed_size": 4026 + }, + { + "id": "7ac0f766f2ddbe36523dc7e30f897f9e535557403fcec8fae4746ce1c7bc82d1", + "uncompressed_size": 13797 + }, + { + "id": "c370cd3fa64c752e3c3d1fc6fd6019a69fe8c03853686645ff3b0cfa59fa7a07", + "uncompressed_size": 5636 + }, + { + "id": "cfae4fdc791644d202cd95f35494d5ec2e8e4dd89831d5a7478351473f97838b", + "uncompressed_size": 2897 + }, + { + "id": "c945782661970af43eeefc5765b0f071533514c838e277de804a544c9b4b27c7", + "uncompressed_size": 8203 + }, + { + "id": "089e58577e81aabc20ed4179e143c22235bc3a986b9d6ec5cb4208939866b489", + "uncompressed_size": 6909 + }, + { + "id": "931465ab10bb2ba577d4c38c1160a2554d322a08ebfb4e838196414da0de3d6d", + "uncompressed_size": 8394 + }, + { + "id": "6709811d1097670e5e2096e5fb41787bff80130abe17650af451af3ef31aba11", + "uncompressed_size": 12134 + }, + { + "id": "1f592a09dcc63a0bead5787876afbbaef734235e5025ce17c91d1b0180d687d5", + "uncompressed_size": 2750 + }, + { + "id": "4a2e9f8b881068295cf539094c25cf609165c717d6bff95a38159ec2082af8b8", + "uncompressed_size": 2870 + }, + { + "id": "0d44b9fa2e55177e14e7cd1badad5c8e39d2f51027c9358cf2b08ac2d3163942", + "uncompressed_size": 6176 + }, + { + "id": "172fbb94647981287ef92273b840901711540d8f22d9e016c7d9be3dbe15253f", + "uncompressed_size": 7855 + }, + { + "id": "3fba59861aa7ea797285b88c0bb3dd4676276bd29d8e471cab834f32117d8b47", + "uncompressed_size": 7928 + }, + { + "id": "89d1b5112ef335d1dd36e915ba0b1cd4a950542d5cbe2b47daccf257ee4a3f9b", + "uncompressed_size": 4587 + }, + { + "id": "37fa8682c19d1f4dc584f70c8b122b954eb8abae1cdb5ce9679040f01d20c66e", + "uncompressed_size": 4822 + }, + { + "id": "b3409d4a9fcdec6e399d12c2b64d0cf7786484f1c2a31436ec1326062da149b1", + "uncompressed_size": 2727 + }, + { + "id": "dde6cb93dfac2aac6789826afc79f1d39e58e507199251adea3457df0ddab23e", + "uncompressed_size": 11307 + }, + { + "id": "27bf7a49aa9073498f42e90809c7f18758b393aa7e84444f2dee5bb812178fdc", + "uncompressed_size": 5798 + }, + { + "id": "afc1b09ab628beb2f7dc7898288926fe90781cd9c585d30cac991b23debeaba5", + "uncompressed_size": 3437 + }, + { + "id": "4c15e039cf1bb4b65c38c817a44f7098774629d7963c722c9afc56fdfded1516", + "uncompressed_size": 9322 + }, + { + "id": "df90db1cdcb03e41dda52b5db865be5efa0844d1d12bc0776d62f16305c990d6", + "uncompressed_size": 2271 + }, + { + "id": "3bd38e17912b4dc1b58e730e02d26b52ce61c2dd6d608215b9984241a37c5632", + "uncompressed_size": 8366 + }, + { + "id": "2f00447fdec253959286341965cdb408ebb584968c1df40aff832815b871500a", + "uncompressed_size": 2619 + }, + { + "id": "e03384213f0cf21d0bffc11a608be7e8030325dc0e4b096ef88c07eaf3fd61bd", + "uncompressed_size": 6646 + }, + { + "id": "ab06a02fa04beccb823877f03f316281e31caf4569cc79325d2b8cd2e555dcb5", + "uncompressed_size": 5252 + }, + { + "id": "4c6640dd18eb6b9fbcd3d44b5132748b8fc04f1f60bb9771d77e8352f9df535e", + "uncompressed_size": 16332 + }, + { + "id": "942816746bd720b8472a0ac5842bdfc9e2ff952562b7ce21bf5c3e951ba65c25", + "uncompressed_size": 3968 + }, + { + "id": "3600ac465e51bb8824d65b0a923e290564bad2cf82c994c730e47c02d997c4c9", + "uncompressed_size": 3883 + }, + { + "id": "2c7ef388e76dd322fff557f2b3411969ecbb84e1647670d2b1875d0aa2dbb57a", + "uncompressed_size": 5862 + }, + { + "id": "15766c58113b2461d6b3d49e9851b3c9d3481f0ad18bee88d4ba938517818b84", + "uncompressed_size": 23871 + }, + { + "id": "4beab041e270eea4c63003058f22fa326dd3df80b85fe937571ed5383b2677bd", + "uncompressed_size": 6850 + }, + { + "id": "2fd7fa2bf16ae9e0a980a464f00c946eeecf663e8f986f9f4a0e26e69f545edb", + "uncompressed_size": 4263 + }, + { + "id": "a01b1bea33a69851870b1e8a2904ae7d59fb93567fa8b4deb83ce09f109953a7", + "uncompressed_size": 2588 + }, + { + "id": "768529d605f3f127501e138b7e3ee572791491c0e8b06601bef9b04bad32f54d", + "uncompressed_size": 11934 + }, + { + "id": "52248de891079acad594a9151476d05f22447ddb4a221cfb537398ad32d81960", + "uncompressed_size": 2963 + }, + { + "id": "c4107e9922804ae0fa230a4d43e69fb870b704af21f48ef1a3c6838ed453e655", + "uncompressed_size": 14311 + }, + { + "id": "c547bdb4672d6601110bb157299000db11279f039e39cbd01605734b439d8d61", + "uncompressed_size": 11661 + }, + { + "id": "f9dac3f258e5e1599532495a2f50962f37acb9dacacc2cecbc369da6266661be", + "uncompressed_size": 7836 + }, + { + "id": "468cf73300c4ae8a3583f7d2cf2d4275334f203f0069ef849b3bc42093360b7c", + "uncompressed_size": 3788 + }, + { + "id": "564c338bb087cc1dc59a54ee41157ec633738e1315f63c922c58cfb96c3d0456", + "uncompressed_size": 6219 + }, + { + "id": "cfaccfbf4eff62e6fd699de3d52ca2f2f64774b7931874377e5414bc847134f6", + "uncompressed_size": 4703 + }, + { + "id": "87115b6732091d6c020e876792d00af0ee9488af0dea678e818af0ceca9f6449", + "uncompressed_size": 2420 + }, + { + "id": "8726865ee019d8594d65c6cbb984c13354348f7f69ef1a4911d34d92c601d369", + "uncompressed_size": 24082 + }, + { + "id": "91e7c49577ba5f04d6b80911e8ea8f8e08a5c1b2ec90cb2a3dcd9e0c2615416c", + "uncompressed_size": 2836 + }, + { + "id": "c42207d61e7a62a2af6e61dd92ed3569c7c8919df85001b32af68bbcc5be3e10", + "uncompressed_size": 3678 + }, + { + "id": "4b195544c4087551b3bbe6431cbd39a651e5838be81a64b4a72568c367158f8b", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "620797b6a249553166433873ead3ab6aadd24e1750b3e71edd642a91c006d1d0", + "uncompressed_size": 32768 + }, + { + "id": "c63df6475b38c773015a674bfbab1ff8ff8f0e6b7dfc7ba9428e9b21e5deacb9", + "uncompressed_size": 4109 + } +] diff --git a/local.go b/local.go index f38c69b..cae7957 100644 --- a/local.go +++ b/local.go @@ -27,7 +27,7 @@ type LocalStore struct { // a cache. Old chunks can be identified and removed from the store that way UpdateTimes bool - opt StoreOptions + Opt StoreOptions converters Converters } @@ -42,7 +42,7 @@ func NewLocalStore(dir string, opt StoreOptions) (LocalStore, error) { if !info.IsDir() { return LocalStore{}, fmt.Errorf("%s is not a directory", dir) } - return LocalStore{Base: dir, opt: opt, converters: opt.converters()}, nil + return LocalStore{Base: dir, Opt: opt, converters: opt.converters()}, nil } // GetChunk reads and returns one (compressed!) chunk from the store @@ -52,7 +52,7 @@ func (s LocalStore) GetChunk(id ChunkID) (*Chunk, error) { if os.IsNotExist(err) { return nil, ChunkMissing{id} } - return NewChunkFromStorage(id, b, s.converters, s.opt.SkipVerify) + return NewChunkFromStorage(id, b, s.converters, s.Opt.SkipVerify) } // RemoveChunk deletes a chunk, typically an invalid one, from the filesystem. @@ -142,7 +142,7 @@ func (s LocalStore) Verify(ctx context.Context, n int, repair bool, w io.Writer) } // Skip compressed chunks if this is running in uncompressed mode and vice-versa var sID string - if s.opt.Uncompressed { + if s.Opt.Uncompressed { if !strings.HasSuffix(path, UncompressedChunkExt) { return nil } @@ -194,7 +194,7 @@ func (s LocalStore) Prune(ctx context.Context, ids map[ChunkID]struct{}) error { // Skip compressed chunks if this is running in uncompressed mode and vice-versa var sID string - if s.opt.Uncompressed { + if s.Opt.Uncompressed { if !strings.HasSuffix(path, UncompressedChunkExt) { return nil } @@ -240,14 +240,24 @@ func (s LocalStore) String() string { return s.Base } -// Close the store. NOP opertation, needed to implement Store interface. +// Close the store. NOP operation, needed to implement Store interface. func (s LocalStore) Close() error { return nil } +// GetChunkSize returns the bytes size of the raw, possibly compressed chunk in this store. +func (s LocalStore) GetChunkSize(id ChunkID) (int64, error) { + _, p := s.nameFromID(id) + i, err := os.Stat(p) + if err != nil { + return 0, err + } + return i.Size(), nil +} + func (s LocalStore) nameFromID(id ChunkID) (dir, name string) { sID := id.String() dir = filepath.Join(s.Base, sID[0:4]) name = filepath.Join(dir, sID) - if s.opt.Uncompressed { + if s.Opt.Uncompressed { name += UncompressedChunkExt } else { name += CompressedChunkExt diff --git a/types.go b/types.go index 3b79c1f..c8df06d 100644 --- a/types.go +++ b/types.go @@ -2,6 +2,7 @@ package desync import ( "encoding/hex" + "encoding/json" "github.com/pkg/errors" ) @@ -29,6 +30,22 @@ func ChunkIDFromString(id string) (ChunkID, error) { return ChunkIDFromSlice(b) } -func (c ChunkID) String() string { +func (c *ChunkID) String() string { return hex.EncodeToString(c[:]) } + +func (c *ChunkID) MarshalJSON() ([]byte, error) { + return json.Marshal(c.String()) +} + +func (c *ChunkID) UnmarshalJSON(data []byte) error { + var ( + str string + err error + ) + if err = json.Unmarshal(data, &str); err != nil { + return err + } + *c, err = ChunkIDFromString(str) + return err +}