Commit Graph

52 Commits

Author SHA1 Message Date
Rafael Weinstein
ee5c0f3a72 MakeStructType and NewStructWithType now takes slices rather than maps (#1945)
NewStructType and NewStructWithType now takes slices rather than maps
2016-07-07 16:36:48 -07:00
Aaron Boodman
1d752e3101 Update license: Noms will be copyright Attic Labs. (#1976) 2016-07-05 22:07:42 -07:00
Rafael Weinstein
02be382799 cleanup error output (#1965) 2016-07-05 14:03:56 -07:00
Rafael Weinstein
05d0b09779 Add back some error output (#1958) 2016-07-02 06:20:54 -07:00
Rafael Weinstein
c47cc21d56 Remove more assertions which allocate in non-failure cases (#1942) 2016-07-01 10:09:59 -07:00
Rafael Weinstein
93e0eca51f Type cache (#1865)
Go TypeCache
2016-07-01 09:23:11 -07:00
Ben Kalman
62a15441da Support the @key annotation in paths (#1934) 2016-06-30 10:43:24 -07:00
Mike Gray
7a1817d287 channels for orderedSequenceDiff (#1926) 2016-06-29 16:56:46 -04:00
Ben Kalman
038192cfcc Make the spec package support types.Path (#1920) 2016-06-29 13:55:05 -07:00
Erik Arvidsson
0dc12c9e3d HRS: Show the size of containers (#1925)
Fixes #1837
2016-06-28 17:04:08 -07:00
Erik Arvidsson
69f4fde87a HRS: Write blobs as hex (#1924)
Instead of writing blobs using base64 we now write the values as
hex (16 per row)

Blob(00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f\n10)

Towards #1837
2016-06-28 16:17:07 -07:00
Ben Kalman
54970c34f0 Add set indexing for paths (#1922) 2016-06-28 10:03:00 -07:00
Rafael Weinstein
55e067802d Reduce size of tmp LDB memtables to 128MB (#1921) 2016-06-27 17:15:57 -07:00
Rafael Weinstein
f464a2d94f Map.MX() -> NewStreamingMap (#1918) 2016-06-27 16:06:40 -07:00
Rafael Weinstein
aacfe751fa Add (temporary) custom leaf-chunker for blobs (#1911)
Add (temporary) custom leaf-chunker for blobs
2016-06-27 15:16:50 -07:00
cmasone-attic
d1f46401d1 Go: Add Mx() for Noms Maps (#1876)
As one step towards #1819, we've created MapMutator, which can take a
bunch of (what would normally be) Map.Set() calls and batch them up to
be applied all at once. The keys and values are held in a LevelDB cache
until everything's done. Usage looks like this:

 m := types.NewMap()
 mx := m.Mx()
 mx = mx.Set(String("foo"), String("bar")).Set(String("baz"), Number(42))
 m = mx.Finish()

We intend to make this the only way to modify collections, but at first
this will only work on an empty NomsMap.
2016-06-27 13:52:52 -07:00
Rafael Weinstein
ddb796ee26 parallelize loading of child sequences during list diff (#1910) 2016-06-25 14:02:07 -07:00
Rafael Weinstein
591093756c Fix goroutine leak in list diff (#1899)
Cleanup goroutines in list diff when closed
2016-06-25 12:13:40 -07:00
Rafael Weinstein
2a04a0abaf Add sizecache to ValueStore (#1909)
Add sizecache to ValueStore.
2016-06-25 07:09:08 -07:00
Mike Gray
9825d9802e fixing bug in max splice matrix size (#1905) 2016-06-24 17:03:31 -07:00
Mike Gray
71d4f0eef7 list/indexed diff with go channel for response (#1895) 2016-06-23 17:32:07 -07:00
Ben Kalman
5978c75bfe Support hash indices in paths i.e. .foo[#sha1-abc...] (#1832) 2016-06-23 16:10:53 -07:00
Ben Kalman
0f4ed16641 Meta nodes encode a fake simple ref of non-ordered values (#1893)
Previously when we had an ordered (set/map) prolly tree containing
non-ordered values (blobs/refs/etc), we'd put the ref of the largest
value in each meta node, complete with its full type info and height.

This is wasteful, all we really need is the hash of the largest item for
searching the tree. In lieu of encoding just the hash - which isn't a
value - this patch creates a fake Ref<Boolean> with height 0.
2016-06-23 15:59:26 -07:00
Ben Kalman
e7da64ad98 Add tests for sets and maps of 1K and 4K structs (#1866)
In Go: there are already similar tests for numbers, but testing structs
hits the non-scalar value prolly tree code.

In JS: the set and map tests hadn't even been ported from Go, so I
ported most of their functionality.
2016-06-23 14:00:03 -07:00
Ben Kalman
93b5dcb550 Add struct diffing to ordered_sequences_diff_test.go (#1877) 2016-06-23 10:10:38 -07:00
Erik Arvidsson
d1a961f0c7 Work around null pointer exception in ValueDecoder (#1883)
Go creates the slice with nil for the type of the field. nil is
never a valid type and when there are recursive types we may end
up calling Hash() on the field type which panics.

Towards #1881
2016-06-23 16:15:03 +08:00
Dan Willhite
095d49fa84 New error handling. 2016-06-22 12:11:31 -07:00
Aaron Boodman
192e7c471b Remove forked version of buzhash from vendor dir (#1868)
Replace with upstream

Fixes #1864
2016-06-22 09:54:15 -07:00
cmasone-attic
4d5eb3b334 Version Noms SDK and storage (#1841)
ChunkStores provide a Version() method so that anyone directly
using a ChunkStore (e.g. BatchStoreAdaptor) can retrieve and
check the version of the underlying store.

remoteDatabaseServer checks the version of the ChunkStore it's
backed by at startup, and then provides that version as an HTTP
header to all clients. In Go, httpBatchStore checks this header
anytime it gets a response from the server and bails if there's
version skew.

In Go, the responsibility for checking whether the running code and
the data being accessed lies with the BatchStore layer. In JS, there
is code in fetch.js that checks the header mentioned above.

Towards #1561
2016-06-21 20:55:07 -07:00
Ben Kalman
1b9ea570ae Fix sequence chunker bug triggered by repeatedly removing last element (#1844)
Fix sequence chunker bug triggered by repeatedly removing last element

The bug is we sometimes create a prollytree with a root meta sequence
node with only a single item. This is never the canonical representation
of prollytrees.

I reworked the sequence chunker to take a different approach to corner
cases. Instead of being smart and avoiding this case (which clearly
didn't work properly), it's more liberal with creating unnecessary
nodes, then it fixes them up in the finalisation step.
2016-06-20 18:35:46 -07:00
Rafael Weinstein
afaec8a6ad Cleanup EnsureHash (#1858) 2016-06-20 17:59:09 -07:00
Rafael Weinstein
578d463e56 Remove assertCanRead (#1842) 2016-06-16 18:13:38 -07:00
Dan Willhite
c00b3aeb72 Don't emit type info in diff. Fixes #1831 2016-06-16 14:04:46 -07:00
cmasone-attic
3b23ee12e7 Additional parallelism in pull.go (#1829)
In discussing the patch that added parallelism, raf and I realized
that it's possible to be a bit more aggressive in the cases where one
queue is 'taller' than the other. In the current code, in that case,
we will parallelize work on all the Refs from the taller queue that
have a strictly higher ref-height than the head of the shorter queue.
We realized that it's safe to also take Refs from the taller queue
that are the SAME height as those at the top of the shorter queue,
as long as you handle common Refs correctly.

Fixes #1818
2016-06-16 08:11:17 -07:00
Aaron Boodman
d58d558548 Make types.String not cache ref (#1836)
Fixes https://github.com/attic-labs/noms/issues/1542
2016-06-16 07:04:28 -07:00
Ben Kalman
c2311c04da Implement path parsing for fields and list/map indices (#1816) 2016-06-14 17:17:32 -07:00
Chris Masone
e5bab88631 Add concurrency to noms-sync
The basic approach here is to take the max of the heights of the
source and sink queues, then grab all the refs of that height from
both and sort them into three sets: refs in the source, refs in the
sink, and refs in both. These are then processed in parallel and the
reachable refs are all added to the appropriate queue. Repeat as long
as stuff still shows up in the source queue.

Fixes #1564
2016-06-14 16:05:30 -07:00
Mike Gray
d637458041 limit the size of the edit distance matrix - js (#1812) 2016-06-14 18:01:55 -04:00
Mike Gray
166a83979b limit the size of the edit distance matrix (#1739) 2016-06-13 17:18:35 -04:00
Mike Gray
48b23c0bf0 adding t.Parallel() to some of the longer tests to allow them to run in parallel (#1774) 2016-06-10 13:52:48 -04:00
Chris Masone
58b44fae52 Small tweaks to speed HandleWriteValue a bit
The bigger change here is having chunks.DeserializeToChan take a
channel of *Chunk, instead of Chunk. It saves a couple of seconds
when committing the sfcrime dataset.

Also, get rid of a d.Chk.Equal in favor of a d.Chk.True and increase
the batch size that ValidatingBatchSink uses to reduce stalls due to
putting into a ChunkStore.
2016-06-10 08:38:53 -07:00
Mike Gray
f94b91a5d2 sequences return a compare func used for diffs (#1771) 2016-06-09 23:17:14 -04:00
cmasone-attic
39bc733a63 Go: Stop treating a chunk's hash as a hint for itself (#1758)
At some point, the Go ValueStore code started caching the hash of a
Chunk as a validation 'hint' for the Chunk itself.  JS never did
this. This must have addressed some edge case back when it was fatal
for validation code to run across a Chunk it hadn't seen and didn't
have a hint for. The downside is that doing this can cause us to send
a hint for every novel Chunk present in a writeValue payload in the
worst case.

Since I can't remember the edge case, and that edge case will no
longer be fatal anyway, removing this to avoid the (potentially
terrible) downside makes sense.
2016-06-08 15:36:16 -07:00
Erik Arvidsson
5571e0bc6f Add commas to HRS of struct type (#1759)
This makes the struct more consistent with the rest.
2016-06-08 14:54:47 -07:00
Mike Gray
4303450a7e fixing bug #1723, diff being slow (#1748)
fixing bug #1723, diff was slow due to an incorrect comparison of metaTuple values
2016-06-08 14:44:09 -07:00
Erik Arvidsson
d13dc6a2c5 HRS: No need to tag numbers any more (#1760) 2016-06-08 14:42:37 -07:00
Erik Arvidsson
bc896efcc5 Add tests for type after mutations (#1753)
Also, remove invariant for set intersection. We can handle different
types now.

Fixes #1749
2016-06-08 11:39:12 -07:00
cmasone-attic
74a0c98d75 Go: Use unified ref-height-based Pull algorithm (#1722)
Change Dataset.Pull to use a single algorithm to pull data from a
source to a sink, regardless of which (if any) is local. The basic
algorithm is described in the first section of pulling.md. This
implementation is equivalent but phrased a bit differently. The
algorithm actually used is described in the second section of
pulling.md

The main changes:
- datas.Pull(), which implements the new pulling algorithm
- RefHeap, a priority queue that sorts types.Ref by ref-height and
  then by ref.TargetHash()
- Add has() to both Database implementations. Cache has() checks.
- Switch Dataset to use new datas.Pull(). Currently not concurrent.

Toward #1568


Mostly, prune reachableChunks
2016-06-08 08:57:48 -07:00
Erik Arvidsson
abbd0cfb1e JS: Make Structs use arrays (#1743)
...instead of objects as maps.

Fixes #1715
2016-06-07 15:59:27 -07:00
Erik Arvidsson
bc9f9d19e1 Go: Make StructDesc use slices for names and types instead of a map (#1741)
The map showed up in benchmarks...

Fixes #1716
2016-06-06 16:58:40 -07:00