Commit Graph

38 Commits

Author SHA1 Message Date
Chris Masone 11382ad716 Code review fixes 2016-04-13 14:01:40 -07:00
Chris Masone d8a2d285e9 Pull DataStore API over the wire and kill chunks.HTTPStore
This patch is unfortunately large, but it seemed necessary to make all
these changes at once to transition away from having an HTTP
ChunkStore that could allow for invalid state in the DB. Now, we have
a RemoteDataStoreClient that allows for reading and writing of Values,
and performs validation on the server side before persisting chunks.
The semantics of DataStore are that written values can be read back
out immediately, but are not guaranteed to be persistent until after
Commit() The semantics are now that Put() blocks until the Chunk is
persisted, and the new PutMany() can be used to write a number of
Chunks all at once.

From a command-line tool point of view, -h and -h-auth still work as
expected.
2016-04-12 14:08:58 -07:00
John Huang 19dd0e69e0 s/an/can in server README 2016-02-01 09:51:04 -08:00
Chris Masone 7fc728f769 Fix LevelDB support for named datastores
We use a conceptually similar approach to the one we use with DynamoDB
to allow a single database to provide multiple named datastores: keys
are all namespaced using the name of the datastore. The implementation
is a bit different, as we need to run the backing database ourselves.

Fixes #917
2016-01-29 12:10:26 -08:00
Chris Masone 1316d19462 Enable clients/server to address multiple DataStores
Add DataStore.Factory and ChunkStore.Factory so that client programs
that need to create multiple namespaced {Chunk,Data}Stores of the kind
indicated by command line flags have a convenient way to do so. The
details of how this is implemented are mostly contained in the various
ChunkStore.Factory implementations:

1) MemoryStore, TestStore - no change
2) LevelDBStore - the namespace is used as a subdirectory of the path
                  provided by the user
3) HTTPStore - the namespace is used as a path prefix for the endpoints
               supported by DataStoreServer
4) DynamoStore - the namespace is used as a prefix on all keys

This change also required that DataStoreServer be able to handle URLs
of the form "http://server:port/namespace/endpoint", e.g.
"http://localhost:8000/mydatastore/getRefs". It currently still handles
the non-namespaced endpoints as well.

In order to make code from DataStoreServer more re-usable in other
contexts, the functions that handle calls to the server's various
endpoints are now standalone and live in datas/handlers.go.
DataStoreServer just contains logic for dispatch and server lifetime
management.
2016-01-26 13:58:57 -08:00
Aaron Boodman 171dd4c771 Update README.md 2015-12-17 23:57:39 -08:00
Aaron Boodman ba9f32e089 Big docs update 2015-12-17 23:54:57 -08:00
Rafael Weinstein ec8461e8fd RemoteDataStore / CopyReachableChunksP 2015-09-24 11:06:50 -07:00
Rafael Weinstein adabda61a4 Make DataStore an interface 2015-09-22 17:30:14 -07:00
Rafael Weinstein 9c6effe19f split chunks/http_store into http/http_client & http/http_server 2015-09-16 10:56:43 -07:00
Rafael Weinstein 9bac46b7f3 better read buffering 2015-09-09 10:58:29 -07:00
Rafael Weinstein 5514d72e74 Allow server to exit gracefully 2015-08-25 14:44:08 -07:00
Rafael Weinstein abc7102ad6 Clean following HttpStore implementation 2015-08-24 10:57:50 -07:00
Rafael Weinstein f6490cbbe5 Add HttpStore implementation 2015-08-21 14:22:45 -07:00
Rafael Weinstein 0e7d61efc6 Remove errors from ChunkStore and Ref 2015-08-18 16:24:26 -07:00
Aaron Boodman 86d630d202 Revert "server: add ds flag" 2015-08-08 18:17:29 -07:00
Aaron Boodman d71c91e13a server: add ds flag
Toward #185
2015-08-07 18:22:49 -07:00
Aaron Boodman 9b2cbd8517 Add autogenerated $name field to structs 2015-08-05 18:43:47 -07:00
Aaron Boodman 7c026ea509 Merge pull request #149 from aboodman/b134
Remove extraneous type asserts from ChunkStore to RootTracker
2015-07-29 15:26:16 -07:00
Aaron Boodman a8bb889e7e Remove extraneous type asserts from ChunkStore to RootTracker
Also, factor out a separate NewDataStoreWithRootTracker() since
the common case is to use the same value for both the ChunkStore
and the RootTracker.

Fixes #134
2015-07-29 15:25:27 -07:00
Aaron Boodman 4488d6b4c6 Abbreviate chunkstore related flags
We type them a lot and the long names are annoying.
2015-07-29 15:01:25 -07:00
Chris Masone f47d117bf2 Add pull command line tool, test for pulling an initial commit, address comments
In addition to putting in the 'pull' tool that I forgot to add in my initial PR,
I added an extra unit test to cover a case that we found to be buggy, as well
as addressing some comments by aa and arv.

1) Switched to io.Copy in CopyChunks
2) Added NewFlagsWithPrefix()
3) Cleaned up some error reporting
2015-07-28 11:21:45 -07:00
Chris Masone 5838df4736 Datastore should be primed with an empty SetOfCommit
We've been keeping some special-case code in Datastore to handle the
situation where the Root of the store is nonexistent. There was some
checking for the empty Ref and creating a SetOfCommit out of whole
cloth. This meant that if you asked an empty Datastore (or Dataset)
what its Heads() were, it would give you back a Value that wasn't
backed by a Chunk in its underlying ChunkStore. This caused some
issues with pull code, so we decided to change things such that a
DataStore is primed with an initial empty SetOfCommit upon creation.

This means creating a Dataset in a DataStore now shows up in DataStore
history, which it did not before. Essentially, every Dataset now has
an "initial commit" of an empty SetOfCommit when it's created. I think
that having these show up as part of the DataStore history makes sense,
but the model may evolve over time.
2015-07-28 09:37:18 -07:00
Chris Masone 0d830e3c1d Pull from one ChunkStore to another
This initial implementation requires that both the "remote" and local
ChunkStores be accessible by the machine running the pull command.
I took an initial pass at splitting up the functions so that, e.g.,
calculating which refs are needed could be done on an actual remote
machine, and we can add a chunk copying routine that gets data from
the network or something.

Towards issue #81
2015-07-27 11:41:18 -07:00
Chris Masone 3b5f18fdfc Change Dataset 'Root' field to be called 'Heads'
Since the Value stored in Dataset.Root is always a CommitSet, 'Heads'
is a more accurate and useful name for this field than 'Root'.
2015-07-24 14:25:15 -07:00
Erik Arvidsson e379360f3a Change the default names for typed data structures
TList -> ListOfT
TSet -> SetOfT
KeyValueMap -> MapOfKeyToValue

Issue #108
2015-07-23 14:12:06 -07:00
Aaron Boodman 39084cc0be Disambiguate the term "root".
datas.Root(Set) -> datas.Commit(Set)
DataStore::Roots() -> DataStore::Heads()
2015-07-22 14:43:36 -07:00
Aaron Boodman 4182ad0a33 Fix startup crash in server binary.
Also change ChunkStore from being embedded in server to being a field of it. It is equivalent, but this feels more semantically correct and it's less code anyway.
2015-07-21 10:12:42 -07:00
Erik Arvidsson 2789d477e2 Add an RPC call to server to get the dataset root
And use that in the heatmap ui
2015-07-20 17:08:28 -07:00
aboodman 95aad8f825 Update README.md 2015-07-07 14:53:25 -07:00
aboodman bcbaae3cb7 Update README.md 2015-07-07 14:53:04 -07:00
Aaron Boodman c0835a970c server: Add README 2015-07-07 14:49:44 -07:00
Aaron Boodman f34d946161 server: remove createDummyData - not needed anymore 2015-07-07 14:40:18 -07:00
Aaron Boodman 31e14b690e server: RootTracker interface is now once again part of ChunkStore 2015-07-07 14:27:38 -07:00
Aaron Boodman 1fe0f6c79f server: Don't crash if no flags passed 2015-07-07 14:27:38 -07:00
Rafael Weinstein 153d83600e remove named TODOs 2015-06-25 09:47:54 -07:00
Rafael Weinstein 72a6d71b43 cleanup for server & explore 2015-06-24 20:24:32 -07:00
Rafael Weinstein e538f73153 Initial impl of server & explore ui 2015-06-24 16:22:33 -07:00