Commit Graph

317 Commits

Author SHA1 Message Date
Erik Arvidsson 4e69837ef0 This introduce two new internal values, blobLeaf and compoundBlob. At
this point the compoundBlob only contains blob leafs but a future
change will create multiple tiers. Both these implement the new Blob
interface.

The splitting is done by using a rolling hash over the last 64 bytes,
when that hash ends with 13 consecutive ones we split the data.

Issue #17
2015-08-03 20:09:42 -04:00
Aaron Boodman 77e4ba95ca Update README.md 2015-07-30 17:03:39 -07:00
Erik Arvidsson c5964aadcd Make Blob take a Reader instead of byte array
This is in preparation for chunking
2015-07-30 18:53:22 -04:00
Aaron Boodman f0a8c5c36e Merge pull request #153 from attic-labs/revert-152-release
Revert "Make WriteValue return a "skinny" copy of input value"
2015-07-30 09:24:10 -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 82523740fb Merge pull request #151 from aboodman/iocopy
Use io.Copy in fileChunkWriter rather than Bytes()
2015-07-29 15:26:33 -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 3e472d447b Use io.Copy in fileChunkWriter rather than Bytes()
Fixes #145.

I looked for other occurences via `git grep Bytes()`. Only other
suspicious cases I found were related to types.Blob, which doesn't
deal in io.Reader yet, and memoryChunkWriter. In memoryChunkWriter
we're copying from a buffer, so I don't think there's any win, so
left that one.
2015-07-29 15:21:17 -07:00
Aaron Boodman ec0bf95637 Merge pull request #150 from aboodman/shorter-cs-flags
Shorter cs flags
2015-07-29 15:02:03 -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
cmasone-attic 45a3a27f15 Merge pull request #144 from cmasone-attic/issue136
Add comments to DataStore and ChunkStore

Part of issue #136
2015-07-29 11:03:15 -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
Rafael Weinstein fc921d1ee8 Merge pull request #142 from rafael-atticlabs/streamy
Allow xml_importer & pitchmap/index to be more streamy
2015-07-28 14:29:42 -07:00
Rafael Weinstein 1369ac9e6b Allow xml_importer & pitchmap/index to be more streamy 2015-07-28 14:13:59 -07:00
cmasone-attic dab46a20eb Merge pull request #140 from cmasone-attic/whoops
Need to prefix the dataset flag

TBR
2015-07-28 13:17:44 -07:00
Chris Masone 7bc389317e Need to prefix the dataset flag
I failed to add the prefix into the dataset flag.
I blame a bad merge I did between my last two PRs.
2015-07-28 13:11:50 -07:00
cmasone-attic ddaaa04727 Merge pull request #137 from cmasone-attic/flags
Shorten 'dataset' related flags
2015-07-28 13:00:45 -07:00
cmasone-attic 996a96bb73 Merge pull request #135 from cmasone-attic/enable_tests
Re-enable 'WalkTestSuite' in walk_test.go
2015-07-28 12:47:07 -07:00
Chris Masone 60fa35df4f Shorten 'dataset' related flags 2015-07-28 11:26:08 -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 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 82ff8b9cd1 Re-enable 'WalkTestSuite' in walk_test.go
I accidentally left this commented out at some point, and it rusted
a bit when I made the change to have walk.doTreeWalk() walk over
chunks rather than values. So, re-enable the tests and fix them.
2015-07-28 10:14:39 -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
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
cmasone-attic ed9d3578f6 Merge pull request #121 from cmasone-attic/walk_chunks
Add walk package

Towards issue #82
2015-07-24 16:06:15 -07:00
Chris Masone 5375081821 Address aa comments
1) Change GetReachabilitySetDiff() to Difference()
2) make doTreeWalk() call cb() before it goes ahead and reads a value
2015-07-24 15:51:05 -07:00
cmasone-attic b90a5e9f34 Merge pull request #128 from cmasone-attic/read_value
ReadValue() should return early if it can't Get() a Ref
2015-07-24 15:35:29 -07:00
Chris Masone 0591e0b32a Add unit test, return specific error for reader == nil 2015-07-24 15:33:28 -07:00
Chris Masone 47e55d591f ReadValue() should return early if it can't Get() a Ref
ReadValue() tries to Get() the ref it's given from the ChunkSource it's given.
We recently changed ChunkSource to return nil with no error if the ref is not
in the ChunkSource. ReadValue, though, soldiers on in the case of a nil
return value from Get, calling Close() on it and other things. This is, I
think, bad.
2015-07-24 15:18:51 -07:00
Erik Arvidsson 50bf19d99f Merge pull request #127 from arv/scale-pitchmap
Scale the pitch locations and fix image
2015-07-24 14:51:50 -07:00
Erik Arvidsson 623988e8fd Scale the pitch locations and fix image
Fixes #125
2015-07-24 14:49:33 -07:00
cmasone-attic 32e29a7955 Merge pull request #123 from cmasone-attic/rename_dataset_root
Change Dataset 'Root' field to be called 'Heads'
2015-07-24 14:46:50 -07:00
Erik Arvidsson 6c0f0f5e1b Merge pull request #122 from arv/fetch
Use whatwg-fetch in explore
2015-07-24 14:46:17 -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 1db5d485a9 Use whatwg-fetch in explore 2015-07-24 14:18:41 -07:00
Chris Masone 0ba565fed6 Add walk package
The walk package contains walk.Some() and walk.All() which let you
walk the Chunk graph starting at a given Ref.

I also added GetReachabilitySetDiff(), which will determine which
refs in a given ChunkSource can be reached from one given ref, but not
the other.

Towards issue #82
2015-07-23 16:47:39 -07:00
Erik Arvidsson 1ce5e3763b Merge pull request #120 from arv/codegen-naming
Change the default names for typed data structures
2015-07-23 16:29:15 -07:00
cmasone-attic e0c4f7b677 Merge pull request #119 from cmasone-attic/public_future
Make types.future public

Towards issue #82
2015-07-23 16:17:28 -07:00
Rafael Weinstein 96c8dadb52 Minor fixes for pitchmap 2015-07-23 16:03:47 -07:00
Chris Masone 5bceb60e88 Update comment on Future 2015-07-23 15:34:40 -07:00
Chris Masone 4fe00d4f81 Address aa's comments
- Return factory methods to privacy
- use tighter syntax inside Chunks() methods
- Rename Futures() -> Chunks()
2015-07-23 15:32:38 -07:00
Chris Masone a560139d73 Make types.future public
This will enable us to walk the chunk graph without having to go
through weird contortions to figure out which values don't have
chunks in any chunkstore (because they were inlined).

Towards issue #82
2015-07-23 15:32:26 -07:00
Rafael Weinstein aa64d0769d Minor fix for fetch-urls 2015-07-23 15:07:52 -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 615a0971c3 Add custom name for all generated types
Map, Set and List can now also define their name using $name.

Issue #108
2015-07-23 13:49:46 -07:00