aboutsummaryrefslogtreecommitdiff
path: root/db.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-07-24 10:36:09 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-07-24 10:36:09 -0600
commitc3400efefdf9733e98cb125d00a0c0721a2db51e (patch)
tree6ba412db0873b653e98d1db414293d413dd2f558 /db.go
parentMerge pull request #228 from benbjohnson/fix-large-append (diff)
downloaddedo-c3400efefdf9733e98cb125d00a0c0721a2db51e.tar.gz
dedo-c3400efefdf9733e98cb125d00a0c0721a2db51e.tar.xz
Change fill percent to be per-bucket.
This commit moves the DB.FillPercent field to Bucket.FillPercent. This allows the fill percentage to be specified per-bucket, per-tx. This value is not persisted and should be set whenever using it.
Diffstat (limited to 'db.go')
-rw-r--r--db.go16
1 files changed, 1 insertions, 15 deletions
diff --git a/db.go b/db.go
index 2a2e2ed..bb6beef 100644
--- a/db.go
+++ b/db.go
@@ -23,15 +23,6 @@ const version = 2
// Represents a marker value to indicate that a file is a Bolt DB.
const magic uint32 = 0xED0CDAED
-const (
- minFillPercent = 0.1
- maxFillPercent = 1.0
-)
-
-// DefaultFillPercent is the percentage that split pages are filled.
-// This value can be changed by setting DB.FillPercent.
-const DefaultFillPercent = 0.5
-
// DB represents a collection of buckets persisted to a file on disk.
// All data access is performed through transactions which can be obtained through the DB.
// All the functions on DB will return a ErrDatabaseNotOpen if accessed before Open() is called.
@@ -42,11 +33,6 @@ type DB struct {
// debugging purposes.
StrictMode bool
- // Sets the threshold for filling nodes when they split. By default,
- // the database will fill to 50% but it can be useful to increase this
- // amount if you know that your write workloads are mostly append-only.
- FillPercent float64
-
// Setting the NoSync flag will cause the database to skip fsync()
// calls after each commit. This can be useful when bulk loading data
// into a database and you can restart the bulk load in the event of
@@ -99,7 +85,7 @@ func (db *DB) String() string {
// If the file does not exist then it will be created automatically.
// Passing in nil options will cause Bolt to open the database with the default options.
func Open(path string, mode os.FileMode, options *Options) (*DB, error) {
- var db = &DB{opened: true, FillPercent: DefaultFillPercent}
+ var db = &DB{opened: true}
// Set default options if no options are provided.
if options == nil {