Table represents a loaded table file with the info we have about it.
| 102 | |
| 103 | // Table represents a loaded table file with the info we have about it. |
| 104 | type Table struct { |
| 105 | sync.Mutex |
| 106 | |
| 107 | fd *os.File // Own fd. |
| 108 | tableSize int // Initialized in OpenTable, using fd.Stat(). |
| 109 | bfLock sync.Mutex |
| 110 | |
| 111 | blockIndex []*pb.BlockOffset |
| 112 | ref int32 // For file garbage collection. Atomic. |
| 113 | bf *z.Bloom // Nil if BfCache is set. |
| 114 | |
| 115 | mmap []byte // Memory mapped. |
| 116 | |
| 117 | // The following are initialized once and const. |
| 118 | smallest, biggest []byte // Smallest and largest keys (with timestamps). |
| 119 | id uint64 // file id, part of filename |
| 120 | |
| 121 | Checksum []byte |
| 122 | // Stores the total size of key-values stored in this table (including the size on vlog). |
| 123 | estimatedSize uint64 |
| 124 | indexStart int |
| 125 | indexLen int |
| 126 | |
| 127 | IsInmemory bool // Set to true if the table is on level 0 and opened in memory. |
| 128 | opt *Options |
| 129 | |
| 130 | noOfBlocks int // Total number of blocks. |
| 131 | } |
| 132 | |
| 133 | // CompressionType returns the compression algorithm used for block compression. |
| 134 | func (t *Table) CompressionType() options.CompressionType { |
nothing calls this directly
no outgoing calls
no test coverage detected