Commit Graph

12 Commits

Author SHA1 Message Date
cmasone-attic 53f2b6a08e Merge pull request #214 from cmasone-attic/dataset-rewrite
Dataset rewrite

Towards issue #147
2015-08-24 16:35:25 -07:00
Chris Masone 45a42976fc Fix test, function name 2015-08-24 16:33:22 -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 68183a8e09 Merge pull request #205 from aboodman/too-many-files
pull: fix "too many files open" error
2015-08-24 15:54:42 -07:00
Aaron Boodman 2d5983ecd2 pull: fix "too many files open" error 2015-08-24 15:53:36 -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
Rafael Weinstein 0e7d61efc6 Remove errors from ChunkStore and Ref 2015-08-18 16:24:26 -07:00
Chris Masone 17fd75f01d Create d.Exp and d.Try
Introduces the notion of debug 'expectations', analogous to the
'checks' that we already have. d.Exp provides the same API as d.Chk,
but expectation violations can be caught using d.Try().

Toward issue #176
2015-08-10 12:40:43 -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 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