Commit graph

31 commits

Author SHA1 Message Date
Seebs
c587dbc94d drop enterprise/b
We added the containers_btree implementation to roaring/, which
makes it silly to keep this one. Also, this one is the only reason
that container.Mapped needed to be exported.
2019-05-30 16:36:20 -05:00
Seebs
77d49ded64 so much lint
So with the switch to a new linter, we get a lot of new warnings,
and the majority of them are harmless probably, but a few might be
real. Variously just use _ to suppress warnings, or report errors.
There's probably things here that deserve better fixes, but we can
always revisit it.
2019-04-16 12:07:18 -05:00
Seebs
47dcb5b4a7 Abstract away access to container slices
On a 64-bit machine, the slices in a Container consume 72
bytes, and the Container itself is 80. But we only use one
slice at a time! This patch shifts us to keeping a single
slice in the Container, and converting provided slices to
and from that type when we want to update it. (It is not
safe to access the slice through the wrong type.)

We also add some new tests, conditional on a build tag
called `roaringparanoia`. These tests will be optimized
away entirely by the compiler when the tag isn't
present, because the conditionals use a const. These catch
possible errors like trying to access the bitmap slice
of a non-bitmap container.

We also eliminate all direct creation of Container literals,
so we can mess with the internals more. (On reflection
and study, we decided not to go to the fancier design where
references to .n and .typ were also converted to function
calls, which would have allowed packing those attributes
more tightly, because it was a lot more overhead and a lot
of work to keep track of.)

There's some circumstances where we appear to have been
relying on incorrect guesses about the nature of containers.
For instance, in xorBitmapRun, there's logic that makes sense
only if the output's a run container, but it's not, it's a
bitmap container. This creates strange behavior sometimes,
though. Several of these are corrected now.
2019-03-22 16:31:29 -05:00
Matt Jaffee
b71096b688
update licensing and NOTICE to reflect btree being moved to roaring 2019-03-05 15:52:32 -06:00
Richard Artoul
bb20f058ba Add Repair operation to btree containers 2018-12-07 16:11:16 -05:00
Seebs
456c092930 enterprise/b: Ensure 64-bit range for btree keys.
The cmp() function used to compare btree keys was using the
trick of comparing unsigned values by coercing the result
of subtraction to a signed type. This is fine as long as
the range of differences never actually exceeds the limits
of the signed type. For instance, with int64, as long as
the magnitude of the difference is under 2^63 or so, it
works reasonably well.

Plain int, however, can be a 32-bit type, at which point
the magnitude of difference needed to break it is only
2^31 or so.

Subtraction and type conversion is enough cheaper than
branches that this is worth preserving, but it's worth
preserving by switching to an explicit int64 for the
operation and return type. This will not actually affect
performance except for people using the btree code on
32-bit machines, so it probably won't ever matter.
Which may also be true of the potential wrong answers,
but "might be slower" is a better risk than "might
crash".
2018-11-05 10:45:17 -06:00
Todd Gruben
be3bc105cd fixed upconvert;reverted to released interface 2018-09-25 10:40:04 -05:00
Todd Gruben
64e86614f8 shrank n(container bit count cache) to int32 2018-09-25 09:14:19 -05:00
Cody Soyland
187ded0a52 Fix linter issues: maligned 2018-07-19 11:07:59 -05:00
Cody Soyland
0a9e6bca7a Re-add return variable names removed in 2aa4d6b1. 2018-07-19 08:09:05 -05:00
Cody Soyland
3ca51989c2 Merge branch 'master' into 1515-metalinter-nakedret 2018-07-19 07:52:58 -05:00
Cody Soyland
2aa4d6b12f Fix linter issues: nakedret 2018-07-18 15:23:36 -05:00
Cody Soyland
0b86bbb4f5 Fix linter issues: gochecknoinits 2018-07-18 11:58:27 -05:00
Cody Soyland
2635759893 Fix linter issues: misspell 2018-07-17 12:22:41 -05:00
Cody Soyland
6fbd373256 Unexport b.TreeNew 2018-07-05 23:11:56 -05:00
Cody Soyland
9a1f348580 Unexport b.Tree 2018-07-05 23:11:56 -05:00
Cody Soyland
fede4ac9f0 Unexport b.NewBTreeContainers 2018-07-05 23:11:56 -05:00
Cody Soyland
eac1bec54b Unexport b.Enumerator 2018-07-05 23:11:56 -05:00
Cody Soyland
446bfff91a Unexport b.BTreeContainers 2018-07-05 23:11:56 -05:00
Cody Soyland
b4011778dd Unexport APIOption, b.BTCIterator, API.Holder, API.Serializer, APIOption, http.Handler.API 2018-07-05 23:11:56 -05:00
Todd Gruben
22a546095a fixed reset method on btree plugin 2018-06-22 10:05:41 -05:00
Todd Gruben
643e5e575a fixed crashing issue that was not handling container removal/recycling correctly 2018-06-21 18:39:06 -05:00
Todd Gruben
aa71c08f12 implemented count optimization for btree 2018-06-19 11:01:00 -05:00
Matt Jaffee
4f3a4864f0
add godoc comment to enterprise/enterprise.go 2018-05-15 16:08:54 -05:00
Cody Soyland
1f925324d7 Add enterprise license 2018-05-15 12:20:45 -05:00
Cody Soyland
e8fcb0f055 Use NewFileBitmap for tests to test btree/slice containers separately. 2018-05-15 11:22:19 -05:00
Cody Soyland
71373945da Rename Contiterator -> ContainerIterator 2018-05-15 10:22:02 -05:00
Cody Soyland
251d21dee1 Remove leftover debug log line 2018-05-14 17:51:10 -05:00
Cody Soyland
513c7fd705 B+tree integration work.
Export necessary vars from roaring to fix b+tree containers implementation.
Clean up naming.
Use constructor replacement for enterprise integration.
2018-05-14 17:32:30 -05:00
Cody Soyland
4282e90fe1 Export a few things to enable enterprise/b/containers_btree.go to work 2018-05-14 14:03:46 -05:00
Cody Soyland
faa79a385c Add B+tree to enterprise subpackage 2018-05-11 20:20:24 -05:00