Commit Graph

16287 Commits

Author SHA1 Message Date
Jason Tedor 9ca032ae9d Enforce strict eviction semantics 2015-10-08 12:42:36 -04:00
Jason Tedor 8d33be83b7 Cache#computeIfAbsent should throw if loader returns null value 2015-10-08 12:21:30 -04:00
Jason Tedor 02a7d9a565 Correct semantics when loading absent values 2015-10-08 12:04:02 -04:00
Jason Tedor d720364b18 Cache.segments can be final 2015-10-08 12:01:18 -04:00
Jason Tedor 35dc287f59 More rigorous test around Cache evictions occurring in LRU order 2015-10-08 11:56:45 -04:00
Jason Tedor 5328f145ef Clarify use of System.nanoTime for measuring eviction times 2015-10-07 11:03:29 -04:00
Jason Tedor ff8f9c9332 Add comment clarifying CacheTests.testCacheStats 2015-10-07 10:56:42 -04:00
Jason Tedor 37becf3dc2 Rename Cache.exceedsSize for clarity 2015-10-07 10:46:09 -04:00
Jason Tedor 44b471b008 Rename LRU and segment locks for clarity 2015-10-07 10:43:56 -04:00
Jason Tedor 1f61384988 Protect against null RemovalListener in setter 2015-10-07 10:40:22 -04:00
Jason Tedor 0fb908178d Clarify Javadoc comment regarding CacheSegment locks 2015-10-07 10:36:05 -04:00
Jason Tedor bde4889daf Add field for expiration conditions 2015-10-04 16:56:15 -04:00
Jason Tedor 105d830114 Correct condition for when time is needed 2015-10-02 11:55:36 +02:00
Jason Tedor 01e7378804 Cache#computeIfAbsent loader can throw checked exceptions 2015-10-01 02:08:14 +02:00
Jason Tedor c100d18f86 Start test threads at the same time 2015-10-01 01:41:29 +02:00
Jason Tedor 50cfe71b2a Forbidden means verboten! 2015-10-01 01:18:26 +02:00
Jason Tedor 4efe7b9c18 Replace CyclicBarrier with CountDownLatch 2015-10-01 01:16:33 +02:00
Jason Tedor 716be91345 Remove hidden synchronization from test 2015-10-01 01:04:20 +02:00
Jason Tedor 7a5e90fc45 Lookups from computeIfAbsent should propogate now 2015-10-01 00:47:08 +02:00
Jason Tedor 30bfea741e Cleanup formatting 2015-10-01 00:37:49 +02:00
Jason Tedor 11d75226a9 Ensure that computeIfAbsent loader is invoked at-most once 2015-10-01 00:32:44 +02:00
Jason Tedor eb2ea01106 Use try-with-resources for lock acquisition 2015-10-01 00:15:34 +02:00
Jason Tedor 8c05d4f43d Remove unnecessary overrides of equals/hashCode in Cache.Entry 2015-09-30 22:46:14 +02:00
Jason Tedor 64727b78de Add support for expiration after write to Cache
This commit adds supports for expiration after writes to Cache. This
enables entries to expire after they were initially placed in the cache
without prolonging their life on retrieval. Replacements are considered
new writes.
2015-09-30 22:44:41 +02:00
Jason Tedor 5d340f5e6e Remove and forbid use of com.google.common.cache.*
This commit removes and now forbids all uses of
com.google.common.cache.Cache, com.google.common.cache.CacheBuilder,
com.google.common.cache.RemovalListener,
com.google.common.cache.RemovalNotification,
com.google.common.cache.Weigher across the codebase. This is a major
step in the eventual removal of Guava as a dependency.

Relates #13224
2015-09-30 21:45:57 +02:00
Jason Tedor aa8bfeb88c Create concurrent cache with flexible eviction policies
This commit adds a concurrent cache with flexible eviction policies. In
particular, this cache supports:

1. concurrency
2. weight-based evictions
3. time-based evictions
4. manual invalidation
5. removal notification
6. cache statistics

Closes #13717
2015-09-30 21:43:00 +02:00
Christoph Büscher 97db3d5ef6 Tests: fix test by making copy of geopoints in assertLuceneQuery 2015-09-30 20:47:39 +02:00
Simon Willnauer 4886562d78 Don't get IndexShard instance in the executor but use already availale instance
We try to get the index shard instance again from the index service on a different
threads while that shard might have already been closed or removed which can cause a NPE
instead of another expected expecption.
2015-09-30 20:43:22 +02:00
Robert Muir 3c18393e48 Merge pull request #13876 from uschindler/features/forbiddenapis-2.0
Update to forbidden-apis 2.0
2015-09-30 14:35:46 -04:00
Simon Willnauer 9d12c38f44 [TEST] Don't corrupt extraFS files 2015-09-30 20:02:55 +02:00
Simon Willnauer f2ae29a1cb [TEST] don't run check index on an intentionally corrupted index 2015-09-30 20:00:53 +02:00
Uwe Schindler 9158b6c2e2 Update to forbidden-apis 2.0 2015-09-30 18:55:52 +02:00
Simon Willnauer fc8e452a37 Merge pull request #13840 from s1monw/source_handler_testability
Start making RecoverySourceHandler unittestable
2015-09-30 18:19:24 +02:00
Simon Willnauer e38f4cf01e Start making RecoverySourceHandler unittestable
This commit shuffels and rewrites some code in RecoverySourceHandler to make it
simpler and more unittestable. This commit doesn't change all parts of this class
neither is it fully tested yet. It's an important part of the infrastrucutre so I started
to make it better tested but I don't want to change everything in one go since it makes
review simpler and more detailed. Future commits will continue cleaning up the class and
add more tests.
2015-09-30 17:45:29 +02:00
Simon Willnauer f0a8c10c87 [TEST] only trim for the comparison 2015-09-30 17:00:39 +02:00
Boaz Leskes 169d06cf9e Internal: Remove the disabled autogenerated id optimization from InternalEngine
If a document is indexed into ES with no id, ES will generate one for it. We used to have an optimization for this case where the engine will not try to resolve the ids of these request in the existing index but immediately try to index them. This optimization has proven to be the source of brittle bugs (solved!) and we disabled it in 1.5, preparing for it to be removed if no performance degradation was found. Since we haven't seen any such degradation we can remove it.

Along with the removal of the optmization, we can remove the autogenerate id flag on indexing requests and the can have duplicate flag. The only downside of the removal of the canHaveDuplicate flag is that we can't make sure any more that when we retry an autogenerated id create operation we will ignore any document already exists exception (See #9125 for background and discussion). To work around this, we don't set the operation to CREATE any more when we generate an id, so the resulting request will never fail when it finds an existing doc but do return a version of 2. I think that's acceptable.

Closes #13857
2015-09-30 16:16:51 +02:00
Simon Willnauer f526754d0e Merge pull request #13848 from s1monw/verify_written_checksum
Verify actually written checksum in VerifyingIndexOutput
2015-09-30 15:36:46 +02:00
Simon Willnauer c185a12ef8 Verify actually written checksum in VerifyingIndexOutput
today we don't verify that the actual checksum written to VerifyingIndexOutput
is the actual checksum we are expecting.
2015-09-30 15:33:05 +02:00
Simon Willnauer 77c2f151d2 Merge pull request #13853 from s1monw/remove_more_deps
Remove ClusterSerivce and IndexSettingsService dependency from IndexShard
2015-09-30 14:20:28 +02:00
Simon Willnauer 6fff824402 Remove ClusterSerivce and IndexSettingsService dependency from IndexShard
We have two unneded heavy dependencies on IndexShard that are unneeded and only cause
trouble if you try to mock index shard. This commit removes IndexSettingsService as well as
ClusterSerivce from IndexShard to simplify future mocking and construction.
2015-09-30 14:19:26 +02:00
Tanguy Leroux d715dfd16c Fix blob size in writeBlob() method 2015-09-30 12:33:14 +02:00
javanna a3abfab865 Query refactoring: set has_parent & has_child types context properly
While refactoring has_child and has_parent query we lost an important detail around types. The types that the inner query gets executed against shouldn't be the main types of the search request but the parent or child type set to the parent query. We used to use QueryParseContext#setTypesWithPrevious as part of XContentStructure class which has been deleted, without taking care though of setting the types and restoring them as part of the innerQuery#toQuery call.

Meanwhile also we make sure that the original context types are restored in PercolatorQueriesRegistry

Closes #13863
2015-09-30 12:07:26 +02:00
Martijn van Groningen bb96dcd3e6 Merge pull request #13869 from tcucchietti/patch-2
Update inner-hits.asciidoc
2015-09-30 11:16:56 +02:00
Thomas Cucchietti ecc2985b84 Update inner-hits.asciidoc
Fix a glitch in inner_hits feature documentation (though I'm not absolutely sure of the final version)
2015-09-30 11:07:51 +02:00
Robert Muir b8b8bdac40 Add 2.2.0 version to master 2015-09-29 19:50:13 -04:00
Robert Muir 6d8c035f70 Add SpecialPermission to guard exceptions to security policy.
Closes #13854

Squashed commit of the following:

commit 42c1166efc55adda0d13fed77de583c0973e44b3
Author: Robert Muir <rmuir@apache.org>
Date:   Tue Sep 29 11:59:43 2015 -0400

    Add paranoia

    Groovy holds on to a classloader, so check it before compilation too.
    I have not reviewed yet what Rhino is doing, but just be safe.

commit b58668a81428e964dd5ffa712872c0a34897fc91
Author: Robert Muir <rmuir@apache.org>
Date:   Tue Sep 29 11:46:06 2015 -0400

    Add SpecialPermission to guard exceptions to security policy.

    In some cases (e.g. buggy cloud libraries, scripting engines), we must
    grant dangerous permissions to contained cases. Those AccessController blocks
    are dangerous, since they truncate the stack, and can allow privilege escalation.

    This PR adds a simple permission to check before each one, so that unprivileged code
    like groovy scripts, can't do anything they shouldn't be allowed to do otherwise.
2015-09-29 17:32:56 -04:00
Robert Muir ad6bc5b94c Throw exception on unsupported OS, so we don't falsely report 'enabled' 2015-09-29 17:16:00 -04:00
xuzha 625d06cd76 cloud-gce plugin should check `discovery.type`
GCE plugin tries to start immediately gce discovery even if we don't
set discovery.type. This commmit adds check `discovery.type` and
other required parameters before loading gce plugin.

closes #13614
2015-09-29 10:26:12 -07:00
Britta Weber 6bfc9eb1d2 Merge pull request #13856 from brwe/vagrant-lang-groovy
add lang-groovy to plugin vagrant test
2015-09-29 18:50:12 +02:00
Britta Weber 1a67440989 add lang-groovy to plugin vagrant test 2015-09-29 17:56:29 +02:00