Commit graph

162 commits

Author SHA1 Message Date
Matt Jaffee
21cf6b6e57
remove URI getters since the fields were exported for serialization 2018-07-05 17:59:18 -05:00
Matt Jaffee
2cec75e399
add proto encoding subpackage and use for send and receive message 2018-07-05 12:00:42 -05:00
Matt Jaffee
5ff77c816a
get rid of unecessary server stuff and export node and uri 2018-07-03 13:26:51 -05:00
Matt Jaffee
f6aef32093
make gossip's interface to Pilosa the API struct rather than effectively being pilosa.Server 2018-07-03 12:58:18 -05:00
Matt Jaffee
fbe035ef25
simplify test cluster setup by exposing gossip transport on server.Command 2018-06-27 10:46:37 -05:00
Matt Jaffee
41bdfceb57
remove MemberSet from cluster, Open in server package 2018-06-27 07:22:32 -05:00
Matt Jaffee
c312bc1316
simplify arguments to NewGossipMemberSet 2018-06-27 07:18:16 -05:00
Matt Jaffee
bcb6942c80
continue simplifying memberset and pilosa setup
since the gossip MemberSet has access to Server, it wasn't really necessary to
pass it a Node object when calling Open on it from Cluster. The end goal is to
have it be removed from Cluster entirely, and have it be Opened externally, and
this is a step toward that.

Exposing Node method on Server doesn't really expose any more than was already
there as the same info can be gotten from LocalStatus with a bit of type
casting. I figured adding the method was a little cleaner, and we could collapse
all the functionality when the dust has settled.

The Cluster.open method has been broken into two parts - one of which happens
earlier (at NewServer time), and the other will eventually just be "waiting to
make sure we've joined the cluster". Right now it's calling Memberset.Open, and
then waiting to make sure the cluster has been joined.
2018-06-26 14:36:05 -05:00
Matt Jaffee
d9b4cfacb0
Merge branch 'develop' into fix-translate-merged 2018-06-26 12:51:41 -05:00
Matt Jaffee
3314a0372c
Merge branch 'develop' into simplify-event-receiver 2018-06-26 11:45:14 -05:00
Cody Soyland
e448d47004 Store commandOptions on test.Main for use in Reopen(); unexport serverOptions 2018-06-26 08:47:31 -05:00
Matt Jaffee
ee37152cd5
consolidate gossipEventReceiver into gossip member set
pilosa.Server now implements StatusHandler and EventReceiver and needs only
start a gossip memberset. A gossip member set now takes a server as an argument
explicitly and the maze of handlers and receivers and the starting sequence is
somewhat simplified.

Server now trivially implements EventHandler by passing the call along to its
Cluster object which has the actual implementation. This means that less things
will need to refer to cluster.
2018-06-26 07:50:33 -05:00
Cody Soyland
9f68ea4663 Use OptCommandServerOptions to inject mock TranslateStore 2018-06-25 17:22:34 -05:00
Cody Soyland
324028a8c2 Add ability to pass ServerOptions when calling NewCommand 2018-06-25 15:09:36 -05:00
Matt Jaffee
b2dd9c50ca
Merge branch 'develop' into fix-translate 2018-06-25 12:33:52 -05:00
Matt Jaffee
c9479afe8c
start handler before server.Open to avoid stall in cluster.open
cluster.open waits for node to join cluster if it is not the coordinator, and
currently this relies on having the http handler able to receive messages, so
handler needs to be started first.
2018-06-21 13:56:46 -05:00
Cody Soyland
c6db3974bc WIP API refactor 2018-06-21 13:51:31 -05:00
Matt Jaffee
343880e0ad
remove broadcaster from server 2018-06-20 13:13:35 -05:00
Matt Jaffee
b271ff286c
unexport done channel on server.Command 2018-06-20 11:31:30 -05:00
Matt Jaffee
69b1f2ea97
make behavior equivalent to pre-change to stop test from failing 2018-06-19 17:02:44 -05:00
Matt Jaffee
33b3a14b24
move static cluster setup logic into Server/Cluster 2018-06-19 16:28:54 -05:00
Matt Jaffee
f06c532047
remove a few unecessary lines from SetupNetworking
NewServer calls LoadNodeID, and NopBroadcaster and NopBroadcastReceiver are
already set up as the defaults.
2018-06-19 13:22:08 -05:00
Matt Jaffee
56ed9bfbe1
remove broadcaster methods from gossip- don't use sendAsync anywhere 2018-06-18 18:47:29 -05:00
Ben Johnson
060254e0d6
Key-to-ID Translation
This commit adds id-to-key translation to make it easier for users
to provide non-integer identifiers for rows & columns.
2018-06-15 16:45:05 -06:00
Cody Soyland
fba865fc6c Remove more net/http references 2018-06-13 16:50:44 -05:00
Cody Soyland
daffa3b125 Rename InternalHTTPClient -> InternalClient 2018-06-13 09:04:04 -05:00
Cody Soyland
64287905bd Add missing argument to Errorf call 2018-06-13 08:56:14 -05:00
Cody Soyland
f2c104dfef Migrate HTTP handler and client into http subpackage. 2018-06-12 13:22:40 -05:00
Cody Soyland
34cea87683 Remove WebUI (now contained in a separate package)
It now lives at https://github.com/pilosa/webui
2018-06-06 11:44:31 -05:00
Cody Soyland
1a9beb0916 Add CORS support to handler. 2018-05-24 08:42:34 -05:00
Travis Turner
b363debd83
replace "Pilosa starting..." log line 2018-05-15 12:52:49 -05:00
alanbernstein
648dedacf7
Merge pull request #1263 from alanbernstein/wrap-errors-server
Wrap errors in server/
2018-05-10 10:27:02 -05:00
Travis Turner
e4c11a28b1
make sure gossipMemberSet.Logger is set during server setup 2018-05-09 10:42:11 -05:00
Alan Bernstein
f0b6fa4ee8 Wrap errors in server/ 2018-05-08 17:20:06 -05:00
Yuce Tekol
244c4e894e
Remove ~ expanding code from Command.Start 2018-05-02 17:33:51 +03:00
Matthew Jaffee
f9ff20689a
remove holder.Peek, combine with HasData, move server logic
Server initializing happens more in NewServer than Open now - expecting to
continue this trend. goal was to remove remoteClient from Server (since it has a
defaultClient) as well, but we'll have to refactor the client usage in fragment
and frame first.
2018-04-24 08:44:58 -05:00
Matthew Jaffee
f99479932d
rename server Run to Start to better reflect functionality 2018-04-23 16:28:24 -05:00
Matthew Jaffee
9deefbaefc
unexport setupLogger and simplify 2018-04-23 16:25:03 -05:00
Matthew Jaffee
1e05a6d627
fix getListener comment 2018-04-23 15:15:02 -05:00
Matthew Jaffee
9f1720f01d
unexport stuff in pilosa.Server
refactor gossip.NewGossipMemberset to not take Server
2018-04-23 15:12:23 -05:00
Matthew Jaffee
28acc29a10
refactoring pilosa/server
trying to separate internal an external concerns in pilosa.Server - it should
handle Cluster, Holder, etc. while pilosa/server handles things with external
deps - e.g. Logger, Stats, Handler, etc. Using functional options in
pilosa.Server now.
2018-04-23 13:35:39 -05:00
Matthew Jaffee
23f6acc165
panic if NewCommand errors on NewServer 2018-04-19 15:37:08 -05:00
Matthew Jaffee
876ed56e30
move pilosa.Config to pilosa/server.Config
step 1 of #1203

The Config object is really just a specification of the options to pilosa
server, so it makes sense to have it in that package.
2018-04-19 14:51:42 -05:00
Matthew Jaffee
3f303d1098
remove global defaults from config.go
these were occaisionally referenced elsewhere in the codebase - in all but one
case, there were workarounds that are actually better I think.

In the one case there wasn't I created a single top level DefaultConfig object
which is instantiated with all the default values and can be referred to if
necessary.

There was a bug in fragment.go with the way MaxWritesPerRequest was treated if
it was 0. Elsewhere, 0 meant no limit, but here, it would have caused a division
by 0.

Changed the default metrics provider from "nop" to "none", although "nop" will
still work. Previously, any value other than "statsd" or "expvar" was treated as
"nop", but I've changed this behavior to return an error if an invalid string is
provided. I think this is better behavior, because in the case that someone
bothered to change the default, they were probably interested in actually
getting stats, and might be annoyed when it silently failed.
2018-04-12 19:52:48 -05:00
Matthew Jaffee
f8cb579187
get tests passing 2018-04-09 14:29:43 -05:00
Yuce Tekol
8336784d57
More API updates; removed Cluster, Holder, etc from Handler 2018-04-03 15:01:36 -07:00
Travis Turner
5c52e48b12
change NewStandardLogger() to only take an io.Writer 2018-03-27 10:30:41 -05:00
Travis Turner
36ce12da59
This commit adds a Close() method to the pilosa.Logger interface,
and it moves the file handling (open/close) out of the main Command and
into the interface implementation. The Logger implementations both have
a `Logger()` method which returns their internal logger (`*log.Logger`).
This is because the gossip setup (memberlist) needs a `*log.Logger` for
its configuration.
2018-03-27 08:40:05 -05:00
Travis Turner
fd8040e699
remove LogOutput and instead close any logger that implements io.Closer 2018-03-27 08:40:05 -05:00
Travis Turner
d113ebe147
Support --verbose logging 2018-03-27 08:40:05 -05:00