Commit graph

57 commits

Author SHA1 Message Date
Michael Baird
143cc14b1a Merge branch 'master' into metrics 2017-05-16 14:03:16 -05:00
Ben Johnson
0b8d935f1c
Add inverse TopN() support.
The TopN() call now supports an `inverse` boolean argument to
specify if the call should operate on the standard view or the
inverse view.
2017-05-15 10:35:48 -06:00
Michael Baird
bd44949cb5 Merge remote-tracking branch 'origin/master' into metrics
Conflicts:
	config.go
	executor_test.go
	server/server.go
2017-05-09 11:31:14 -05:00
Michael Baird
bf6ed942f0 Merge pull request #8 from alanbernstein/stats
Stats
2017-05-09 11:15:23 -05:00
Ben Johnson
d4ddf3676c
Support inverse Range() queries. 2017-05-08 09:46:01 -06:00
Ben Johnson
e3d6f96657
Add max-writes-per-requests limit.
A configurable limit has been added to restrict the number of
mutating calls in a `pql.Query`. This is to prevents requests from
timing out from large queries.

The default is set to 5000 writes per request and is configurable
through the configuration file and the command line flags.
2017-05-03 08:53:20 -06:00
Travis
f429c87a56
new test function: MustCreateRankedFragmentIfNotExists 2017-05-01 23:57:43 -05:00
Travis
231cf683f0
Adjust tests to work with new DefaultPartitionN.
This mainly involved running `RecalculateCache()` on all fragments
in `TopN` tests. It seems these tests have been running as LRU
caches, and once we made `ranked` the default, they stopped working.
Some tests were affected by the change in partition number and
therefore the change in fragment to node mapping.
2017-05-01 23:07:41 -05:00
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
Michael Baird
e699c55700 fixed conflicts from the db index change
Conflicts:
	cluster.go
	executor_test.go
	handler_test.go
	server.go
2017-04-25 11:47:29 -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
Travis
2cacff8e09
Rename Index to Holder
Rename `index.go` to `holder.go` and `index_test.go` to `holder_test.go`
2017-04-23 15:59:20 -05:00
Ben Johnson
d34687121f
Rename bitmap/profile to row/column. 2017-04-21 21:23:24 -06:00
Alan Bernstein
985c0b4cdf Update tests to work with handler stats 2017-04-21 10:11:19 -05:00
Travis
7c2f6a9bae adds a basic gossip implementation using hashicorp/memberlist
Changes Gossiper to NodeSet.
Adds StaticNodeSet (for testing) and GossipNodeSet (for memberlist) implementations.
Changes NodeSet interface to return a pilosa-specific generic instead of `NodeSet interface`.
Removes NumMembers from interface (which is specific to memberlist).

Implements a Messenger interface with which to send inter-node messages via NodeSet.
The Pilosa implementation occurs in the GossipNodeSet.

Implements the Messenger as an object on Server, Handler, and Index.

Uses HealthStatus constants.
Removes commented-out code.

for gossip, make sure to bind to both host and port, and advertise those as well

adjust messenger to work with the db schema logic

add dependencies: hashicorp/memberlist, golang.org/x/sync
add dependency: golang.org/x/net

Uses `errgroup` to handle errors from broadcast messages.
Marshals message one time instead of once for every node.
Adds error handling for some errors that were being swallowed.
2017-04-19 10:13:38 -05:00
Matt Jaffee
6f443f447a add signed int support
this affects the scanner/parser and makes it produce signed ints rather than
uints, and so it affects all code that is expecting unsighed ints to come out of
the parser.
2017-04-18 12:50:26 -05:00
Ben Johnson
9cbc786376 Consolidate Bitmap() & Profile() calls.
This commit changes the executor to select a bitmap from the
standard view or the inverse view based on whether the row label
or column label is specified.
2017-04-17 13:48:56 -06:00
Ben Johnson
2731311378 Refactor higher level view interface. 2017-04-05 17:00:31 -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
41d334aeaf If a top-n query contains BitmapIDs, then treat N as having value 0. 2017-03-08 16:09:56 -06:00
Travis
75e12740d3 Merge branch 'master' into performance-enhancements 2017-03-07 15:07:21 -06:00
Linh Vo
0971578f6b Merge pull request #358 from linhvo/retriction-frame
Restriction frame and db name
2017-03-06 14:18:29 -06:00
Matt Jaffee
57de42bb91 fix empty queries crashing pilosa 2017-03-02 16:27:45 -06:00
Linh Vo
a39ab12ecc Merge branch 'master' of github.com:pilosa/pilosa into retriction-frame 2017-03-02 15:27:51 -06:00
Linh Vo
5aea6095f0 add tests 2017-03-02 15:27:33 -06:00
Todd Gruben
def03f3a45 more TopN tests 2017-03-02 15:07:10 -06:00
Yuce Tekol
41b6a6f49c Merge pull request #342 from yuce/setbit-time-format-315
Setbit time format. Implements ticket 315
2017-03-02 22:45:29 +02:00
Yuce Tekol
6f645b9db5 SetBit uses TimeFormat. Implements 315 2017-02-24 16:35:41 +03:00
Ben Johnson
7de0293034 Add basic schema support.
Databases and frames now require explicit creation and have the
option of setting row & column labels. If no labels are provided
then the default `id` and `profileID` labels are used.
2017-02-20 13:55:03 -07:00
Yuce Tekol
1eff86f78b Moved timestamp from HTTP query to PQL 2017-02-08 16:04:19 +03:00
Ben Johnson
f39768b49b Refactor parser & AST to remove compile-time field names.
Consolidates all the pql.Call implementations into a single
pql.Call struct. This is needed to support user-defined schemas
on frames.

This also has the added benefit that a lot of redundant parsing
code has been consolidated.
2017-02-02 14:27:18 -07:00
Travis
659db70a57 Fixes merge conflicts related to MaxSlices.
Merge branch 'time' of github.com:benbjohnson/pilosa into benbjohnson-time
2016-12-12 09:04:23 -06:00
Ben Johnson
c6e2b1294b Add time-based frames and Range() support. 2016-12-08 12:29:49 -07:00
Travis
78666d6bba Merge branch 'master' into db-specific-slices 2016-11-29 11:59:41 -06:00
Cody Soyland
5206461d51 Migrate from Umbel to Pilosa organization on Github 2016-11-28 15:21:11 -06:00
Travis
b6f0a62fdd changes MaxSlices logic to be DB-specific 2016-11-21 16:12:30 -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
722d697228 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
Ben Johnson
a0a519bfdf refactor main into pilosa.Server
This commit refactors most of the code in `cmd/pilosa` to
`pilosa.Server` so that it can be reused in long running cluster
testing.
2016-05-13 14:39:09 -06:00
Ben Johnson
569bafdc7d add bulk call support to the query endpoint
This commit changes the `pql.Query` so that it can accept one or more
top-level calls instead of only one.

The query request format change because a query with a single call is
still valid. However, the result format now returns a `results` field
that has one result for each top-level call. The `profiles` field is
still the same, however, it combines all profiles from all bitmap
responses into one return so that there's not duplicate attributes.

Fixes #59
2016-03-08 14:34:37 -07:00
Ben Johnson
5a63a14742 refetch full counts for TopN()
This commits adds refetching to get the actual TopN() count
after the top bitmaps are determined.

Fixes #57
2016-03-03 13:03:20 -07:00
tgruben
a58468fc7a Merge pull request #56 from benbjohnson/backup
Add backup/restore to pilosactl
2016-02-29 10:49:58 -06:00
Todd Gruben
24260e9d0c test for topn fill 2016-02-29 10:18:57 -06:00
Ben Johnson
5d79555d3e add backup/restore to pilosactl
This commit adds two commands:

    pilosactl backup
    pilosactl restore

The `Client` implementations have also been added to support these
commands:

    func (c *Client) BackupTo(w io.Writer, db, frame string) error
    func (c *Client) RestoreFrom(r io.Reader, db, frame string) error

Backups occur on a per-frame basis and all slices from the cluster
are packed into a single tar file. The backup tool attempts to
read from owner nodes in a random order and will retry against
the next owner if one fails.

During restore, the slices are restored to all owner nodes. This
allows users to backup a frame from one cluster and restore it
to a different one -- even if the topology of the new cluster is
different.
2016-02-29 08:38:24 -07:00
Todd Gruben
759ad537be merged 2016-02-24 14:19:44 -06:00
Todd Gruben
9fc6a39d65 adjust SetBit/ClearBit to releably report bit change 2016-02-24 14:00:41 -06:00
Ben Johnson
cca8970019 add Range() support
This commit adds support for setting bits in time-based frames.
2016-02-23 14:53:03 -07:00