weed mount can work well

TODO: somehow filer url is returning empty content
This commit is contained in:
Chris Lu
2018-05-22 03:26:38 -07:00
parent 9dd228747c
commit 7362de9a18
10 changed files with 206 additions and 146 deletions

View File

@@ -37,6 +37,21 @@ func CompactFileChunks(chunks []*filer_pb.FileChunk) (compacted, garbage []*file
return
}
func FindUnusedFileChunks(oldChunks, newChunks []*filer_pb.FileChunk) (unused []*filer_pb.FileChunk) {
fileIds := make(map[string]bool)
for _, interval := range newChunks {
fileIds[interval.FileId] = true
}
for _, chunk := range oldChunks {
if found := fileIds[chunk.FileId]; !found {
unused = append(unused, chunk)
}
}
return
}
func logPrintf(name string, visibles []*visibleInterval) {
// return