Commit Graph

41 Commits

Author SHA1 Message Date
Rafael Weinstein
d884cd263b make dataStoreCommon private 2015-09-22 17:46:53 -07:00
Rafael Weinstein
82c4a54bd7 move comments 2015-09-22 17:31:56 -07:00
Rafael Weinstein
adabda61a4 Make DataStore an interface 2015-09-22 17:30:14 -07:00
Rafael Weinstein
8d56b8c968 Reland: ChunkSource.Get() now returns a []byte. chunks.Serialize takes a stream of Chunks 2015-09-17 12:31:25 -07:00
Rafael Weinstein
a62cf1bbb8 Revert "ChunkSouce.Get() now returns []byte"
This reverts commit 2be269acf4.
2015-09-16 20:47:36 -07:00
Aaron Boodman
522df3055b Merge pull request #302 from aboodman/stable-gen
nomgen: stabilize the order types are generated in across runs
2015-09-16 17:41:39 -07:00
Aaron Boodman
3c85411dc1 Regenerate all gen'd code in repo 2015-09-16 17:26:45 -07:00
Rafael Weinstein
2be269acf4 ChunkSouce.Get() now returns []byte 2015-09-16 16:42:36 -07:00
Rafael Weinstein
9c6effe19f split chunks/http_store into http/http_client & http/http_server 2015-09-16 10:56:43 -07:00
Erik Arvidsson
5ba36e2a4a Fix tests after file store was removed 2015-08-28 11:01:19 -04:00
Dan Willhite
ab34143ba5 Pin dependencies using godep tool. Rewrite dep urls. 2015-08-26 14:05:40 -07:00
Chris Masone
5f34469f22 Allow for Dataset and DataStore to be headless
Get rid of the notion of a special 'Empty' Commit value, which means
that a freshly created Dataset or DataStore will have no Head at
all. To allow callers to tolerate this, we provide the MaybeHead()
method for them to use when they're unsure about whether a given
Data{set,Store} has ever been committed to.

To ease the API impacts of this change, we've also modified Commit()
to take a types.Value and handle creating a Commit struct holding that
Value and descending directly from the current Head.
Callers who wish to provide alternate parents can use CommitWithParents()
2015-08-24 15:55:17 -07:00
Aaron Boodman
b3bf30daa6 Rewrite DataSet to compose DataStore rather than embed it 2015-08-24 12:03:25 -07:00
Chris Masone
7d8f599003 Remove implicit branching
This patch changes the "Head" of a DataStore to be a single Commit,
as opposed to a SetOfCommit. This has several consequences:

1) Commit() will only accept Commits that are descendants of the
   current Head.
2) Calls to Commit() can now fail, so the method now has an additional
   'ok' return value that callers must check. Whether ok is true or
   false, the DataStore struct returned is the right one to use for
   subsequent calls to Commit() -- retries or otherwise.
3) This rolls up the stack, so Dataset.Commit() can now fail as well,
   and similar logic applies.
4) sync.SetNewHeads() also behaves similarly, since it can also now fail.
5) Examples now die on Commit() failures.

Also, removes the /dataset endpoint from server. It's deprecated, and this
patch would have required updating it, so instead just delete it.

Towards issue #147
2015-08-24 11:48:03 -07:00
Rafael Weinstein
0555d7a3c1 Remove errors from read/write/encode/decode 2015-08-18 16:37:04 -07:00
Aaron Boodman
214b37eccf Remove global imports of dbg package
Fixes #179
2015-08-08 23:57:37 -07:00
Aaron Boodman
9b2cbd8517 Add autogenerated $name field to structs 2015-08-05 18:43:47 -07:00
Aaron Boodman
7944c1b3af Revert "Make WriteValue return a "skinny" copy of input value" 2015-07-30 09:23:35 -07:00
Aaron Boodman
841a268f98 Merge pull request #152 from aboodman/release
Make WriteValue return a "skinny" copy of input value
2015-07-29 17:09:36 -07:00
Aaron Boodman
a84893c0d8 Make WriteValue return a "skinny" copy of input value
Fixes #141
2015-07-29 16:06:54 -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
Chris Masone
d1e1fb4f01 Revise some comments per feedback 2015-07-29 09:22:56 -07:00
Chris Masone
5a5ba47fb4 Add comments to DataStore and ChunkStore
Towards issue #136
2015-07-28 16:01:18 -07:00
cmasone-attic
7678d46466 Merge pull request #132 from cmasone-attic/issue81
Pull from one ChunkStore to another

Towards Issue #81
2015-07-28 11:24:15 -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
Erik Arvidsson
6b26be741d nomgen: Move file handling into nomgen.go
Fixes #46
2015-07-27 15:58:02 -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
Erik Arvidsson
9e9b9556e4 Add tests for codegen
The test for this does the following:

1. The generated code is checked in
2. Running the test regenerates the generated code
3. Then the test.go is compiled and run

This also adds a smoke test for the codegen which just makes sure
that we do not fail when we try to generate code.

Fixes #90
2015-07-23 13:47:00 -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
Erik Arvidsson
3fdc008f5c Codegen: Add support for noms types
This makes it possible to do a List of Bool or Map of Int32 etc
2015-07-22 12:24:27 -07:00
Aaron Boodman
2d8aed9753 Regenerate everything after change to map iteration order.
Fixes #62.
2015-07-20 09:29:51 -07:00
Rafael Weinstein
f18ae3ef22 Avoid loading full commit history of all new commits superceed at least one current root 2015-07-17 13:59:20 -07:00
Rafael Weinstein
565115a3a1 Fix datastore concurrency bug 2015-07-17 11:08:33 -07:00
Aaron Boodman
4c521b6fa2 Rename _rungen.go to rungen.go everywhere because I'm an idiot 2015-07-15 13:55:17 -07:00
Aaron Boodman
0ef19f91c1 Remove references to "BUG 11" in the code since #11 has been fixed. 2015-07-14 18:27:57 -07:00
Aaron Boodman
2d5b7630aa Standardize on _rungen.go for the file to contain go:generate commands.
Fixes issue #33.
2015-07-14 16:13:26 -07:00
Chris Masone
8fe0c86e31 Fix comment typo 2015-07-13 14:16:57 -07:00
Chris Masone
2e196aacef Introduce per-dataset named roots
We want to be able to track individual datasets by name, so
that we can create pipelines that share the same datastore
but create unique views of the shared data.

Addresses issue #22
2015-07-13 10:59:23 -07:00
Aaron Boodman
82a87d548c Use go generate instead of custom thing for generating primitives 2015-07-10 10:39:31 -07:00
Aaron Boodman
2aa809e167 Move enc/* into types/*. 2015-07-09 17:30:43 -07:00
Chris Masone
748f75101f Change datastore package to be named datas
Because datastore is too long, and datas is reminiscent of chunks.

Resolves #8
2015-07-07 13:09:38 -07:00