Bucket represents a collection of key/value pairs inside the database.
| 28 | |
| 29 | // Bucket represents a collection of key/value pairs inside the database. |
| 30 | type Bucket struct { |
| 31 | *common.InBucket |
| 32 | tx *Tx // the associated transaction |
| 33 | buckets map[string]*Bucket // subbucket cache |
| 34 | page *common.Page // inline page reference |
| 35 | rootNode *node // materialized node for the root page. |
| 36 | nodes map[common.Pgid]*node // node cache |
| 37 | |
| 38 | // Sets the threshold for filling nodes when they split. By default, |
| 39 | // the bucket will fill to 50% but it can be useful to increase this |
| 40 | // amount if you know that your write workloads are mostly append-only. |
| 41 | // |
| 42 | // This is non-persisted across transactions so it must be set in every Tx. |
| 43 | FillPercent float64 |
| 44 | } |
| 45 | |
| 46 | // newBucket returns a new bucket associated with a transaction. |
| 47 | func newBucket(tx *Tx) Bucket { |
nothing calls this directly
no outgoing calls
no test coverage detected