Commit graph

112 commits

Author SHA1 Message Date
Travis Turner
a1871388b0 Merge pull request #504 from travisturner/default-row-label
change DefaultRowLabel from `id` to `rowID`
2017-04-28 22:06:34 -05:00
Travis
0b5e058579
change DefaultRowLabel from id to rowID 2017-04-28 15:26:30 -05:00
Cody Soyland
3996b56b88 Apply Apache License 2.0 2017-04-28 14:22:03 -05:00
Travis
2ad322c2c7
Rename DB to Index
Rename `db.go` to `index.go` and `db_test.go` to `index_test.go`
2017-04-23 21:49:27 -05:00
Ben Johnson
d34687121f
Rename bitmap/profile to row/column. 2017-04-21 21:23:24 -06:00
Travis
25e649add8 remove cacheSize argument from NewFragment() 2017-04-19 11:41:41 -05:00
Travis
b0f1fc7523 Makes Messenger a first-class object under Server (with pointers in Handler and Index).
Primary message interface is the MessageBroker which is an attribute of the Messenger.
MessageBroker implementations:
- Gossip (memberlist)
- Broadcast (uses HTTP, received by existing Handler)
- Static (no-ops)

Changes CacheSize from `int` to `uint32` for consistency with protobuf.
Removes unnecessary dependencies in glide:
- `github.com/aws/aws-sdk-go`
- `golang.org/x/net` (although this gets included by memberlist)

TODO:
- [ ] Add tests around the Messenger and MessageBroker objects.
- [ ] Refactor CreateSliceMessage to work with views.
- [ ] Support propogation of meta data on PATCH calls.

fixing some issues from last rebase
2017-04-19 10:33:26 -05:00
Michael Baird
e864a45d57 cleaned up the comments and code for the cache threshold. Also made the max size the set value of the cache rather than the calculated index. This ensures the user will not receive less cached values than they expect 2017-04-19 10:26:47 -05:00
Michael Baird
ce1e8e2e75 changed the frame cache name 2017-04-19 10:24:00 -05:00
Michael Baird
9a1a631dd4 test storing frame cache size 2017-04-19 10:22:44 -05:00
Michael Baird
591c35c95f set the cache size on frame creation 2017-04-19 10:06:11 -05:00
Michael Baird
3b71ed1b2f make the fragment cache ThresholdIndex a function at 90% of ThresholdLength 2017-04-19 10:06:10 -05:00
Michael Baird
8ceaef1eaa fragment cache size is set on frame creation with a default value of 50,000 2017-04-19 10:06:10 -05:00
Ben Johnson
d32edb5329 Add cacheType to frame options.
Previously the cache type (`lru` or `ranked`) was determined by
checking the ending suffix of the frame. If it ended with a `.n`
then it was ranked. Otherwise it was an LRU.

This commit changes frames so that a `cacheType` option can be
passed in during creation to set either `lru` or `ranked`.
2017-04-18 08:24:58 -06:00
Ben Johnson
eff08af112 Separate physical data layout with views.
Previously, multiple frames with different prefixes were used to separate
different data layouts. This included separating standard row/column
layouts from inverted column/row layouts as well as storing aggregate
information for timestamp data.

Unfortunately, this caused frame meta data to be copied between multiple
frames and it made it difficult to keep these frames in sync.

This commit separates these different physical layouts into `Views`.
A `Frame` now has one or more views which represent each layout.
Fragments have been moved from under the `Frame` to be contained
within the `View`.

There are two primary views:

- `standard`
- `inverse`

If a frame has a time quantum, then views are generated for these
each of the standard/inverse views. For example a time quantum
of `YMDH` for the date `2000-01-02T00:00:00Z` would create the
following views:

- `standard_2000`
- `inverse_2000`
- `standard_200001`
- `inverse_200001`
- `standard_20000102`
- `inverse_20000102`

From the user's perspective, nothing should change in PQL. Different
PQL statements will handle the appropriate view automatically. For
example, `Bitmap()` and `Profile()` will fetch using the `standard`
view or the `inverse` view, respectively. The `Range()` statement
will lookup the appropriate time-based views automatically.
2017-03-24 13:57:02 -06:00
Linh Vo
ac8018c4f3 change Pair struct Key to ID 2017-03-23 12:38:09 -05:00
Travis
73df55a980 Refactor some repetitive function calls. Correct the casting to float64() 2017-03-10 13:46:57 -06:00
Linh Vo
0a4de77d38 add tanimoto option to pilosa 2017-03-10 13:45:18 -06:00
Travis
2b94be965e Make sure the TopN test is actually using a RankCache supported frame.
Implement cache.Recalculate to bypass the 10-second delay built into cache.Invalidate().
2017-03-10 11:07:18 -06:00
Travis
cd7434fa95 remove TODO; Todd confirmed f.cache.Top() was not doing a copy 2017-03-08 16:39:36 -06:00
Travis
41d334aeaf If a top-n query contains BitmapIDs, then treat N as having value 0. 2017-03-08 16:09:56 -06:00
Travis
b6430bcc09 remove code that is no longer used:
- `cacheoveride`
- `Bitmap.SetCount()`
2017-03-07 15:25:36 -06:00
Travis
03e1f4f09b turn on bitmapCache support in openCache() 2017-03-07 08:57:03 -06:00
Travis
5048fa1d72 Merge branch 'performance-enhancements-collapse' into performance-enhancements 2017-03-06 11:17:46 -06:00
Travis
c3ed12c20e Refactor fragment.bitmap() so that it leverages bitmapCache and so that
it's no longer reponsible for updating the count cache.
This commit also helps SetBit/ClearBit performance by allowing them
to work against data from `bitmapCache` instead of loading bitmaps
from fragment.storage every time.
2017-03-06 11:06:22 -06:00
Travis
cbac9ec88b move BitmapCache into cache.go. adjust some variable names for clarity 2017-03-02 15:17:21 -06:00
Todd Gruben
9237e7b699 rank cache update after count
heap sort order backwards

WIP TopN accuracy

adjusted first phase topn to collect all slices id's

incorrect handling of large topns

cache performance enhancement

fix for failed test TestMain_FrameRestore

remove unused code and fix some variable names
2017-03-02 12:32:53 -06:00
Todd Gruben
26041563fa fix for failed test TestMain_FrameRestore 2017-03-02 10:36:35 -06:00
Todd Gruben
527ff5682f cache performance enhancement 2017-03-01 15:14:00 -06:00
Todd Gruben
3b309d0d51 WIP TopN accuracy 2017-02-27 18:25:45 -06:00
Todd Gruben
ab52a803b8 rank cache update after count 2017-02-27 12:42:36 -06:00
Travis
846b528c52 change the names of Simple, turbo to SimpleCache, bitmapCache 2017-02-24 13:18:29 -06:00
Todd Gruben
ff52ffa047 WIP TopN optimization 2017-02-23 15:08:18 -06:00
Todd Gruben
43ede4d9c8 WIP increase caching and topn adjustments 2017-02-21 09:28:01 -06:00
Todd Gruben
028539f10d top bug in cache refresh 2017-02-17 15:18:38 -05:00
Todd Gruben
667d56eedf added simple cache to fragment 2017-02-16 15:54:47 -05:00
Travis
1e816b401c Adds Todd's performance improvements:
- Ingore asserts in fragment container.
- Only log queries that take longer than 90 seconds.

TODO:
- address the TODOs that make the asserts configurable.
2017-01-27 13:16:27 -06:00
jaffee
2c4d3859bb remove LogOutput arg from New* funcs
default to ioutil.Discard
2017-01-18 12:28:09 -06:00
jaffee
6d748ae177 thread logoutput index -> db -> frame -> fragment
also stop extra output to stderr from tests
2017-01-18 09:29:42 -06:00
Todd Gruben
eff0e0e7fc removed low count limit on import which is fix for #243 2017-01-11 15:00:44 -05:00
Ben Johnson
7a91cbdd6d Add timestamps to import/sort.
The HTTP API, client, and `pilosactl` have been updated to allow
for a timestamp formatted using the pilosa date format of
`YYYY-MM-DDTHH:MM`.
2016-12-20 10:36:33 -07:00
Ben Johnson
c6e2b1294b Add time-based frames and Range() support. 2016-12-08 12:29:49 -07:00
Cody Soyland
5206461d51 Migrate from Umbel to Pilosa organization on Github 2016-11-28 15:21:11 -06:00
Ben Johnson
8f78f854dd 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
c6ca86f2d9 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
d5ad5fbb05 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
f006270971 merge 2016-09-22 03:05:26 -05:00
Ben Johnson
46bef724a5 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
b40d4385e8 Remove import count optimization. 2016-09-16 11:36:54 -06:00
Todd Gruben
ec4b1352d1 cache update on import adjustment 2016-09-16 11:20:31 -06:00