Commit Graph

1927 Commits

Author SHA1 Message Date
Colin Goodheart-Smithe 68b8ce40fd Upgrades to 6.0.0-alpha1-SNAPSHOT (elastic/elasticsearch#672)
* Upgrades to ES 6.0.0-alpha1-SNAPSHOT

* Kibana changes to run upgrade to 6.0.0-alpha1-SNAPSHOT

* Other version changes to 6.0.0-alpha1-SNAPSHOT

Original commit: elastic/x-pack-elasticsearch@574d8573ab
2017-01-10 11:04:29 +00:00
Martijn van Groningen 2d8de6adb2 Fix scheduler config aggregation serialization logic due to upstream change in ES.
Original commit: elastic/x-pack-elasticsearch@3836cf753b
2017-01-10 11:39:04 +01:00
David Kyle fd4d412433 Fix GET bucket params validation (elastic/elasticsearch#661)
Original commit: elastic/x-pack-elasticsearch@66f522588b
2017-01-10 10:04:05 +00:00
Daniel Mitterdorfer b9eab29195 Merge remote-tracking branch 'origin/master' into strict-booleans
Original commit: elastic/x-pack-elasticsearch@3eda267724
2017-01-10 10:19:12 +01:00
Lee Hinman 320ec6716d Merge branch 'master' into enhancement/use_shard_bulk_for_single_ops
Original commit: elastic/x-pack-elasticsearch@23761f3e16
2017-01-09 16:27:42 -07:00
Nik Everett 66a2f0d49e Handle core replacing Suggesters with namedObject
Original commit: elastic/x-pack-elasticsearch@e68d82569f
2017-01-09 16:51:47 -05:00
Lee Hinman 8326b6d83b Merge branch 'master' into enhancement/use_shard_bulk_for_single_ops
Original commit: elastic/x-pack-elasticsearch@98f4e74d2e
2017-01-09 14:22:18 -07:00
Jay Modi e0f0b4b7b8 rename the kibana role to kibana_system
This commit renames the kibana role to kibana_system and provides a backwards compatibility
layer so that kibana access still works properly during a rolling upgrade.

Closes elastic/elasticsearch#4525

Original commit: elastic/x-pack-elasticsearch@5c5796e53a
2017-01-09 16:06:50 -05:00
Lee Hinman e311ce0794 IndexAction is now handled at the shard level, so don't test it
Original commit: elastic/x-pack-elasticsearch@0398acb10c
2017-01-09 13:41:51 -07:00
Lee Hinman 0b64c9e550 MockIndicesRequest should implement CompositeIndicesRequest
Original commit: elastic/x-pack-elasticsearch@094a31d379
2017-01-09 13:33:13 -07:00
Lee Hinman 93720505b8 Merge branch 'master' into enhancement/use_shard_bulk_for_single_ops
Original commit: elastic/x-pack-elasticsearch@089fa9977d
2017-01-09 11:39:37 -07:00
Lee Hinman 8c3b05fa32 Re-add index and delete actions to AuthorizationServiceTests
Original commit: elastic/x-pack-elasticsearch@719db23c02
2017-01-09 11:16:49 -07:00
Lee Hinman 99f96862b4 Add subrequest versions of index and delete actions to `isCompositeAction`
Original commit: elastic/x-pack-elasticsearch@0e0a74eaea
2017-01-09 11:16:08 -07:00
Nik Everett ac260505af Handle core moving Aggregation parsing to namedObject
Original commit: elastic/x-pack-elasticsearch@a968c54e86
2017-01-09 13:05:56 -05:00
David Roberts 45ef535b38 Endpoint adjustments (elastic/elasticsearch#662)
This commit contains around half of the endpoint changes Sophie and Steve
agreed with Clint:

1) Automatic job ID generation is removed

2) Job IDs must now be specified in the URL when putting a job; to avoid
   breaking many test configs, job IDs may also be specified in the job config
   body, but in this case the value specified must match the URL argument

3) The endpoint name for posting data is now post_data instead of job_data

4) The post_data endpoint ends with _data instead of data

5) modelsnapshots is renamed to model_snapshots in all related endpoints

6) PUT model_snapshots/description is changed to POST model_snapshots/_update

Relates elastic/elasticsearch#630

Original commit: elastic/x-pack-elasticsearch@c379a23f3c
2017-01-09 15:52:07 +00:00
Colin Goodheart-Smithe 0d7ac401f9 Removes duplicate influencer field declaration for results (elastic/elasticsearch#668)
The `influencer_field_name` field was declared two in the results mapping. Once directly from `ElasticsearchMappings.resultsMapping()` and again from `addInfluencerFieldsToMapping(XContentBuilder)` which the `resultsMapping()` method calls.

this change removes the duplicate.

Original commit: elastic/x-pack-elasticsearch@5707a5ee53
2017-01-09 13:59:12 +00:00
Nik Everett c597d37fbb Hande SearchExtParsers replaced by namedObject
Original commit: elastic/x-pack-elasticsearch@9691f9b772
2017-01-09 08:22:01 -05:00
jaymode a0090ac556 test: ensure the roles store is called when verifying mock interations
The CompositeRolesStoreTests#testNegativeLookupsAreCached test had a bug where it was expected to
retrieve the superuser role but the mockito verification on the call failed. This was because there
is also randomization on the number of times to call, which could be 0.

Closes elastic/elasticsearch#4562

Original commit: elastic/x-pack-elasticsearch@5c62df15b7
2017-01-09 08:05:59 -05:00
Martijn van Groningen c06342b556 use ActionListener.wrap(...) helper rather than anonymous action listener implementations
Original commit: elastic/x-pack-elasticsearch@d3c7e176ef
2017-01-09 13:59:47 +01:00
Martijn van Groningen ade3f6f207 fixed integration tests due to upstream changes
Original commit: elastic/x-pack-elasticsearch@e6bf9bb4a1
2017-01-09 12:03:14 +01:00
Martijn van Groningen 8e6aa2ba3d fixed compile errors due to upstream changes.
Original commit: elastic/x-pack-elasticsearch@9d3a96680d
2017-01-09 10:38:49 +01:00
Tim Vernum 525364cf0e Add TRACE logging for LDAP traffic (elastic/elasticsearch#4551)
We frequently have support requests to diagnose LDAP realm problems.
One of the tools that would be useful in those cases is to be able to turn on trace logging and be able to see the LDAP searches and their results

Original commit: elastic/x-pack-elasticsearch@632d8e4f19
2017-01-09 11:26:22 +11:00
Jason Tedor c1d44d7d71 Mark failing action throttle test as awaits fix
This commit marks ActionThrottleTests#testFailingActionDoesGetThrottled
as awaits fix as this test fails reliably.

Original commit: elastic/x-pack-elasticsearch@465c48b603
2017-01-08 16:47:54 -05:00
javanna 8d31827f28 Migrate ToXContent impls to ToXContentObject
Original commit: elastic/x-pack-elasticsearch@b09f537ef4
2017-01-06 23:32:05 +01:00
javanna 0b93bc98bf WatchSourceBuilder to extend ToXContentToBytes
Original commit: elastic/x-pack-elasticsearch@b97ad8f92c
2017-01-06 23:32:05 +01:00
javanna c23de42f29 Adapt to ToXContentObject introduction
Changes required are for two reasons:

1) SearchResponse is a self contained valid object which doesn't need to be wrapped in a new object anymore
2) RestToXContentBuilderListener requires ToXContentObject, hence GraphExploreResponse needs to be moved over

Original commit: elastic/x-pack-elasticsearch@12277d0220
2017-01-06 23:32:05 +01:00
Zachary Tong a375d90547 Allow deletes to proceed even if index is missing (elastic/elasticsearch#660)
Allow deletes to proceed even if index is missing

Also adds some tests.  All non-IndexNotFound exceptions will still abort the delete.
We can revisit this if we find other edge-cases.

Original commit: elastic/x-pack-elasticsearch@823d00d8a7
2017-01-06 12:26:13 -05:00
Martijn van Groningen d7f6de7133 Made client calls non blocking in JobProvider#modelSizeStats(...)
and FixBlockingClientOperations in two places where blocking client calls are ok,
because these methods aren't called from a network thread.

Original commit: elastic/x-pack-elasticsearch@a6dc34651c
2017-01-06 18:02:07 +01:00
Zachary Tong ae8695a22d Tweak logic to allow Deletes on already-deleting job (elastic/elasticsearch#658)
Original commit: elastic/x-pack-elasticsearch@5352cba1e7
2017-01-06 10:07:28 -05:00
Martijn van Groningen 3c3509d397 create XContentParser instances inside try code block
Original commit: elastic/x-pack-elasticsearch@664cba1633
2017-01-06 15:20:07 +01:00
Martijn van Groningen 092d2e2bdc Made client calls non blocking for JobProvider#getDataCounts(..)
Original commit: elastic/x-pack-elasticsearch@4d6d6360f6
2017-01-06 14:39:52 +01:00
Martijn van Groningen 468402426e Made client calls non blocking in get category apis.
Merged categoryDefinition(...) into categoryDefinitions(...) as the two did similar things. The get call has been replaced with a search with a query on the _uid field and routing on category id, so that the response handling code can be reused.

Original commit: elastic/x-pack-elasticsearch@4243917b00
2017-01-06 11:18:35 +01:00
Martijn van Groningen 66a2f999e5 scheduler: prevent stopping scheduler before the scheduler was actually started
The start scheduler waits until the scheduler state has been set to started before returning.
Before this change after the scheduler state has been set to started, the scheduler would link itself to the task the start scheduler api has created.
If the stop scheduler api was called immediately after the start scheduler api then this could lead the stop scheduler api cancelling the task without
stopping the scheduler, as the scheduler could not have been linked to the task.

Now the scheduler gets linked to the task before the scheduler state is set to started, fixing the problematic situation discribed above.

Original commit: elastic/x-pack-elasticsearch@8334ae1967
2017-01-05 21:10:23 +01:00
javanna 80dc895450 remove ParseFieldMatcher usages from Script parsing code
Original commit: elastic/x-pack-elasticsearch@4be5f83084
2017-01-05 19:33:15 +01:00
Tim B f71733ec4d Replace com.sun.net.httpserver.Http/Https server usages with MockHttpServer. (elastic/elasticsearch#4476)
Original commit: elastic/x-pack-elasticsearch@4b2d184f53
2017-01-05 11:29:31 -06:00
Tanguy Leroux b72dd8a2d1 [Monitoring] Schedule data collection instead of sleeping (elastic/elasticsearch#4266)
This commit renames the current AgentService into MonitoringService and changes the way it works: it was previously based on thread sleeping and it now use thread scheduling instead. 

At every given time interval, a MonitoringExecution is executed. It first checks if monitoring data can be collected and if so it will collect data from Collectors and then export the data using the Exporters. There are cases where the data cannot be collected: when the service is stopping, when the interval has been set to -1 after the MonitoringExecution has been scheduled, or when the previous data collection is not yet terminated. In this last case, MonitoringExecution will still be executed at the given interval but will not collect any data.

All tasks are executed on the generic thread pool.

closes elastic/elasticsearch#2866

Original commit: elastic/x-pack-elasticsearch@d37b4d3731
2017-01-05 17:45:17 +01:00
Colin Goodheart-Smithe b9205142a4 fix checkstyle
Original commit: elastic/x-pack-elasticsearch@b86e94228b
2017-01-05 16:29:18 +00:00
Colin Goodheart-Smithe 8fdeedf61d fix generics compile error in Eclipse
Eclipse compiler needs a hint to tell it the generics for the comparator function

Original commit: elastic/x-pack-elasticsearch@b3d71d3465
2017-01-05 16:23:24 +00:00
David Kyle 42898ba421 Fix noisy log message about missing mappings
From the scheduler integration test

Original commit: elastic/x-pack-elasticsearch@02d3f58d83
2017-01-05 14:43:29 +00:00
Alexander Reelsen 63f4bbba98 Watcher: Use Apache HttpClient for internal Watcher HttpClient (elastic/elasticsearch#4434)
Watcher: Use Apache HttpClient for internal Watcher HttpClient

The current implementation based on URLConnection has several drawbacks.

* If server returned HTTP header but then got stuck, no timeout would help, the connection remained stuck
* GET requests with a body were not supported, the method was silently changed to POST
* More complex handling of input/error stream handling, the body could not be read from a single input stream

NOTE: This is a BWC breaker. From now on every part of the URL needs to be encoded properly before it is configured in the requeust builder. This requires an upgrade of all watches.

Closes elastic/elasticsearch#1141

Original commit: elastic/x-pack-elasticsearch@bbc8f85dd8
2017-01-05 14:25:58 +01:00
David Roberts 2746edf21b Properly assert that large state documents can be consumed quickly
AssertBusy was not the correct way to do this

Original commit: elastic/x-pack-elasticsearch@c6535e7545
2017-01-05 13:07:56 +00:00
Martijn van Groningen 41f2f51df6 Made client calls in get buckets code non blocking.
Also merged the JobProvider#getBucket(...) method into Jobprovider#getBuckets(...) method, because
it contained a lot of similar logic, otherwise it had to be converted to use non blocking client calls too.

Part of elastic/elasticsearch#127

Original commit: elastic/x-pack-elasticsearch@b1e66b62cb
2017-01-05 13:58:46 +01:00
Martijn van Groningen 51e1199860 Install prelert metadata and create required indices only once.
Original commit: elastic/x-pack-elasticsearch@12c8ba0ce0
2017-01-05 13:38:48 +01:00
David Roberts 27c9f39bf5 Speed up state processing (elastic/elasticsearch#642)
There was an N-squared algorithm in the state processing code, leading
to large state persistence eventually timing out.  Large state documents
are read from the network in 8KB chunks, and the old code was checking
ALL previously read chunks for separators every time a new chunk was read.

Fixes elastic/elasticsearch#635

Original commit: elastic/x-pack-elasticsearch@c814858c2c
2017-01-05 12:37:11 +00:00
Alexander Reelsen 9f43a5320e Watcher: Fix test failure in case watch alias was created before
An integration test was failing due to the possibility of the
.watch index being an alias (which only happens rarely).

Original commit: elastic/x-pack-elasticsearch@d53a4ebdd4
2017-01-05 11:44:41 +01:00
Alexander Reelsen cb7f916485 Watcher: Remove async code in sync code block (elastic/elasticsearch#4506)
Watcher: Remove async code in sync code block

When removing the watch store this code snippet sneaked in.
A call to get a watch in order to find out if it exists was async, but
the code checking the result was called immediately afterwards without
waiting for the result, thus always using the default value.

This also removes some unused code in TriggeredWatchStore.

Original commit: elastic/x-pack-elasticsearch@c47e70bf8a
2017-01-05 10:24:17 +01:00
David Roberts c7cfa56aaf Rename prelert to ml in endpoint base path (elastic/elasticsearch#639)
Original commit: elastic/x-pack-elasticsearch@ff6745e545
2017-01-05 08:18:43 +00:00
Tim Vernum c64ad22579 Use Version.compareTo when calculating minimum version (elastic/elasticsearch#4505)
Results from elasticsearch change elastic/elasticsearch#22378 (6ad5486)

Original commit: elastic/x-pack-elasticsearch@73c09657bb
2017-01-05 17:43:10 +11:00
Tim Vernum ca3bbc7da0 [TESTS] Test resolving ldap groups with preloaded attributes (elastic/elasticsearch#4530)
Add a test for the `UserAttributeGroupsResolver` when using attributes provided as a parameter.

(ported from commit elastic/x-pack@ebc62b7, elastic/elasticsearch#4522)

Original commit: elastic/x-pack-elasticsearch@6502fdb801
2017-01-05 17:42:28 +11:00
polyfractal f98b4a967c s/nocommit/norelease
Original commit: elastic/x-pack-elasticsearch@6523f5caa1
2017-01-04 16:50:51 -05:00
Zachary Tong 23aef2679d DELETING job status cluster state changes (elastic/elasticsearch#612)
Deleting a job now starts a three-step process:

1. Job status updated to DELETING
2. Physical index is deleted
3. Job removed from cluster state

When jobs are in DELETING, they cannot be modified/updated/changed at all.  Only jobs that are DELETING can actually be removed from the CS.

Original commit: elastic/x-pack-elasticsearch@2cd99a240c
2017-01-04 16:43:24 -05:00
Chris Earle 3c68e6dd23 Ignore 5m and 15m system load averages in resolver tests so that Mac users can run them
Original commit: elastic/x-pack-elasticsearch@4a2a75b046
2017-01-04 11:59:05 -05:00
Martijn van Groningen 090c7e792a in case of general exception no need to execute the rest of the method
Original commit: elastic/x-pack-elasticsearch@d0cdaf037d
2017-01-04 15:52:17 +01:00
Martijn van Groningen 5371cc8454 When failures happen during the scheduler's loopback run then make sure we either continue or stop.
Relates to elastic/elasticsearch#628

Original commit: elastic/x-pack-elasticsearch@c5726bd8e4
2017-01-04 15:52:17 +01:00
David Roberts a816ee27bb Fix error message for state index creation
Original commit: elastic/x-pack-elasticsearch@cd36db071e
2017-01-04 13:31:03 +00:00
Chris Earle 35b405d029 [Monitoring] Add 'logstash' type to old .monitoring-data-2 indices (elastic/elasticsearch#4517)
Add `logstash`, in addition to `kibana` type mappings if they are missing from the _existing_ .monitoring-data-2 indices. This allows existing indices to be upgraded in place to support the Logstash monitoring feature added in 5.2 without having to delete the .monitoring-data-2 index.

Original commit: elastic/x-pack-elasticsearch@864343a116
2017-01-04 00:43:30 -05:00
Chris Earle 0d62207f8f [Monitoring] BWC Allow New Types to be added to .monitoring-data-2 index (elastic/elasticsearch#4504)
* [Monitoring] BWC Allow New Types to be added to .monitoring-data-2 index

This adds the new Logstash (and technically Kibana) types to the index mapping if they're not already there. Pre-existing indices will be blocked from creating new types in the index due to the index setting. The index setting cannot be flipped without opening/closing the index, so manually adding the new types is easier.

Original commit: elastic/x-pack-elasticsearch@e85e800335
2017-01-03 16:47:09 -05:00
javanna cd2e608ecc Remove unused ParseFieldMatcher argument from SearchInput and SearchTransform parse methods
Original commit: elastic/x-pack-elasticsearch@6cf7323961
2017-01-03 22:39:48 +01:00
Martijn van Groningen 567153d73a test: create airline-data index as part of test setup
Original commit: elastic/x-pack-elasticsearch@81dea8b071
2017-01-03 22:35:31 +01:00
javanna 4359a0508f remove unused ParseFieldMatcher imports
Original commit: elastic/x-pack-elasticsearch@c5c4834a8b
2017-01-03 22:26:17 +01:00
David Roberts 852eeb106d Remove obsolete test files
Original commit: elastic/x-pack-elasticsearch@d708431007
2017-01-03 17:12:14 +00:00
Jay Modi e41b53c344 roles with FLS and/or DLS are ignored when unlicensed (elastic/elasticsearch#4481)
Currently, roles making use of field or document level security are still applied when
the license level does not enable field and document level security. There is no indication
that these roles are not being applied so it is misleading to users. This change prevents
these roles for applying to authorization and also adds a transient metadata to the response
that indicates which features of a role is unlicensed.

Additionally, this PR prevents the addition or modification of roles to include field or
document level security.

Closes elastic/elasticsearch#2472

Original commit: elastic/x-pack-elasticsearch@c9455958f5
2017-01-03 12:06:33 -05:00
Chris Earle f4b9e794e8 [Monitoring] Fix test that fails with Cgroups missing on some machines
Original commit: elastic/x-pack-elasticsearch@23b7c2a25a
2017-01-03 12:02:12 -05:00
David Kyle f6564c03e2 Add Influencer.influencer_field_value to custom all field (elastic/elasticsearch#624)
Original commit: elastic/x-pack-elasticsearch@5aa98d84dc
2017-01-03 16:46:19 +00:00
David Kyle 7a7ec570ae Flushing a closed job should not return a 200 (elastic/elasticsearch#625)
Original commit: elastic/x-pack-elasticsearch@419389e1af
2017-01-03 16:44:13 +00:00
David Kyle c58d1d43d6 Null check for anomaly score filter values and default the page params
Fixes broken tests

Original commit: elastic/x-pack-elasticsearch@2ebc42515a
2017-01-03 15:33:19 +00:00
David Kyle f8309a0706 Fix validating params for single bucket requests (elastic/elasticsearch#622)
Original commit: elastic/x-pack-elasticsearch@42f8771bf8
2017-01-03 14:59:01 +00:00
javanna 33653a8865 Remove ParseFieldMatcher usage from SearchRequest
Original commit: elastic/x-pack-elasticsearch@e1b08ab801
2017-01-03 14:48:13 +01:00
Daniel Mitterdorfer dd26c93f68 Eliminate unneccessary declaration of IOException
Original commit: elastic/x-pack-elasticsearch@9f71ff4b55
2017-01-03 12:41:06 +01:00
Martijn van Groningen db3358166b made checkstyle happy
Original commit: elastic/x-pack-elasticsearch@6e12c81c33
2017-01-03 12:38:12 +01:00
Martijn van Groningen 134ce2f074 test: added a temporary workaround in on check that happens after a suite has completed,
with the fix we also make sure that prelert metatadata is taken into account when verifying the cluste state consistency

Original commit: elastic/x-pack-elasticsearch@1deaec3836
2017-01-03 12:23:23 +01:00
Martijn van Groningen 16bd07b603 register prelert metadata as named writables
Original commit: elastic/x-pack-elasticsearch@628a4aa154
2017-01-03 11:59:37 +01:00
David Roberts 161eefe7d8 Remove PROTO constants
This is a follow-up to the previous commit

Original commit: elastic/x-pack-elasticsearch@4d1e52fe43
2017-01-03 10:49:00 +00:00
Christoph Büscher 63baf5a86a Remove Getters and Setters for "minimumNumberShouldMatch" in BoolQueryBuilder
The interval value set is "minimumShouldMatch" and also the documented query dsl
parameter is `minimum_should_match` so we can deprecate
`minimum_number_should_match` and its getters/setters in 5.x and remove them in 6.

Original commit: elastic/x-pack-elasticsearch@53ce64b7b3
2017-01-03 11:29:54 +01:00
David Roberts ad9d65cfa5 Fix compilation after upstream Elasticsearch changes (elastic/elasticsearch#621)
The Elasticsearch change that caused the breakage was
73625f6291

Original commit: elastic/x-pack-elasticsearch@01b82a79d4
2017-01-03 10:13:39 +00:00
Luca Cavanna 3532e34aaa Remove some usages of ParseFieldMatcher in favour of using ParseField directly (elastic/elasticsearch#4495)
Relates to elastic/elasticsearch#19552
Relates to elastic/elasticsearch#22130

Original commit: elastic/x-pack-elasticsearch@85d2a4cdbf
2016-12-31 09:24:35 +01:00
Chris Earle d210213fc9 [Monitoring] Use Cgroup Data from _nodes/stats (elastic/elasticsearch#4484)
* [Monitoring] Use Cgroup Data from _nodes/stats

This adds Cgroup data from _nodes/stats.

- This also adds 5m and 15m from system load, which are sent from ES, but
  were not recorded. Kibana does record/report those values though.

Original commit: elastic/x-pack-elasticsearch@8e04452c60
2016-12-30 18:55:51 -05:00
Chris Earle 2bce702f62 [Monitoring] Add Logstash monitoring feature
This PR adds UI for visualizing Logstash internal metrics with contributions from @ph, @jsvd and @pickypg

Changes include:

* x-pack component for Logstash which installs a monitoring exporter plugin to Logstash core. This periodically ships
  monitoring data to the monitoring bulk API endpoint.
* Adds xpack.monitoring.* setting to logstash.yml when x-pack is installed.
* UI changes to graph Logstash monitoring data. Logstash processes are called nodes. They send separate monitoring info
  which gets aggregated and displayed at cluster level and also at individual node level.
* Adds gradle build support for Logstash x-pack which can be controled via `xpack.logstash.build=false`

Fixes elastic/elasticsearch#4169

Original commit: elastic/x-pack-elasticsearch@f58ef406c1
2016-12-30 10:36:11 -08:00
Luca Cavanna 37a29c0387 Remove some usages of ParseFieldMatcher in favour of using ParseField directly (elastic/elasticsearch#4492)
Relates to elastic/elasticsearch#19552
Relates to elastic/elasticsearch#22130

Original commit: elastic/x-pack-elasticsearch@28f8e3cca4
2016-12-30 18:58:03 +01:00
Jay Modi 39263d83d2 ldap and ad realms should obey the verification_mode setting (elastic/elasticsearch#4486)
When migrating realms to use the new settings for SSL, the removal of the
hostname_verification setting was missed in addition to actually using the
ssl.verification_mode setting. This change deprecates the
hostname_verification and enables the use of the ssl.verification_mode setting.

Original commit: elastic/x-pack-elasticsearch@ea24e83fd3
2016-12-30 10:04:56 -05:00
Jay Modi 18a2cf23d4 Build a single role that represents a user's permissions (elastic/elasticsearch#4449)
This PR changes how we use roles and how we look at the roles of a user. Previously we looked up each role individually, parsed each into their own `Role` object, and had a wrapper that essentially served as an iterator over the roles. The same pattern was also followed for the permissions that composed a role (ClusterPermission, IndicesPermission, and RunAsPermission). This resulted in a lot of code that was hard to follow and could be inefficient. 

Now, we look up the roles for a user in bulk and only get the RoleDescriptor for each role. Once all role descriptors have been retrieved, we build a single Role that represents the user's permissions and we also cache this combination for better performance as authorization can happen many times for a single top level request as we authorize the top level request and any sub requests, which could be a large number in the case of shard requests.

This change also enabled a large cleanup of our permission and privilege classes, which should reduce the footprint of what needs to be followed. Some of the notable changes are:

* Consolidation of GeneralPrivilege and AbstractAutomatonPrivilege into the Privilege class
* The DefaultRole class has been removed and the permissions it provided were moved into the AuthorizationService
* The GlobalPermission class was removed as there is a single role that represents a user's permissions
* The Global inner classes for the various permissions were removed
* The Core inner class was removed and ClusterPermission, IndexPermission, RunAsPermission became final classes instead of interfaces
* The Permission interface has been removed. The isEmpty() method defined by this interface is not needed as we can simply evaluate the permission to get the same effect
* The ClusterPermission#check method only takes the action name again
* The AutomatonPredicate class was removed and replaced by Automatons#predicate
* IndicesAccessControl objects no longer need to be merged when evaluating permissions
* MergedFieldPermissions has been removed
* The Name class that was used to hold an array of strings has been removed and replaced with the use of a Set
* Privilege resolution is more efficient by only combining automata once

Other items:
* NativeRolesStore no longer does caching, so the RoleAndVersion class could be removed
* FileRolesStore doesn't need to be an AbstractLifecycleComponent

Relates elastic/elasticsearch#4327

Original commit: elastic/x-pack-elasticsearch@c1901bc82e
2016-12-30 09:27:49 -05:00
jaymode 9c09b88e9f watcher: do not continue execution when get result doesn't exist
When attempting to a get a watch that does not exist, the listener is called once inside
an if statement and the execution of the method continues as if the watch existed. This
causes failures to happen including a NPE. This commit wraps the execution in a if-else
to prevent this.

Original commit: elastic/x-pack-elasticsearch@27f09852e7
2016-12-30 08:34:39 -05:00
Adrien Grand 2b92ee71bc Fix compilation.
Original commit: elastic/x-pack-elasticsearch@8e845fe3b3
2016-12-30 10:54:20 +01:00
Igor Motov 7597fa8ae9 Use java.nio.charset.StandardCharsets instead of com.google.common.base.Charsets
We are trying to get rid of guava, so it doesn't make much sense to use it as a dependency unless we really need to.

Original commit: elastic/x-pack-elasticsearch@e2e2d58fba
2016-12-29 10:49:40 -05:00
Tim Vernum 22a32c8748 Add logstash_system user to X-Pack security reserved realm
The `logstash_system` user/role are used by logstash internals (e.g. monitoring), and work similarly to the Kibana user and role

Included features:  
- New logstash_system user/role (elastic/elasticsearch#4350, elastic/elasticsearch#4021)
- We no longer hide the reserved roles in the API (applies to both kibana and logstash_system)
- Automatically Disable logstash_system user on upgrade. If upgrading from a pre-5.2.0 version, automatically set the `logstash_system` user to disabled so that the system stays locked down. (elastic/elasticsearch#4445, elastic/elasticsearch#4394)

Closes: elastic/elasticsearch#4021
Closes: elastic/elasticsearch#4394 

Original commit: elastic/x-pack-elasticsearch@a9e6d1f216
2016-12-29 12:36:47 +11:00
Igor Motov 576a512ef2 Remove PROTO-based custom cluster state components
Switches custom cluster state components from PROTO-based de-serialization to named objects based de-serialization

Original commit: elastic/x-pack-elasticsearch@e1be8597ee
2016-12-28 12:38:03 -05:00
Martijn van Groningen ec8fb6c99f fixed scheduler job integration tests
Original commit: elastic/x-pack-elasticsearch@bb522d9d6d
2016-12-27 22:54:07 +01:00
Martijn van Groningen b94b79a411 test: fixed deleteAllSchedulers(...) method
Original commit: elastic/x-pack-elasticsearch@641c8c16b9
2016-12-27 20:34:05 +01:00
Martijn van Groningen b409b72629 fixed two other rest integ tests
Original commit: elastic/x-pack-elasticsearch@7fe318e2a8
2016-12-27 17:37:54 +01:00
Martijn van Groningen a2aaef90b7 first step to get things working again, added norelease work around for blocking client calls
Original commit: elastic/x-pack-elasticsearch@2c2a6d9ae8
2016-12-27 17:25:45 +01:00
David Kyle d431ebba6f Fix compilation after upstream changes
Original commit: elastic/x-pack-elasticsearch@b1cb074651
2016-12-23 12:34:25 +00:00
Yannick Welsch 505ed14c97 Separate cluster update tasks that are published from those that are not
Companion commit to elastic/elasticsearchelastic/elasticsearch#21912

Original commit: elastic/x-pack-elasticsearch@4ba569f8da
2016-12-23 12:21:59 +01:00
Dimitrios Athanasiou c1cd964458 fixed compile errors due to upstream changes in elasticsearch itself
Note that the change in elasticsearch allowed us to store scheduler
config's query and scriptFields as typed objects instead of
ByteReference.

Original commit: elastic/x-pack-elasticsearch@38c5aef2ef
2016-12-23 02:21:31 +00:00
Jason Tedor 935eec54c5 Enable assertions in integration tests
This commit fixes some bugs that were found after enabling assertions in
integration tests.

Relates elastic/elasticsearch#4443

Original commit: elastic/x-pack-elasticsearch@4fdd84166d
2016-12-22 20:14:02 -05:00
Nik Everett 4ff6279865 Remove exception from client suite
Original commit: elastic/x-pack-elasticsearch@51e94561d9
2016-12-22 09:10:42 -05:00
David Kyle 95cfae59ea Fix bulkrequest validation exception in the log (elastic/elasticsearch#610)
* Check the bulk request contains actions before executing.

This suppresses an validation exception about no requests being added.

* Persist bulk request before refreshing the indexes on a flush acknowledgment

Original commit: elastic/x-pack-elasticsearch@22543e46c8
2016-12-22 11:23:58 +00:00
Martijn van Groningen 84b419052f fixed compile errors due to upstream changes in elasticsearch itself
Original commit: elastic/x-pack-elasticsearch@defb853486
2016-12-22 11:12:12 +01:00
Areek Zillur 84db1b8731 x-pack changes for elasticsearchelastic/elasticsearch#21964
In https://github.com/elastic/elasticsearch/pull/21964, index
and delete operations are executed as single item bulk requests
internally. This means index and delete operations use the
bulk transport endpoints (indices:data/write/bulk[s][p] and
indices:data/write/bulk[s][r]).

This PR adds bulk transport endpoint to 'write' and 'delete'
index privilages and adds index and delete action as composite
actions to delay the authentication to the shard level.

Original commit: elastic/x-pack-elasticsearch@2305fc9ca0
2016-12-22 02:35:35 -05:00
Jason Tedor d5db68702c Adapt to method name change in core
This commit adapts to the change of the method name
ESTestCase#randomPostivieLong to ESTestCase#randomNonNegativeLong.

Original commit: elastic/x-pack-elasticsearch@689429cb54
2016-12-21 23:19:52 -05:00
Daniel Mitterdorfer b973d10685 Improve BWC
Original commit: elastic/x-pack-elasticsearch@f84cb5b1fa
2016-12-21 16:43:55 +01:00
David Roberts 92def19a73 Send header to C++ process on job open (elastic/elasticsearch#603)
This avoids the problem of the C++ process getting confused by control
messages that are sent before any data messages have been sent

Fixes elastic/elasticsearch#593

Original commit: elastic/x-pack-elasticsearch@9aed3f0b82
2016-12-21 14:32:54 +00:00
David Kyle a47c5332d5 Rename prelertresults- to .ml-anomalies (elastic/elasticsearch#607)
Original commit: elastic/x-pack-elasticsearch@ad3bb7c819
2016-12-21 13:47:00 +00:00
Nik Everett 483711ed20 Handle removal of IndiciesQueriesRegistry
It has been replaced by `XContentParser#namedObject`.

Original commit: elastic/x-pack-elasticsearch@fd316791a2
2016-12-21 08:01:49 -05:00
David Kyle 6de846d4c6 Put model state in the .mlstate-anomalydetectors index (elastic/elasticsearch#589)
* Put model state in the .mlstate index

* Revert results index rename

* Put ModelSnapshots in the results index

* Change state index in C++

* Fix logging

* Rename state index ‘.ml-state’

Original commit: elastic/x-pack-elasticsearch@dbe5f6b525
2016-12-21 12:03:17 +00:00
Dimitris Athanasiou 3e494070bf Strict parse search parts of schedulerConfig (elastic/elasticsearch#600)
* Strict parse search parts of schedulerConfig

This commit adds methods to build the typed objects
for the search parts of a scheduler config. Those are:
query, aggregations and script_fields.

As scheduler configs are stored in the cluster state and parsing
the search parts requires a SearchRequestParsers object, we cannot
store them as typed fields. Instead, they are now stored as
BytesReferences.

This change is in preparation for switching over to using a
client based data extractor.

Point summary of changes:

- query, aggregations and scriptFields are now stored as BytesReference
- adds methods to build the corresponding typed objects
- putting a scheduler now builds the search parts to to validate that
the config is valid

Relates to elastic/elasticsearch#478



Original commit: elastic/x-pack-elasticsearch@e6d5a85871
2016-12-21 10:57:55 +00:00
David Roberts 4033c93a13 Never persist records inside bucket objects (elastic/elasticsearch#588)
This doesn't happen initially when buckets are output by the C++, but
buckets can contain records at the moment they're sent for persistence
during normalization or during integration tests.  It's safest if the
persistence code specifically doesn't persist these records.

Original commit: elastic/x-pack-elasticsearch@a93135d8c0
2016-12-21 10:42:39 +00:00
Daniel Mitterdorfer fa1219fd13 Merge remote-tracking branch 'origin/master' into strict-booleans
Original commit: elastic/x-pack-elasticsearch@6fbbaf19dd
2016-12-21 08:47:45 +01:00
Martijn van Groningen 0b5b26284b Validate if job index already exists after job validation.
Closes elastic/elasticsearch#594

Original commit: elastic/x-pack-elasticsearch@b3b7b086a7
2016-12-21 08:34:16 +01:00
Nik Everett b2dc1bdca3 Introduce NamedXContentRegistry (elastic/elasticsearch#4399)
This "super registry" will eventually replace things like
`IndiciesQueriesRegistry` but for now it is just another thing
to plumb across requests.

Original commit: elastic/x-pack-elasticsearch@da26a42b36
2016-12-20 11:05:42 -05:00
Alexander Reelsen 6f7a065605 Watcher: Parse index action results to prevent exceptions (elastic/elasticsearch#4424)
When the index action is used to do some bulk indexing, the single
items of the response were not checked to have been indexed successful.
This could lead to NPEs due to an index response being null when the index
operation had failed. The action was still logged as a success though.

This commit only returns SUCCESS for the action, if all items were indexed
successfully. If all items failed, the result will be FAILED as well. Lastly
the result status PARTIAL_FAILURE is used if there were successful and unsuccessful
index operations.

Additionally some minor cleanups happened, like changing equals/hashcode.

Closes elastic/elasticsearch#4416

Original commit: elastic/x-pack-elasticsearch@692687e1af
2016-12-20 16:53:12 +01:00
Alexander Reelsen 0f8e6354f6 Watcher: Allow deletion of watches regardless of license (elastic/elasticsearch#4414)
The user might want to delete watches on expiry to prevent
further execution, without any actions being executed.

Closes elastic/elasticsearch#4413

Original commit: elastic/x-pack-elasticsearch@244a1b9cd8
2016-12-20 15:26:06 +01:00
Yannick Welsch 68bfc90cea Let ClusterStateObserver only hold onto state that's needed for change detection
Companion commit for elastic/elasticsearchelastic/elasticsearch#21631

Original commit: elastic/x-pack-elasticsearch@3333480707
2016-12-20 15:23:00 +01:00
Martijn van Groningen 999a1eb234 fix JobTests#testEquals_noId by fixing regex expression and including `-`
Original commit: elastic/x-pack-elasticsearch@b295d5f621
2016-12-20 15:15:47 +01:00
David Roberts 8b135226f6 Fix long line
Original commit: elastic/x-pack-elasticsearch@8d030d8cf8
2016-12-20 14:09:39 +00:00
David Kyle 537fea313f Add job config option to set the index name (elastic/elasticsearch#560)
* Add job config option to set the index name

* Check index does not already exist if ’index_name’ is set

* Don’t create alias if ‘index_name’ is the same as ‘job_id’

* Default index_name value

Set it to job_id if null and only create the index alias if job_id != index_name

* Fix compile errors after rebasing

* Address review comments

* Test if the index exists by checking the cluster state

* Update comment

Original commit: elastic/x-pack-elasticsearch@a3e7f1a5bb
2016-12-20 14:03:24 +00:00
David Roberts 3383c67cf2 Ensure automatically generated job IDs meet the validation criteria (elastic/elasticsearch#586)
Original commit: elastic/x-pack-elasticsearch@34b67cb509
2016-12-20 13:53:29 +00:00
Alexander Reelsen b994f16f4a Watcher: Ensure non duplicate Wid ids (elastic/elasticsearch#4423)
Removing the WatchLockService could result in duplication of wids, because of a wrong
call to replace underscores with dashes. As UUIDs.createBase64UUID() can contain underscores
but they are kind of reserved in the Wid class due to handling of watch ids, this just uses
the toString() representation of a random UUID.

Closes elastic/elasticsearch#4422

Original commit: elastic/x-pack-elasticsearch@dceb01ae5e
2016-12-20 14:02:00 +01:00
David Roberts 5b029ee595 Correct test condition and add a message in case of future failures
Original commit: elastic/x-pack-elasticsearch@55729b39fa
2016-12-20 11:22:03 +00:00
David Kyle 78fdca65d5 Add job Id to state document IDs (elastic/elasticsearch#579)
* Persist quantile documents with the jobId in the document Id

* Add job Id to snapshot Id

* Add job Id to categoriser state document Id

* Rename quantiles doc to start with job id as the other state docs do

* Fix restoring categoriser state

Original commit: elastic/x-pack-elasticsearch@3e5d3368b5
2016-12-20 10:47:37 +00:00
Dimitrios Athanasiou 316f6bf6cb Remove unused methods and fix test
Original commit: elastic/x-pack-elasticsearch@12290517d0
2016-12-20 10:15:53 +00:00
Dimitris Athanasiou bee58f8b81 Add get API for schedulers (elastic/elasticsearch#582)
Original commit: elastic/x-pack-elasticsearch@59c555d60a
2016-12-20 10:09:45 +00:00
Daniel Mitterdorfer b9a38d9b97 Enable trace logging for LocalExporterTests#testSimpleExport()
This test fails due to a changing cluster state(?).  The
test checks that a local exporter is ready and then continues.
However, during the test, we see output similar to:

skipping exporter [_local] as it isn't ready yet

Which indicates that the cluster state has changed and the
exporter does not return a bulk anymore. Hence, the test is
failing although at one point in time it returned a bulk.

By enabling trace logging we should be able to find out
what's going on.

Original commit: elastic/x-pack-elasticsearch@d7e2200dd9
2016-12-20 08:54:26 +01:00
Ryan Ernst 789df7d2fa Internal: Update signatures for EnvironmentAwareCommand (elastic/elasticsearch#4367)
This is the xplugins side of elastic/elasticsearchelastic/elasticsearch#22175

Original commit: elastic/x-pack-elasticsearch@4359cb1947
2016-12-19 15:23:53 -08:00
javanna adf22c3d24 Adapt to strict parsing mode removal
Original commit: elastic/x-pack-elasticsearch@2d6276a60f
2016-12-19 19:39:08 +01:00
David Roberts 9b3764b7fa Max jobs per node cannot be dynamic due to threadpool (elastic/elasticsearch#578)
The threadpool that supplies the threads used for job IO cannot be
resized, so the number of jobs cannot be dynamic either

Original commit: elastic/x-pack-elasticsearch@c584bf7147
2016-12-19 17:48:22 +00:00
Alexander Reelsen 79a8f27569 Watcher: Remove WatchLockService (elastic/elasticsearch#4365)
The watch lock service is not really needed, as there is already
a data structure that has information about the currently executing
watches, that can be consulted before executed.

This change will now check, if there is already a watch running with
the current id. If there is not, execution will happen as usual. If
there is however, than a watch record will be created, stating that
the watch is currently being executed - which means that it is either
being executed or in the list of planned executions.

This way users can check in the watch history, if a watch has been executed
more often than it should.

In order to easily search for this, a new execution state called
`NOT_EXECUTED_ALREADY_QUEUED` has been added.

Original commit: elastic/x-pack-elasticsearch@867acec3c3
2016-12-19 17:33:48 +01:00
David Roberts f65125df55 No point rethrowing exception in thread pool task
It will just get logged twice, but with a less useful message the
second time

Original commit: elastic/x-pack-elasticsearch@7d32f65cc1
2016-12-19 16:24:45 +00:00
Dimitrios Athanasiou 081bebbbcd Remove unused constants
Original commit: elastic/x-pack-elasticsearch@0f72f1fc6e
2016-12-19 14:22:05 +00:00
Dimitris Athanasiou 8750e5f926 Redesign the get anomaly_detectors APIs (elastic/elasticsearch#570)
* Redesign the get anomaly_detectors APIs

This commit redesigns the APIs to get anomaly_detectors.

The new design has 2 GET APIs:

- An API to get the configurations: /anomaly_detectors/{job_id}
- An API to get the stats: /anomaly_detectors/{job_id}/_stats

For both APIs entering "_all" as the job_id returns results for
all jobs.

Note that page params have been removed. They were useful
when the configs were stored in an index. Now that they are part
of cluster state there is no need. Additionally, future support
for wildcard job_id expressions will give users a tool to narrow
down the GET actions to a certain subset of jobs which will be
more useful than the from/size approach.

Follow up:

- Implement similar GET APIs for schedulers
- Remove scheduler_stats from the anomaly_detectors _stats API
as it will be part of the schedulers _stats API

Closes elastic/elasticsearch#548

Original commit: elastic/x-pack-elasticsearch@046a0db8f5
2016-12-19 13:09:54 +00:00
Daniel Mitterdorfer 2cb41e690d Address initial review comments
Original commit: elastic/x-pack-elasticsearch@bcd6433afb
2016-12-19 13:27:40 +01:00
Daniel Mitterdorfer 24a4290379 Merge remote-tracking branch 'origin/master' into strict-booleans
Original commit: elastic/x-pack-elasticsearch@32a533f38f
2016-12-19 12:58:30 +01:00
David Kyle 4eda09d24a Don’t write job description if not set
Original commit: elastic/x-pack-elasticsearch@6e7ff939d3
2016-12-19 11:27:32 +00:00
David Roberts 854dc88cbd Corrections to previous commit
Original commit: elastic/x-pack-elasticsearch@a9e94119e1
2016-12-19 10:28:23 +00:00
David Roberts 028a505fe5 Update copyright headers (elastic/elasticsearch#572)
* Added the Elastic copyright header to C++ files

* Added the name of the copyright holder to Java files

Original commit: elastic/x-pack-elasticsearch@aea1b5a656
2016-12-19 10:19:21 +00:00
Dimitris Athanasiou 6a14f52d2e Remove aggs and retrieve_whole_source from SchedulerConfig (elastic/elasticsearch#569)
Aggs does not need to be a separate member field. There can simply
be an aggs parse field which also then stored onto the aggregations
parse field.

Finally, retrieve_whole_source is unnecessary as we move towards
a node client based data extraction.

Original commit: elastic/x-pack-elasticsearch@14024c2ee5
2016-12-19 09:54:59 +00:00
Daniel Mitterdorfer 7a652fa090 Merge pull request elastic/elasticsearch#4398 from danielmitterdorfer/xcontent_strict_duplicate_checks
Enable strict duplicate checks for all XContent types

Original commit: elastic/x-pack-elasticsearch@ad249c2e65
2016-12-19 09:30:19 +01:00
Tim Vernum df7c528c66 Change classification of event_type in index audit trail (elastic/elasticsearch#4375)
In LoggingAuditTrail and the audit-event filtering, we distinguish between single-realm authentication failures ("realm_authentication_failure") and global failures ("authentication_failure").

Update the message output of IndexAuditTrail to reflect this distinction.

Original commit: elastic/x-pack-elasticsearch@56802ae2df
2016-12-19 14:39:21 +11:00
Simon Willnauer c9cfedc3cb [TEST] check if .watches index / alias exists before creating it
Original commit: elastic/x-pack-elasticsearch@74d85121eb
2016-12-18 10:17:43 +01:00
Areek Zillur 278496d5e5 x-pack changes for removing deprecated _suggest endpoint (elasticsearchelastic/elasticsearch#22203)
Original commit: elastic/x-pack-elasticsearch@b9bba20fae
2016-12-16 13:06:35 -05:00
David Kyle aacb6f3949 Move JobResultsPersister.getJobIndexName to new class AnomalyDetectorsIndex (elastic/elasticsearch#567)
Original commit: elastic/x-pack-elasticsearch@bf54dd56a9
2016-12-16 17:47:52 +00:00
Martijn van Groningen e3ec908828 run with native process by default
Original commit: elastic/x-pack-elasticsearch@c73beec522
2016-12-16 15:21:11 +01:00
Martijn van Groningen eaca8fb06a Stop local allocated jobs before closing node.
Original commit: elastic/x-pack-elasticsearch@ad3ed7c86a
2016-12-16 14:59:35 +01:00
David Roberts c43a9ba1dd Fix intermittent failure of renormalization (elastic/elasticsearch#558)
The synchronization was flawed

Original commit: elastic/x-pack-elasticsearch@a968c68c7d
2016-12-16 13:45:47 +00:00
Daniel Mitterdorfer d3c1fbe002 Enable strict duplicate checks for all XContent types
With this commit we enable the Jackson feature 'STRICT_DUPLICATE_DETECTION'
by default for all XContent types (not only JSON).

We have also changed the name of the system property to disable this feature
from `es.json.strict_duplicate_detection` to the now more appropriate name
`es.xcontent.strict_duplicate_detection`.

Relates elastic/elasticsearchelastic/elasticsearch#19614
Relates elastic/elasticsearchelastic/elasticsearch#22073

Original commit: elastic/x-pack-elasticsearch@c92e2a6c55
2016-12-16 13:57:55 +01:00
Colin Goodheart-Smithe 5e6c63bc51 Removes warnings
Original commit: elastic/x-pack-elasticsearch@59626a3a3a
2016-12-16 12:35:45 +00:00
Alexander Reelsen 0d9cb5f7bd Docs: Updating execution phases of watch execution
Closes elastic/elasticsearch#4079

Original commit: elastic/x-pack-elasticsearch@658ba0a7f7
2016-12-16 11:30:27 +01:00
Dimitris Athanasiou c932588c68 Repackage scheduler classes (elastic/elasticsearch#559)
* Repackage scheduler classes

* Rename and move scheduler status tests

Original commit: elastic/x-pack-elasticsearch@a9d7cc4e48
2016-12-16 09:50:06 +00:00
Daniel Mitterdorfer e3302da589 Make boolean conversion strict
This PR removes all leniency in the conversion of Strings to booleans: "true"
is converted to the boolean value `true`, "false" is converted to the boolean
value `false`. Everything else raises an error.

Original commit: elastic/x-pack-elasticsearch@6400f18911
2016-12-15 19:06:59 +01:00
Boaz Leskes b2972a142c Remove Cluster State Status (elastic/elasticsearch#4313)
A companion PR for https://github.com/elastic/elasticsearch/pull/21817

Original commit: elastic/x-pack-elasticsearch@392235877f
2016-12-15 17:07:02 +01:00
David Kyle 8d5c8b24d6 Make ModelDebugOutput fields snake case (elastic/elasticsearch#555)
* snake_case model debug output fields

* Rename CategorizerState and BucketInfluencer types to snake_case

Original commit: elastic/x-pack-elasticsearch@da94dc7ec1
2016-12-15 15:42:38 +00:00
David Kyle 8e14aee978 Audit message were being persisted with the type ‘audit_activity’ (elastic/elasticsearch#554)
Original commit: elastic/x-pack-elasticsearch@7c00495c98
2016-12-15 15:31:11 +00:00
Dimitris Athanasiou 8841a97659 Disallow non alphanumeric chars from start or end in IDs (elastic/elasticsearch#552)
Closes elastic/elasticsearch#550

Original commit: elastic/x-pack-elasticsearch@ca0ca9f4da
2016-12-15 13:49:07 +00:00
Dimitrios Athanasiou bc8d966690 Fix integration tests
Original commit: elastic/x-pack-elasticsearch@a5955cfde3
2016-12-15 12:03:51 +00:00
David Kyle b97610f245 Streamed boolean values can on be 0 or 1
Original commit: elastic/x-pack-elasticsearch@16ffa0727b
2016-12-15 12:01:09 +00:00
Alexander Reelsen e6ee905931 Watcher: Remove unused class
Original commit: elastic/x-pack-elasticsearch@ecd48b7914
2016-12-15 11:33:36 +01:00
Ryan Ernst 6d4d599f91 Build: Convert xplugins to use new extra projects setup (elastic/elasticsearch#4175)
* Build: Convert xplugins to use new extra projects setup

This change makes the gradle initialization for xplugins look in the
correct location for elasticsearch, which is now as a sibling of an
elasticsearch-extra directory, with x-plugins as a child of the extra
directory.

The elasticsearch side of this change is
elastic/elasticsearchelastic/elasticsearch#21773. This change will enable renaming x-plugins
to x-pack, see elastic/elasticsearch#3643.

Original commit: elastic/x-pack-elasticsearch@09398aea5a
2016-12-14 15:02:28 -08:00
Martijn van Groningen faf54d4952 renamed test classes
Original commit: elastic/x-pack-elasticsearch@5296de69d7
2016-12-14 19:52:10 +01:00
Martijn van Groningen 985bdf6cb1 Changed rest start scheduler api to wait with returning a response until the the scheduler status has been set to STARTED and
changed stop scheduler api to wait with returning a response until the scheduler status has been set to STOPPED.

Original commit: elastic/x-pack-elasticsearch@e20fcd1ae9
2016-12-14 19:50:02 +01:00
Martijn van Groningen 3b487a268b Add validation for stop scheduler api
Original commit: elastic/x-pack-elasticsearch@4571bbacd9
2016-12-14 19:28:12 +01:00
David Kyle f085b935f6 Custom all mapping for interesting result fields (elastic/elasticsearch#535)
* Check use of mappings

* Add unit tests for JobProvider.createJobRelatedIndices

* Remove ‘index: no’ from mappings as no longer required

The entire type mapping has ‘enabled: false’

* Restore “index.analysis.analyzer.default.type” setting

* Remove include_in_all from nested mappings

* Add audit and usage mappings to the job index

* Revert ‘Restore “index.analysis.analyzer.default.type” setting’

Original commit: elastic/x-pack-elasticsearch@c7d62e0c7e
2016-12-14 16:32:36 +00:00
Nik Everett 597ca9275e Finish centralizing XContentParser creation in tests
Now we're ready to add `NamedXContentRegistry`.

Original commit: elastic/x-pack-elasticsearch@c4f6c7c3d6
2016-12-14 11:19:09 -05:00
David Roberts 0a45d846df Add back native process normalizer functionality (elastic/elasticsearch#540)
This builds on PR elastic/elasticsearch#526 to get normalization working end-to-end using the
native normalizer process.

The ShortCircuitingRenormalizer class is basically doing what the old
BlockingQueueRenormaliser class did but using the ES threadpool instead
of its own thread.

Also fixed a bug where the C++ was calling the score field of partition_score
documents normalized_probability but the Java was calling it anomaly_score.

Original commit: elastic/x-pack-elasticsearch@d4cecae150
2016-12-14 16:06:01 +00:00
Dimitris Athanasiou 4732223214 Split SchedulerConfig from Job (elastic/elasticsearch#541)
Original commit: elastic/x-pack-elasticsearch@32a55da726
2016-12-14 14:10:44 +00:00
David Kyle 7efdbd9320 Fix the reported number of bytes read (elastic/elasticsearch#544)
Original commit: elastic/x-pack-elasticsearch@a98902f309
2016-12-14 13:39:00 +00:00
Daniel Mitterdorfer feabaaf1d6 Add missing import
Original commit: elastic/x-pack-elasticsearch@fbc8eb7ac6
2016-12-14 09:34:55 +01:00
Daniel Mitterdorfer 83240e25b4 Merge remote-tracking branch 'origin/master' into json_strict_duplicate_checks
Original commit: elastic/x-pack-elasticsearch@af25e460d0
2016-12-14 08:53:45 +01:00
Nik Everett d4939e1972 Start centralizing XContentParser creation in tests
Original commit: elastic/x-pack-elasticsearch@65be7ecd27
2016-12-13 20:28:19 -05:00
Jason Tedor 3f5d24ae55 Add shutdown hook for closing CLI commands
This commit adapts some CLI command tests for some changes in core.

Relates elastic/elasticsearch#4342

Original commit: elastic/x-pack-elasticsearch@1e48c1404f
2016-12-13 19:10:35 -05:00
Alexander Reelsen 1e7985563a Tests: Make MockWebServer thread-safe (elastic/elasticsearch#4351)
The new MockWebServer assumed that responses are inserted at the beginning
and removed later on. This was not thread safe.

Also this fixes a bug in the HttpExporterIT where there was no wait time
for a bulk request, even though the request execution is asynchronous.

Closes elastic/elasticsearch#4335

Original commit: elastic/x-pack-elasticsearch@11f31f68bd
2016-12-13 19:34:33 +01:00
Zachary Tong b386ed33a1 Add ability to get all lists, ensure params are mutually exclusive (elastic/elasticsearch#514)
Also removes some unnecessary stuff in validate()

Related elastic/elasticsearch#291

Original commit: elastic/x-pack-elasticsearch@d9af2d3a30
2016-12-13 11:38:11 -05:00
Zachary Tong 6ef954e3f0 Add mutually-exclusive param validation to GetCategories (elastic/elasticsearch#512)
Also adds body parsing to the REST action, which seemed to be missing (but supported because of the POST)

Closes elastic/elasticsearch#430

Original commit: elastic/x-pack-elasticsearch@e7455ffbb6
2016-12-13 11:37:46 -05:00
Daniel Mitterdorfer 8be3250601 Merge remote-tracking branch 'origin/master' into json_strict_duplicate_checks
Original commit: elastic/x-pack-elasticsearch@a010b1b4e9
2016-12-13 16:22:47 +01:00
Daniel Mitterdorfer 7cb0771c46 Use assume* instead of custom skipping logic
Original commit: elastic/x-pack-elasticsearch@0f3a01735f
2016-12-13 16:21:46 +01:00
Martijn van Groningen 3581fc9d91 removed redundant private method
Original commit: elastic/x-pack-elasticsearch@dbc377d6b4
2016-12-13 13:35:14 +01:00
Martijn van Groningen d15933ac32 test: move java rest test to yaml rest test.
These test are just checking response / status code. It is cleaner to have these tests as yaml tests.

Original commit: elastic/x-pack-elasticsearch@61c323059e
2016-12-13 12:13:24 +01:00
Luca Cavanna 1c846dd893 Stop execution once destructive operations check has failed (elastic/elasticsearch#4337)
Otherwise we do return an error, but we also go ahead and open/close/delete the indices anyways.

Original commit: elastic/x-pack-elasticsearch@176eca4cff
2016-12-13 11:22:48 +01:00
David Kyle 9f73f047eb Test for job existence before updating its state (elastic/elasticsearch#532)
* Test for job existence before updating its state

* Add unit tests covering expected missing job exceptions

Original commit: elastic/x-pack-elasticsearch@bcd270dafd
2016-12-13 09:24:16 +00:00
Alexander Reelsen b57c4f6ebe Watcher: Remove in memory watch store (elastic/elasticsearch#4201)
In order to prepare to the distributed watch execution, this commit
removes the in memory watch store.

Whenever a watch is needed now, a get request is executed and the parsing
is done. This happens when

* Put
* Get
* Ack
* Activate/Deactivate
* Execute

Note: This also means there are no usage stats currently regarding
the watch count, because we would need to execute a query. This would
require the usage stats to be async, see elastic/elasticsearch#3569

Another advantage is, that there is no dirty flag in the watch itself
needed anymore, because the watch is always the latest. Also write
operations store immediately and dont leave anything in memory.

Also ActionListener.wrap() was used a lot instead of more verbose anonmyous
inner classes.

Original commit: elastic/x-pack-elasticsearch@c47465b47c
2016-12-13 08:54:03 +01:00
Tim Vernum 7192c46307 Define explicit settings for security realms/ssl (elastic/elasticsearch#4311)
Modified the definition and loading of settings in Security to provide early detection and failure of invalid (unrecognised or syntactically invalid) settings.
Also consolidates the number of places where settings were defined.

Each realm now defines its supported settings.
This is facilitated for custom realms via a new "getRealmSettings" method on XPackExtension.
The realm group setting performs validation of the child settings with reference to the "type".
For backwards compatibility reasons, realm types that have no configuration defined, will be accepted during validation, but may fail at realm creation time.

All SSL settings have been centralised into SSLConfigurationSettings, which supports a variable "prefix" to accommodate the multiple places we define SSL config.

HTTP Proxy settings are explicitly defined rather than being a generic group.

Where possible all security settings now reference a Setting object, and there are less magic strings scattered in the code.

Closes: elastic/elasticsearch#3965

Original commit: elastic/x-pack-elasticsearch@2c76a137a9
2016-12-13 16:14:02 +11:00
David Kyle bca06f0ad7 Fix forbidden API errors and logger usage check (elastic/elasticsearch#533)
Original commit: elastic/x-pack-elasticsearch@e7bdaa8b0a
2016-12-12 17:31:39 +00:00
David Kyle 1d67c6ea1d Fix build: rename import Renormali[s]er -> Renormali[z]er
Original commit: elastic/x-pack-elasticsearch@70fa67aaf7
2016-12-12 17:08:39 +00:00
David Kyle 2302dc78ba AutodetectResultProcessor Integration Test (elastic/elasticsearch#516)
* Add results processor integration test

* Integration tests for AutodetectResultProcessor

Original commit: elastic/x-pack-elasticsearch@19e7ec48dd
2016-12-12 16:55:20 +00:00
David Kyle dae0b5625d Add yaml tests assert a 404 is returned when the job id isn’t recognised (elastic/elasticsearch#531)
For open, close, _flush and posting data

Original commit: elastic/x-pack-elasticsearch@be2c29c409
2016-12-12 16:00:20 +00:00
David Kyle 300d7c67d2 Fix failing integration tests
Incorrect job id was used

Original commit: elastic/x-pack-elasticsearch@625a1616ee
2016-12-12 13:03:09 +00:00
David Kyle 3829a83864 Check job exists and return a 404 on flush (elastic/elasticsearch#529)
Original commit: elastic/x-pack-elasticsearch@7721d4510a
2016-12-12 12:50:40 +00:00
David Kyle 46938b281c Check job exists before opening & closing (elastic/elasticsearch#530)
Original commit: elastic/x-pack-elasticsearch@037ea30a12
2016-12-12 12:50:29 +00:00
David Roberts 1d4df3903c Add back parts of the normalizer functionality (elastic/elasticsearch#526)
* Added back Normalizable classes
* Added back normalization process management classes
* Added back the scores updater

Original commit: elastic/x-pack-elasticsearch@ac8edf6ed6
2016-12-12 12:40:13 +00:00
javanna 85679fcf19 Adapt to removal of support for empty queries
Original commit: elastic/x-pack-elasticsearch@87915a9cde
2016-12-12 13:34:30 +01:00
Daniel Mitterdorfer 050a36bb28 Address review comments in ES core
Original commit: elastic/x-pack-elasticsearch@925c78d4fe
2016-12-12 13:30:39 +01:00
Daniel Mitterdorfer b7d2ef0160 Merge remote-tracking branch 'origin/master' into json_strict_duplicate_checks
Original commit: elastic/x-pack-elasticsearch@601a663982
2016-12-12 12:36:38 +01:00
Martijn van Groningen bad8a2beb5 let prelert metadata test extend from AbstractSerializingTestCase, so that we test the writable and xcontent serialization much better.
Original commit: elastic/x-pack-elasticsearch@de8609ad59
2016-12-12 12:09:07 +01:00
Martijn van Groningen f73d22b4b2 removed unused method
Original commit: elastic/x-pack-elasticsearch@bbe4b7e932
2016-12-12 11:19:44 +01:00
Martijn van Groningen 3d8353ac6a replaced `RestActions` helper methods for checking whether there is a request body and getting the request body with getters on RestRequest itself
Original commit: elastic/x-pack-elasticsearch@857d999c8e
2016-12-12 10:51:54 +01:00
David Kyle 45c8aeb0f2 Remove the ES_TIMESTAMP constant (elastic/elasticsearch#523)
Original commit: elastic/x-pack-elasticsearch@04fa354619
2016-12-12 09:28:42 +00:00
Alexander Reelsen 779eb44b66 Watcher: Cleanup - Replace list of integers with bitset (elastic/elasticsearch#4324)
In the triggered watch store a list of integers was returned to keep track
which watches had been successfully stored and thus should be executed.

This means, that an arraylist, plus autoboxing/unboxing needs to be done for
all the triggered watches. This data structure can easily be replaced with a BitSet,
resulting in much less objects being created or parsed - also it's a bit faster.

Original commit: elastic/x-pack-elasticsearch@e9fba67e34
2016-12-12 09:48:58 +01:00
Simon Willnauer 5716a20fd3 Fix compile issues after elastic/elasticsearchelastic/elasticsearch#22037
Original commit: elastic/x-pack-elasticsearch@c286839ba5
2016-12-10 11:05:58 +01:00
Nik Everett f6cb60204a Handle core moving some methods around
We're trying to move all the XContentParser creation into
`RestRequest`.

Original commit: elastic/x-pack-elasticsearch@87c05c4a9a
2016-12-09 20:01:53 -05:00
Zachary Tong 30bbbf0f78 Convert `jobs` namespace to `anomaly_detectors` (elastic/elasticsearch#513)
This also shuffles results under /anomaly_detectors/.  Note: the cluster state still refers to
"jobs" which should probably be fixed in a separate PR

Original commit: elastic/x-pack-elasticsearch@c9e634621c
2016-12-09 11:54:56 -05:00
Martijn van Groningen a85dfcd91f changed end back to primitive long
renamed private method

Original commit: elastic/x-pack-elasticsearch@fc1849dbc6
2016-12-09 15:56:22 +01:00
Martijn van Groningen de9dbdabe1 fixed typos
Original commit: elastic/x-pack-elasticsearch@21a62161d9
2016-12-09 15:50:58 +01:00
Martijn van Groningen 431a7988fb added more tests
Original commit: elastic/x-pack-elasticsearch@871c13307e
2016-12-09 15:45:25 +01:00
Martijn van Groningen b42f9cccb0 renamed `scheduler_status` to `scheduler_state` in get job response
Original commit: elastic/x-pack-elasticsearch@a7955eb027
2016-12-09 15:36:12 +01:00
Martijn van Groningen d5412627d2 Moved scheduler status to prelertmetadata to make it more independent of job.
Removed SchedulerStats as scheduler status is all we need and start and end times are only needed in start scheduler api.

Original commit: elastic/x-pack-elasticsearch@80c563cb69
2016-12-09 15:03:53 +01:00
Jay Modi ac34c3c37f Remove deprecated methods from the Realm class
This change removes the deprecated methods from the realm class. These methods include
blocking authentication and lookup and the lookup supported method.

Original commit: elastic/x-pack-elasticsearch@cff21e21ee
2016-12-09 07:28:11 -05:00
Daniel Mitterdorfer 8153d2ca69 Enable strict duplicate checks for JSON content
With this commit we enable the Jackson feature 'STRICT_DUPLICATE_DETECTION'
by default. This ensures that JSON keys are always unique. While this has
a performance impact, benchmarking has indicated that the typical drop in
indexing throughput is around 1 - 2%.

As a last resort, we allow users to still disable strict duplicate checks
by setting `-Des.json.strict_duplicate_detection=false` which is
intentionally undocumented.

Relates elastic/elasticsearchelastic/elasticsearch#19614

Original commit: elastic/x-pack-elasticsearch@cced57b884
2016-12-09 12:48:28 +01:00
Martijn van Groningen e067008a21 make optional flush parameter really optional
Original commit: elastic/x-pack-elasticsearch@6129023c49
2016-12-09 10:24:16 +01:00
Martijn van Groningen 372cb7c964 Let the scheduler use the data transport action instead of directly using autodetect process manager.
Original commit: elastic/x-pack-elasticsearch@2442e222fd
2016-12-09 09:41:04 +01:00
Alexander Reelsen 37b0d52882 Watcher: Remove mock web server from square (elastic/elasticsearch#4221)
The latest release of the mock web server requires more security permissions, and
we dont need all the functionality anyway.

This introduces a small MockWebServer using the JDK internal HttpServer, yet fullfilling
all our needs and supporting SSL as well for testing.

The MockWebServer allows to enqueue responses and also requires you to enqueue as many responses
as you requests will be executed - there is no fallback at the moment.

SSL is also supported by passing an SSL context - for which the TestsSSLService is needed, which
makes the required methods public.

Original commit: elastic/x-pack-elasticsearch@55f4a172a2
2016-12-09 09:07:09 +01:00
Ryan Ernst b1846190af Remove uses of 2.0 prerelease constants
This is the xplugins side of elastic/elasticsearchelastic/elasticsearch#22004

Original commit: elastic/x-pack-elasticsearch@55433d760c
2016-12-08 23:11:20 -08:00
Jason Tedor e6d758b92b Bump version to 5.1.2
This commit bumps the version to 5.1.2.

Relates elastic/elasticsearch#4318

Original commit: elastic/x-pack-elasticsearch@a922dc7288
2016-12-08 18:43:16 -05:00
David Roberts 65f03a8888 Use well-defined IDs for records and influencers (elastic/elasticsearch#510)
* Use well-defined IDs for records and influencers

Removes the reliance on ES autogenerated UUIDs for all types that will
be renormalized

* Address some review comments

Original commit: elastic/x-pack-elasticsearch@85fde8b957
2016-12-08 18:39:03 +00:00
David Roberts 256ab7f3e2 Fix another misuse of ParameterizedMessage
Original commit: elastic/x-pack-elasticsearch@9e36900432
2016-12-08 17:32:59 +00:00
David Roberts 3f460b030e Fix a couple of ParameterizedMessage mistakes
Original commit: elastic/x-pack-elasticsearch@0006755c8b
2016-12-08 16:56:49 +00:00
Zachary Tong 8fa17f7ea8 Add mutually-exclusive param validation to GetBuckets (elastic/elasticsearch#497)
Related elastic/elasticsearch#430

Original commit: elastic/x-pack-elasticsearch@2579efca46
2016-12-08 10:28:30 -05:00
Zachary Tong b594e93a5d Remove SingleDocument as it is now unused (elastic/elasticsearch#498)
Closes elastic/elasticsearch#314

Original commit: elastic/x-pack-elasticsearch@88d2d20bdc
2016-12-08 10:28:12 -05:00
David Kyle a55944b284 Make ModelDebugOutput a result type (elastic/elasticsearch#484)
* Make ModelDebugOutput a result type

* Delete unused ElasticsearchBatchedModelDebugOutputIterator

* Add result_type field to ModelDebugOutput

* Address review comments

Original commit: elastic/x-pack-elasticsearch@a48e4cd946
2016-12-08 15:05:06 +00:00
David Kyle d18daf0b3d Make ModelSizeStats a result type (elastic/elasticsearch#500)
* Make ModelSizeStats a result type

* Address review comments

Original commit: elastic/x-pack-elasticsearch@74de7b36d8
2016-12-08 14:44:59 +00:00
Martijn van Groningen 9c2c831996 Hooked scheduler into task api infrastructure.
The start scheduler api call will run until the scheduler has completed. Either when lookback only scheduler completes or the scheduler has been stopped.
 The start scheduler api will first update the scheduler status from STOPPED to STARTED on master node and then start running the scheduler.
 Once a scheduled job completes it updates the scheduler status from STARTED to STOPPED and then the start schedule api returns.
 The STARTING and STOPPING statuses are no longer used, so have been removed.
 The stop scheduler api is a sugar api that uses the task list and cancel apis stop the scheduler.
 Renamed ScheduledJobService to ScheduledJobRunner

Original commit: elastic/x-pack-elasticsearch@ab504fe3d9
2016-12-08 14:37:55 +01:00
Martijn van Groningen c8bda6b1d9 Collapsed JobProvider and JobResultsProvider and renamed ElasticsearchJobProvider to JobProvider
Original commit: elastic/x-pack-elasticsearch@05d5969d73
2016-12-08 10:53:31 +01:00
Tanguy Leroux 1f9871c31e [TEST] Mute OldMonitoringIndicesBackwardsCompatibilityTests
This tests fails because of multiple issues in monitoring service and exporters lifecycle. These issues are tracked in https://github.com/elastic/x-plugins/issues/4314.

Original commit: elastic/x-pack-elasticsearch@f461d98a4c
2016-12-08 10:48:39 +01:00
Dimitris Athanasiou 4990195c90 Convert field references in error messages to snake case (elastic/elasticsearch#495)
* Convert field references in error messages to snake case

Closes elastic/elasticsearch#493

Original commit: elastic/x-pack-elasticsearch@38f4cd91bc
2016-12-08 09:32:10 +00:00
Areek Zillur b274ddc0da Log license type on license update (elastic/elasticsearch#4308)
Now when a cluster gets updated with a new license,
the license uid and type will be logged as info. Making
it easier to verify the current license mode of the cluster.

Original commit: elastic/x-pack-elasticsearch@c205cb42ae
2016-12-07 18:01:58 -05:00
Zachary Tong 4d86670772 Make jobId and from/size mutually exclusive options (elastic/elasticsearch#477)
Make jobId and from/size mutually exclusive options.  

This approach has the main properties of not allowing an invalid Request to be built, and alerting the user if they set an incorrect configuration. It has the downside that PageParams can be null so the consumer will have to check for it. Since jobId could be null before, this seemed acceptable.

Original commit: elastic/x-pack-elasticsearch@106dcdf61a
2016-12-07 12:48:33 -05:00
Zachary Tong 3c711e6dff Add delete_list endpoint (elastic/elasticsearch#409)
Adds a delete_list endpoint.  If a list is currently in use by a job, it is not allowed to be deleted

Original commit: elastic/x-pack-elasticsearch@7d9a984b3a
2016-12-07 12:40:12 -05:00
Yannick Welsch 754fada43b Use autoMinMasterNodes for most of the license tests
There were some test failures as LicenseServiceClusterTests was not properly setting minimum_master_nodes while having autoMinMasterNodes disabled.

Original commit: elastic/x-pack-elasticsearch@2030db2424
2016-12-07 17:59:25 +01:00
David Kyle af61a51e22 Fix results not being persisted (elastic/elasticsearch#489)
Original commit: elastic/x-pack-elasticsearch@d0ee02ccf6
2016-12-07 16:52:58 +00:00
Martijn van Groningen 7cc2b8c5ce create allocation when the job has been created instead of creating it when opening the job.
This avoids the confusing situation that a there is no allocation when a job hasn't been opened yet. Now it complains about the fact that the job status is closed.

Original commit: elastic/x-pack-elasticsearch@3159dc6954
2016-12-07 17:15:18 +01:00
jaymode 714bf929af test: LocalExporterTests should wait for exporters to be started
Original commit: elastic/x-pack-elasticsearch@978933f9d6
2016-12-07 09:22:05 -05:00
David Kyle ccf8cb7e0d Refactor delete interim results (elastic/elasticsearch#470)
* Collapse ElasticsearchBulkDeleter into JobDataDeleter

* Add blocking delete to JobDataDeleter

* Delete interim results only after all the results are parsed.

* Remove unused deleteModelSizeStats and deleteModelDebugOutput methods.

Document missing javadoc tags

Original commit: elastic/x-pack-elasticsearch@1997541673
2016-12-07 11:23:27 +00:00
Martijn van Groningen 14f43af818 moved metric part to be the suffix of the path
Original commit: elastic/x-pack-elasticsearch@6fc1b861ed
2016-12-07 12:09:16 +01:00
Martijn van Groningen e396e8aa68 Changes rest actions with data namespace into the job namespace.
Also added `_status` suffic to get job api as it would otherwise clash with open/close/flush APIs.

Original commit: elastic/x-pack-elasticsearch@6e8ef0ef7d
2016-12-07 12:09:16 +01:00
Martijn van Groningen d807eda9ed replaced custom ClosableIterator with Stream
Stream is closable, which is the reason ClosableIterator was introduced.

Original commit: elastic/x-pack-elasticsearch@b5a4a37e9e
2016-12-07 12:07:59 +01:00
Jim Ferenczi fba54d02d7 fix compilation error due to a missing parameter in SortedSetDVOrdinalsIndexFieldData.
Original commit: elastic/x-pack-elasticsearch@f9803968d9
2016-12-07 11:33:29 +01:00
Martijn van Groningen 5812ef4a86 use ActionListener.wrap(...) for delegate wrappers
Original commit: elastic/x-pack-elasticsearch@f1ccdb3f40
2016-12-07 10:23:47 +01:00
David Kyle 36d6141885 Move opening braces on new line to the end of the previous line (elastic/elasticsearch#473)
Original commit: elastic/x-pack-elasticsearch@57aedab104
2016-12-06 13:05:15 +00:00
Martijn van Groningen 570cde7a6a Added open and close job APIs.
* A job now has the following statuses: OPENING, OPENED, CLOSING, CLOSED and FAILED.
* The open job and close job APIs wait until the job gets into a OPENED or CLOSED state.
* The post data api no longer lazily opens a job and fails if the job has not been opened.
* When a job gets into a failed state also the reason is recorded in the allocation.
* Removed pause and resume APIs.
* Made `max_running_jobs` setting dynamically updatedable.

Original commit: elastic/x-pack-elasticsearch@3485ec5317
2016-12-06 13:51:26 +01:00
Dimitrios Athanasiou f960eea4b1 Remove obsolete comments in SchedulerConfig
Original commit: elastic/x-pack-elasticsearch@e7fc30bb2a
2016-12-06 12:45:10 +00:00
Dimitris Athanasiou 50df0d4326 Remove unnecessary parts of scheduler config (elastic/elasticsearch#468)
* Remove credentials from SchedulerConfig

* Remove dataSource and baseUrl from SchedulerConfig

Original commit: elastic/x-pack-elasticsearch@f5b92be252
2016-12-06 11:38:39 +00:00
Boaz Leskes affdf10274 Remove `InternalTestCluster.startNode(s)Async` (elastic/elasticsearch#4198)
A companion PR to https://github.com/elastic/elasticsearch/pull/21846 where the above methods were removed. See ES PR for details.

With the concurrent starting the issues with licenses and time freeze became more apparent and I had to apply my suggestion to only freeze time once the license has been applied (as opposed to freeze on node start up). Since this also means that a node that starts up after the cluster time has been frozen need to also immediately freeze, it felt natural to use a `ServiceDisruptionScheme`. Although the name doesn't really make sense here, it all has all the logic we need. 

Original commit: elastic/x-pack-elasticsearch@5641742f60
2016-12-06 12:07:28 +01:00
Ryan Ernst 13e427d83f Remove action filter response override (elastic/elasticsearch#4268)
This is the xplugins side of elastic/elasticsearchelastic/elasticsearch#21950

Original commit: elastic/x-pack-elasticsearch@0034a3384c
2016-12-05 16:14:10 -08:00
Jay Modi ffeaea0663 Migrate authentication calls to be asynchronous
This commit migrates the actual authentication calls that are performed by internal realms
to be asynchronous so that we do not execute blocking calls on network threads. The realms
that used LDAP were especially bad as they can issue many different requests and/or open
multiple connections per authentication attempt.

The LdapRealm now uses the ThreadPool to fork a thread for authentication. This is necessary
because a LDAP bind operation is not allowed to be performed asynchronously and must be done
in a blocking manner. After the bind request has completed, all other requests can be done
asynchrnously. The LdapUtils class now provides asynchronous methods for searching and also
includes the handling of referral following as automated following is not supported by
UnboundID when using the asynchronous calls.

Original commit: elastic/x-pack-elasticsearch@dfb259e498
2016-12-05 10:07:31 -05:00
Tanguy Leroux 549629b1aa [Watcher] HistoryStore should hide secrets (elastic/elasticsearch#4256)
* [Watcher] HistoryStore should hide secrets

Some watcher actions like Jira stores the whole HTTP request in case of a failure. This is very helpful when something goes wrong, but it has to hide the password used for Basic authentication otherwise it will appear in the watch record in the .watcher-history index. In general, I would consider better to always hide secrets when storing something in the history index.

 This commit removes the XContentParams "hide secrets" set at the JiraIssue so that it is now set at the HistoryStore level.

 It also fixes test failures that can be reproduced with:
 gradle :x-plugins:elasticsearch:test -Dtests.seed=BA730F93E726AECC -Dtests.class=org.elasticsearch.xpack.notification.jira.JiraIssueTests -Dtests.method="testToXContent" -Dtests.security.manager=true -Dtests.locale=es -Dtests.timezone=Asia/Choibalsan

Original commit: elastic/x-pack-elasticsearch@d686b3b3ad
2016-12-05 15:30:48 +01:00
Jay Modi 9afb6dd4f2 monitoring: local exporter waits for in flight requests before retrying
The local exporter previously fired off asynchronous requests every time a cluster state was
observed that did not contain all of the required items for monitoring. This change adds a
flag so that monitoring can wait for the pending requests to complete before retrying. This
will reduce the number of duplicated log messages as well.

Additionally, the log message for adding modern aliases now contains the name of the indices.

Closes elastic/elasticsearch#3756

Original commit: elastic/x-pack-elasticsearch@727a0adfbe
2016-12-05 09:01:24 -05:00
David Kyle d3b4261759 Fix querying for model size stats (elastic/elasticsearch#465)
* Add test to read model size stats

* Most recent model_size_stats document should have the name ‘model_size_stats’

Original commit: elastic/x-pack-elasticsearch@e192d4c34d
2016-12-05 13:35:29 +00:00
David Kyle 2785cc727d Get records & categoryDefinitions with post body (elastic/elasticsearch#438)
* Allow POST with body to get records

* Allow records endpoint to accept POST requests with body

* CategoryDefinition can accept POST requests with body parameters

Original commit: elastic/x-pack-elasticsearch@2edb7a9c47
2016-12-05 11:46:12 +00:00
Colin Goodheart-Smithe a8d2cf16b9 Removes compile warnings (elastic/elasticsearch#463)
These warnings include:
* Resource not used
* Resource leak due to not being closed

Original commit: elastic/x-pack-elasticsearch@e0fb068a0c
2016-12-05 11:24:56 +00:00
David Roberts 98eb5534ee Camel to snake case (elastic/elasticsearch#461)
Original commit: elastic/x-pack-elasticsearch@222065cc4c
2016-12-05 10:34:41 +00:00
Martijn van Groningen b5c6970209 test: removed jackson databind leftover
Original commit: elastic/x-pack-elasticsearch@0cbd5595c8
2016-12-05 08:38:33 +01:00
Ryan Ernst 97336ea946 Fix rest filter tests to expect passthrough when security is disabled
Original commit: elastic/x-pack-elasticsearch@ea6adabb4d
2016-12-02 16:28:18 -08:00
Ryan Ernst dbbf470734 Fix line length to appease checkstyle
Original commit: elastic/x-pack-elasticsearch@35df54d342
2016-12-02 15:06:33 -08:00