Add NumTombstones to BlockMeta.
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
		
							parent
							
								
									9d388941ef
								
							
						
					
					
						commit
						31cf939448
					
				
							
								
								
									
										11
									
								
								block.go
								
								
								
								
							
							
						
						
									
										11
									
								
								block.go
								
								
								
								
							|  | @ -95,6 +95,9 @@ type BlockMeta struct { | ||||||
| 	Compaction struct { | 	Compaction struct { | ||||||
| 		Generation int `json:"generation"` | 		Generation int `json:"generation"` | ||||||
| 	} `json:"compaction"` | 	} `json:"compaction"` | ||||||
|  | 
 | ||||||
|  | 	// The number of tombstones.
 | ||||||
|  | 	NumTombstones int64 `json:"numTombstones"` | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| const ( | const ( | ||||||
|  | @ -278,7 +281,13 @@ Outer: | ||||||
| 	str := newMapTombstoneReader(delStones) | 	str := newMapTombstoneReader(delStones) | ||||||
| 	tombreader := newMergedTombstoneReader(tr, str) | 	tombreader := newMergedTombstoneReader(tr, str) | ||||||
| 
 | 
 | ||||||
| 	return writeTombstoneFile(pb.dir, tombreader) | 	if err := writeTombstoneFile(pb.dir, tombreader); err != nil { | ||||||
|  | 		return err | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	// TODO(gouthamve): This counts any common tombstones too. But gives the same heuristic.
 | ||||||
|  | 	pb.meta.NumTombstones += int64(len(delStones)) | ||||||
|  | 	return writeMetaFile(pb.dir, &pb.meta) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func chunkDir(dir string) string { return filepath.Join(dir, "chunks") } | func chunkDir(dir string) string { return filepath.Join(dir, "chunks") } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue