Commit graph

70 commits

Author SHA1 Message Date
Cody Soyland
a2d9a9a8d3 Migrate from Umbel to Pilosa organization on Github 2016-11-28 15:21:11 -06:00
Ben Johnson
5fcea77be3
Add context to Client, Executor, & Handler.
This changes the API of the types but does not alter the functionality
since only the `context.Background()` is currently being used. Adding
`Context` will help handle fault tolerance in the future by allowing
timeouts to be propagated across calls to different nodes.
2016-11-10 13:37:00 -07:00
Ben Johnson
b00901d265
Add ExpvarStatsClient and basic tracking.
A `StatsClient` for `expvar` is added so we can track Stats through
the `/debug/vars` endpoint. Tags are nested inside maps so that we
can see stats for db, frame & slice.

Also added a `MultiStatsClient` for chaining multiple `StatsClient`
implementations together (e.g. `expvar` and DataDog).
2016-10-20 14:35:14 -06:00
Ben Johnson
d90a9b97c8
Add profile & bitmap attribute anti-entropy.
Adds block-based anti-entropy for the attribute stores and hooks
into the existing `IndexSyncer` to regulate frequency of syncs.
2016-09-30 11:47:43 -06:00
Todd Gruben
f53c2d07d8 merge 2016-09-22 03:05:26 -05:00
Ben Johnson
432bf74368
Add import sorting command.
Introduces new `pilosactl sort` to sort import files by bit
position so they can be inserted faster. Also optimizes container
scanning and adds a `-buffer-size` flag to `import`.
2016-09-21 14:33:24 -06:00
Ben Johnson
7c07cdf304
Remove import count optimization. 2016-09-16 11:36:54 -06:00
Todd Gruben
3907414a10
cache update on import adjustment 2016-09-16 11:20:31 -06:00
Todd Gruben
60853a6bef
ignore checksum on single node clusters 2016-09-16 11:18:44 -06:00
Todd Gruben
b7780518cc cache update on import adjustment 2016-09-15 13:37:10 -05:00
Todd Gruben
15e425ae8f Merge branch 'master' of github.com:umbel/pilosa 2016-09-13 20:59:23 -05:00
Ben Johnson
947eea4668
Optimize TopN() w/ source query.
This commit makes several changes to optimize the TopN() query:

- Reduce highbits() back from 24-bits to 16-bits.
- Reduce MaxArraySize back from 2^20 to 4096.
- Optimize bitmap count invalidation.
- Parallelize TopN() across nodes.
- Parallelize TopN() across slices.
2016-09-13 14:55:56 -06:00
Todd Gruben
aea68cbbd8 Merge branch 'master' of github.com:umbel/pilosa 2016-09-01 12:07:27 -05:00
Ben Johnson
0879bab148
Remove post-mmap resizing 2016-09-01 09:18:52 -06:00
Todd Gruben
1968972a17 Merge branch 'master' of github.com:umbel/pilosa 2016-08-30 17:36:21 -05:00
Ben Johnson
157b7eb966
Add export command to pilosactl
CSV exports can now be done with the pilosactl application:

	$ pilosactl -d mydb -f myframe -o MYFILE.csv

If `-o` is not specified then the CSV is written to STDOUT. The
exporter combines all slices for the db/frame to into a single
concatenated CSV file.
2016-08-30 16:18:12 -06:00
Todd Gruben
758bed45ac Merge branch 'master' of github.com:umbel/pilosa 2016-08-26 12:59:55 -05:00
Ben Johnson
54f12b655f
Optimize bitmap with zero copy
Segments bitmaps by slice and changes `Fragment.Bitmap()` to return
bitmaps with segments which are offset ranges of mmapped bitmaps.
2016-08-25 13:30:25 -06:00
Todd Gruben
6f7031652f Merge branch 'master' of github.com:umbel/pilosa 2016-08-15 18:36:08 -05:00
Ben Johnson
888040c26c
add CountRange()
This commit adds `roaring.Bitmap.CountRange()` to return the number
of bits in a subrange of a bitmap. This significantly improves
server start time and is needed for upcoming zero copy bitmap
optimizations.
2016-08-15 16:03:25 -06:00
Todd Gruben
5eabf67a11 Merge branch 'master' of github.com:umbel/pilosa 2016-08-12 15:10:57 -05:00
Todd Gruben
13f8ce673e cache loading 2016-08-12 15:10:50 -05:00
Ben Johnson
76af8b53a3
fix count() cache retrieval 2016-08-12 11:02:52 -06:00
Ben Johnson
f50fc24749
fix bitmap reference bug 2016-08-09 14:57:37 -06:00
Todd Gruben
a833624e20 Merge branch 'master' of github.com:umbel/pilosa 2016-08-08 09:35:43 -05:00
Ben Johnson
15cc4d7d5a
serialize cache flush
This commit moves the cache flush to the `Index` and only serializes
a single fragment at a time.

Also included in this commit is the `inspect` command for the
`pilsoactl` binary. This provides insight into pilosa data files.
2016-08-05 14:58:37 -06:00
Todd Gruben
0513dfd9ae Merge branch 'master' of github.com:umbel/pilosa 2016-07-07 11:23:50 -05:00
Todd Gruben
3b32db998d ignore checksum on single node clusters 2016-07-07 11:22:15 -05:00
Ben Johnson
3fdf63f84f
optimize sparse bitmap block checksums
This commit refactors the block checksumming by removing the
iteration over each block and instead only checking blocks which
have data. This requires merging the cache inspection with the
roaring iterator to reduce CPU time and memory allocations.
2016-07-07 10:03:38 -06:00
Ben Johnson
583aef6bbb
check for early close during AAE
This commit adds a `Closing` channel to the `IndexSyncer` and the
`FragmentSyncer` that is periodically checked during execution.
If the channel is closed then an in-progress sync is immediately
stopped.
2016-06-29 10:18:24 -06:00
Todd Gruben
620a109046 Merge branch 'master' of github.com:umbel/pilosa 2016-06-10 10:21:27 -05:00
Todd Gruben
98c7f8d361 tuning slicewidth 2016-06-10 10:21:23 -05:00
Ben Johnson
64c29d4b6e
add buffered snapshot writer
This commit wraps the snapshot in a `bufio.Writer`.
2016-06-10 08:58:37 -06:00
Ben Johnson
c330c2e4c0
sort bits on import
This commit sorts bits from import files before performing the input.
2016-06-09 14:25:41 -06:00
Todd Gruben
2145a568d6 Merge branch 'master' of github.com:umbel/pilosa 2016-06-07 15:25:42 -05:00
Todd Gruben
b140eb1c56 added logging on import;crashing bug on sync on empty fragment 2016-06-07 15:25:37 -05:00
Ben Johnson
2d22ae55ee
use db in fragment allocation
This commit changes the fragment allocation algorithm in the cluster
to make use of the `DB` name. This allows each database to use a
different slice distribution.

Initially, the `frame` was going to be used for allocation, however,
this was problematic since queries can span multiple frames so it's
impossible to choose a single frame to use.
2016-06-07 14:01:13 -06:00
Todd Gruben
13f00b08ae code cleanup 2016-06-01 14:55:48 -05:00
Todd Gruben
a935f601a1 Import optimization 2016-06-01 14:10:34 -05:00
Todd Gruben
dea21d674d merge 2016-05-25 09:18:57 -05:00
Ben Johnson
1a20e83a5b
refactor in-memory bitmap storage
This commit changes the underlying storage for `Bitmap` from a
red-black tree to a roaring bitmap. It also removes bitmaps from
the cache and only stores the bitmap count.
2016-05-24 15:01:49 -06:00
Todd Gruben
91b052f1c4 Merge branch 'master' of github.com:umbel/pilosa 2016-05-13 19:59:24 -05:00
Todd Gruben
d0abcfc910 changed slicewidth 2016-05-13 19:59:14 -05:00
Ben Johnson
a206d55834
fix import cache updates
This commit fixes a bug in the import where the cache was not being
updated and the block checksum was not being invalidated.
2016-05-11 17:32:28 -06:00
Ben Johnson
ebdd5f8477
consensus block merge
This commit refactors the anti-entropy system to fetch data from
all replicated blocks and only set/clear bits which deviate from
the consensus between all blocks.

An example of this is if 3 nodes had the following bits set for
a single bitmap:

	Node A: 1 2 3
	Node B:   2   4
	Node C: 1 2   4

Then only bits which are set on a majority will be set. In this
case bits 1, 2, & 4 are set but 3 only exists on a single node.

The node performing the merge would then determine the following
set/clear diffs for each node:

	Node A: clear(3), set(4)
	Node B: set(1)
	Node C: none

Once the merge is performed and all nodes receive their diff
instructions then the nodes will be in sync:

	Node A: 1 2 4
	Node B: 1 2 4
	Node C: 1 2 4

There still exists situations where bits can be reset. If Node A
is up and Node B & C are down then Node A's bits will be reset
once B & C come back online. We should add write consistency
settings for incoming writes so that we can ensure that a quorum
is written to before returning a success. This is outside the
scope of this commit though.
2016-05-06 16:19:10 -06:00
Todd Gruben
cc048f5f3f made Bitmap SetBit method public 2016-04-19 09:22:42 -05:00
Ben Johnson
37d90eac7a
active anti-entropy
This commit adds active anti-entropy via a merkle tree structure.
2016-04-12 19:48:32 -06:00
Ben Johnson
dfda274c40 add 'pilosactl bench' command
This commit adds a simple benchmarking utility to the `pilosactl`
binary. It currently only supports individual `SetBit()` commands
but it's a good start towards making a generic benchmarking
framework at the integration level.

The subcommands and usage/help messages were also cleaned up to
output correctly.
2016-03-31 15:49:57 -06:00
Ben Johnson
7f1e7e91c7 snapshot after op threshold
This commit changes `SetBit()` and `ClearBit()` to issue a
snapshot after a certain number of calls are made on a given
fragment.

Fixes #66
2016-03-30 15:28:42 -06:00
Ben Johnson
137247311b add cache to fragment backup/restore
This commit changes the backup format of a fragment from a
simple file stream to a tar archive which combines the data file
and the cache file.

Fixes #63
2016-03-17 15:48:48 -06:00