Merge branch '1.4.x'

* 1.4.x:
  Corrections to release notes from review
  Add last name for Chuck to release notes
  Release notes for 1.4.0
  Change references for 1.3.x to 1.4
Merge branch '1.4.x'

This merge contains a lot of commits, as there hasn't been a rollup for quite
some time.

* 1.4.x: (97 commits)
  Docs: fix a typo
  Fix spec tests to be compatible with puppet 3.3
  (maint) Fix tar task to allow spaces in path by wrapping the full path in quotes
  (packaging) For EL and Suse systems the pidfile will be in /var/run/$NAME/$NAME.pid
  (packaging) Suse doesn't need a special conditional to run the same command as the else block in puppetdb.spec.erb
  Modify Rakefile to support Ruby 2.0
  Revert "Merge pull request #565 from MosesMendoza/packaging/1.3.x/fix_template_for_suse"
  (packaging) Add suse init script to PuppetDB
  Whitespace fixup
  Making the buildroot doesn't need a special case on sles.
  Align fields in rpm spec
  (#21611) Allow rake commands to be ran on Ruby 2.0
  (Bug #21759) Update spec files to support Fedora 19
  Don't template nonexistent init script for suse
  Remove LGPL init script
  (maint) chkconfig does not exist on sles/suse so let's not depend on it.
  (maint) Move suse specific java requirements into the open_jdk macro
  (maint) Fix typo in puppetdb.spec
  Change createdb docs example to use UTF8 encoding
  Change createdb docs example to use UTF8 encoding
  ...
Merge branch 'burgundy'

This is really just to sync up burgundy with master, its a noop but aligns
the commits properly.

* burgundy:
Merge branch '1.4.x'

* 1.4.x:
  (maint) Remove legacy ssl-setup tests during upgrade
Merge branch 'burgundy'

* burgundy: (21 commits)
  (packaging) Remove Ubuntu Oneiric, add Raring
  (Bug #22165) rm hardcoded hostname dependencies
  (maint) Remove oneiric, add raring to puppetdb build_deb shell script. (cherry picked from commit f1c6ebbb8948ec59f2c2b005b09f58c28ade18f3)
  (maint) document max-threads
  (#22168) Adjust max-threads based on cpu
  Fix test to generate events and handle time
  Fix typo in redhat postinstall template
  (PE-957) Fix spec so that it doesn't assume array order
  Event query endpoint file/line documentation
  Comment cleanup and add validation precondition
  Anonymize source file/line
  (PE-957) port `to_bool` logic over to match puppet's impl
  (PE-957) Filter out default "skipped" Schedule events
  Bump up report format in exporter
  Use file/line even during skipped events
  Remove unused settings relating to queued commands
  Bump up report version to 2
  (PE-959) Save resource event file/line properties
  Introduce v2 of store-report command
  Updated store-report command to a multimethod
  ...
Streaming resource queries

Previously, we'd load all rows from a resource query into RAM, then do a
bunch of sorting and aggregation to transform them into a format that
clients expect. That has obvious problems involving RAM usage for large
result sets. Furthermore, this does all the work for querying
up-front...if a client disconnects, the query continues to tax the
database until it completes. And lastly, we'd have to wait until all the
query results have been paged into RAM before we could send anything to
the client.

This patchset adds streaming capabilities to resource queries. This is
accomplished through a few key additions:

1) HTTP functions for streaming a response. Ring can handle an
InputStream as a response object, and it will pass that to Jetty who
just reads from the stream and sends output to the client using a
Chunked Transfer encoding. I've created a macro that will wrap the body,
binding a Writer object to local scope. A PipedInputStream is then
hooked up to that Writer, and is returned as the Ring response. This
way, the body can stream content to the Writer object and Ring takes
care of the rest. No muss, no fuss!

2) Functions for streaming a JSON response. While Jackson does streaming
output, my testing seemed to indicate that it still needs to buffer up
into RAM the next object to be streamed. That doesn't really help us for
very large JSON arrays. I've written a simple function that streams an
array one object at a time, thus reducing resident memory usage.

3) Functions for streaming a JDBC query. We can't use the stock
clojure.java.jdbc querying code, as that doesn't open up a proper
database cursor. So I've written a function that will do the proper
initialization of a database cursor, and invoke a callback on the
resultset.  By using a callback-based approach instead of a lazy-sequence
of rows, we can more precisely control the lifecycle of the cursor. To
wit, if the callback fails for whatever reason, we can simply cancel the
query.

Taken together, we can now issue a query for, say, all resources we know
about. As soon as the database can produce the first complete resource,
the client can receive it. And if the client disconnects prematurely,
the query is cancelled, sparing the database from doing too much work.
This is all done asynchronously and with low memory usage, though at the
expense of an additional thread (for the PipedInputStream).
Add a table containing full parameter sets

Much of the slowness of resource queries comes from the format of the
resultset. We get back one row per parameter, and we need to collapse
multiple rows into single resource objects that we can emit to the
client.

It's much faster and tidier to just have a separate table that contains
a json-ified version of all a resource's parameters. That way, there's
no need to collapse multiple rows at all, or do any kind of ORDER BY to
ensure that the rows are properly sequenced.

In testing, this appears to speed up queries between 2x-3x...the
improvement is much better the larger the resultset.

Also, the parameter cache table can easily be extended to serve as an
additional set of constraints on resources and parameters. Previously,
there was no foreign key relationship between the two tables, as they
were linked in a many-to-many way. The cache table, though, has a single
row for each resource. This allows for foreign keys that point into that
table, thus improving the overall consistency of our data.

Some minor changes needed to be made to make this happen. We need to
make sure that all resources have an entry in the cache table, even
those with no parameters (thus making parameters a nullable column). We
then need to add the foreign keys to catalog_resources and
resource_params. We then need to slightly change insertion order when
catalogs are added...we need ot make sure that entries are added to the
cache table first, prior to catalog_resources and resource_params (to
satisfy foreign key constraints).

Finally, we use a higher schema migration number, to allow for other
branches.
Remove resource-query-limit

As we now can stream resource queries containing zillions of rows
without blowing out RAM, there's no longer a need for this safeguard.
Remove unneeded transaction
Add test cases for params cache migration
Merge pull request #612 from grimradical/streaming2

Streaming resource queries (2)
Fix broken test case on PG
Merge pull request #617 from grimradical/test-fix

Fix broken test case on PG
Query compilation should happen within a db transaction

In order to successfully compile equality predicates, we need to know
exactly which database the user is talking to (PG8, PG9, HSQLDB). That
lets us figure out if we can use a fast-path (for array queries).
Merge pull request #620 from grimradical/fix-broken-acceptance-tests

Query compilation should happen within a db transaction
Merge branch 'burgundy'

* burgundy:
  (22247) Remove docs task and references
  (PE-1304) Add configuration-version to events response
  (#22159) Fix anonymization for catalog edges
  Add comment relating code to ticket
  (Bug #22240) Remove EoL Fedora 17
  (PE-1300) Don't ignore failed resource statuses
  Fix missing paren in doc
  (PE-1205) Add support for querying reports by hash
  (#22122) Fix ssl-setup error when no puppet certs exist
  (PE-962) remove unnecessary extra index on primary key
  (PE-962) Clean up SQL for initial `latest_reports` population
  (PE-962) Update latest report for node when storing reports
  (PE-962) Add schema for flagging latest report per node

Conflicts:
	src/com/puppetlabs/puppetdb/scf/migrate.clj
	test/com/puppetlabs/puppetdb/test/scf/migrate.clj
(#22380) Document store-usage and temp-usage

Though the default config.ini specifies the purpose of these options,
they are not in the official documentation.
Merge pull request #630 from supercow/add_storage_limits_to_documentation

(#22380) Document store-usage and temp-usage
Upgrade to latest core.match

The newer releases switch to using :guard to denote predicates inside a
match clause.
Merge pull request #635 from grimradical/upgrade-core.match

Upgrade to latest core.match