25 Commits

Author SHA1 Message Date
ncabatoff
804c83609e Rework assertion to follow etcd approach. Enable assertions in tests.
Signed-off-by: ncabatoff <ncabatoff@hashicorp.com>
2023-10-26 09:19:13 -04:00
James Blair
4154f9c642
Remove deprecated rand.Seed calls.
From go 1.20 if Seed is not called, the generator will be seeded randomly at program startup.

Signed-off-by: James Blair <mail@jamesblair.net>
2023-08-19 22:16:51 +12:00
Benjamin Wang
6adc0c47a6 move FreelistType from internal/common to top level package bbolt
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-04-12 07:32:45 +08:00
mingtingzhang
c9c264c9d9 modified freelist_hmap/hashmapGetFreePageIDs with better performance
Signed-off-by: Cenk Alti <cenkalti@gmail.com>
2023-03-15 00:00:26 -04:00
Benjamin Wang
ea511567eb refactor both bolt and guts_cli based on the common package
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-04 04:22:09 +08:00
Josh Rickmar
543c40ab41 Fix unsafe pointer conversions caught by Go 1.14 checkptr 2020-03-18 21:18:39 -04:00
Ning Xie
35b6661093 enhance ut (#172) 2019-08-08 21:43:56 -07:00
Xingyu Chen
8693da9f4d use segregated hashmap to boost the freelist allocate and release performance (#141) 2019-01-25 10:30:05 -08:00
Xingyu Chen
26245f2a4c fix test in releaserange (#142) 2019-01-23 18:34:41 -08:00
Xingyu Chen
f0ad07c7d4 add getFreePageIDs (#140) 2019-01-20 23:42:17 -08:00
Xingyu Chen
c5638469ec update the freelist readIDs (#139) 2019-01-20 21:45:53 -08:00
Gyuho Lee
76a4670663 *: update import paths "go.etcd.io/bbolt"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 08:15:54 -07:00
Anthony Romano
e39821f3de *: fix gofmt errors and makefile test 2017-09-13 14:38:05 -07:00
Joe Betz
9245fa7732 Increase freelist.releaseRange unit test coverage. 2017-09-08 10:33:46 -07:00
Anthony Romano
78d099ed1f Garbage collect pages allocated after minimum txid
Read txns would lock pages allocated after the txn, keeping those pages
off the free list until closing the read txn. Instead, track allocating
txid to compute page lifetime, freeing pages if all txns between
page allocation and page free are closed.
2017-06-05 16:07:55 -07:00
Ben Johnson
8b08bd4a80 test suite refactoring
This commit refactors the test suite to make it cleaner and to use the
standard testing library better. The `assert()`, `equals()`, and `ok()`
functions have been removed and some test names have been changed for
clarity.

No functionality has been changed.
2016-01-02 21:30:31 -07:00
Martin Kobetic
04a3e85793 Merge sorted pgids rather than resorting everything 2015-06-16 13:48:54 -06:00
Ben Johnson
44e6192d2b Remove testify. 2014-07-26 17:17:03 -06:00
Ben Johnson
def455554b Add freelist cache.
This commit adds a cache to the freelist which combines the available free pages and pending free pages in
a single map. This was added to improve performance where freelist.isFree() was consuming 70% of CPU time
for large freelists.
2014-06-30 08:01:41 -06:00
Ben Johnson
12b36fe70c Fix freelist allocate(). 2014-05-19 14:11:32 -06:00
Ben Johnson
782ead0dbf Fix freelist allocation direction.
This commit fixes the freelist so that it frees from the beginning of the data file
instead of the end. It also adds a fast path for pages which can be allocated from
the first free pages and it includes read transaction stats.
2014-05-19 12:08:33 -06:00
Ben Johnson
698b07b074 Add nested buckets.
This commit adds the ability to create buckets inside of other buckets.
It also replaces the buckets page with a root bucket.

Fixes #56.
2014-04-11 12:36:54 -06:00
Ben Johnson
57376f0905 Rename Transaction to Tx.
I changed the Transaction/RWTransaction types to Tx/RWTx, respectively. This makes the naming
more consistent with other packages such as database/sql. The txnid is changed to txid as well.
2014-03-08 17:04:02 -07:00
Ben Johnson
8ad59edd02 API Documentation. 2014-02-13 10:58:27 -07:00
Ben Johnson
509e93dff4 Add freelist. 2014-02-10 14:04:01 -07:00