Commit Graph

705 Commits

Author SHA1 Message Date
Erik Arvidsson 747dc0c335 Make sure we allocate the right size
growslice was showing up in a csv-import
2017-09-21 11:24:52 -07:00
Aaron Boodman ec302256b6 Restructure decentralized examples directory structure (#3730) 2017-09-20 17:39:21 -07:00
Erik Arvidsson 72da69ebce Add readTypeOfValue (#3728)
This improves csv-import a bit since it allows us to skip allocation of
values in the struct when we only want the type.
2017-09-20 16:46:19 -07:00
Erik Arvidsson 66ae5574e3 Remove useless param from ReadManuValues (#3727) 2017-09-20 12:14:21 -07:00
Erik Arvidsson c1db2b8ec2 Change ReadMany to do HashSlice -> ValueSlice (#3724)
The order of the values is the same as the order of the hashes.

This way we can easily map the hash to the value.

Motivation #3710
2017-09-20 10:49:13 -07:00
Benjamin Kalman 71164e1cd2 Remove List.Map (#3726) 2017-09-20 10:36:05 -07:00
Dan Willhite 742f0681c3 Modifications to ipfs-chat and ipfs chunkstore (#3691)
* Modifications to ipfs-chat and ipfs chunkstore
 * Change ipfs paths to include directory where ipfs repo is stored.
 * Rework ipfs-chat to create ipfs chunkstores manually rather than
   relying on Spec.ForDataset. This enables creating two chunkstores
   (one local and one network) using the same IpfsNode (ipfs repo).
 * Create separate replicate function for daemon and mergeMessage
   function for client to experiment with slightly different behaviors
   for each.

* Re-organization of code to remove duplication.

The main points are:
* added event loop to process events synchronously
* more agressive about not re-processing msgs from other nodes
  that we've already processed
* fixed bug in ipfs chunkstore HasMany()

* Add go-base58 library
2017-09-19 17:54:32 -07:00
Erik Arvidsson 9f758c0bdc Make EncodeValue return bytes directly (#3725)
Also make the primitives allocate a more exact buffer instead of the
initialBufferSize.

Also, stack allocate binaryNomsWriter
2017-09-19 17:02:11 -07:00
Erik Arvidsson 6fcfeeb215 Optimize CSV Export (#3721)
This optimizes CSV export after the change in types.Value being backed
by byte slices.

Towards #3710
2017-09-19 00:48:21 -07:00
Erik Arvidsson 865f2498bb Update README.md 2017-09-18 16:20:15 -07:00
Benjamin Kalman a03416acba Reuse the "current" buffer in sequenceChunker (#3702)
Avoids memory reallocation.
2017-09-18 12:23:20 -07:00
Erik Arvidsson b497bcc974 Make values be backed by []byte (#3694)
This makes all but types.Type be backed by a []byte.

The motivation is to reduce the allocations and the work needed to be
done when we read parts of a value (especially prolly trees).

Towards #2270
2017-09-14 17:45:08 -07:00
Dan Willhite 10ec10dc00 Add ability to register HRSCommenters on Structs. (#3609)
Clients can register HRSCommenters to cause additional info
to be included as comments when generating the human readable
encoding for Noms Structs.
2017-09-13 17:21:08 -07:00
Benjamin Kalman 26eb9e3713 Don't write a sequence chunk if there is no parent (#3699)
In most cases this will avoid writing the root chunk of a prolly tree,
which is the behavior we're aiming for: a prolly tree might be used
inline in which case the root never needs to be written.

The solution in this patch is imperfect because it may unnecessarily
write chunks, but this is rare.

Fixes https://github.com/attic-labs/noms/issues/3645
2017-09-13 15:52:31 -07:00
Erik Arvidsson 3db7be5062 Clean up Type WalkValues (#3700)
Use good practice OO design 😝
2017-09-13 15:45:52 -07:00
Erik Arvidsson 8f95c25403 Remove some printf debugging from tests (#3701) 2017-09-13 15:36:42 -07:00
Erik Arvidsson 5ff6432c7b Add support for parsing values (#3688)
This allows parsing all Noms values from the string representation
used by human readable encoding:

```
v, err := nomdl.Parse(vrw, `map {"abc": 42}`)
```

Fixes #1466
2017-09-13 15:02:01 -07:00
cmasone-attic 41f63a5a6a Stop noms sync from destroying locality (#3659)
This patch implements a new strategy for Pull() that pulls the chunks
from a given level of the graph over in the order they'll be
encountered by clients reading the graph.

Fixes #2968
2017-09-11 16:04:13 -07:00
cmasone-attic 14e95379af NBS: Fragmentation tool using new estimate of locality (#3658)
The new version of this tool now estimates the locality of a DB
written using the "grandchild" strategy implemented by
types.ValueStore. It does do by dividing each level of the graph
up into groups that are roughly the size of the branching factor
of that level, and then calculating how many physical reads are
needed to read each group.

In the case of perfect locality, each group could be read in a
single physical read, so that's what the tool uses as its estimate
of the optimal case.

Toward #2968
2017-09-11 15:34:17 -07:00
wardn 79e285e5d5 explicit collection types (#3683) 2017-09-09 19:56:30 -07:00
phritz 025609828e request set & list elements in batch (#3660)
When requesting a range of values read all the chunks ahead of time.

This works for indexed sequences. Does not include support for ordered sequences.

Work towards https://github.com/attic-labs/noms/issues/3619
2017-09-07 16:23:22 -10:00
Ben Kalman 03b7221c36 Use stretchr/testify not attic-labs/testify (#3677)
stretchr has fixed a bug with the -count flag. I could merge these
changes into attic-labs, but it's easier to just use strechr.

We forked stretchr a long time ago so that we didn't link in the HTTP
testing libraries into the noms binaries (because we were using d.Chk in
production code). The HTTP issue doesn't seem to happen anymore, even
though we're still using d.Chk.
2017-09-07 15:01:03 -07:00
Dan Willhite 071ba838d2 Modifications to ipfs-chat can ipfs chunkstore (#3666) 2017-09-05 18:35:50 -07:00
Ian Davis 8c4fa02c6e Fix godoc strings for several functions (#3665) 2017-09-05 11:50:30 -07:00
Ian Davis 052d3d73c8 Don't ignore spec split error in ForDatasetOpts 2017-09-03 09:06:21 -07:00
Erik Arvidsson 84b4aba5a6 HRS: Prefix map/set values with map/set (#3655)
We now print map and set values as:

```
map {
  "string": 42,
  "set": set {
    true,
    false,
  },
}
```

Towards #1466
2017-08-31 13:31:21 -07:00
Dan Willhite aa65868741 Changes to accommodate new version of ipfs 2017-08-31 10:48:27 -07:00
Dan Willhite b1cb8a0fff Add rate limit to ipfs chunkstore, increase thread limit 2017-08-30 17:09:54 -07:00
Erik Arvidsson e5bcde644a HRS: Write blob values as blob { ... } (#3654)
This prints blob values as:

```
blob {  // 17 B
  00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
  10
}
```

Towards #1466
2017-08-30 15:16:22 -07:00
Dan Willhite 04e837bad9 Increase rlimit and auto-initialize IPFS repos 2017-08-30 11:52:50 -07:00
Rafael Weinstein 86dfd49efc Histogram: allow for samples > 1 << 63 (#3650) 2017-08-30 11:20:20 -07:00
Erik Arvidsson 864f1a8fae HRS: Struct printing cleanup (#3653)
We always write the struct name now so no point in passing the
param.
2017-08-30 11:05:42 -07:00
Erik Arvidsson eac2264193 Skip more perf suite tests (#3652)
Since these are flaky
2017-08-30 11:03:06 -07:00
Erik Arvidsson a8d2ade6ac Skip TestRunFlag since it is flaky (#3651) 2017-08-30 10:32:32 -07:00
Erik Arvidsson a93777d93a HRS: Cleanup struct head (#3647)
For struct values we always prefix with struct.

For struct types we always prefix with Struct.

Towards #1466
2017-08-29 17:47:54 -07:00
Erik Arvidsson 9cd2aae786 Print Refs with # (#3644)
Print Ref values as #123 instead of 123

Since our hashes are SHA-512 and we write them using Base32 there are a lot of overlaps with other parts of NomDL. This makes them unambiguous.

Towards #1466
2017-08-29 17:43:29 -07:00
Erik Arvidsson 9200aabaa7 Remove HRS tagged versions (#3643)
This removes the type tagged version of the human readable encoding.

Motivation: Simplify this in preparation to make the HRS unambiguous so that we can write a parser.

Towards #1466
2017-08-29 17:38:46 -07:00
Rafael Weinstein c3f98d1631 Remove in mem graphs (#3635)
This patch removes the ability to keep alive uncommitted prolly-tree sequences.
2017-08-29 13:12:10 -07:00
Rafael Weinstein 61f3d87dcf Introduce Sloppy (#3631)
Introduce Sloppy - an estimating compression function for snappy - which allows for the rolling hash to better produce a given target chunk size after compression.
2017-08-28 13:23:00 -07:00
Ben Kalman f23cbe5344 Make field and index paths work for types (#3639)
Struct type field support field paths, like `.fieldName`
Compound types (List/Set/Map/Union) support index paths, like `[0]`

Fixes https://github.com/attic-labs/noms/issues/3622
2017-08-25 12:23:59 -07:00
Dan Willhite 95aac7ca1e Merge modifications made by Aaron. (#3638)
* Add kingpin library for argument handling.
* Update hard-coded Version number in chunkstore.
* Store noms repo information in ipfs home directory.
2017-08-24 17:50:15 -07:00
Erik Arvidsson 06d0696860 Fix ngql test (#3634) 2017-08-23 13:33:11 -07:00
Erik Arvidsson 3e4fc565ff Pipe through ValueReader in ngql (#3633)
This is in preparation for passing in a ValueReader to collection
constructors.
2017-08-23 13:12:27 -07:00
Aaron Boodman 1a7e006862 Landing beginning of IPFS experiment on trunk (#3625)
* add ipfs dependencies

* Add initial ipfs chunkstore
2017-08-23 11:42:06 -07:00
cmasone-attic 8b5cd66cce NBS: Expose hashes request builder for use in tests (#3630) 2017-08-22 15:53:24 -07:00
cmasone-attic 461ff64579 NBS: Fix large HTTP {get,has}Refs/ requests (#3629)
When we added GetMany and HasMany, we didn't realize that requests
could then be larger than the allowable HTTP form size. This patch
makes the body of getRefs and hasRefs be serialized as binary instead,
which addresses this issue and actually makes the request body more
compact.

Fixes #3589
2017-08-22 14:24:13 -07:00
Rafael Weinstein e43f50c52c Make Histogram keep a precise sum (#3628) 2017-08-22 10:55:25 -07:00
Rafael Weinstein a95b2ba9ff Collection test (#3624)
* loadLeafSeqs => loadLeafCollections

* Collection tests examine leaf node counts
2017-08-18 13:40:54 -07:00
Jesse Ditson 5db3cf1679 kingpin docs, noms blob [put | get] (#3621)
* use kingpin for help and new commands, set up dummy command for noms blob

* document existing commands using kingpin

* remove noms-get and noms-set in favor of new noms blob command

* normalize bool flags in tests, remove redundant cases that kingpin now handles

* add kingpin to vendor files

* make profile flags global

* move --verbose and --quiet to global flags
2017-08-16 16:35:22 -07:00
Dan Willhite 0c14fbad05 Ensure NewStreamingMap and NewStreamingSet panic when input is not ordered (#3570)
Fixes #3560
2017-08-16 11:37:40 -07:00