Commit Graph

25 Commits

Author SHA1 Message Date
Rafael Weinstein 591026bcfa Chunk 2015-09-21 13:24:41 -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
Rafael Weinstein 2be269acf4 ChunkSouce.Get() now returns []byte 2015-09-16 16:42:36 -07:00
Rafael Weinstein 068d4d3878 CopyChunksP 2015-09-16 10:50:19 -07:00
Erik Arvidsson f23de01c5f Remove test that used to test too many opend files 2015-08-28 12:14:34 -04: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
Erik Arvidsson 15abec7a1c Fix broken pull_test.go
This broke due to changes in the API regarding heads and commits
2015-08-25 10:56:20 -04:00
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
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 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