-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Adding best_compression #49974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Adding best_compression #49974
Changes from all commits
Commits
Show all changes
702 commits
Select commit
Hold shift + click to select a range
3f3f4ee
Upgrade to Lucene 8.4.0. (#50518)
jpountz 1d882c9
Reenable bw tests after merging #50333. (#50746)
jpountz bca8790
[Docs] Update similarity.asciidoc (#50719)
blueSky1825821 3c37c16
[DOCS] Fixed typos (_op => op) in Painless context docs (#50301)
consulthys 61b6994
[DOCS] Add default index-time analyzer example (#50501)
jrodewig 3594fb2
Make Multiplexer inherit filter chains analysis mode (#50662)
95b2a79
ElasticSearchExceptionTests guessRootCauses fix (#50752)
henningandersen cbf47d4
Mute TimeSeriesLifecycleActionsIT.testHistoryIsWritten* (#50755)
dakrone b45d9a1
[DOCS] Adds DFA resources as deleted page to redirects. (#50756)
szabosteve 7fe8f02
Fix java home environment variables for experimental jjbb job
mark-vieira 49a8048
Inject environment variables like we do in other CI builds
mark-vieira e796b55
[DOCS] Add overview page to analysis topic (#50515)
jrodewig d4ea1a5
Make InitializePolicyContextStep retryable (#50685)
dakrone 5aff41d
Fix open/close race in ConnectionManagerTests (#50621)
Tim-Brooks 720ec8f
[DOCS] Add section ID to analysis overview page
jrodewig e6fba66
SQL: Optimisation fixes for conjunction merges (#50703)
bpintea 8cc63a0
Add experimental build for identifying docker-compose issues in CI
mark-vieira ab7c3b5
Ensure that field collapsing works with field aliases. (#50722)
jtibshirani 6fcb6b4
Remove UBI-based Docker images (#50747)
jasontedor e38de2e
Another attempt to work around the JJBB job workspace issue
mark-vieira 3465efa
Disable the build trigger until we sort out the JJBB workspace issue
mark-vieira 027546b
Foreach processor - fork recursive call (#50514)
jakelandis 8801ed0
Adjust the skip version in tests for field collapsing with aliases.
jtibshirani ee20767
ILM action to wait for SLM policy execution (#50454)
probakowski 2a372a9
Wrap triggering of a watch inside an assertBusy(...) invocation
martijnvg d377298
[DOCS] Improves description for forecast_stats (#50729)
szabosteve 1ecb19e
Enforce Logging of Errors in GCS Rest RetriesTests (#50761)
original-brownbear 2d27087
[DOCS] Clarifies model_size_stats.total_xxx_field_count objects and r…
szabosteve 4f1a344
[DOCS] Forms role and privilege requirements as bulleted lists in DFA…
szabosteve 2f9db15
[DOCS] Improves find_file_structure documentation (#50743)
szabosteve 76c6cd1
Remove Snapshot Tool from 8.0+ (#50784)
original-brownbear 323ea17
[DOCS] Moves analysis resources to PUT DFA API docs (#50704)
szabosteve c093f7f
Mute TimeSeriesLifecycleActionsIT.testWaitForSnapshot (#50790)
original-brownbear 6b9eba0
[ML][Inference][HLRC] Add necessary lang ident classes (#50705)
benwtrent dcbe7bb
Fix Snapshot Repository Corruption in Downgrade Scenarios (#50692)
original-brownbear 6ccef91
[Transform] fail to start/put on missing pipeline (#50701)
benwtrent ffba952
[DOCS] Fine-tunes data frame analytics API docs formatting. (#50799)
szabosteve 62b13fe
Typo of ' instead of ` (#50767)
seanstory 31a29df
Remove type parameter from CIR.mapping(type, object...) (#50739)
romseygeek 5b7f001
[DOCS] Clarify detector_index property in ML APIs (#50723)
lcawl 10ebe8c
Move scripted metric to ObjectParser (#50708)
nik9000 a357a0e
Drop "funny" functions building parsers (#50715)
nik9000 933a1bf
[DOCS] Update license expiry links (#50812)
lcawl e8602cf
Fix typo in refresh API docs (#50759)
mattayes fa60d92
Do not force refresh when write indexing buffer (#50769)
dnhatn 2a29921
Correct the skip version in tests for field collapsing on an alias.
jtibshirani 4f73522
Skip test suite entirely for non-applicable distribution types (#50824)
mark-vieira c1437be
[DOCS] Move snapshot-restore out of modules. (#49618)
debadair 8f48f79
Remove the 'template' field in index templates. (#49460)
jtibshirani 8334487
Review comments
SivagurunathanV 61a61d7
Fix Snapshot Shard Status Request Deduplication (#50788)
original-brownbear 331c6c8
Mute TimeSeriesLifecycleActionsIT.testWaitForSnapshotSlmExecutedBefor…
probakowski 8cec7b1
[ML] Reuse SourceDestValidator for data frame analytics (#50841)
dimitris-athanasiou c63d440
Introduce reusable QL plugin for SQL and EQL (#50815)
costin c7f6de9
Fix MultiVersionRepositoryAccessIT Tests (#50848)
original-brownbear f04f7aa
GlobalBuildInfo support packed-refs with work-tree (#50791)
henningandersen a68e8da
[DOCS] Fix time_zone example in range query docs (#50830)
jrodewig a2e8f67
Remove type parameter from PutMappingRequest.buildFromSimplifiedDef()…
romseygeek 853d528
[ML][Inference] Unify top_classes object field names with analytics (…
benwtrent 0b67fa1
Fix testSkipRefreshIfShardIsRefreshingAlready (#50856)
henningandersen 617b4a0
Fix upgrade of custom similarity (#50851)
jimczi adb135f
Drop BWC suppressions for composite aggs (#50857)
nik9000 f40bd30
Adjust the skip version in flattened field telemetry tests.
jtibshirani c5d2402
Fix format problem in composite of unmapped (#50869)
nik9000 c56637d
Fix SLM check for restore in progress (#50868)
dakrone d1adea6
Adding GET/PUT ILM cluster privileges to `kibana_system` role (#49451)
legrego 51b11a0
Improve build scan tags and values for Jenkins matrix jobs (#50881)
mark-vieira 0ff99b0
Delete experimental JJBB job
mark-vieira 842a208
[ML][Inference] PUT API (#50852)
benwtrent c289beb
Fix non-corruption in testCurrentHeaderVersion (#50883)
DaveCTurner 0265ba4
Fix memory leak in DLS bitset cache (#50635)
tvernum 7f0fe96
Validate field permissions when creating a role (#50212)
tvernum bfd44b7
Increase Size and lower TTL on DLS BitSet Cache (#50535)
tvernum 34401a2
Add max_resource_units to enterprise license (#50735)
tvernum 913e285
Make .async-search-* a restricted namespace (#50294)
albertzaharovits 40c522b
Nit fix test randomInt bound
albertzaharovits 7604055
[ML][Inference] minor fixes for created_by, and action permission (#5…
benwtrent 997dd5c
Prevent Old Version Clusters From Corrupting Snapshot Repositories (#…
original-brownbear 581640f
Add certutil http command (#49827)
tvernum af85743
Move metadata storage to Lucene (#50907)
ywelsch 3f83985
[DOCS] Correct typo in `ignore_malformed` mapping parm docs (#50780)
junmuz 8327fc8
Disallow Password Change when authenticated by Token (#49694)
jkakavas d970d3f
Improve warning value extraction performance in Response (#50208)
darrenfoong 3e82852
Use default profile for remote connections (#50828)
Tim-Brooks 1d6ab13
Fix build scan logic to support folder nested Jenkins job names
mark-vieira 21499b6
Add protection in windows for slow file lock releasing (#50884)
rjernst 8b367c9
Migrate certgen packaging test from bats (#50880)
rjernst 559e56b
Refresh cached phase policy definition if possible on new poli… (#50820)
dakrone 8910197
[DOCS] Adds elasticsearch-keystore command reference (#50872)
lcawl f0bc900
Allow proxy mode server name to be configured (#50774)
Tim-Brooks 8bdd29a
[DOCS] Array of index patterns is also valid source indices with tran…
geekpete 80b9d6a
Increase timeouts in TimeSeriesLifecycleActionsIT#testWaitForSnapshot…
probakowski 276b0ed
Deprecate synced flush (#50835)
dnhatn 6b2a46d
Remove outdated requirement of CCR (#50859)
dnhatn 9760f2d
Support Client and RoleMapping in custom Realms (#50534)
tvernum 44c658c
Deprecating kibana_user and kibana_dashboard_only_user roles (#46456)
legrego d76283d
Add notice about official Rust client (#50897)
philkra 30e9bfb
SQL: Fix incomplete registration of geo NamedWritables
costin 1e3fdcf
Mute HttpCertificateCommandTests.testTextFileSubstitutions (#50965)
danielmitterdorfer 8e10736
[DOCS] Correctly read total hits inside watcher config
9ecbbaf
Handle nested and aliased fields correctly when copying mapping. (#50…
przemekwitek dfd6a20
[Transform] correctly retrieve checkpoints from remote indices (#50903)
7d1e640
[ML] Add num_top_feature_importance_values param to regression and cl…
dimitris-athanasiou 11c3dcd
Warn on slow metadata performance (#50956)
ywelsch 249d040
Fix queuing in AsyncLucenePersistedState (#50958)
ywelsch 5de2d0f
Check for deprecations when analyzers are built (#50908)
romseygeek 830e616
[ML] Mute data frame analytics BWC tests (#50972)
dimitris-athanasiou 9fa42ab
[DOCS] Use `s` parameter in cat API overview example (#50616)
jrodewig cd5ac8e
Work around JVM Bug in LongGCDisruptionTests (#50731)
original-brownbear 91d7e32
Begin moving date_histogram to offset rounding (#50873)
nik9000 500aaab
Explicitly require a OriginSettingClient in ML results iterators (#50…
davidkyle 2a70a65
Switch AggregationSpec to ContextParser (#50871)
nik9000 5b656db
Don't use user-supplied type when building DocumentMapper (#50960)
romseygeek a1df655
[ML] Unmute DFA BWC tests and fix versions after backport of #50914 (…
dimitris-athanasiou 1fb1b57
Add "did you mean" to ObjectParser (#50938)
nik9000 a7e63f0
Revert "Update handshake response version constants to 7.6 (#48917)" …
Tim-Brooks b3501cb
[ML] Disable invalid assertion (#50986)
tveasey 94e071d
Track Snapshot Version in RepositoryData (#50930)
original-brownbear a2ed7e9
Deprecate and remove camel-case nGram and edgeNGram tokenizers (#50862)
ab8627b
Adds support for geo-bounds filtering in geogrid aggregations (#50002)
talevy 756683a
[ML][Inference] Adding classification_weights to ensemble models (#50…
benwtrent 166fb0f
SQL: Extend the optimisations for equalities (#50792)
bpintea da6ed28
[DOCS] Fix realm chains example (#50568)
lcawl 610c4ee
Allow installing multiple plugins as a transaction (#50924)
jasontedor cf35515
Remove custom metadata tool (#50813)
ywelsch 00b11b9
Fix compilation for #50813
ywelsch 1c45ebd
Add matrix job params as build scan tag
mark-vieira 07b8e85
Disable BWC tests until #50996 is merged (#51002)
talevy 10eb0e3
[DOCS] Fixes typo in keystore command
lcawl d976f31
re-enable bwc tests and update geo-grid bounds version guard to 7.6 a…
talevy a3e75e5
Change ExampleRescoreBuilder ctor visibility (#50922)
Arfey 479768a
Report progress of multiple plugin installs (#51001)
jasontedor 60ac896
[DOCS] Document `breakers`, `script`, and `discovery` node stats (#50…
jrodewig 1ff5853
Migrate cron eval bats test to java (#50940)
rjernst c0a8f41
Add generated benchmark files to gitignore
gwbrown d6f728f
Fix windows chown to work with single file (#51004)
rjernst 4c824a9
Update skip after backport (#51015)
nik9000 09c7703
[ML] Removed key value from the catch regex test (#50977)
delvedor af7b08a
[DOCS] Describes the relationship of the time-related settings in ano…
szabosteve 1b2e8fb
Tidy up enrich processors: (#50957)
martijnvg db1b98f
[TEST] Increase ML distributed test job open timeout (#50998)
droberts195 78a49a7
QL: Extend NodeSubclass to read classes from jars (#50866)
costin b0586ad
QL: Remove implicit conversion inside Literal (#50962)
costin 29599df
Tweak formatter config for long generic lines (#50909)
pugnascotia b9aa9df
[ML] Assert top classes are ordered by score (#51003)
tveasey 9a9164a
Auto-format buildSrc (#50786)
pugnascotia 8e797be
Add missing docs for new evaluation metrics (#50967)
przemekwitek 99c8507
Block too many concurrent mapping updates (#51038)
ywelsch e397be1
Add version constant for 7.7.0
polyfractal ee02062
Add pipeline name to ingest metadata (#50467)
martijnvg b767760
[Docs] Fix sub-heading in start-stop-ilm.asciidoc (#51045)
robin13 de2d9a2
Guard against null settings in CCRIndexLifecycleIT (#51008)
dakrone 826aa4c
Add blurb about ILM-injected unfollow action (#51009)
dakrone 674732f
Add analysis components and mapping types to the usage API. (#51031)
jpountz 66d1f54
Address failures in SnapshotLifecycleRestIT.testFullPolicySnap… (#51055)
dakrone d718468
Fix AllocateRoutedStepTests reusing keys for random values (#51016)
dakrone bbcd397
Fix NPE in PinnedQuery call to DisjunctionMaxScorer. (#51047)
markharwood 9ae917a
Move test of custom sig heuristic to plugin (#50891)
nik9000 4efcfb3
[DOCS] Add note to community clients page (#51065)
jrodewig 42373ad
[DOCS] Add Elixir Bulk Processor to community clients (#50630)
sashman 9dde43c
Encrypt generated key with AES (#51019)
ywangd 70d3973
Fix windows newline issue in test (#51030)
tvernum b8b9846
Unmute SmokeTestWatcherTestSuiteIT suite (#50973)
martijnvg 182d7ce
Add more logging when failing watch history entry fails. (#50931)
martijnvg 4284e34
Fix hardcoded version replacement in put-dfanalytics.asciidoc (#51056)
davidkyle 96ec19a
Remove useless logger instance from CircuitBreakerService (#50580)
asdf2014 7d6221e
[Docs] Fix example output of edge n-gram token filter. (#51085)
swen128 e1a055e
Fix caching for PreConfiguredTokenFilter (#50912)
matriv b37755b
[Docs] Fix short alias for 'unassigned.for' (#51059)
tedder 8169470
Fix Infinite Retry Loop in loading RepositoryData (#50987)
original-brownbear 9ab1782
Fail gracefully on invalid token strings (#51014)
jkakavas d96755c
[DOCS] Use same index in Cluster Allocation Explain docs (#50936)
jrodewig 059e4d2
Follow symlinks in Docker entrypoint (#50927)
pugnascotia e0cd30b
[DOCS] Correctly read total hits inside watcher config (#50614)
38fb64a
Goodbye and thank you synced flush! (#50882)
dnhatn df30a81
Mute GeoGridAggregatorTestCase#testBounds()
polyfractal e5fb48d
Tests for agg missing values (#51068)
not-napoleon f4974e9
[DOCS] Fix indent issue in similarity snippet (#51107)
jrodewig a7c7f0e
Muted test.
martijnvg 1df8338
[ML] Update DFA progress document in the index the document belongs t…
przemekwitek 94c781a
[DOCS] Retitle analysis reference pages (#51071)
jrodewig 073a113
[DOCS] Add concepts section to analysis topic (#50801)
jrodewig 167e908
[DOCS] Add tutorials section to analysis topic (#50809)
jrodewig 21b9c61
[DOCS] Collapse node stats response sections (#51063)
jrodewig f6942e7
Upgrade to Gradle 6.1 (#50453)
mark-vieira d0fefc5
Fix X-Pack Indices Breaking Repository BwC Tests (#51120)
original-brownbear 5689cea
[Transform] Improve force stop robustness in case of an error (#51072)
98d0b41
Remove types from WatcherSearchTemplateRequest (#51112)
romseygeek 067bc72
Remove the AllFieldMapper from master (#51106)
romseygeek 16e891b
[ML] DF Analytics _explain API should skip object fields (#51115)
dimitris-athanasiou a46fed1
[ML] Fix tests randomly failing on CI (#51142)
przemekwitek 95aca04
increase timeout of DocsClientYamlTestSuiteIT
27db4d9
Don't fallback to anonymous for tokens/apikeys (#51042)
jkakavas 281ae25
"did you mean" for ObjectParser with top named (#51018)
nik9000 94d4b0a
Upgrade to the latest OWASP HTML sanitizer (#50765)
jaymode e7a556d
Introduce hidden indices (#50452)
jaymode 6901ed3
[ML] Add audit warning for 1000 categories found early in job (#51146)
droberts195 798b63b
Improve file filter for insecure repo tests (#51121)
jaymode d03e9f6
[DOCS] Remove out-dated monitoring note (#51129)
lcawl 3a1fe82
[DOCS] Recommend Metricbeat for 7.x (#49758)
cachedout f2e1fd0
[DOCS] Adds text about data types to the categorization docs (#51145)
szabosteve 2d2eee2
Fix flaky usage tracking test (#51169)
nik9000 c868d0f
Update skip after backport (#51175)
nik9000 17fd7e9
Use separate policies for tests in SnapshotLifecycleRestIT (#51075)
dakrone 2ee6ee3
Update BWC version for hidden indices (#51174)
jaymode 396778a
Initial autoscaling commit (#51161)
jasontedor ebe33d4
Fix CorruptedBlobStoreRepository Test (#51128)
original-brownbear 829ad5f
Deprecates _upgrade API (#47678) (#50484)
timoninmaxim eff5d0d
Make soft-deletes mandatory in 8.0 (#51122)
dnhatn 60e4bcd
Adding Elastic Exception
SivagurunathanV 181b5d3
Bump docs test suite timeout to 40min (#51200)
tvernum 76427ef
Mute TimeSeriesLifecycleActionsIT.waitForSnapshot (#51203)
tvernum f52ffb4
Fixing broken tests
SivagurunathanV 60ec651
[DOCS] Removes CCS limitation item from Transforms limitations. (#51151)
szabosteve 875daa7
[Docs] Small edits to Ranking Evaluation API docs (#51116)
liebeslied 559617b
Add CoolDown Period to S3 Repository (#51074)
original-brownbear 9cab6e8
[DOCS] Expands the documentation of Node Query Cache (#51105)
szabosteve c31d60e
Exclude unmapped fields from query max_clause limit (#49523)
zacharymorn 7b41175
SQL: change the way unsupported data types fields are handled (#50823)
astefan d607690
Revert "Don't use user-supplied type when building DocumentMapper (#5…
romseygeek 9c85060
check custom meta data to avoid NPE (#51163)
5b667b7
Add trace logging for responses coming from server (#50530)
astefan 3c1529a
SQL: add support for passing query parameters in REST API calls (#51029)
astefan d804ff0
Account soft-deletes in FrozenEngine (#51192)
dnhatn 46045dc
PutIndexTemplateRequest contains a single mapping (#50899)
romseygeek 8ca83e0
Clean soft-deletes setting in ccr tests (#51113)
dnhatn 8c0d210
Exclude autoscaling docs from release docs (#51190)
jasontedor fe0a41c
Disable xpack/15_basic/Usage stats for mappings.
jpountz 4d5f670
Rebase master
SivagurunathanV 801eaa2
Resolving conflicts
SivagurunathanV 6a8195f
Fixing broken tests
SivagurunathanV f6e71ff
Merge branch 'master' into master
SivagurunathanV 000821d
Changing codec to String for best compression
SivagurunathanV 9993330
Random color test fix
SivagurunathanV 2d3c17c
Merge remote-tracking branch 'refs/remotes/upstream/master'
SivagurunathanV 878019d
Merge remote-tracking branch 'refs/remotes/upstream/master'
SivagurunathanV e338e94
fixing broken test
SivagurunathanV 2063828
adding null pointer check
SivagurunathanV 69d58eb
refactor plus fixing test
SivagurunathanV af20e44
Adding forceMerge step for handling both old and new flow
SivagurunathanV 3c1db21
Adding forceMerge step (as it idempotent) for handling both old and n…
SivagurunathanV e81a286
Merge branch 'master' of https://github.com/SivagurunathanV/elasticse…
SivagurunathanV a4be717
Adding non-compression test fix
SivagurunathanV 59e1552
Removing unused import
SivagurunathanV 10a78e4
Merge remote-tracking branch 'refs/remotes/upstream/master'
SivagurunathanV 3380459
Removing compression test
SivagurunathanV 766ed8e
Remove unused import
SivagurunathanV c3ec0b2
review comments
SivagurunathanV f32b604
Formatting the code :face_palm
SivagurunathanV aa395cd
Merge remote-tracking branch 'refs/remotes/upstream/master'
SivagurunathanV File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CloseIndexStep.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.core.ilm; | ||
|
||
import org.elasticsearch.ElasticsearchException; | ||
import org.elasticsearch.action.ActionListener; | ||
import org.elasticsearch.action.admin.indices.close.CloseIndexRequest; | ||
import org.elasticsearch.client.Client; | ||
import org.elasticsearch.cluster.ClusterState; | ||
import org.elasticsearch.cluster.ClusterStateObserver; | ||
import org.elasticsearch.cluster.metadata.IndexMetaData; | ||
|
||
/** | ||
* Invokes a close step on a single index. | ||
*/ | ||
|
||
public class CloseIndexStep extends AsyncActionStep { | ||
public static final String NAME = "close-index"; | ||
|
||
CloseIndexStep(StepKey key, StepKey nextStepKey, Client client) { | ||
super(key, nextStepKey, client); | ||
} | ||
|
||
@Override | ||
public void performAction(IndexMetaData indexMetaData, ClusterState currentClusterState, | ||
ClusterStateObserver observer, Listener listener) { | ||
if (indexMetaData.getState() == IndexMetaData.State.OPEN) { | ||
CloseIndexRequest request = new CloseIndexRequest(indexMetaData.getIndex().getName()); | ||
getClient().admin().indices() | ||
.close(request, ActionListener.wrap(closeIndexResponse -> { | ||
if (closeIndexResponse.isAcknowledged() == false) { | ||
throw new ElasticsearchException("close index request failed to be acknowledged"); | ||
} | ||
listener.onResponse(true); | ||
}, listener::onFailure)); | ||
} | ||
else { | ||
listener.onResponse(true); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean isRetryable() { | ||
return true; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/OpenIndexStep.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.core.ilm; | ||
|
||
import org.elasticsearch.ElasticsearchException; | ||
import org.elasticsearch.action.ActionListener; | ||
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; | ||
import org.elasticsearch.client.Client; | ||
import org.elasticsearch.cluster.ClusterState; | ||
import org.elasticsearch.cluster.ClusterStateObserver; | ||
import org.elasticsearch.cluster.metadata.IndexMetaData; | ||
|
||
/** | ||
* Invokes a open step on a single index. | ||
*/ | ||
|
||
final class OpenIndexStep extends AsyncActionStep { | ||
dakrone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
static final String NAME = "open-index"; | ||
|
||
OpenIndexStep(StepKey key, StepKey nextStepKey, Client client) { | ||
super(key, nextStepKey, client); | ||
} | ||
|
||
SivagurunathanV marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@Override | ||
public void performAction(IndexMetaData indexMetaData, ClusterState currentClusterState, | ||
ClusterStateObserver observer, Listener listener) { | ||
if (indexMetaData.getState() == IndexMetaData.State.CLOSE) { | ||
OpenIndexRequest request = new OpenIndexRequest(indexMetaData.getIndex().getName()); | ||
getClient().admin().indices() | ||
.open(request, | ||
ActionListener.wrap(openIndexResponse -> { | ||
if (openIndexResponse.isAcknowledged() == false) { | ||
throw new ElasticsearchException("open index request failed to be acknowledged"); | ||
} | ||
listener.onResponse(true); | ||
}, listener::onFailure)); | ||
|
||
} else { | ||
listener.onResponse(true); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean isRetryable() { | ||
return true; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.