The query string cache can't return the same instance, since Query is mutable changing the query else where in the execution path changes the instance in the cache too.

Instead the query parser cache should return a cloned instances.

Closes #2542
Closes #6733
Added licence header
[TEST] Reset all cluster if a test hit a failure

Closes #6734
make sure we use the new analyzer wrapper on 4.10
PluginManager: tests for missing plugin name when passing --url

Adding code to test for unset plugin names to fail fast with descriptive error messages. Also simplified the series of `if` statements checking for the commands by using a `switch` (now that it's using Java 7), added tests, and updated random exceptions with the up-to-date flag names (e.g., "--verbose" instead of "-verbose").

Closes #5976.
Closes #6013.
[TEST] mute test - working on a fix
Docs: Link to eskka discovery plugin from doc

Closes #6721
[TEST] Ensure scores are consistent.
Removing plugin does not fail when plugin dir is read only

If you try to remove a plugin in read only dir, you get a successful result:

```
$ bin/plugin --remove marvel
-> Removing marvel
Removed marvel
```

But actually the plugin has not been removed.

When installing, if fails properly:

```
$ bin/plugin -i elasticsearch/marvel/latest
-> Installing elasticsearch/marvel/latest...

Failed to install elasticsearch/marvel/latest, reason: plugin directory /usr/local/elasticsearch/plugins is read only
```

This change throw an exception when we don't succeed removing the plugin.

Closes #6546.
Update plugins.asciidoc
Update lang-analyzer.asciidoc

Clarified the use of the `stem_exclusion` token filter.

Closes #6613
[Logging] added trace logging to TransportShardSingleOperationAction

And enabled them on SimpleRecoveryTests.testSimpleRecovery
[TEST] wait for no pending tasks so processed all mappings
[TEST] also assert that put mapping is ack'ed
[QUERY] Remove Queries#optimizeQuery(...)

This method tires to optimize boolean queries if there is only
one clause. Yet BooleanQuery already does that internally This
optimization is unneeded.

Closes #6743
[TEST] Close threadpool once test searchcontext is released
Improve performance for many new fields introduction in mapping
When we have many new fields keep being introduced, the immutable open map we used becomes more and more expensive because of its clone characteristics, and we use it in several places.

The usage semantics of it allows us to also use a CHM if we want to, but it would be nice to still maintain the concurrency aspects of volatile immutable map when the number of fields is sane.

Introduce a new map like data structure, that can switch internally to CHM when a certain threshold is met.

Also add a benchmark class to exploit the many new field mappings use case, which shows significant gains by using this change, to a level where mapping introduction is no longer a significant bottleneck.
closes #6707
Improve pending api to include current executing class
the pending tasks api will now include the current executing tasks (with a proper marker boolean flag)
this will also help in tests that wait for no pending tasks, to also wait till the current executing task is done
closes #6744
Add license header to ManyMappingsBenchmark.java
[TEST] only mark the event as processed when its out of its execution