Commit 64ec8e46 authored by Jeromy's avatar Jeromy

implement mark and sweep GC

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>

dont GC blocks used by pinner

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>

comment GC algo

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>

add lock to blockstore to prevent GC from eating wanted blocks

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>

improve FetchGraph

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>

separate interfaces for blockstore and GCBlockstore

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>

reintroduce indirect pinning, add enumerateChildren dag method

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>
parent bd20a39b
...@@ -164,7 +164,7 @@ func runBatchFetchTest(t *testing.T, read io.Reader) { ...@@ -164,7 +164,7 @@ func runBatchFetchTest(t *testing.T, read io.Reader) {
spl := chunk.NewSizeSplitter(read, 512) spl := chunk.NewSizeSplitter(read, 512)
root, err := imp.BuildDagFromReader(dagservs[0], spl, nil) root, err := imp.BuildDagFromReader(dagservs[0], spl)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
...@@ -306,7 +306,7 @@ func TestFetchGraph(t *testing.T) { ...@@ -306,7 +306,7 @@ func TestFetchGraph(t *testing.T) {
} }
read := io.LimitReader(u.NewTimeSeededRand(), 1024*32) read := io.LimitReader(u.NewTimeSeededRand(), 1024*32)
root, err := imp.BuildDagFromReader(dservs[0], chunk.NewSizeSplitter(read, 512), nil) root, err := imp.BuildDagFromReader(dservs[0], chunk.NewSizeSplitter(read, 512))
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
...@@ -333,7 +333,7 @@ func TestEnumerateChildren(t *testing.T) { ...@@ -333,7 +333,7 @@ func TestEnumerateChildren(t *testing.T) {
ds := NewDAGService(bsi[0]) ds := NewDAGService(bsi[0])
read := io.LimitReader(u.NewTimeSeededRand(), 1024*1024) read := io.LimitReader(u.NewTimeSeededRand(), 1024*1024)
root, err := imp.BuildDagFromReader(ds, chunk.NewSizeSplitter(read, 512), nil) root, err := imp.BuildDagFromReader(ds, chunk.NewSizeSplitter(read, 512))
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment