aboutsummaryrefslogtreecommitdiff
path: root/bucket.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move code to src/ and tests/EuAndreh2024-10-251-777/+0
|
* Fix return statement inside else block at the end of function and gofmt ↵nick2016-10-311-2/+1
| | | | | | windows file Signed-off-by: nick <nicholasjamesrusso@gmail.com>
* Merge pull request #578 from resin-os/align-fixBen Johnson2016-09-061-1/+9
|\ | | | | Correct broken unaligned load/store in armv5
| * bucket: correct broken unaligned load/store in armv5Lorenzo Stoakes2016-07-281-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | armv5 devices and older (i.e. <= arm9 generation) require addresses that are stored to and loaded from to to be 4-byte aligned. If this is not the case the lower 2 bits of the address are cleared and the load is performed in an unexpected order, including up to 3 bytes of data located prior to the address. Inlined buckets are stored after their key in a page and since there is no guarantee that the key will be of a length that is a multiple of 4, it is possible for unaligned load/stores to occur when they are cast back to bucket and page pointer types. The fix adds a new field to track whether the current architecture exhibits this issue, sets it on module load for ARM architectures, and then on bucket open, if this field is set and the address is unaligned, a byte-by-byte copy of the inlined bucket is performed. Ref: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15414.html
* | Minor bolt compact revisionsBen Johnson2016-09-051-0/+22
|/
* lower MaxValue to 2GBBen Johnson2015-10-281-1/+1
| | | | | | This commit changes the maximum value size to 2GB so that tests can run on 32-bit machines. There's really no reason to write a 2GB+ value to Bolt. It's not terribly efficient for large values.
* Merge pull request #441 from pmezard/document-put-constraintBen Johnson2015-10-281-0/+1
|\ | | | | bucket: document Put() value must remain valid for the transaction
| * bucket: document Put() value must remain valid for the transactionPatrick Mezard2015-10-191-0/+1
| | | | | | | | Issue #324
* | bucket: document buckets are valid only during the transactionPatrick Mezard2015-10-211-0/+3
|/ | | | Issue #313
* Document undefined behavior in ForEachLuke Champine2015-09-211-1/+2
|
* Document key/value safety.Ben Johnson2015-03-241-0/+1
| | | | | | This commit adds safety documentation to the data accessor functions in Bolt as well as the README. This was documented once in the package level godoc but it's important enough that it should be more clear.
* Persist sequence-only changes.Ben Johnson2015-02-021-0/+6
| | | | | | | | | | This commit fixes a bug where only calling NextSequence() on a Bucket does not cause the Bucket to be peristed. The simple fix is to simply materialize the root node so that the bucket is flushed out during commit. Thanks to Matthew Dawson (@MJDSys) for reporting. https://github.com/boltdb/bolt/issues/296
* Expand assertion statements.Ben Johnson2015-01-301-4/+12
| | | | | | This commit expands calls to _assert() that use variadic arguments. These calls require conversion to interface{} so there was a large number of calls to Go's internal convT2E() function. In some profiling this was taking over 20% of total runtime. I don't remember seeing this before Go 1.4 so perhaps something has changed.
* Fix split root dereference.Ben Johnson2014-08-211-1/+1
| | | | | | This commit fixes a bug that occurs when a root node is split just after a re-mmap occurs. Previously, this would cause a panic because the new root node would still reference keys from the old mmap.
* Move tests to a test package.Ben Johnson2014-07-261-1/+1
|
* Add FillPercent documentation.Ben Johnson2014-07-241-0/+2
|
* Change fill percent to be per-bucket.Ben Johnson2014-07-241-2/+20
| | | | | | 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.
* Add DefaultOptions variable.Ben Johnson2014-06-221-27/+0
| | | | | | | | | This commit adds an explicit DefaultOptions variable for additional documentation. Open() can still be passed a nil options which will cause options to be change to the DefaultOptions variable. This change also allows options to be set globally for an application if more than one database is being opened in a process. This commit also moves all errors to errors.go so that the godoc groups them together.
* Change Bucket.NextSequence() to return uint64.Ben Johnson2014-06-221-13/+2
| | | | | | | This commit changes NextSequence() to return a uint64 instead of an int. This also removes the ErrSequenceOverflow error condition since overflowing a uint64 is unlikely. Fixes #39.
* Fix merge-split spill issues.Ben Johnson2014-06-031-0/+1
|
* Remove allocations from read-only buckets.Ben Johnson2014-05-231-6/+17
|
* Minor stats fixes.Ben Johnson2014-05-141-1/+9
|
* address review commentsMartin Kobetic2014-05-131-3/+23
|
* tweaksMartin Kobetic2014-05-121-1/+2
|
* merge inline branch into leaf branchMartin Kobetic2014-05-121-20/+17
|
* fix inline bucket statsMartin Kobetic2014-05-121-6/+26
|
* aggregate bucket stats recursively and add stats to cmdMartin Kobetic2014-05-091-4/+8
|
* first partMartin Kobetic2014-05-091-5/+38
|
* Merge branch 'master' of https://github.com/boltdb/bolt into fix-deletionBen Johnson2014-05-091-0/+1
|\ | | | | | | | | Conflicts: node.go
| * add asserts for detecting pgid high watermark overflowMartin Kobetic2014-05-091-0/+1
| |
* | Fix deletion reclamation.Ben Johnson2014-05-091-5/+2
|/
* Minor fixes.Ben Johnson2014-05-071-1/+1
|
* Improve bucket code documentation.Ben Johnson2014-05-071-11/+14
|
* Fix bucket free.Ben Johnson2014-05-071-2/+40
|
* Add inline bucket support.Ben Johnson2014-05-051-24/+137
| | | | | | | | | | | | | | | This commit adds support for writing small buckets directly inline to their value in their parent's leaf node. Previously, subbuckets would simply have a bucket header stored in their parent bucket which pointed to the root page. This required that every bucket use at least a single page. This has a high overhead for buckets with only one or two small items. Inline buckets checks subbuckets to see if they only have a small amount of data (about 1kb) and no subbuckets. If these conditions are met then the bucket's root node is written to a fake page which is simply a pointer to the end of the bucket's header. Fixes #124.
* Consolidate code for clarity.Ben Johnson2014-05-051-0/+15
| | | | | | This commit consolidates some of the smaller files into some of the larger files. The smaller files cluttered the file tree and made it harder to see the logical groupings of structs.
* Refactor split/spill.Ben Johnson2014-05-031-77/+17
|
* Copy key on Put() and CreateBucket().Ben Johnson2014-04-291-0/+9
| | | | | | | This commit makes a copy of the key byte slice before inserting into the database. This fixes the issue where users may reuse byte buffers which can corrupt the database. Fixes #143.
* Change to BucketStats and Bucket.Stats().Ben Johnson2014-04-221-14/+19
| | | | | | | | This commit pluralizes the BucketStat type to be BucketStats. This makes it more consistent with the other Stats() calls. This commit also changes the return type to a struct instead of a pointer. Finally, this commit adds documentation to the fields of BucketStats.
* rename MaxDepth to DepthMartin Kobetic2014-04-221-3/+3
|
* allign naming with MemStatsMartin Kobetic2014-04-221-17/+17
|
* moar tweaksMartin Kobetic2014-04-221-16/+17
|
* add Used/Free Leaf/Branch bucket statsMartin Kobetic2014-04-221-0/+15
|
* build c/cursor and running testsSteven Normore2014-04-161-0/+10
|
* Return bucket from CreateBucket() functions.Ben Johnson2014-04-151-15/+17
| | | | | | | | | | | This commit changes the API for: Tx.CreateBucket() Tx.CreateBucketIfNotExists() Bucket.CreateBucket() Bucket.CreateBucketIfNotExists() These functions now return the *Bucket and error instead of just the error.
* Add nested buckets.Ben Johnson2014-04-111-37/+329
| | | | | | | This commit adds the ability to create buckets inside of other buckets. It also replaces the buckets page with a root bucket. Fixes #56.
* Add performance counters.Ben Johnson2014-04-021-0/+4
| | | | | | | | | | | | This commit adds performance counters for each transaction which are rolled up to the database level on each commit/rollback. Counters are meant to be a very fast way to track what is going on in the database. A few timers are also added in areas where the time.Now() overhead is not noticible. The DB.Stat() function is now deprecated since the `bolt` CLI now performs similar functions. Fixes #108.
* Error refactoring.Ben Johnson2014-03-241-0/+34
| | | | Fixed up a few error issues and refactored out the Error type.
* Add ErrTxClosed error.Ben Johnson2014-03-231-3/+12
| | | | | | | | Commit/Rollback and mutable calls on Tx and Bucket now return ErrTxClosed if the transaction has already been committed or rolled back. Non-mutable calls have added an assertion to check if the transaction is closed which will cause a panic. I don't want to introduce an error return for accessor methods that are being used improperly so I think the panic is appropriate.
* fix 32bit build fails: bucket.go#67binz2014-03-231-1/+1
|