Commit Graph

110 Commits

Author SHA1 Message Date
Erik Arvidsson
1edbee5f34 Remove Set Subtract 2015-12-17 15:23:28 -05:00
Benjamin Kalman
9a3e73779d Make types.Ref implement the OrderedValue interface.
This fixes the bug where compoundSets/Maps of refs are ordered by their
type.Ref's Ref, rather than their type.Ref's TargetRef.
2015-12-14 11:28:38 -08:00
Rafael Weinstein
d198036618 Compound Map & Set 2015-12-08 16:25:02 -08:00
Dan Willhite
2018863432 Add hasCache to datastore.
Fixes #693.
2015-12-08 11:22:50 -08:00
Chris Masone
e035b1166d Fix import of goleveldb package to point into Godeps/_workspace
Need to keep our dependencies hermetic and pinned.
2015-12-03 10:21:07 -08:00
Dan Willhite
699cc2accc Fixes #687.
Make dataStoreCommon.doCommit() return an error instead of boolean.
2015-12-02 16:41:00 -08:00
Erik Arvidsson
698c21bc67 NomDL: Change type syntax to use <> instead of ()
Fixes #678
2015-12-02 12:30:00 -05:00
Dan Willhite
afc3944341 Add top-down sync strategy. 2015-12-01 12:39:42 -08:00
Rafael Weinstein
7caa08bc5c Complex Types embed a ChunkStore 2015-12-01 10:40:47 -08:00
Rafael Weinstein
e75f5097c7 Allow Map & Set to order by natural ordering of element type if available. 2015-11-16 14:30:30 -08:00
Erik Arvidsson
a72ce41a1d Go: TypeRef -> Type
Remaining identifiers
2015-11-13 17:54:53 -05:00
Chris Masone
f0f49c6010 Generated Code 2015-11-09 08:35:06 -08:00
Aaron Boodman
69a86f3036 Rewrite walk() to walk value tree instead of chunks
Also fix quad_tree to take advantage of that to be generic again.

Fixes #445, #497
2015-11-05 16:12:02 -08:00
Chris Masone
c40b57fc41 Generated code 2015-11-05 15:15:07 -08:00
Erik Arvidsson
329e13e0ae Generated code 2015-11-05 16:33:25 -05:00
Erik Arvidsson
460841e3ed Clean up registration of Ref values
Ref values use the TargetRef to get the internal implementation

RegisterFromValFunction and ToNomsValueFromTypeRef were only used by
ref values at this point so these were renamed and simplified to be
more specific for ref values
2015-11-05 14:32:45 -05:00
Chris Masone
7b55efa9b6 Generated Code 2015-11-05 08:42:22 -08:00
Erik Arvidsson
8c98964fee Generated code 2015-11-04 18:57:27 -05:00
Erik Arvidsson
07414d0a9e Remove InternalImplementation from structs
By adding a reader to structs we can remove the function that exposes
the internal implementation details of a struct.
2015-11-04 14:57:52 -05:00
Erik Arvidsson
756b893e8f Remove FromVal functions
The generated objects are all type.Values now so FromVal is not needed
2015-11-04 12:13:55 -05:00
Erik Arvidsson
9aadd85004 Add types.Struct and improve typed structs
The generated code for typed structs now uses a Go struct which
implements Value directly. The fields in this struct uses the "user"
type. (The union value still uses types.Value though.)

When a typed struct is created by the decoder, it asks for a struct
builder which returns a channel that the values of the fields of the
struct are sent to.
2015-11-04 11:55:07 -05:00
Erik Arvidsson
eeaac87d5f Make Chunks return all reachable Refs from the current Value
We now do a recursive call which bottoms out with a ref.Ref for RefKind
Values. This means that we traverse into nested structures consistently.

The effect of this is that we get all the refs that the current chunk
references.
2015-11-03 17:13:20 -05:00
Erik Arvidsson
30cc7d518f Make Equals compare by Ref (after comparing TypeRef)
This changes equal to compare by ref. Since computing the ref can be
expensive we first check that the type refs are equal.

Fixes #532
2015-10-30 16:50:49 -04:00
Dan Willhite
80be862fda Regroup common code. 2015-10-30 10:36:34 -07:00
Aaron Boodman
a9bc416a2f Change Chunks() to return []ref.Ref 2015-10-30 09:24:58 -07:00
Dan Willhite
84b99fbc37 Check in generated files with new names and delete old ones. 2015-10-28 14:28:20 -07:00
Erik Arvidsson
81f80d5ce6 NomDL: Encode compound blobs as structs
Before encoding a compoundBlob we create a compoundBlobStruct and
encode that instead.

After decoding we check if the value is a compoundBlobStruct and if so
we convert it to a compoundBlob.

Fixes #455, #165
2015-10-27 17:53:16 -04:00
Erik Arvidsson
11799dc957 Merge pull request #481 from arv/counter
Don't read the current commit from the datastore
2015-10-26 16:38:32 -04:00
Erik Arvidsson
8702743875 Cleanup based on code review 2015-10-26 16:22:57 -04:00
Erik Arvidsson
cdcf952270 Update TypeRef comment and get rid of useless param
The name param of MakeCompoundTypeRef is always the empty string.

I didn't change the underlying storage or serialization.

Fixes #436, #477
2015-10-26 15:35:45 -04:00
Erik Arvidsson
33c88381ee Don't read the current commit from the datastore
We tried to read the current commit from that datastore almost
directly after it was written. Instead of reading it we pass along the
Commit.
2015-10-26 15:03:32 -04:00
Erik Arvidsson
1d13a878c4 Fix types.Ref and RefKind objects
Ref Values now have a TargetRef() method that returns the ref.Ref of
the target the Value is referencing.

Note: This is a breaking change. In old code the Ref() of the Value was
the Ref of the underlying target.

Fixes #464
2015-10-26 11:18:02 -04:00
Erik Arvidsson
a60de44b13 Generated code 2015-10-23 11:04:41 -04:00
Erik Arvidsson
71197cb4e7 Generated code 2015-10-22 12:33:39 -04:00
Erik Arvidsson
64217a8548 Generated files 2015-10-22 10:49:06 -04:00
Erik Arvidsson
0b80508047 Fix Commit to use Set(Ref(Commit)) 2015-10-21 19:29:11 -04:00
Erik Arvidsson
afeef44020 Updated generated code 2015-10-21 19:04:22 -04:00
Erik Arvidsson
16353f38f8 NomDL: Make the new serialization default
This makes the new typed serialization the default (the old
serialization is not used but the code has not been cleaned up yet).

Some things are no working in the new world:

Chunking -  The compound list is not working correctly any more. The
Chunks method is having issues because it assumed things based on the
old implicit chunking.

Commit - uses a `Set(Commit)` which means that the parent commit is
embedded. We need to change that to be `Set(Ref(Commit))` so that the
parent commit is referenced instead.
2015-10-21 19:04:22 -04:00
Dan Willhite
bb2f983446 Add IsEmpty() function on ref.Ref.
Fixes #337.
2015-10-21 12:07:34 -07:00
Erik Arvidsson
91f720be81 NomDL: Need to include the deps in the package 2015-10-21 09:17:35 -04:00
Aaron Boodman
e2e51a3ae7 Merge pull request #438 from aboodman/server-port
server: print port listening on at startup
2015-10-20 10:54:33 -07:00
Aaron Boodman
9118530e53 server: print port listening on at startup 2015-10-20 10:28:31 -07:00
Erik Arvidsson
d6869cef35 NomDL: Make Package a primitive type
This solves the bootstrapping problems we are encountering.

Previously Package was a Struct but structs depend on Package.
2015-10-20 10:26:00 -04:00
Erik Arvidsson
e9f5b1e2b5 NomDL codegen: Clean up write and improve ordering
Now we write the named types first, then the using types and finally
the inline type defs in the order that they were defined.
2015-10-19 11:39:58 -04:00
Erik Arvidsson
36d9362628 NomDL: Use ordinal for unresolved type refs
Instead of using the name of the type we now use the index of the type
in the Package that defines it.
2015-10-16 17:46:15 -04:00
Chris Masone
30422eaa33 Fix a few issues with switching from NamedTypes -> Types and re-run go generate
grammar.peg didn't get updated along with grammar.peg.go in arv's last patch,
so that needed to be fixed. Also, pkg.Parsed had its own field named Types, which
shadowed the one it got by embedded types.Package. This only came into play when
generating code for packages pulled out of a dataset. Since arv had to manually
patch up all generated code in his last patch, he never hit this issue and I
missed it in review.

Now, go generate passes once more. Yay
2015-10-14 14:31:06 -07:00
Erik Arvidsson
6185ea1ddb NomDL: Use a list for the types in the package
This does not yet update the serialization to use the ordinal.
2015-10-14 14:49:04 -04:00
Dan Willhite
43d9a6f4fb Remove commit lineage from datastore head.
Replace datastore head with a map of datasetID's to commits. Each commit in the map represents that dataset's head. Fixes #402. Fixes #60. Filed #404 about small window of potential conflict with updating root that needs to be resolved at some point. # Please enter the commit message for your changes. Lines starting
2015-10-14 11:04:13 -07:00
Erik Arvidsson
8565f175ee Make sure Chunks includes type.Refs and the TypeRef
Chunks shold return the futures for types.Ref values.

For typed values that have a TypeRef which has a package ref, also
include that.
2015-10-13 11:00:51 -04:00
Dan Willhite
d6b221444a Simplify logic in doCommit as per Raf's suggestions. Define ref.EmptyRef variable. 2015-10-12 10:53:12 -07:00