Commit Graph

2550 Commits

Author SHA1 Message Date
Ryan Ernst b50d94efab Merge pull request #15228 from rjernst/cli_error
Cli tools: Use toString instead of getMessage for exceptions
2015-12-03 19:01:33 -08:00
Ryan Ernst f78c732ca9 Cli tools: Use toString instead of getMessage for exceptions
When not in debug mode, we currently only print the message of an
exception. However, this is not usually useful without knowing what the
exception type was. This change makes cli tools use toString() on the
exception so we get the type + message.
2015-12-03 17:27:45 -08:00
Jason Tedor 6613b3a0d6 Merge pull request #15221 from jasontedor/avoid-trace-logging-allocations-in-transport-broadcast-by-node-action
Avoid trace logging allocations in TransportBroadcastByNodeAction
2015-12-03 17:17:01 -05:00
Jason Tedor de0e1f5e2f Avoid trace logging allocations in TransportBroadcastByNodeAction
This commit wraps the trace logging statements in
TransportBroadcastByNodeAction in trace enabled checks to avoid
unnecessarily allocating objects.

The most egregious offenders were the two trace logging statements in
BroadcastByNodeTransportRequestHandler#onShardOperation. Aside from the
usual object allocations that occur when invoking ESLogger#trace (the
allocated object array for the varargs Object... parameter), these two
logging statements were invoking ShardRouting#shortSummary generating a
bunch of char arrays and Strings (from the StringBuilder, and so a bunch
of array copies as well). In a scenario where there are a lot of shards
and this method is being invoked frequently (e.g., constantly hitting
the _stats endpoint), these two unprotected trace logging statements
were generating a lot of unnecessary allocations.
2015-12-03 14:38:16 -05:00
Jason Tedor b58d82f66c Remove obsolete flag in ShardStateAction$ShardRoutingEntry 2015-12-03 14:08:35 -05:00
Jason Tedor 928d53a884 Apply shard starts in a single batch 2015-12-03 14:04:10 -05:00
Jason Tedor 99eac0e7d7 Use general cluster state batching mechanism for shard started
This commit modifies the handling of shard started cluster state updates
to use the general cluster state batching mechanism. An advantage of
this approach is we now get correct per-listener notification on
failures.
2015-12-03 14:04:10 -05:00
Jason Tedor 182c22f23f Merge pull request #15016 from jasontedor/shard-failure-batch
Use general cluster state batching mechanism for shard failures
2015-12-03 14:02:48 -05:00
Jason Tedor b70d97f36b Remove unnecessary method in AllocationService 2015-12-03 13:42:05 -05:00
Jason Tedor 73a2d3085a Rename variable for clarity in ShardFailedClusterStateHandler#execute 2015-12-03 13:41:34 -05:00
Adrien Grand d2e07f21e0 Merge pull request #15217 from jpountz/fix/simplify_MetaDataMappingService
Simplify MetaDataMappingService.
2015-12-03 16:26:08 +01:00
Adrien Grand 3ff91baedf Simplify MetaDataMappingService.
Now that we create all types on indices that receive a mapping update, creation
of temporary indices could get simpler.
2015-12-03 16:06:51 +01:00
Jason Tedor d1fd1fb908 Remove unnecessary early-out in MetaDataMappingService#executeRefresh
This commit removes a simple early-out check in
MetaDataMappingService#executeRefresh. The early-out is unnecessary
because the cluster state task execution framework will not invoke
ClusterStateTaskExecutor#execute if the list of tasks is empty.
2015-12-03 09:05:19 -05:00
Jason Tedor 310e98f51d Update stale Javadoc in MetaDataMappingService#executeRefresh
This commit updates a stale Javadoc on
MetaDataMappingService#executeRefresh. Previously this method handled
refresh and update tasks. Update tasks have been removed and the method
was renamed, but the Javadoc was not updated to reflect this.
2015-12-03 09:05:19 -05:00
Martijn van Groningen d0fbd9d1c4 index template: Disallow index template pattern to be the same as an alias name
This can cause index creation to fail down the line.
2015-12-03 13:35:16 +01:00
Boaz Leskes c5301e853a reduced the number of shards in RecoveryWhileUnderLoadIT.testRecoveryWhileRelocating 2015-12-03 10:00:48 +01:00
Boaz Leskes 9930e6883d Move IndicesService.canDeleteShardContent to use IndexSettings
Just a minor cleanup/simplification

Closes #15059
Closes #15150
2015-12-03 09:55:07 +01:00
Adrien Grand 6ff82260a7 Merge pull request #15029 from jpountz/remove/onIndexService
Remove Plugin.onIndexService.
2015-12-03 09:46:30 +01:00
Adrien Grand 612ef4488e Add missing license header. 2015-12-03 09:41:06 +01:00
Adrien Grand 79ff2ddd20 Merge pull request #15202 from jpountz/fix/clear_empty_query_cache
Fix NPE when a segment with an empty cache gets closed.
2015-12-03 09:38:08 +01:00
Jason Tedor ab45d69b16 Remove unused import in o.e.c.l.Releasables 2015-12-02 16:29:04 -05:00
Adrien Grand 7d25623b1f Fix NPE when a segment with an empty cache gets closed.
This is due to the fact that the query cache will still call the
onDocIdSetEviction callback in this case but with a number of entries equal to
zero.

Close #15043
2015-12-02 21:59:20 +01:00
Areek Zillur 3d8c32008e [TEST] geo completions work with geo point fields 2015-12-02 13:01:33 -05:00
Jason Tedor 199a05311e Remove unchecked warnings rendered unnecessary 2015-12-02 10:55:25 -05:00
Jason Tedor 05430a788a Remove and forbid use of the type-unsafe empty Collections fields
This commit removes and now forbids all uses of the type-unsafe empty
Collections fields Collections#EMPTY_LIST, Collections#EMPTY_MAP, and
Collections#EMPTY_SET. The type-safe methods Collections#emptyList,
Collections#emptyMap, and Collections#emptySet should be used instead.
2015-12-02 10:41:59 -05:00
Adrien Grand 79188ed38d Treat mappings at an index-level feature.
Today we try to have type-level granularity when dealing with mappings. This
does not play well with the cross-type validations that we are adding. For
instance we prevent the `_parent` field to point to an existing type. This
validation would be skipped today in the case of dedicated master nodes, since
those master nodes would only create the type that is being updated when
updating a mapping.
2015-12-02 16:32:12 +01:00
Robert Muir b7f497627f Merge pull request #15172 from rmuir/nuke_unused_deps
remove unused core dependencies
2015-12-02 07:20:11 -05:00
Martijn van Groningen ec74586680 metadata: If an alias and index share the same name then a descriptive error should be thrown
In 1.x it is possible via index templates to create an index with an alias with the same name as the index. The index name must match the index template and have an alias with the same name as the index being created.
2015-12-02 12:23:51 +01:00
Ryan Ernst d68c6673a2 Build: Cleanup precommit task gradle code
This change attempts to simplify the gradle tasks for precommit. One
major part of that is using a "less groovy style", as well as being more
consistent about how tasks are created and where they are configured. It
also allows the things creating the tasks to set up inter task
dependencies, instead of assuming them (ie decoupling from tasks
eleswhere in the build).
2015-12-01 22:36:54 -08:00
Robert Muir ef7258413f improve exception and remove complex test, such indexes will not be loaded into a closed state.
we will not load them at all.
2015-12-01 23:03:54 -05:00
Robert Muir 6e5c301739 remove unused dependencies 2015-12-01 22:22:11 -05:00
Jason Tedor e52faa81cc Fix typo in field name in MetaDataMappingService 2015-12-01 13:16:28 -05:00
Adrien Grand 304695e7ee Don't treat _default_ as a regular type.
This adds safety that you can't index into the `_default_` type (it was possible
before), and can't add default mappers to the field type lookups (was not
happening in tests but I think this is still a good check).

Also MapperService.types() now excludes `_default` so that eg. the `ids` query
does not try to search on this type anymore.
2015-12-01 18:03:11 +01:00
Jason Tedor 413688b0ca Apply shard failures in a single batch 2015-12-01 11:19:47 -05:00
Adrien Grand 77095a3e97 Merge pull request #15144 from jpountz/fix/ignored_merge_failure
Mappings: Don't ignore merge failures.
2015-12-01 16:37:32 +01:00
Jason Tedor d7f4dd0767 Use general cluster state batching mechanism for shard failures
This commit modifies the handling of shard failure cluster state updates
to use the general cluster state batching mechanism. An advantage of
this approach is we now get correct per-listener notification on
failures.
2015-12-01 10:19:23 -05:00
Christoph Büscher 6f2c36dcb7 Merge pull request #15113 from cbuescher/highligh-builder-refactoring
Make HighlighterBuilder implement Writable, equals and hashCode
2015-12-01 15:28:33 +01:00
Christoph Büscher 027a9b1844 Refactor HighlighterBuilder
This change pulls out the common fields that HighlighterBuilder shares with
its nested Field class into a new abstract CommonHighlighterOptions superclass
which also gets equals() and hashCode() method and methods to serialize the
common fields to a StreamOutput and read them from a stream.

Relates to #15044
2015-12-01 15:17:09 +01:00
javanna c67a332486 Query DSL: Enforce distance is greater than 0 in geo distance query
Validation is not done as part of the distance setter method and tested in GeoDistanceQueryBuilderTests. Fixed GeoDistanceTests to adapt to the new validation.

Closes #15135
2015-12-01 14:07:32 +01:00
Jason Tedor 13dbed9c92 Add each mapping at most once on batch mapping updates
When creating an index on master for the purpose of updating mappings, a
mapping being updated could needlessly be merged multiple times. This
commit ensures that each mapping is merged at most once while preparing
to update mappings.
2015-12-01 07:52:32 -05:00
Jason Tedor 09006ace11 Add the default mapping at most once on batch mapping updates
When creating an index on master for the purpose of updating mappings,
the default mapping could needlessly be added multiple times. This
commit ensures that the default mapping is added at most once while
preparing to update mappings.
2015-12-01 07:52:32 -05:00
Jason Tedor eea72a6d86 Preserve existing mappings on batch mapping updates
This commit addresses an issues introduced in #14899 to apply mapping
updates in batches. The issue is that an existing mapping for a type
could be lost if that type came in a batch that already contained a
mapping update for another type on the same index. The underlying issue
was that the existing mapping would not be merged in because the merging
logic was only tripped once per index, rather than for all types seeing
updates for each index. Resolving this issue is simply a matter of
ensuring that all existing types seeing updates are merged in.

Closes #15129
2015-12-01 07:52:32 -05:00
David Pilato fb79d064d7 Merge remote-tracking branch 'origin/master' 2015-12-01 12:46:09 +01:00
Adrien Grand cebd7bdd7f Mappings: Don't ignore merge failures. 2015-12-01 12:22:07 +01:00
javanna d17d629422 [TEST] stabilize SimpleSearchIT.testQueryNumericFieldWithRegex
Provide mappings explicitly instead of relying on dynamic mapping, also add missing ensureGreen.

Closes #15105
2015-12-01 12:13:06 +01:00
David Pilato 854099f1d5 Reject refresh usage in bulk items when using and fix NPE when no source
The REST bulk API rejects use of `refresh` at the item level. But the Java API lets the user setting it.

We need to have the same behavior and don't let think the user he can define `refresh` per bulk item.

Note that the user can still define `refresh` on the bulk itself.

Also a user can create with Java API an IndexRequest without any source which is causing a NPE when evaluating the bulk item size.

Closes #7361.
Closes #15120.
2015-12-01 12:00:30 +01:00
Yannick Welsch 059a675aa5 [TEST] mark test as awaitsfix: RareClusterStateIT.testDeleteCreateInOneBulk() 2015-12-01 11:41:51 +01:00
Britta Weber e2f87b0c52 multi field names may not contain dots
related to #14957
2015-12-01 11:27:26 +01:00
Boaz Leskes e256c6fdd1 AwaitsFix testDynamicUpdates
pending on https://github.com/elastic/elasticsearch/issues/15129
2015-12-01 09:57:22 +01:00
Robert Muir 44f21b24d7 Fix unit tests to bind to port 0.
I will followup with ITs and other modules. By fixing this, these tests become more reliable (will never sporatically
fail due to other stuff on your machine: ports are assigned by the OS), and it allows us to move forward with
gradle parallel builds, in my tests this is a nice speedup, but we can't do it until tests are cleaned up
2015-11-30 17:22:58 -05:00