Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
355 commits
Select commit Hold shift + click to select a range
11efb50
Adds tests for AllocateAction and its steps
colings86 Apr 9, 2018
7610afc
Adds Steps for ReplicasAction
colings86 Apr 9, 2018
418d7a6
Adds rollover step and implements RolloverAction.toSteps
colings86 Apr 9, 2018
ee32795
add more force-merge related steps and tests
talevy Apr 9, 2018
6ea0992
Fixes compilation issue in test
colings86 Apr 10, 2018
8981d60
Removes unused and unneeded code
colings86 Apr 10, 2018
40b6613
Cleans up warnings
colings86 Apr 10, 2018
de03485
Changes update replica and alllocation to async steps
colings86 Apr 10, 2018
ce3b05f
refactor a collection of step-related things + shrink_step
talevy Apr 11, 2018
65c4618
Removes unused imports
colings86 Apr 11, 2018
0792e4e
Tidies up some of the unit tests
colings86 Apr 11, 2018
f89cb9d
Adds more missing equality tests
colings86 Apr 11, 2018
5e4febb
introduce refactored ShrinkAction
talevy Apr 12, 2018
c7b7ebb
clean up PhaseTests
talevy Apr 12, 2018
5d4d803
cleanup tests
talevy Apr 12, 2018
656d6aa
migrate step tests to extend AbstractStepTestCase
talevy Apr 12, 2018
709cd73
Fixes compile errors from TimeValue serialisation
colings86 Apr 12, 2018
152260a
Removes unused imports
colings86 Apr 12, 2018
09306a2
Increases iterations on step equality tests
colings86 Apr 12, 2018
c4619dd
Tidies up unit tests
colings86 Apr 12, 2018
fb0325d
fix ilm rest-tests to reflect latest get_policy changes
talevy Apr 12, 2018
43f1c46
Fixes shrunk shards allocation check step
colings86 Apr 12, 2018
d0ddfe8
Adds shrink check that original index is deleted
colings86 Apr 12, 2018
5de26b0
Renames AliasStep to ShrinkSetAliasStep
colings86 Apr 12, 2018
81a9089
change policy logs to be DEBUG
talevy Apr 12, 2018
e4dad50
Fixes checkstyle error
colings86 Apr 13, 2018
46d7bfc
Adds phase and action change times on state transition
colings86 Apr 13, 2018
a5ad34e
Moves registing of NamedWriteables to plugin:core
colings86 Apr 13, 2018
1786cf9
Fixes checkstyle error
colings86 Apr 13, 2018
104e7d3
move phase-after steps to have the previous phase's phase in its key …
talevy Apr 17, 2018
45cf159
Applying changes required for ILM after merge
talevy Apr 25, 2018
0ffd12a
fix syntax error in info.asciidoc
talevy Apr 26, 2018
3d78ff6
fix typo in xpack-rest test plugin->module
talevy Apr 26, 2018
437e202
update RolloverAction to utilize an index-setting for rollover_alias …
talevy Apr 26, 2018
80f81b6
fix line length in RolloverStep
talevy Apr 27, 2018
4b5d5af
Adds single node allocation to shrink (#30206)
colings86 May 1, 2018
95b3259
Adds infrastructure for dealing with errors in step execution (#30341)
colings86 May 3, 2018
c1be0ac
Makes all step tests use `randomStepKey()`
colings86 May 3, 2018
09eae9e
Throws ElasticsearchException from cluster state tasks if something
colings86 May 3, 2018
0413813
AwaitsFix testCreateShrinkIndexToN
dnhatn May 7, 2018
d7172b1
Adjusts logging levels to be more realistic
colings86 May 9, 2018
3f97573
Fixes SetSingleNodeAllocateStepTests so the allocated node is always
colings86 May 11, 2018
b9928d2
Adds `index.lifecycle.step_info` setting and uses it on ERROR and inc…
colings86 May 14, 2018
7215e84
Adds step info to ClusterStateWaitSteps (#30609)
colings86 May 16, 2018
2d7cea9
add Rest tests to index-lifecycle (#30159)
talevy May 17, 2018
dd7d9b5
add move-to-step endpoint for lifecycles (#30636)
talevy May 17, 2018
e87e5bc
Stores security headers with the LifecyclePolicy and uses them for As…
colings86 May 21, 2018
e80bf32
AwaitsFix flaky integration test we should revisit
talevy May 23, 2018
e491d89
add index.lifecycle.skip setting for skipping policy execution (#30766)
talevy May 23, 2018
819b73c
Changes PhaseAfterStep to take the name of the previous phase (#30756)
colings86 May 24, 2018
f8fd6af
remove requirement for shards/replicas in allocation check steps (#30…
talevy May 25, 2018
8db721b
add _retry API to index lifecycle policies (#30769)
talevy May 30, 2018
6dc6951
Fixes compile errors caused by merge
colings86 Jun 1, 2018
591123a
Fixes checkstyle error
colings86 Jun 1, 2018
61f2872
Adds an explain API endpoint (#31005)
colings86 Jun 1, 2018
7fce118
add MoveToStepAction and RetryAction to the XPackClient Actions
talevy Jun 1, 2018
af63ee5
fix merge conflicts with latest master
talevy Jun 4, 2018
841dcea
update retry-action to be in line with indices requests (#31042)
talevy Jun 4, 2018
c425519
Makes IndexLifecycleMetadata feature aware
colings86 Jun 11, 2018
cf4d9b0
fix explainlifecyclerequesttest
talevy Jun 12, 2018
677945a
Fixes ExplainLifecycleRequestTests
colings86 Jun 13, 2018
db253aa
Adds API to assign or change the policy for an index (#31277)
colings86 Jun 13, 2018
d0e8a08
fix retryrequest test
talevy Jun 13, 2018
762e958
Removes erroreously added file
colings86 Jun 14, 2018
e64d74d
Removes warnings from ILM code
colings86 Jun 14, 2018
a7be8a9
Removes unused stepsRegistry from move to step task
colings86 Jun 14, 2018
b870964
Move IndexLifecycleMetadata installation to put-lifecycle-action (#31…
talevy Jun 15, 2018
f68eb1f
fix merge messup
talevy Jun 15, 2018
73614f2
Introduce Maintenance Mode to ILM (#31164)
talevy Jun 15, 2018
488d4ae
render non-ElasticsearchException in ILM (#31284)
talevy Jun 15, 2018
4dc5da9
fix actions to reflect changes in master
talevy Jun 19, 2018
7ff6b71
fix client signature
talevy Jun 19, 2018
7d211ad
Adds an API to remove ILM from an index completely (#31358)
colings86 Jun 21, 2018
959a289
Adds ability to update a policy (#31361)
colings86 Jun 21, 2018
d497d90
inherit [index.lifecycle.date] from rolled-over time (#30853)
talevy Jun 21, 2018
c71ba45
add APIs to Maintenance Mode in ILM (#31410)
talevy Jun 21, 2018
bab6992
Fixes compile error due to client interface change
colings86 Jun 22, 2018
b003751
Renames endpoints for setting and deleting ILM policies# (#31552)
colings86 Jun 25, 2018
798fc83
Adds concept of a safe action (#31971)
colings86 Jul 12, 2018
c4f92ff
Adds a check to only fail policy update if unsafe action is changed (…
colings86 Jul 12, 2018
5e2c852
add ILM ShrinkAction IT (#32176)
talevy Jul 19, 2018
a1fb420
add qa project for running ILM tests against security (#32218)
talevy Jul 23, 2018
ccae95e
Fix index-lifecycle build
jasontedor Jul 25, 2018
8993273
Remove "best_compression" option from the ForceMergeAction (#32373)
dakrone Jul 25, 2018
4ed5095
Fix serialisation bug
colings86 Jul 27, 2018
936247b
Skips to next available action on missing step (#32283)
colings86 Jul 27, 2018
0d83d11
Removes redundent NORELEASES and ObjectParserUtils (#32427)
colings86 Jul 30, 2018
7b8e651
Make various LifecycleSettings Settings internal (#32381)
dakrone Jul 30, 2018
b961aed
Add high level rest client support for SetIndexLifecyclePolicy (#32443)
dakrone Jul 30, 2018
a202f5a
stop throwing an IllegalStateException for unrecognized steps (#32212)
talevy Jul 31, 2018
b76f499
remove mention of old maintenance mode setting
talevy Jul 31, 2018
9d52076
re-enable ILM integration tests and fix policyRegistry update bug (#3…
talevy Aug 1, 2018
2cb3d45
Make index.lifecycle.name setting internal (#32518)
dakrone Aug 2, 2018
276b2f7
Rename ILM, ILM endpoints and drop _xpack (#32564)
jasontedor Aug 2, 2018
0cd2a0c
[TEST] Fix HLRC using pre-rename endpoint for setting lifecycle policy
dakrone Aug 2, 2018
08ee752
adds index_lifecycle to ignored API conventions
colings86 Aug 3, 2018
740e981
Fixes X-Pack loaded YAML test
colings86 Aug 3, 2018
98899b0
fix smoke test with security reference to renamed ilm
talevy Aug 3, 2018
866fd4a
Remove ILM constructor hacks (#32597)
dakrone Aug 6, 2018
3b4fa1c
Remove RolloverIndexTestHelper (#32559)
dakrone Aug 6, 2018
6bf89c8
Remove UpdateSettingsTestHelper class (#32557)
dakrone Aug 6, 2018
6c93c29
change default indices.lifecycle.poll_interval to something sane (#32…
talevy Aug 6, 2018
ffd500e
move replicas action functionality into AllocateAction (#32523)
talevy Aug 8, 2018
4063d3f
Adds explain lifecycle API to the Rest Client (#32606)
colings86 Aug 9, 2018
b3ccf6d
Fix explain lifecycle REST API test failure
colings86 Aug 9, 2018
0d78f2b
Fixes test after replicas removal
colings86 Aug 9, 2018
2ee5356
Adds REST client support for starting and stopping ILM (#32609)
colings86 Aug 9, 2018
fbeb74d
move qa yaml tests to inside the ILM plugin (#32693)
talevy Aug 9, 2018
d3ca7d4
Set up ILM docs. (#32823)
debadair Aug 13, 2018
8c3843d
introduce random timeseries lifecycle policy util method (#32852)
talevy Aug 14, 2018
d58329b
fix merge with master
talevy Aug 15, 2018
7262abe
remove `type` config from LifecyclePolicy JSON (#32660)
talevy Aug 15, 2018
3c7b310
update cluster-state task execution to halt on new phase (#32886)
talevy Aug 16, 2018
266f4ba
remove extraneous CreateIndexRequest context in ShrinkAction (#32893)
talevy Aug 16, 2018
b0077b0
migrate allocate action pojo/xcontent to xpack.protocol (#32853)
talevy Aug 16, 2018
3bd4e15
copy more actions to protocol.xpack (#32892)
talevy Aug 16, 2018
54162ab
Prepare index-lifecycle for 6.x
jasontedor Aug 17, 2018
8154ee8
Add license headers for ILM request builders
jasontedor Aug 17, 2018
0294b3d
Fix line-length violations in ILM request builders
jasontedor Aug 17, 2018
2adb629
Store phase steps for index in PolicyStepsRegistry (#32926)
dakrone Aug 18, 2018
77ec599
Fix X-Pack modules REST test
jasontedor Aug 18, 2018
4d32ff4
Remove unrecognized setting
jasontedor Aug 18, 2018
7a0ef3f
copy LifecyclePolicy to protocol.xpack (#32915)
talevy Aug 20, 2018
450e494
add INDEX_LIFECYCLE_ORIGIN to run as xpack
talevy Aug 20, 2018
6766e5d
make operation mode YAML test more robust
colings86 Aug 21, 2018
4647af6
Merge branch '6.x' into index-lifecycle-6.x
colings86 Aug 21, 2018
29ac3ab
fix compile error after merge
colings86 Aug 21, 2018
aa072e6
add user authentication test for ILM (#32826)
talevy Aug 21, 2018
a3d8cc2
conditionally update CS only if StepInfo changes (#33004)
talevy Aug 21, 2018
d57b1c7
move ESLoggerFactory usage to LogManager (#33043)
talevy Aug 22, 2018
b6901b6
rename pre-phase/pre-action to new/init (#32996)
talevy Aug 22, 2018
1d6de09
fixes qa test setting
colings86 Aug 23, 2018
38b3b03
Fixes shrink action to remove single ndoe allocation (#33091)
colings86 Aug 23, 2018
e069316
Remove canSetPolicy, canUpdatePolicy, and canRemovePolicy (#33037)
dakrone Aug 23, 2018
2110de8
Merge branch '6.x' into index-lifecycle-6.x
colings86 Aug 24, 2018
c21aa05
Merge branch '6.x' into index-lifecycle-6.x
talevy Aug 27, 2018
25aeb35
separate out IndexLifecycleService cluster-state change concerns (#33…
talevy Aug 27, 2018
05dcf0c
Adds docs for how to set up a policy (#32987)
colings86 Aug 28, 2018
df3a7eb
change setup policy note
colings86 Aug 28, 2018
ba39c86
Merge branch '6.x' into index-lifecycle-6.x
gwbrown Aug 29, 2018
7d679f7
Fix Gradle configuration
gwbrown Aug 23, 2018
4739058
Duplicate Protocol classes into Core
gwbrown Aug 23, 2018
d34dcb2
HLRC: Add Lifecycle Policy delete to HLRC (#33142)
gwbrown Aug 29, 2018
f568bd5
HLRC: Add Put Lifecycle Policy API to HLRC (#33250)
gwbrown Aug 30, 2018
90a3a26
Renames XPackField.INDEX _LIFCYCLE value to "ilm" (#33270)
colings86 Aug 31, 2018
3da00fc
Merge branch '6.x' into index-lifecycle-6.x
colings86 Aug 31, 2018
c184971
Merge branch '6.x' into index-lifecycle-6.x
colings86 Sep 3, 2018
ea28969
Fixes test issue after merging
colings86 Sep 3, 2018
d7fd9ff
Adds documentation about defining rollover action in ILM (#33243)
colings86 Sep 3, 2018
8803406
Merge branch '6.x' into index-lifecycle-6.x
colings86 Sep 4, 2018
6ccf95e
Fixes Rendering of after in Phase (#33304)
colings86 Sep 4, 2018
6734e9c
Merge branch '6.x' into index-lifecycle-6.x
colings86 Sep 5, 2018
6fe05bf
Adds ILMClient for use with transport client (#33357)
colings86 Sep 5, 2018
b7aebf4
add new phase definition setting used for retrieving phase to execute…
talevy Sep 5, 2018
1aaa728
Merge branch '6.x' into index-lifecycle-6.x
talevy Sep 5, 2018
1cf7ad0
fix test
talevy Sep 5, 2018
2e0fe64
Replace PhaseAfterStep with PhaseCompleteStep (#33398)
dakrone Sep 5, 2018
fb12ea6
Merge branch '6.x' into index-lifecycle-6.x
colings86 Sep 6, 2018
801cde0
HLRC: Add ILM Status to HLRC (#33283) (#33448)
jakelandis Sep 6, 2018
60de4fa
Merge branch 'index-lifecycle-6.x' of github.com:elastic/elasticsearc…
dakrone Sep 6, 2018
39494f5
add notion of version and modified_date to LifecyclePolicyMetadata (#…
talevy Sep 6, 2018
0c5782e
Merge branch '6.x' into index-lifecycle-6.x
colings86 Sep 7, 2018
f158c35
Adds checks to ensure index metadata exists when we try to use it
colings86 Sep 7, 2018
d79c233
move ILM client objects from protocol to client (#33532)
talevy Sep 7, 2018
bf9257b
Encapsulate Client as class variable for PolicyStepsRegistry (#33529)
dakrone Sep 7, 2018
0cd2d63
HLRC: Add Get Lifecycle Policy API to HLRC (#33323)
gwbrown Sep 7, 2018
50f4405
Rename "after" to "minimum_age" in lifecycle definition (#33530)
dakrone Sep 9, 2018
5faa56f
Merge branch '6.x' into index-lifecycle-6.x
colings86 Sep 10, 2018
8c296a4
Renames lifecycle to policy in rest-api-spec (#33507)
colings86 Sep 11, 2018
1795bc2
Merge branch '6.x' into index-lifecycle-6.x
colings86 Sep 13, 2018
8d8af24
Merge branch '6.x' into index-lifecycle-6.x
colings86 Sep 13, 2018
97cdaef
Merge branch '6.x' into index-lifecycle-6.x
talevy Sep 14, 2018
68502ca
Remove unneeded listener on MoveToNextStepUpdateTask (#33725)
dakrone Sep 14, 2018
8dbd6d1
Merge remote-tracking branch 'origin/6.x' into index-lifecycle-6.x
dakrone Sep 14, 2018
86e6c71
Merge remote-tracking branch 'origin/6.x' into index-lifecycle-6.x
dakrone Sep 17, 2018
7a19e26
add phase execution info to ILM Explain API (#33488)
talevy Sep 18, 2018
90edfe7
Merge remote-tracking branch 'origin/6.x' into index-lifecycle-6.x
dakrone Sep 18, 2018
37d04dd
[TEST] Handle an IndexLifecycleService that has not started up
dakrone Sep 18, 2018
40d3609
Rebuild step on PolicyStepsRegistry.getStep (#33780)
dakrone Sep 18, 2018
0c84651
Merge remote-tracking branch 'origin/6.x' into index-lifecycle-6.x
dakrone Sep 19, 2018
ac06b1f
Fix index-lifecycle-6.x build
gwbrown Sep 19, 2018
9504286
Use custom index metadata for ILM state (#33783)
gwbrown Sep 19, 2018
316f742
Merge remote-tracking branch 'origin/6.x' into index-lifecycle-6.x
dakrone Sep 24, 2018
f9892ec
Only make indexes read-only on Shrink and ForceMerge actions (#33907)
gwbrown Sep 25, 2018
8a0b3e0
Make ShrinkStep copy settings to shrunken index
gwbrown Sep 25, 2018
fac667f
Merge remote-tracking branch 'origin/6.x' into index-lifecycle-6.x
dakrone Sep 27, 2018
05e9166
Merge remote-tracking branch 'origin/6.x' into index-lifecycle-6.x
dakrone Sep 28, 2018
bf24307
Merge remote-tracking branch 'origin/6.x' into index-lifecycle-6.x
dakrone Oct 1, 2018
819dbb5
Use more descriptive task names for ILM cluster state updates (#34161)
dakrone Oct 1, 2018
dc7b384
Merge remote-tracking branch 'origin/6.x' into index-lifecycle-6.x
dakrone Oct 2, 2018
b0af1ac
Change step execution flow to be deliberate about type (#34126)
dakrone Oct 3, 2018
4bfed30
Merge remote-tracking branch 'origin/6.x' into index-lifecycle-6.x
dakrone Oct 3, 2018
3f1d54a
ILM integration test with full policy (#33402)
talevy Oct 3, 2018
1733f54
[HLRC] Update Stop & Start ILM APIs to use Validatable (#34242)
gwbrown Oct 3, 2018
de1e80a
Provide useful error when a policy doesn't exist (#34206)
gwbrown Oct 4, 2018
217af3d
Fix expected next step being incorrect when executing async action (#…
dakrone Oct 8, 2018
8a3bae8
Merge branch '6.x' into index-lifecycle-6.x
colings86 Oct 15, 2018
2be39f4
HLRC: Add remove index lifecycle policy (#34204)
jdconrad Oct 16, 2018
1222981
initial api reference docs for ILM (#33866)
talevy Oct 16, 2018
a45f764
Merge branch '6.x' into index-lifecycle-6.x
talevy Oct 16, 2018
69616ea
update version on ILM setting updates
talevy Oct 16, 2018
2bdd9c5
fix timeout assertion in requestconvertertests
talevy Oct 16, 2018
aae80a2
fix setting version on deleting unmaanged indices with wildcard
talevy Oct 17, 2018
95e443d
Merge branch '6.x' into index-lifecycle-6.x
colings86 Oct 17, 2018
bfc8c21
Fix checkstyle
colings86 Oct 17, 2018
d1c9276
Merge branch '6.x' into index-lifecycle-6.x
colings86 Oct 17, 2018
7ce7cbf
Merge remote-tracking branch 'upstream/6.x' into index-lifecycle-6.x
talevy Oct 17, 2018
3fa631e
Merge branch '6.x' into index-lifecycle-6.x
colings86 Oct 18, 2018
521cb50
Rework ILM build to separate integration tests (#34617)
gwbrown Oct 18, 2018
d86ea32
Merge branch '6.x' into index-lifecycle-6.x
colings86 Oct 19, 2018
d95ac27
Merge remote-tracking branch 'upstream/6.x' into index-lifecycle-6.x
talevy Oct 22, 2018
6e93b5a
Merge remote-tracking branch 'upstream/6.x' into index-lifecycle-6.x
talevy Oct 23, 2018
06b9ecf
Merge remote-tracking branch 'upstream/6.x' into index-lifecycle-6.x
talevy Oct 23, 2018
7d4c386
[ILM] Add null check to CopyExecutionStateStep (#34619)
gwbrown Oct 23, 2018
9113430
Merge remote-tracking branch 'upstream/6.x' into index-lifecycle-6.x
talevy Oct 23, 2018
5d593ff
Ensure phase_time is set when in the "new" phase (#34280)
dakrone Oct 23, 2018
84713f4
Removes Set Policy API in favour of setting index.lifecycle.name
colings86 Oct 24, 2018
fa491b3
fixes compile issue with back port
colings86 Oct 24, 2018
04798e2
Adds usage data for ILM (#33377)
colings86 Oct 24, 2018
12395a9
Fixes NPE in multi node qa testt
colings86 Oct 25, 2018
357f076
Fixes SOTP docs test to restart ILM after
colings86 Oct 24, 2018
675365e
fix PolicyStatsTests mutateInstance (#34835)
talevy Oct 25, 2018
b2cea99
remove index.lifecycle.skip setting (#34823)
talevy Oct 25, 2018
f93b9f4
ILM Docs: update start/stop documentation (#34787)
talevy Oct 25, 2018
88c7b39
HLRC: Add ILM Retry (#33990)
original-brownbear Oct 19, 2018
4d521fd
HLRC: Split ILM request converters (#34759)
gwbrown Oct 25, 2018
0ab1862
Merge remote-tracking branch 'origin/6.x' into index-lifecycle-6.x
dakrone Oct 25, 2018
6f01ca0
update updating-policy docs (#34661)
talevy Oct 25, 2018
b979774
fix `GET _ilm` response with uninitialized ILM metadata (#34881)
talevy Oct 25, 2018
9cdb5be
fix PolicyStatsTests: mutate kept same indicesManaged
talevy Oct 25, 2018
5898527
[TEST] Fix RolloverActionTests.mutateInstance
dakrone Oct 26, 2018
024e92a
Merge remote-tracking branch 'upstream/6.x' into index-lifecycle-6.x
talevy Oct 26, 2018
7d101c6
remove old doc placeholder and migrate ilm docs to top-level (#34615)
talevy Oct 26, 2018
599d140
[ILM] Convert Explain request to new HLRC classes (#34922)
gwbrown Oct 26, 2018
2a3b94e
[ILM] Fix Move To Step API causing ILM to hang (#34618)
gwbrown Oct 29, 2018
3829d16
Merge remote-tracking branch 'upstream/6.x' into index-lifecycle-6.x
talevy Oct 29, 2018
273aa0d
Merge remote-tracking branch 'upstream/6.x' into index-lifecycle-6.x
talevy Oct 30, 2018
5e4180d
Move to Error step if ClusterState* steps throw (#35069)
gwbrown Oct 30, 2018
29ecafa
rename ILM Phase "minimum_age" to "min_age" (#35058)
talevy Oct 30, 2018
15fe224
rename CRUD api REST path prefix _ilm to _ilm/policy (#35056)
talevy Oct 30, 2018
18cc5af
throw exception when ilm-rollover-step runs on index without rollover…
talevy Oct 30, 2018
5a1b3c6
Merge remote-tracking branch 'upstream/6.x' into index-lifecycle-6.x
talevy Oct 31, 2018
b660a1d
[DOCS] Fixed edit links for ILM APIs and added the APIs to the REST r…
debadair Oct 31, 2018
1a18236
fix IndexLifecycleService setting member
talevy Oct 31, 2018
1e66b8b
cleanup ILM qa structure (#35110)
talevy Oct 31, 2018
a0f1214
update ILM integ test cluster poll interval to 1s (#35113)
talevy Nov 1, 2018
344281f
Merge remote-tracking branch 'upstream/6.x' into index-lifecycle-6.x
talevy Nov 1, 2018
f06c041
remove acks from rests to reflect index-lifecycle branch
talevy Nov 1, 2018
1f0aea5
ILM: use node _id attribute when allocating to one node (#35061)
talevy Nov 1, 2018
821f2bb
Merge branch '6.x' into index-lifecycle-6.x
colings86 Nov 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ class BuildPlugin implements Plugin<Project> {
compilerJavaHome = findJavaHome(compilerJavaProperty)
}
if (compilerJavaHome == null) {
if (System.getProperty("idea.active") != null || System.getProperty("eclipse.launcher") != null) {
if (System.getProperty("idea.executable") != null || System.getProperty("eclipse.launcher") != null) {
// IntelliJ does not set JAVA_HOME, so we use the JDK that Gradle was run with
return Jvm.current().javaHome
} else {
throw new GradleException(
" " + System.getProperties().toString() + " " +
"JAVA_HOME must be set to build Elasticsearch. " +
"Note that if the variable was just set you might have to run `./gradlew --stop` for " +
"it to be picked up. See https://github.com/elastic/elasticsearch/issues/31399 details."
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.elasticsearch.client;

import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.elasticsearch.client.indexlifecycle.DeleteLifecyclePolicyRequest;
import org.elasticsearch.client.indexlifecycle.ExplainLifecycleRequest;
import org.elasticsearch.client.indexlifecycle.GetLifecyclePolicyRequest;
import org.elasticsearch.client.indexlifecycle.LifecycleManagementStatusRequest;
import org.elasticsearch.client.indexlifecycle.PutLifecyclePolicyRequest;
import org.elasticsearch.client.indexlifecycle.RemoveIndexLifecyclePolicyRequest;
import org.elasticsearch.client.indexlifecycle.RetryLifecyclePolicyRequest;
import org.elasticsearch.client.indexlifecycle.StartILMRequest;
import org.elasticsearch.client.indexlifecycle.StopILMRequest;
import org.elasticsearch.common.Strings;

import java.io.IOException;

final class IndexLifecycleRequestConverters {

private IndexLifecycleRequestConverters() {}

static Request getLifecyclePolicy(GetLifecyclePolicyRequest getLifecyclePolicyRequest) {
String endpoint = new RequestConverters.EndpointBuilder().addPathPartAsIs("_ilm/policy")
.addCommaSeparatedPathParts(getLifecyclePolicyRequest.getPolicyNames()).build();
Request request = new Request(HttpGet.METHOD_NAME, endpoint);
RequestConverters.Params params = new RequestConverters.Params(request);
params.withMasterTimeout(getLifecyclePolicyRequest.masterNodeTimeout());
params.withTimeout(getLifecyclePolicyRequest.timeout());
return request;
}

static Request putLifecyclePolicy(PutLifecyclePolicyRequest putLifecycleRequest) throws IOException {
String endpoint = new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_ilm/policy")
.addPathPartAsIs(putLifecycleRequest.getName())
.build();
Request request = new Request(HttpPut.METHOD_NAME, endpoint);
RequestConverters.Params params = new RequestConverters.Params(request);
params.withMasterTimeout(putLifecycleRequest.masterNodeTimeout());
params.withTimeout(putLifecycleRequest.timeout());
request.setEntity(RequestConverters.createEntity(putLifecycleRequest, RequestConverters.REQUEST_BODY_CONTENT_TYPE));
return request;
}

static Request deleteLifecyclePolicy(DeleteLifecyclePolicyRequest deleteLifecyclePolicyRequest) {
Request request = new Request(HttpDelete.METHOD_NAME,
new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_ilm/policy")
.addPathPartAsIs(deleteLifecyclePolicyRequest.getLifecyclePolicy())
.build());
RequestConverters.Params params = new RequestConverters.Params(request);
params.withMasterTimeout(deleteLifecyclePolicyRequest.masterNodeTimeout());
params.withTimeout(deleteLifecyclePolicyRequest.timeout());
return request;
}

static Request removeIndexLifecyclePolicy(RemoveIndexLifecyclePolicyRequest removePolicyRequest) {
String[] indices = removePolicyRequest.indices() == null ?
Strings.EMPTY_ARRAY : removePolicyRequest.indices().toArray(new String[] {});
Request request = new Request(HttpDelete.METHOD_NAME,
new RequestConverters.EndpointBuilder()
.addCommaSeparatedPathParts(indices)
.addPathPartAsIs("_ilm")
.build());
RequestConverters.Params params = new RequestConverters.Params(request);
params.withIndicesOptions(removePolicyRequest.indicesOptions());
params.withMasterTimeout(removePolicyRequest.masterNodeTimeout());
return request;
}

static Request startILM(StartILMRequest startILMRequest) {
Request request = new Request(HttpPost.METHOD_NAME,
new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_ilm")
.addPathPartAsIs("start")
.build());
RequestConverters.Params params = new RequestConverters.Params(request);
params.withMasterTimeout(startILMRequest.masterNodeTimeout());
params.withTimeout(startILMRequest.timeout());
return request;
}

static Request stopILM(StopILMRequest stopILMRequest) {
Request request = new Request(HttpPost.METHOD_NAME,
new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_ilm")
.addPathPartAsIs("stop")
.build());
RequestConverters.Params params = new RequestConverters.Params(request);
params.withMasterTimeout(stopILMRequest.masterNodeTimeout());
params.withTimeout(stopILMRequest.timeout());
return request;
}

static Request lifecycleManagementStatus(LifecycleManagementStatusRequest lifecycleManagementStatusRequest){
Request request = new Request(HttpGet.METHOD_NAME,
new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_ilm")
.addPathPartAsIs("status")
.build());
RequestConverters.Params params = new RequestConverters.Params(request);
params.withMasterTimeout(lifecycleManagementStatusRequest.masterNodeTimeout());
params.withTimeout(lifecycleManagementStatusRequest.timeout());
return request;
}

static Request explainLifecycle(ExplainLifecycleRequest explainLifecycleRequest) {
String[] indices = explainLifecycleRequest.indices() == null ? Strings.EMPTY_ARRAY : explainLifecycleRequest.indices();
Request request = new Request(HttpGet.METHOD_NAME,
new RequestConverters.EndpointBuilder()
.addCommaSeparatedPathParts(indices)
.addPathPartAsIs("_ilm")
.addPathPartAsIs("explain")
.build());
RequestConverters.Params params = new RequestConverters.Params(request);
params.withIndicesOptions(explainLifecycleRequest.indicesOptions());
params.withMasterTimeout(explainLifecycleRequest.masterNodeTimeout());
return request;
}

static Request retryLifecycle(RetryLifecyclePolicyRequest retryLifecyclePolicyRequest) {
Request request = new Request(HttpPost.METHOD_NAME,
new RequestConverters.EndpointBuilder()
.addCommaSeparatedPathParts(retryLifecyclePolicyRequest.getIndices())
.addPathPartAsIs("_ilm")
.addPathPartAsIs("retry")
.build());
RequestConverters.Params params = new RequestConverters.Params(request);
params.withMasterTimeout(retryLifecyclePolicyRequest.masterNodeTimeout());
params.withTimeout(retryLifecyclePolicyRequest.timeout());
return request;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.util.List;
import java.util.Locale;
import java.util.StringJoiner;

Expand Down Expand Up @@ -1022,7 +1023,12 @@ EndpointBuilder addCommaSeparatedPathParts(String[] parts) {
return this;
}

EndpointBuilder addPathPartAsIs(String... parts) {
EndpointBuilder addCommaSeparatedPathParts(List<String> parts) {
addPathPart(String.join(",", parts));
return this;
}

EndpointBuilder addPathPartAsIs(String ... parts) {
for (String part : parts) {
if (Strings.hasLength(part)) {
joiner.add(part);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ public class RestHighLevelClient implements Closeable {
private final WatcherClient watcherClient = new WatcherClient(this);
private final GraphClient graphClient = new GraphClient(this);
private final LicenseClient licenseClient = new LicenseClient(this);
private final IndexLifecycleClient indexLifecycleClient = new IndexLifecycleClient(this);
private final MigrationClient migrationClient = new MigrationClient(this);
private final MachineLearningClient machineLearningClient = new MachineLearningClient(this);
private final SecurityClient securityClient = new SecurityClient(this);
Expand Down Expand Up @@ -368,6 +369,16 @@ public final XPackClient xpack() {
*/
public LicenseClient license() { return licenseClient; }

/**
* Provides methods for accessing the Elastic Licensed Index Lifecycle APIs that are shipped with the default distribution of
* Elasticsearch. All of these APIs will 404 if run against the OSS distribution of Elasticsearch.
* <p>
* See the <a href="http://FILL-ME-IN-WE-HAVE-NO-DOCS-YET.com"> X-Pack APIs on elastic.co</a> for more information.
*/
public IndexLifecycleClient indexLifecycle() {
return indexLifecycleClient;
}

/**
* Provides methods for accessing the Elastic Licensed Licensing APIs that
* are shipped with the default distribution of Elasticsearch. All of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Please note, any requests that use a ackTimeout should set timeout as they
* represent the same backing field on the server.
*/
public class TimedRequest implements Validatable {
public abstract class TimedRequest implements Validatable {

public static final TimeValue DEFAULT_ACK_TIMEOUT = timeValueSeconds(30);
public static final TimeValue DEFAULT_MASTER_NODE_TIMEOUT = TimeValue.timeValueSeconds(30);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,5 @@ public void usageAsync(XPackUsageRequest request, RequestOptions options, Action
restHighLevelClient.performRequestAsyncAndParseEntity(request, XPackRequestConverters::usage, options,
XPackUsageResponse::fromXContent, listener, emptySet());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.client.indexlifecycle;

import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;

import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.Objects;

public class AllocateAction implements LifecycleAction, ToXContentObject {

public static final String NAME = "allocate";
static final ParseField NUMBER_OF_REPLICAS_FIELD = new ParseField("number_of_replicas");
static final ParseField INCLUDE_FIELD = new ParseField("include");
static final ParseField EXCLUDE_FIELD = new ParseField("exclude");
static final ParseField REQUIRE_FIELD = new ParseField("require");

@SuppressWarnings("unchecked")
private static final ConstructingObjectParser<AllocateAction, Void> PARSER = new ConstructingObjectParser<>(NAME,
a -> new AllocateAction((Integer) a[0], (Map<String, String>) a[1], (Map<String, String>) a[2], (Map<String, String>) a[3]));

static {
PARSER.declareInt(ConstructingObjectParser.optionalConstructorArg(), NUMBER_OF_REPLICAS_FIELD);
PARSER.declareObject(ConstructingObjectParser.optionalConstructorArg(), (p, c) -> p.mapStrings(), INCLUDE_FIELD);
PARSER.declareObject(ConstructingObjectParser.optionalConstructorArg(), (p, c) -> p.mapStrings(), EXCLUDE_FIELD);
PARSER.declareObject(ConstructingObjectParser.optionalConstructorArg(), (p, c) -> p.mapStrings(), REQUIRE_FIELD);
}

private final Integer numberOfReplicas;
private final Map<String, String> include;
private final Map<String, String> exclude;
private final Map<String, String> require;

public static AllocateAction parse(XContentParser parser) {
return PARSER.apply(parser, null);
}

public AllocateAction(Integer numberOfReplicas, Map<String, String> include, Map<String, String> exclude, Map<String, String> require) {
if (include == null) {
this.include = Collections.emptyMap();
} else {
this.include = include;
}
if (exclude == null) {
this.exclude = Collections.emptyMap();
} else {
this.exclude = exclude;
}
if (require == null) {
this.require = Collections.emptyMap();
} else {
this.require = require;
}
if (this.include.isEmpty() && this.exclude.isEmpty() && this.require.isEmpty() && numberOfReplicas == null) {
throw new IllegalArgumentException(
"At least one of " + INCLUDE_FIELD.getPreferredName() + ", " + EXCLUDE_FIELD.getPreferredName() + " or "
+ REQUIRE_FIELD.getPreferredName() + "must contain attributes for action " + NAME);
}
if (numberOfReplicas != null && numberOfReplicas < 0) {
throw new IllegalArgumentException("[" + NUMBER_OF_REPLICAS_FIELD.getPreferredName() + "] must be >= 0");
}
this.numberOfReplicas = numberOfReplicas;
}

public Integer getNumberOfReplicas() {
return numberOfReplicas;
}

public Map<String, String> getInclude() {
return include;
}

public Map<String, String> getExclude() {
return exclude;
}

public Map<String, String> getRequire() {
return require;
}

@Override
public String getName() {
return NAME;
}

@Override
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
builder.startObject();
if (numberOfReplicas != null) {
builder.field(NUMBER_OF_REPLICAS_FIELD.getPreferredName(), numberOfReplicas);
}
builder.field(INCLUDE_FIELD.getPreferredName(), include);
builder.field(EXCLUDE_FIELD.getPreferredName(), exclude);
builder.field(REQUIRE_FIELD.getPreferredName(), require);
builder.endObject();
return builder;
}

@Override
public int hashCode() {
return Objects.hash(numberOfReplicas, include, exclude, require);
}

@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (obj.getClass() != getClass()) {
return false;
}
AllocateAction other = (AllocateAction) obj;
return Objects.equals(numberOfReplicas, other.numberOfReplicas) &&
Objects.equals(include, other.include) &&
Objects.equals(exclude, other.exclude) &&
Objects.equals(require, other.require);
}

@Override
public String toString() {
return Strings.toString(this);
}
}
Loading