From bbc0713c2eacc496b64430862f2edc90b5f57a9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Yulia=20=C4=8Cech?=
<6585477+yuliacech@users.noreply.github.com>
Date: Mon, 27 Sep 2021 13:18:18 +0200
Subject: [PATCH] [ILM] Added `max_primary_shard_size` input to shrink action
(#111394)
* [ILM] Added `max_primary_shard_size` input to shrink action (hot and warm phases)
* [ILM] Fixed form serializer and deserializer
* [ILM] Added CITs for shrink action
* [ILM] Fixed i18n issues
* [ILM] Made `number_of_shards` the default option for the shrink action
* [ILM] Fixed i18n files
* [ILM] Added default value of 1 to the number of shards input in shrink action
* [ILM] Switched to a radio button group for shrink options
* [ILM] Back to shorter labels in the radio button group
* [Snapshot & Restore] Fixed eslint issues
* Update x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
* [ILM] Added key to the shrink field fixing shared state
* [ILM] Removed duplicated i18n strings
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
---
.../hot_phase_validation.test.ts | 18 ++-
.../warm_phase_validation.test.ts | 24 ++-
.../policy_serialization.test.ts | 49 +++++-
.../helpers/actions/shrink_actions.ts | 41 +++--
.../common/types/policies.ts | 3 +-
.../described_form_row/described_form_row.tsx | 2 +-
.../hot_phase/components/max_age_field.tsx | 8 +-
.../components/max_index_size_field.tsx | 8 +-
.../max_primary_shard_size_field.tsx | 17 +-
.../components/phases/hot_phase/constants.ts | 92 -----------
.../min_age_field/min_age_field.tsx | 66 +-------
.../phases/shared_fields/shrink_field.tsx | 60 +++++--
.../unit_field.tsx | 3 +-
.../sections/edit_policy/constants.ts | 92 +++++++++++
.../sections/edit_policy/form/deserializer.ts | 17 ++
.../form/global_fields_context.tsx | 10 +-
.../sections/edit_policy/form/schema.ts | 41 ++++-
.../edit_policy/form/serializer/serializer.ts | 153 +++++++++---------
.../sections/edit_policy/i18n_texts.ts | 26 ++-
.../application/sections/edit_policy/types.ts | 15 +-
.../translations/translations/ja-JP.json | 22 ---
.../translations/translations/zh-CN.json | 22 ---
22 files changed, 452 insertions(+), 337 deletions(-)
delete mode 100644 x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/constants.ts
rename x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/{hot_phase/components => shared_fields}/unit_field.tsx (97%)
diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/form_validation/hot_phase_validation.test.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/form_validation/hot_phase_validation.test.ts
index 6cbc28ec161f2..6dca2b7b23fb7 100644
--- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/form_validation/hot_phase_validation.test.ts
+++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/form_validation/hot_phase_validation.test.ts
@@ -158,13 +158,23 @@ describe(' hot phase validation', () => {
});
describe('shrink', () => {
- test(`doesn't allow 0 for shrink`, async () => {
- await actions.hot.setShrink('0');
+ test(`doesn't allow 0 for shrink size`, async () => {
+ await actions.hot.setShrinkSize('0');
actions.errors.waitForValidation();
actions.errors.expectMessages([i18nTexts.editPolicy.errors.numberGreatThan0Required]);
});
- test(`doesn't allow -1 for shrink`, async () => {
- await actions.hot.setShrink('-1');
+ test(`doesn't allow -1 for shrink size`, async () => {
+ await actions.hot.setShrinkSize('-1');
+ actions.errors.waitForValidation();
+ actions.errors.expectMessages([i18nTexts.editPolicy.errors.numberGreatThan0Required]);
+ });
+ test(`doesn't allow 0 for shrink count`, async () => {
+ await actions.hot.setShrinkCount('0');
+ actions.errors.waitForValidation();
+ actions.errors.expectMessages([i18nTexts.editPolicy.errors.numberGreatThan0Required]);
+ });
+ test(`doesn't allow -1 for shrink count`, async () => {
+ await actions.hot.setShrinkCount('-1');
actions.errors.waitForValidation();
actions.errors.expectMessages([i18nTexts.editPolicy.errors.numberGreatThan0Required]);
});
diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/form_validation/warm_phase_validation.test.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/form_validation/warm_phase_validation.test.ts
index 0b8bfceebfaf4..741611f2d2c3b 100644
--- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/form_validation/warm_phase_validation.test.ts
+++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/form_validation/warm_phase_validation.test.ts
@@ -58,17 +58,33 @@ describe(' warm phase validation', () => {
});
describe('shrink', () => {
- test(`doesn't allow 0 for shrink`, async () => {
+ test(`doesn't allow 0 for shrink size`, async () => {
const { actions } = testBed;
- await actions.warm.setShrink('0');
+ await actions.warm.setShrinkSize('0');
actions.errors.waitForValidation();
actions.errors.expectMessages([i18nTexts.editPolicy.errors.numberGreatThan0Required]);
});
- test(`doesn't allow -1 for shrink`, async () => {
+ test(`doesn't allow -1 for shrink size`, async () => {
const { actions } = testBed;
- await actions.warm.setShrink('-1');
+ await actions.warm.setShrinkSize('-1');
+
+ actions.errors.waitForValidation();
+
+ actions.errors.expectMessages([i18nTexts.editPolicy.errors.numberGreatThan0Required]);
+ });
+ test(`doesn't allow 0 for shrink count`, async () => {
+ const { actions } = testBed;
+ await actions.warm.setShrinkCount('0');
+
+ actions.errors.waitForValidation();
+
+ actions.errors.expectMessages([i18nTexts.editPolicy.errors.numberGreatThan0Required]);
+ });
+ test(`doesn't allow -1 for shrink count`, async () => {
+ const { actions } = testBed;
+ await actions.warm.setShrinkCount('-1');
actions.errors.waitForValidation();
diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/serialization/policy_serialization.test.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/serialization/policy_serialization.test.ts
index c315bde7e37d8..7a4d1f7efca63 100644
--- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/serialization/policy_serialization.test.ts
+++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/serialization/policy_serialization.test.ts
@@ -171,7 +171,7 @@ describe(' serialization', () => {
await actions.hot.toggleForceMerge();
await actions.hot.setForcemergeSegmentsCount('123');
await actions.hot.setBestCompression(true);
- await actions.hot.setShrink('2');
+ await actions.hot.setShrinkCount('2');
await actions.hot.toggleReadonly();
await actions.hot.setIndexPriority('123');
@@ -274,7 +274,7 @@ describe(' serialization', () => {
await actions.warm.setDataAllocation('node_attrs');
await actions.warm.setSelectedNodeAttribute('test:123');
await actions.warm.setReplicas('123');
- await actions.warm.setShrink('123');
+ await actions.warm.setShrinkCount('123');
await actions.warm.toggleForceMerge();
await actions.warm.setForcemergeSegmentsCount('123');
await actions.warm.setBestCompression(true);
@@ -546,4 +546,49 @@ describe(' serialization', () => {
});
});
});
+
+ describe('shrink', () => {
+ test('shrink shard size', async () => {
+ const { actions } = testBed;
+ await actions.hot.setShrinkSize('50');
+
+ await actions.togglePhase('warm');
+ await actions.warm.setMinAgeValue('11');
+ await actions.warm.setShrinkSize('100');
+
+ await actions.savePolicy();
+ const latestRequest = server.requests[server.requests.length - 1];
+ const entirePolicy = JSON.parse(JSON.parse(latestRequest.requestBody).body);
+ expect(entirePolicy).toMatchInlineSnapshot(`
+ Object {
+ "name": "my_policy",
+ "phases": Object {
+ "hot": Object {
+ "actions": Object {
+ "rollover": Object {
+ "max_age": "30d",
+ "max_primary_shard_size": "50gb",
+ },
+ "shrink": Object {
+ "max_primary_shard_size": "50gb",
+ },
+ },
+ "min_age": "0ms",
+ },
+ "warm": Object {
+ "actions": Object {
+ "set_priority": Object {
+ "priority": 50,
+ },
+ "shrink": Object {
+ "max_primary_shard_size": "100gb",
+ },
+ },
+ "min_age": "11d",
+ },
+ },
+ }
+ `);
+ });
+ });
});
diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/shrink_actions.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/shrink_actions.ts
index 29c3e4a04a9a1..394a64696d5eb 100644
--- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/shrink_actions.ts
+++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/shrink_actions.ts
@@ -6,18 +6,41 @@
*/
import { TestBed } from '@kbn/test/jest';
+import { act } from 'react-dom/test-utils';
import { Phase } from '../../../../common/types';
-import { createFormToggleAndSetValueAction } from './form_toggle_and_set_value_action';
+import { createFormSetValueAction } from './form_set_value_action';
export const createShrinkActions = (testBed: TestBed, phase: Phase) => {
- const { exists } = testBed;
- const toggleSelector = `${phase}-shrinkSwitch`;
+ const { exists, form, component, find } = testBed;
+ const toggleShrinkSelector = `${phase}-shrinkSwitch`;
+ const shrinkSizeSelector = `${phase}-primaryShardSize`;
+ const shrinkCountSelector = `${phase}-primaryShardCount`;
+
+ const changeShrinkRadioButton = async (selector: string) => {
+ await act(async () => {
+ await find(selector).find('input').simulate('change');
+ });
+ component.update();
+ };
return {
- shrinkExists: () => exists(toggleSelector),
- setShrink: createFormToggleAndSetValueAction(
- testBed,
- toggleSelector,
- `${phase}-primaryShardCount`
- ),
+ shrinkExists: () => exists(toggleShrinkSelector),
+ setShrinkCount: async (value: string) => {
+ if (!exists(shrinkCountSelector) && !exists(shrinkSizeSelector)) {
+ await form.toggleEuiSwitch(toggleShrinkSelector);
+ }
+ if (!exists(shrinkCountSelector)) {
+ await changeShrinkRadioButton(`${phase}-configureShardCount`);
+ }
+ await createFormSetValueAction(testBed, shrinkCountSelector)(value);
+ },
+ setShrinkSize: async (value: string) => {
+ if (!exists(shrinkCountSelector) && !exists(shrinkSizeSelector)) {
+ await form.toggleEuiSwitch(toggleShrinkSelector);
+ }
+ if (!exists(shrinkSizeSelector)) {
+ await changeShrinkRadioButton(`${phase}-configureShardSize`);
+ }
+ await createFormSetValueAction(testBed, shrinkSizeSelector)(value);
+ },
};
};
diff --git a/x-pack/plugins/index_lifecycle_management/common/types/policies.ts b/x-pack/plugins/index_lifecycle_management/common/types/policies.ts
index 3a338c80fa56c..b9922a0d59459 100644
--- a/x-pack/plugins/index_lifecycle_management/common/types/policies.ts
+++ b/x-pack/plugins/index_lifecycle_management/common/types/policies.ts
@@ -168,7 +168,8 @@ export interface AllocateAction {
}
export interface ShrinkAction {
- number_of_shards: number;
+ number_of_shards?: number;
+ max_primary_shard_size?: string;
}
export interface ForcemergeAction {
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/described_form_row/described_form_row.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/described_form_row/described_form_row.tsx
index cc05ac2c47872..98fe3d52bc6ae 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/described_form_row/described_form_row.tsx
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/described_form_row/described_form_row.tsx
@@ -29,7 +29,7 @@ export interface SwitchProps
}
export type Props = EuiDescribedFormGroupProps & {
- children: (() => JSX.Element) | JSX.Element | JSX.Element[] | undefined;
+ children: (() => JSX.Element) | JSX.Element | JSX.Element[] | undefined | null;
switchProps?: SwitchProps;
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/components/max_age_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/components/max_age_field.tsx
index 7fbdaf344b8fa..7ee861ce8071e 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/components/max_age_field.tsx
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/components/max_age_field.tsx
@@ -11,10 +11,8 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { NumericField } from '../../../../../../../shared_imports';
import { UseField } from '../../../../form';
-import { ROLLOVER_FORM_PATHS } from '../../../../constants';
-import { UnitField } from './unit_field';
-
-import { maxAgeUnits } from '../constants';
+import { ROLLOVER_FORM_PATHS, timeUnits } from '../../../../constants';
+import { UnitField } from '../../shared_fields/unit_field';
export const MaxAgeField: FunctionComponent = () => {
return (
@@ -30,7 +28,7 @@ export const MaxAgeField: FunctionComponent = () => {
append: (
{
append: (
{
return (
@@ -30,15 +28,10 @@ export const MaxPrimaryShardSizeField: FunctionComponent = () => {
append: (
),
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/constants.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/constants.ts
deleted file mode 100644
index 3b03c7c7ec0c8..0000000000000
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/constants.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-
-export const maxSizeStoredUnits = [
- {
- value: 'gb',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.gigabytesLabel', {
- defaultMessage: 'gigabytes',
- }),
- },
- {
- value: 'mb',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.megabytesLabel', {
- defaultMessage: 'megabytes',
- }),
- },
- {
- value: 'b',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.bytesLabel', {
- defaultMessage: 'bytes',
- }),
- },
- {
- value: 'kb',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.kilobytesLabel', {
- defaultMessage: 'kilobytes',
- }),
- },
- {
- value: 'tb',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.terabytesLabel', {
- defaultMessage: 'terabytes',
- }),
- },
- {
- value: 'pb',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.petabytesLabel', {
- defaultMessage: 'petabytes',
- }),
- },
-];
-
-export const maxAgeUnits = [
- {
- value: 'd',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.daysLabel', {
- defaultMessage: 'days',
- }),
- },
- {
- value: 'h',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.hoursLabel', {
- defaultMessage: 'hours',
- }),
- },
- {
- value: 'm',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.minutesLabel', {
- defaultMessage: 'minutes',
- }),
- },
- {
- value: 's',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.secondsLabel', {
- defaultMessage: 'seconds',
- }),
- },
- {
- value: 'ms',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.millisecondsLabel', {
- defaultMessage: 'milliseconds',
- }),
- },
- {
- value: 'micros',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.microsecondsLabel', {
- defaultMessage: 'microseconds',
- }),
- },
- {
- value: 'nanos',
- text: i18n.translate('xpack.indexLifecycleMgmt.hotPhase.nanosecondsLabel', {
- defaultMessage: 'nanoseconds',
- }),
- },
-];
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/min_age_field/min_age_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/min_age_field/min_age_field.tsx
index 2c42d76415dbc..b6c6102425d12 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/min_age_field/min_age_field.tsx
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/min_age_field/min_age_field.tsx
@@ -25,43 +25,10 @@ import { PhaseWithTiming } from '../../../../../../../../common/types';
import { getFieldValidityAndErrorMessage, useFormData } from '../../../../../../../shared_imports';
import { UseField, useConfiguration, useGlobalFields } from '../../../../form';
import { getPhaseMinAgeInMilliseconds } from '../../../../lib';
+import { timeUnits } from '../../../../constants';
import { getUnitsAriaLabelForPhase, getTimingLabelForPhase } from './util';
const i18nTexts = {
- daysOptionLabel: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.daysOptionLabel', {
- defaultMessage: 'days',
- }),
-
- hoursOptionLabel: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.hoursOptionLabel', {
- defaultMessage: 'hours',
- }),
- minutesOptionLabel: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.minutesOptionLabel', {
- defaultMessage: 'minutes',
- }),
-
- secondsOptionLabel: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.secondsOptionLabel', {
- defaultMessage: 'seconds',
- }),
- millisecondsOptionLabel: i18n.translate(
- 'xpack.indexLifecycleMgmt.editPolicy.milliSecondsOptionLabel',
- {
- defaultMessage: 'milliseconds',
- }
- ),
-
- microsecondsOptionLabel: i18n.translate(
- 'xpack.indexLifecycleMgmt.editPolicy.microSecondsOptionLabel',
- {
- defaultMessage: 'microseconds',
- }
- ),
-
- nanosecondsOptionLabel: i18n.translate(
- 'xpack.indexLifecycleMgmt.editPolicy.nanoSecondsOptionLabel',
- {
- defaultMessage: 'nanoseconds',
- }
- ),
rolloverToolTipDescription: i18n.translate(
'xpack.indexLifecycleMgmt.editPolicy.minimumAge.rolloverToolTipDescription',
{
@@ -180,36 +147,7 @@ export const MinAgeField: FunctionComponent = ({ phase }): React.ReactEle
append={selectAppendValue}
data-test-subj={`${phase}-selectedMinimumAgeUnits`}
aria-label={getUnitsAriaLabelForPhase(phase)}
- options={[
- {
- value: 'd',
- text: i18nTexts.daysOptionLabel,
- },
- {
- value: 'h',
- text: i18nTexts.hoursOptionLabel,
- },
- {
- value: 'm',
- text: i18nTexts.minutesOptionLabel,
- },
- {
- value: 's',
- text: i18nTexts.secondsOptionLabel,
- },
- {
- value: 'ms',
- text: i18nTexts.millisecondsOptionLabel,
- },
- {
- value: 'micros',
- text: i18nTexts.microsecondsOptionLabel,
- },
- {
- value: 'nanos',
- text: i18nTexts.nanosecondsOptionLabel,
- },
- ]}
+ options={timeUnits}
/>
);
}}
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/shrink_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/shrink_field.tsx
index 8ac387ba106b7..1becf90de4d46 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/shrink_field.tsx
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/shrink_field.tsx
@@ -6,24 +6,35 @@
*/
import { FormattedMessage } from '@kbn/i18n/react';
-import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTextColor } from '@elastic/eui';
+import { EuiTextColor, EuiRadioGroup, EuiSpacer } from '@elastic/eui';
import React, { FunctionComponent } from 'react';
-import { NumericField } from '../../../../../../shared_imports';
+import { get } from 'lodash';
+import { NumericField, useFormData } from '../../../../../../shared_imports';
import { useEditPolicyContext } from '../../../edit_policy_context';
-import { UseField } from '../../../form';
+import { UseField, useGlobalFields } from '../../../form';
import { i18nTexts } from '../../../i18n_texts';
import { LearnMoreLink, DescribedFormRow } from '../../';
+import { byteSizeUnits } from '../../../constants';
+import { UnitField } from './unit_field';
interface Props {
phase: 'hot' | 'warm';
}
export const ShrinkField: FunctionComponent = ({ phase }) => {
- const path = `phases.${phase}.actions.shrink.number_of_shards`;
+ const globalFields = useGlobalFields();
+ const { setValue: setIsUsingShardSize } =
+ globalFields[`${phase}IsUsingShardSize` as 'hotIsUsingShardSize'];
const { policy } = useEditPolicyContext();
+ const isUsingShardSizePath = `_meta.${phase}.shrink.isUsingShardSize`;
+ const [formData] = useFormData({ watch: [isUsingShardSizePath] });
+ const isUsingShardSize: boolean | undefined = get(formData, isUsingShardSizePath);
+ const path = `phases.${phase}.actions.shrink.${
+ isUsingShardSize ? 'max_primary_shard_size' : 'number_of_shards'
+ }`;
return (
= ({ phase }) => {
}}
fullWidth
>
-
-
+ {isUsingShardSize === undefined ? null : (
+ <>
+ setIsUsingShardSize(id === `${phase}-configureShardSize`)}
+ />
+
+ ) : null,
},
}}
/>
-
-
-
+ >
+ )}
);
};
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/components/unit_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/unit_field.tsx
similarity index 97%
rename from x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/components/unit_field.tsx
rename to x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/unit_field.tsx
index 2ef8917d53989..6b76b0357b8ba 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/components/unit_field.tsx
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/unit_field.tsx
@@ -7,8 +7,7 @@
import React, { FunctionComponent, useState } from 'react';
import { EuiFilterSelectItem, EuiPopover, EuiButtonEmpty } from '@elastic/eui';
-
-import { UseField } from '../../../../form';
+import { UseField } from '../../../form';
interface Props {
path: string;
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/constants.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/constants.ts
index 88d5f6e138882..bd8c06de7e402 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/constants.ts
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/constants.ts
@@ -5,6 +5,8 @@
* 2.0.
*/
+import { i18n } from '@kbn/i18n';
+
export const isUsingCustomRolloverPath = '_meta.hot.customRollover.enabled';
export const isUsingDefaultRolloverPath = '_meta.hot.isUsingDefaultRollover';
@@ -25,3 +27,93 @@ export const ROLLOVER_FORM_PATHS = {
* exist as a "managed" repository.
*/
export const CLOUD_DEFAULT_REPO = 'found-snapshots';
+
+/*
+ * Labels for byte size units
+ */
+export const byteSizeUnits = [
+ {
+ value: 'gb',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.byteSizeUnits.gigabytesLabel', {
+ defaultMessage: 'gigabytes',
+ }),
+ },
+ {
+ value: 'mb',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.byteSizeUnits.megabytesLabel', {
+ defaultMessage: 'megabytes',
+ }),
+ },
+ {
+ value: 'b',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.byteSizeUnits.bytesLabel', {
+ defaultMessage: 'bytes',
+ }),
+ },
+ {
+ value: 'kb',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.byteSizeUnits.kilobytesLabel', {
+ defaultMessage: 'kilobytes',
+ }),
+ },
+ {
+ value: 'tb',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.byteSizeUnits.terabytesLabel', {
+ defaultMessage: 'terabytes',
+ }),
+ },
+ {
+ value: 'pb',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.byteSizeUnits.petabytesLabel', {
+ defaultMessage: 'petabytes',
+ }),
+ },
+];
+
+/*
+ * Labels for time units
+ */
+export const timeUnits = [
+ {
+ value: 'd',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.timeUnits.daysLabel', {
+ defaultMessage: 'days',
+ }),
+ },
+ {
+ value: 'h',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.timeUnits.hoursLabel', {
+ defaultMessage: 'hours',
+ }),
+ },
+ {
+ value: 'm',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.timeUnits.minutesLabel', {
+ defaultMessage: 'minutes',
+ }),
+ },
+ {
+ value: 's',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.timeUnits.secondsLabel', {
+ defaultMessage: 'seconds',
+ }),
+ },
+ {
+ value: 'ms',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.timeUnits.millisecondsLabel', {
+ defaultMessage: 'milliseconds',
+ }),
+ },
+ {
+ value: 'micros',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.timeUnits.microsecondsLabel', {
+ defaultMessage: 'microseconds',
+ }),
+ },
+ {
+ value: 'nanos',
+ text: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.timeUnits.nanosecondsLabel', {
+ defaultMessage: 'nanoseconds',
+ }),
+ },
+];
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/deserializer.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/deserializer.ts
index dc3714bdaf8da..1ce5b8aa7a717 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/deserializer.ts
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/deserializer.ts
@@ -39,6 +39,7 @@ export const createDeserializer =
},
bestCompression: hot?.actions?.forcemerge?.index_codec === 'best_compression',
readonlyEnabled: Boolean(hot?.actions?.readonly),
+ shrink: { isUsingShardSize: Boolean(hot?.actions.shrink?.max_primary_shard_size) },
},
warm: {
enabled: Boolean(warm),
@@ -47,6 +48,7 @@ export const createDeserializer =
dataTierAllocationType: determineDataTierAllocationType(warm?.actions),
readonlyEnabled: Boolean(warm?.actions?.readonly),
minAgeToMilliSeconds: -1,
+ shrink: { isUsingShardSize: Boolean(warm?.actions.shrink?.max_primary_shard_size) },
},
cold: {
enabled: Boolean(cold),
@@ -97,6 +99,13 @@ export const createDeserializer =
draft._meta.hot.customRollover.maxAgeUnit = maxAge.units;
}
}
+ if (draft.phases.hot?.actions.shrink?.max_primary_shard_size) {
+ const primaryShardSize = splitSizeAndUnits(
+ draft.phases.hot.actions.shrink.max_primary_shard_size!
+ );
+ draft.phases.hot.actions.shrink.max_primary_shard_size = primaryShardSize.size;
+ draft._meta.hot.shrink.maxPrimaryShardSizeUnits = primaryShardSize.units;
+ }
if (draft.phases.warm) {
if (draft.phases.warm.actions?.allocate?.require) {
@@ -110,6 +119,14 @@ export const createDeserializer =
draft.phases.warm.min_age = minAge.size;
draft._meta.warm.minAgeUnit = minAge.units;
}
+
+ if (draft.phases.warm.actions.shrink?.max_primary_shard_size) {
+ const primaryShardSize = splitSizeAndUnits(
+ draft.phases.warm.actions.shrink.max_primary_shard_size!
+ );
+ draft.phases.warm.actions.shrink.max_primary_shard_size = primaryShardSize.size;
+ draft._meta.warm.shrink.maxPrimaryShardSizeUnits = primaryShardSize.units;
+ }
}
if (draft.phases.cold) {
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/global_fields_context.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/global_fields_context.tsx
index 5834fe5b9ea77..bb02e5a50a48a 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/global_fields_context.tsx
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/global_fields_context.tsx
@@ -11,13 +11,15 @@ import { UseMultiFields, FieldHook, FieldConfig } from '../../../../shared_impor
/**
* Those are the fields that we always want present in our form.
*/
-interface GlobalFieldsTypes {
+export interface GlobalFieldsTypes {
deleteEnabled: boolean;
searchableSnapshotRepo: string;
warmMinAgeMilliSeconds: number;
coldMinAgeMilliSeconds: number;
frozenMinAgeMilliSeconds: number;
deleteMinAgeMilliSeconds: number;
+ hotIsUsingShardSize: boolean;
+ warmIsUsingShardSize: boolean;
}
type GlobalFields = {
@@ -46,6 +48,12 @@ export const globalFields: Record {
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts
index c26f54cbb6f5a..24112cf4725d2 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts
@@ -93,6 +93,22 @@ const numberOfShardsField = {
label: i18n.translate('xpack.indexLifecycleMgmt.shrink.numberOfPrimaryShardsLabel', {
defaultMessage: 'Number of primary shards',
}),
+ defaultValue: 1,
+ validations: [
+ {
+ validator: emptyField(i18nTexts.editPolicy.errors.numberRequired),
+ },
+ {
+ validator: numberGreaterThanField({
+ message: i18nTexts.editPolicy.errors.numberGreatThan0Required,
+ than: 0,
+ }),
+ },
+ ],
+ serializer: serializers.stringToNumber,
+};
+const shardSizeField = {
+ label: i18nTexts.editPolicy.maxPrimaryShardSizeLabel,
validations: [
{
validator: emptyField(i18nTexts.editPolicy.errors.numberRequired),
@@ -173,6 +189,14 @@ export const getSchema = (isCloudEnabled: boolean): FormSchema => ({
defaultValue: false,
label: i18nTexts.editPolicy.readonlyEnabledFieldLabel,
},
+ shrink: {
+ isUsingShardSize: {
+ defaultValue: false,
+ },
+ maxPrimaryShardSizeUnits: {
+ defaultValue: 'gb',
+ },
+ },
},
warm: {
enabled: {
@@ -207,6 +231,14 @@ export const getSchema = (isCloudEnabled: boolean): FormSchema => ({
defaultValue: false,
label: i18nTexts.editPolicy.readonlyEnabledFieldLabel,
},
+ shrink: {
+ isUsingShardSize: {
+ defaultValue: false,
+ },
+ maxPrimaryShardSizeUnits: {
+ defaultValue: 'gb',
+ },
+ },
},
cold: {
enabled: {
@@ -334,12 +366,7 @@ export const getSchema = (isCloudEnabled: boolean): FormSchema => ({
fieldsToValidateOnChange: rolloverFormPaths,
},
max_primary_shard_size: {
- label: i18n.translate(
- 'xpack.indexLifecycleMgmt.hotPhase.maximumPrimaryShardSizeLabel',
- {
- defaultMessage: 'Maximum primary shard size',
- }
- ),
+ label: i18nTexts.editPolicy.maxPrimaryShardSizeLabel,
validations: [
{
validator: rolloverThresholdsValidator,
@@ -370,6 +397,7 @@ export const getSchema = (isCloudEnabled: boolean): FormSchema => ({
},
shrink: {
number_of_shards: numberOfShardsField,
+ max_primary_shard_size: shardSizeField,
},
set_priority: {
priority: getPriorityField('hot'),
@@ -385,6 +413,7 @@ export const getSchema = (isCloudEnabled: boolean): FormSchema => ({
},
shrink: {
number_of_shards: numberOfShardsField,
+ max_primary_shard_size: shardSizeField,
},
forcemerge: {
max_num_segments: maxNumSegmentsField,
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/serializer/serializer.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/serializer/serializer.ts
index cf81468dd2b48..652f045922d4d 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/serializer/serializer.ts
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/serializer/serializer.ts
@@ -43,100 +43,104 @@ export const createSerializer =
*/
if (draft.phases.hot) {
draft.phases.hot.min_age = draft.phases.hot.min_age ?? '0ms';
- }
- if (draft.phases.hot?.actions) {
- const hotPhaseActions = draft.phases.hot.actions;
+ if (draft.phases.hot?.actions) {
+ const hotPhaseActions = draft.phases.hot.actions;
- /**
- * HOT PHASE ROLLOVER
- */
- if (isUsingRollover) {
- if (_meta.hot?.isUsingDefaultRollover) {
- hotPhaseActions.rollover = cloneDeep(defaultRolloverAction);
- } else {
- // Rollover may not exist if editing an existing policy with initially no rollover configured
- if (!hotPhaseActions.rollover) {
- hotPhaseActions.rollover = {};
+ /**
+ * HOT PHASE ROLLOVER
+ */
+ if (isUsingRollover) {
+ if (_meta.hot?.isUsingDefaultRollover) {
+ hotPhaseActions.rollover = cloneDeep(defaultRolloverAction);
+ } else {
+ // Rollover may not exist if editing an existing policy with initially no rollover configured
+ if (!hotPhaseActions.rollover) {
+ hotPhaseActions.rollover = {};
+ }
+
+ // We are using user-defined, custom rollover settings.
+ if (updatedPolicy.phases.hot!.actions.rollover?.max_age) {
+ hotPhaseActions.rollover.max_age = `${hotPhaseActions.rollover.max_age}${_meta.hot?.customRollover.maxAgeUnit}`;
+ } else {
+ delete hotPhaseActions.rollover.max_age;
+ }
+
+ if (typeof updatedPolicy.phases.hot!.actions.rollover?.max_docs !== 'number') {
+ delete hotPhaseActions.rollover.max_docs;
+ }
+
+ if (updatedPolicy.phases.hot!.actions.rollover?.max_primary_shard_size) {
+ hotPhaseActions.rollover.max_primary_shard_size = `${hotPhaseActions.rollover.max_primary_shard_size}${_meta.hot?.customRollover.maxPrimaryShardSizeUnit}`;
+ } else {
+ delete hotPhaseActions.rollover.max_primary_shard_size;
+ }
+
+ if (updatedPolicy.phases.hot!.actions.rollover?.max_size) {
+ hotPhaseActions.rollover.max_size = `${hotPhaseActions.rollover.max_size}${_meta.hot?.customRollover.maxStorageSizeUnit}`;
+ } else {
+ delete hotPhaseActions.rollover.max_size;
+ }
}
- // We are using user-defined, custom rollover settings.
- if (updatedPolicy.phases.hot!.actions.rollover?.max_age) {
- hotPhaseActions.rollover.max_age = `${hotPhaseActions.rollover.max_age}${_meta.hot?.customRollover.maxAgeUnit}`;
+ /**
+ * HOT PHASE FORCEMERGE
+ */
+ if (!updatedPolicy.phases.hot!.actions?.forcemerge) {
+ delete hotPhaseActions.forcemerge;
+ } else if (_meta.hot?.bestCompression) {
+ hotPhaseActions.forcemerge!.index_codec = 'best_compression';
} else {
- delete hotPhaseActions.rollover.max_age;
+ delete hotPhaseActions.forcemerge!.index_codec;
}
- if (typeof updatedPolicy.phases.hot!.actions.rollover?.max_docs !== 'number') {
- delete hotPhaseActions.rollover.max_docs;
+ if (_meta.hot?.bestCompression && hotPhaseActions.forcemerge) {
+ hotPhaseActions.forcemerge.index_codec = 'best_compression';
}
- if (updatedPolicy.phases.hot!.actions.rollover?.max_primary_shard_size) {
- hotPhaseActions.rollover.max_primary_shard_size = `${hotPhaseActions.rollover.max_primary_shard_size}${_meta.hot?.customRollover.maxPrimaryShardSizeUnit}`;
+ /**
+ * HOT PHASE READ-ONLY
+ */
+ if (_meta.hot?.readonlyEnabled) {
+ hotPhaseActions.readonly = hotPhaseActions.readonly ?? {};
} else {
- delete hotPhaseActions.rollover.max_primary_shard_size;
+ delete hotPhaseActions.readonly;
}
-
- if (updatedPolicy.phases.hot!.actions.rollover?.max_size) {
- hotPhaseActions.rollover.max_size = `${hotPhaseActions.rollover.max_size}${_meta.hot?.customRollover.maxStorageSizeUnit}`;
+ /**
+ * HOT PHASE SHRINK
+ */
+ if (!updatedPolicy.phases.hot?.actions?.shrink) {
+ delete hotPhaseActions.shrink;
+ } else if (_meta.hot.shrink.isUsingShardSize) {
+ delete hotPhaseActions.shrink!.number_of_shards;
+ hotPhaseActions.shrink!.max_primary_shard_size = `${hotPhaseActions.shrink?.max_primary_shard_size}${_meta.hot?.shrink.maxPrimaryShardSizeUnits}`;
} else {
- delete hotPhaseActions.rollover.max_size;
+ delete hotPhaseActions.shrink!.max_primary_shard_size;
}
+ } else {
+ delete hotPhaseActions.rollover;
+ delete hotPhaseActions.forcemerge;
+ delete hotPhaseActions.readonly;
+ delete hotPhaseActions.shrink;
}
-
/**
- * HOT PHASE FORCEMERGE
+ * HOT PHASE SET PRIORITY
*/
- if (!updatedPolicy.phases.hot!.actions?.forcemerge) {
- delete hotPhaseActions.forcemerge;
- } else if (_meta.hot?.bestCompression) {
- hotPhaseActions.forcemerge!.index_codec = 'best_compression';
- } else {
- delete hotPhaseActions.forcemerge!.index_codec;
- }
-
- if (_meta.hot?.bestCompression && hotPhaseActions.forcemerge) {
- hotPhaseActions.forcemerge.index_codec = 'best_compression';
+ if (!updatedPolicy.phases.hot!.actions?.set_priority) {
+ delete hotPhaseActions.set_priority;
}
/**
- * HOT PHASE READ-ONLY
+ * HOT PHASE SEARCHABLE SNAPSHOT
*/
- if (_meta.hot?.readonlyEnabled) {
- hotPhaseActions.readonly = hotPhaseActions.readonly ?? {};
+ if (updatedPolicy.phases.hot!.actions?.searchable_snapshot) {
+ hotPhaseActions.searchable_snapshot = {
+ ...hotPhaseActions.searchable_snapshot,
+ snapshot_repository: _meta.searchableSnapshot.repository,
+ };
} else {
- delete hotPhaseActions.readonly;
+ delete hotPhaseActions.searchable_snapshot;
}
- } else {
- delete hotPhaseActions.rollover;
- delete hotPhaseActions.forcemerge;
- delete hotPhaseActions.readonly;
- }
-
- /**
- * HOT PHASE SET PRIORITY
- */
- if (!updatedPolicy.phases.hot!.actions?.set_priority) {
- delete hotPhaseActions.set_priority;
- }
-
- /**
- * HOT PHASE SHRINK
- */
- if (!updatedPolicy.phases.hot?.actions?.shrink) {
- delete hotPhaseActions.shrink;
- }
-
- /**
- * HOT PHASE SEARCHABLE SNAPSHOT
- */
- if (updatedPolicy.phases.hot!.actions?.searchable_snapshot) {
- hotPhaseActions.searchable_snapshot = {
- ...hotPhaseActions.searchable_snapshot,
- snapshot_repository: _meta.searchableSnapshot.repository,
- };
- } else {
- delete hotPhaseActions.searchable_snapshot;
}
}
@@ -197,6 +201,11 @@ export const createSerializer =
*/
if (!updatedPolicy.phases.warm?.actions?.shrink) {
delete warmPhase.actions.shrink;
+ } else if (_meta.warm.shrink.isUsingShardSize) {
+ delete warmPhase.actions.shrink!.number_of_shards;
+ warmPhase.actions.shrink!.max_primary_shard_size = `${warmPhase.actions.shrink?.max_primary_shard_size}${_meta.warm?.shrink.maxPrimaryShardSizeUnits}`;
+ } else {
+ delete warmPhase.actions.shrink!.max_primary_shard_size;
}
} else {
delete draft.phases.warm;
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts
index bfc31c220825a..dca07fa6b1ead 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts
@@ -9,9 +9,21 @@ import { i18n } from '@kbn/i18n';
export const i18nTexts = {
editPolicy: {
- shrinkLabel: i18n.translate('xpack.indexLifecycleMgmt.shrink.indexFieldLabel', {
+ shrinkLabel: i18n.translate('xpack.indexLifecycleMgmt.shrink.enableShrinkLabel', {
defaultMessage: 'Shrink index',
}),
+ shrinkCountLabel: i18n.translate(
+ 'xpack.indexLifecycleMgmt.editPolicy.shrink.configureShardCountLabel',
+ {
+ defaultMessage: 'Configure shard count',
+ }
+ ),
+ shrinkSizeLabel: i18n.translate(
+ 'xpack.indexLifecycleMgmt.editPolicy.shrink.configureShardSizeLabel',
+ {
+ defaultMessage: 'Configure shard size',
+ }
+ ),
rolloverOffsetsHotPhaseTiming: i18n.translate(
'xpack.indexLifecycleMgmt.rollover.rolloverOffsetsPhaseTimingDescription',
{
@@ -89,6 +101,18 @@ export const i18nTexts = {
defaultMessage: 'Searchable snapshot storage',
}
),
+ maxPrimaryShardSizeLabel: i18n.translate(
+ 'xpack.indexLifecycleMgmt.hotPhase.maximumPrimaryShardSizeLabel',
+ {
+ defaultMessage: 'Maximum primary shard size',
+ }
+ ),
+ maxPrimaryShardSizeUnitsLabel: i18n.translate(
+ 'xpack.indexLifecycleMgmt.editPolicy.maximumPrimaryShardSizeAriaLabel',
+ {
+ defaultMessage: 'Maximum shard size units',
+ }
+ ),
errors: {
numberRequired: i18n.translate(
'xpack.indexLifecycleMgmt.editPolicy.errors.numberRequiredErrorMessage',
diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/types.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/types.ts
index ba7d31cf6da49..6c4d311d6177c 100644
--- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/types.ts
+++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/types.ts
@@ -22,7 +22,14 @@ export interface ForcemergeFields {
bestCompression: boolean;
}
-interface HotPhaseMetaFields extends ForcemergeFields {
+interface ShrinkFields {
+ shrink: {
+ isUsingShardSize: boolean;
+ maxPrimaryShardSizeUnits?: string;
+ };
+}
+
+interface HotPhaseMetaFields extends ForcemergeFields, ShrinkFields {
/**
* By default rollover is enabled with set values for max age, max size and max docs. In this policy form
* opting in to default rollover overrides custom rollover values.
@@ -47,7 +54,11 @@ interface HotPhaseMetaFields extends ForcemergeFields {
};
}
-interface WarmPhaseMetaFields extends DataAllocationMetaFields, MinAgeField, ForcemergeFields {
+interface WarmPhaseMetaFields
+ extends DataAllocationMetaFields,
+ MinAgeField,
+ ForcemergeFields,
+ ShrinkFields {
enabled: boolean;
warmPhaseOnRollover: boolean;
readonlyEnabled: boolean;
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 990a42ffe7a5f..61dff1ffbb73c 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -12399,7 +12399,6 @@
"xpack.indexLifecycleMgmt.editPolicy.dataTierAllocation.nodeAllocationFieldLabel": "ノード属性を選択",
"xpack.indexLifecycleMgmt.editPolicy.dataTierHotLabel": "ホット",
"xpack.indexLifecycleMgmt.editPolicy.dataTierWarmLabel": "ウォーム",
- "xpack.indexLifecycleMgmt.editPolicy.daysOptionLabel": "日",
"xpack.indexLifecycleMgmt.editPolicy.defaultToDataNodesDescription": "データを特定のデータノードに割り当てるには、{roleBasedGuidance}か、elasticsearch.ymlでカスタムノード属性を構成します。",
"xpack.indexLifecycleMgmt.editPolicy.defaultToDataNodesDescription.migrationGuidanceMessage": "ユーザーロールに基づく割り当て",
"xpack.indexLifecycleMgmt.editPolicy.deletePhase.activateWarmPhaseSwitchLabel": "削除フェーズを有効にする",
@@ -12454,7 +12453,6 @@
"xpack.indexLifecycleMgmt.editPolicy.hotPhase.learnAboutRolloverLinkText": "詳細",
"xpack.indexLifecycleMgmt.editPolicy.hotPhase.rolloverDefaultsTipContent": "インデックスが30日経過するか、50 GBに達したときにロールオーバーします。",
"xpack.indexLifecycleMgmt.editPolicy.hotPhase.rolloverDescriptionMessage": "現在のインデックスが特定のサイズ、ドキュメント数、または年齢に達したときに、新しいインデックスへの書き込みを開始します。時系列データを操作するときに、パフォーマンスを最適化し、リソースの使用状況を管理できます。",
- "xpack.indexLifecycleMgmt.editPolicy.hoursOptionLabel": "時間",
"xpack.indexLifecycleMgmt.editPolicy.indexPriority.indexPriorityEnabledFieldLabel": "インデックスの優先度を設定",
"xpack.indexLifecycleMgmt.editPolicy.indexPriorityLabel": "インデックスの優先順位",
"xpack.indexLifecycleMgmt.editPolicy.indexPriorityText": "インデックスの優先順位",
@@ -12465,16 +12463,12 @@
"xpack.indexLifecycleMgmt.editPolicy.lifecyclePoliciesReloadButton": "再試行",
"xpack.indexLifecycleMgmt.editPolicy.loadSnapshotRepositoriesErrorBody": "このフィールドを更新し、既存のスナップショットリポジトリの名前を入力します。",
"xpack.indexLifecycleMgmt.editPolicy.loadSnapshotRepositoriesErrorTitle": "スナップショットリポジトリを読み込めません",
- "xpack.indexLifecycleMgmt.editPolicy.microSecondsOptionLabel": "マイクロ秒",
- "xpack.indexLifecycleMgmt.editPolicy.milliSecondsOptionLabel": "ミリ秒",
"xpack.indexLifecycleMgmt.editPolicy.minAgeSmallerThanColdPhaseError": "コールドフェーズ値({value})以上でなければなりません",
"xpack.indexLifecycleMgmt.editPolicy.minAgeSmallerThanFrozenPhaseError": "フローズンフェーズ値({value})以上でなければなりません",
"xpack.indexLifecycleMgmt.editPolicy.minAgeSmallerThanWarmPhaseError": "ウォームフェーズ値({value})以上でなければなりません",
"xpack.indexLifecycleMgmt.editPolicy.minimumAge.minimumAgeFieldLabel": "次のときに、データをフェーズに移動します。",
"xpack.indexLifecycleMgmt.editPolicy.minimumAge.minimumAgeFieldSuffixLabel": "古",
"xpack.indexLifecycleMgmt.editPolicy.minimumAge.rolloverToolTipDescription": "データの年齢はロールオーバーから計算されます。ロールオーバーはホットフェーズで構成されます。",
- "xpack.indexLifecycleMgmt.editPolicy.minutesOptionLabel": "分",
- "xpack.indexLifecycleMgmt.editPolicy.nanoSecondsOptionLabel": "ナノ秒",
"xpack.indexLifecycleMgmt.editPolicy.noCustomAttributesTitle": "カスタム属性が定義されていません",
"xpack.indexLifecycleMgmt.editPolicy.nodeAllocation.allocateToDataNodesOption": "任意のデータノード",
"xpack.indexLifecycleMgmt.editPolicy.nodeAllocation.customOption.description": "ノード属性を使用して、シャード割り当てを制御します。{learnMoreLink}。",
@@ -12526,7 +12520,6 @@
"xpack.indexLifecycleMgmt.editPolicy.searchableSnapshotRepoFieldLabel": "スナップショットリポジトリ",
"xpack.indexLifecycleMgmt.editPolicy.searchableSnapshotRepoRequiredError": "スナップショットリポジトリ名が必要です。",
"xpack.indexLifecycleMgmt.editPolicy.searchableSnapshotStorageFieldLabel": "検索可能スナップショットストレージ",
- "xpack.indexLifecycleMgmt.editPolicy.secondsOptionLabel": "秒",
"xpack.indexLifecycleMgmt.editPolicy.showPolicyJsonButton": "リクエストを表示",
"xpack.indexLifecycleMgmt.editPolicy.shrinkIndexExplanationText": "インデックス情報をプライマリシャードの少ない新規インデックスに縮小します。",
"xpack.indexLifecycleMgmt.editPolicy.shrinkText": "縮小",
@@ -12545,30 +12538,16 @@
"xpack.indexLifecycleMgmt.forcemerge.enableLabel": "データを強制結合",
"xpack.indexLifecycleMgmt.forceMerge.numberOfSegmentsLabel": "セグメントの数",
"xpack.indexLifecycleMgmt.frozePhase.freezeIndexLabel": "インデックスを凍結",
- "xpack.indexLifecycleMgmt.hotPhase.bytesLabel": "バイト",
- "xpack.indexLifecycleMgmt.hotPhase.daysLabel": "日",
"xpack.indexLifecycleMgmt.hotPhase.enableRolloverLabel": "ロールオーバーを有効にする",
- "xpack.indexLifecycleMgmt.hotPhase.gigabytesLabel": "ギガバイト",
- "xpack.indexLifecycleMgmt.hotPhase.hoursLabel": "時間",
"xpack.indexLifecycleMgmt.hotPhase.isUsingDefaultRollover": "推奨のデフォルト値を使用",
- "xpack.indexLifecycleMgmt.hotPhase.kilobytesLabel": "キロバイト",
"xpack.indexLifecycleMgmt.hotPhase.maximumAgeLabel": "最高年齢",
"xpack.indexLifecycleMgmt.hotPhase.maximumAgeUnitsAriaLabel": "最高年齢の単位",
"xpack.indexLifecycleMgmt.hotPhase.maximumDocumentsLabel": "最高ドキュメント数",
"xpack.indexLifecycleMgmt.hotPhase.maximumIndexSizeDeprecationMessage": "最大インデックスサイズは廃止予定であり、将来のバージョンでは削除されます。代わりに最大プライマリシャードサイズを使用してください。",
"xpack.indexLifecycleMgmt.hotPhase.maximumIndexSizeLabel": "最大インデックスサイズ",
"xpack.indexLifecycleMgmt.hotPhase.maximumIndexSizeUnitsAriaLabel": "最大インデックスサイズの単位",
- "xpack.indexLifecycleMgmt.hotPhase.maximumPrimaryShardSizeAriaLabel": "最大プライマリシャードサイズ単位",
"xpack.indexLifecycleMgmt.hotPhase.maximumPrimaryShardSizeLabel": "最大プライマリシャードサイズ",
- "xpack.indexLifecycleMgmt.hotPhase.megabytesLabel": "メガバイト",
- "xpack.indexLifecycleMgmt.hotPhase.microsecondsLabel": "マイクロ秒",
- "xpack.indexLifecycleMgmt.hotPhase.millisecondsLabel": "ミリ秒",
- "xpack.indexLifecycleMgmt.hotPhase.minutesLabel": "分",
- "xpack.indexLifecycleMgmt.hotPhase.nanosecondsLabel": "ナノ秒",
- "xpack.indexLifecycleMgmt.hotPhase.petabytesLabel": "ペタバイト",
"xpack.indexLifecycleMgmt.hotPhase.rolloverFieldTitle": "ロールオーバー",
- "xpack.indexLifecycleMgmt.hotPhase.secondsLabel": "秒",
- "xpack.indexLifecycleMgmt.hotPhase.terabytesLabel": "テラバイト",
"xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.actionStatusTitle": "アクションステータス",
"xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.currentActionHeader": "現在のステータス",
"xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.currentActionTimeHeader": "現在のアクション時間",
@@ -12671,7 +12650,6 @@
"xpack.indexLifecycleMgmt.searchableSnapshot.disallowedCalloutBody": "このフェーズで検索可能なスナップショットを使用するには、ホットフェーズで検索可能なスナップショットを無効にする必要があります。",
"xpack.indexLifecycleMgmt.searchableSnapshot.disallowedCalloutTitle": "検索可能スナップショットが無効です",
"xpack.indexLifecycleMgmt.searchSnapshotlicenseCheckErrorMessage": "検索可能なスナップショットを使用するには、1 つ以上のエンタープライズレベルのライセンスが必要です。",
- "xpack.indexLifecycleMgmt.shrink.indexFieldLabel": "インデックスを縮小",
"xpack.indexLifecycleMgmt.shrink.numberOfPrimaryShardsLabel": "プライマリシャードの数",
"xpack.indexLifecycleMgmt.templateNotFoundMessage": "テンプレート{name}が見つかりません。",
"xpack.indexLifecycleMgmt.timeline.coldPhaseSectionTitle": "コールドフェーズ",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index e150b474be207..27f2bb701cac4 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -12563,7 +12563,6 @@
"xpack.indexLifecycleMgmt.editPolicy.dataTierAllocation.nodeAllocationFieldLabel": "选择节点属性",
"xpack.indexLifecycleMgmt.editPolicy.dataTierHotLabel": "热",
"xpack.indexLifecycleMgmt.editPolicy.dataTierWarmLabel": "温",
- "xpack.indexLifecycleMgmt.editPolicy.daysOptionLabel": "天",
"xpack.indexLifecycleMgmt.editPolicy.defaultToDataNodesDescription": "要将数据分配给特定数据节点,请{roleBasedGuidance}或在 elasticsearch.yml 中配置定制节点属性。",
"xpack.indexLifecycleMgmt.editPolicy.defaultToDataNodesDescription.migrationGuidanceMessage": "使用基于角色的分配",
"xpack.indexLifecycleMgmt.editPolicy.deletePhase.activateWarmPhaseSwitchLabel": "激活删除阶段",
@@ -12619,7 +12618,6 @@
"xpack.indexLifecycleMgmt.editPolicy.hotPhase.learnAboutRolloverLinkText": "了解详情",
"xpack.indexLifecycleMgmt.editPolicy.hotPhase.rolloverDefaultsTipContent": "当索引已存在 30 天或任何主分片达到 50 GB 时滚动更新。",
"xpack.indexLifecycleMgmt.editPolicy.hotPhase.rolloverDescriptionMessage": "在当前索引达到特定大小、文档计数或存在时间时,开始写入到新索引。允许您在使用时间序列数据时优化性能并管理资源使用。",
- "xpack.indexLifecycleMgmt.editPolicy.hoursOptionLabel": "小时",
"xpack.indexLifecycleMgmt.editPolicy.indexPriority.indexPriorityEnabledFieldLabel": "设置索引优先级",
"xpack.indexLifecycleMgmt.editPolicy.indexPriorityLabel": "索引优先级",
"xpack.indexLifecycleMgmt.editPolicy.indexPriorityText": "索引优先级",
@@ -12632,16 +12630,12 @@
"xpack.indexLifecycleMgmt.editPolicy.linkedIndices": "{indicesCount, plural, other {# 个已链接索引}}",
"xpack.indexLifecycleMgmt.editPolicy.loadSnapshotRepositoriesErrorBody": "刷新此字段并输入现有快照储存库的名称。",
"xpack.indexLifecycleMgmt.editPolicy.loadSnapshotRepositoriesErrorTitle": "无法加载快照存储库",
- "xpack.indexLifecycleMgmt.editPolicy.microSecondsOptionLabel": "微秒",
- "xpack.indexLifecycleMgmt.editPolicy.milliSecondsOptionLabel": "毫秒",
"xpack.indexLifecycleMgmt.editPolicy.minAgeSmallerThanColdPhaseError": "必须大于或等于冷阶段值 ({value})",
"xpack.indexLifecycleMgmt.editPolicy.minAgeSmallerThanFrozenPhaseError": "必须大于或等于冻结阶段值 ({value})",
"xpack.indexLifecycleMgmt.editPolicy.minAgeSmallerThanWarmPhaseError": "必须大于或等于温阶段值 ({value})",
"xpack.indexLifecycleMgmt.editPolicy.minimumAge.minimumAgeFieldLabel": "在以下情况下将数据移到相应阶段:",
"xpack.indexLifecycleMgmt.editPolicy.minimumAge.minimumAgeFieldSuffixLabel": "以前",
"xpack.indexLifecycleMgmt.editPolicy.minimumAge.rolloverToolTipDescription": "数据存在时间计算自滚动更新。滚动更新配置于热阶段。",
- "xpack.indexLifecycleMgmt.editPolicy.minutesOptionLabel": "分钟",
- "xpack.indexLifecycleMgmt.editPolicy.nanoSecondsOptionLabel": "纳秒",
"xpack.indexLifecycleMgmt.editPolicy.noCustomAttributesTitle": "未定义定制属性",
"xpack.indexLifecycleMgmt.editPolicy.nodeAllocation.allocateToDataNodesOption": "任何数据节点",
"xpack.indexLifecycleMgmt.editPolicy.nodeAllocation.customOption.description": "使用节点属性控制分片分配。{learnMoreLink}。",
@@ -12693,7 +12687,6 @@
"xpack.indexLifecycleMgmt.editPolicy.searchableSnapshotRepoFieldLabel": "快照存储库",
"xpack.indexLifecycleMgmt.editPolicy.searchableSnapshotRepoRequiredError": "快照存储库名称必填。",
"xpack.indexLifecycleMgmt.editPolicy.searchableSnapshotStorageFieldLabel": "可搜索快照存储",
- "xpack.indexLifecycleMgmt.editPolicy.secondsOptionLabel": "秒",
"xpack.indexLifecycleMgmt.editPolicy.showPolicyJsonButton": "显示请求",
"xpack.indexLifecycleMgmt.editPolicy.shrinkIndexExplanationText": "将索引缩小成具有较少主分片的新索引。",
"xpack.indexLifecycleMgmt.editPolicy.shrinkText": "缩小",
@@ -12712,30 +12705,16 @@
"xpack.indexLifecycleMgmt.forcemerge.enableLabel": "强制合并数据",
"xpack.indexLifecycleMgmt.forceMerge.numberOfSegmentsLabel": "分段数目",
"xpack.indexLifecycleMgmt.frozePhase.freezeIndexLabel": "冻结索引",
- "xpack.indexLifecycleMgmt.hotPhase.bytesLabel": "字节",
- "xpack.indexLifecycleMgmt.hotPhase.daysLabel": "天",
"xpack.indexLifecycleMgmt.hotPhase.enableRolloverLabel": "启用滚动更新",
- "xpack.indexLifecycleMgmt.hotPhase.gigabytesLabel": "千兆字节",
- "xpack.indexLifecycleMgmt.hotPhase.hoursLabel": "小时",
"xpack.indexLifecycleMgmt.hotPhase.isUsingDefaultRollover": "使用建议的默认值",
- "xpack.indexLifecycleMgmt.hotPhase.kilobytesLabel": "千字节",
"xpack.indexLifecycleMgmt.hotPhase.maximumAgeLabel": "最大存在时间",
"xpack.indexLifecycleMgmt.hotPhase.maximumAgeUnitsAriaLabel": "最大存在时间单位",
"xpack.indexLifecycleMgmt.hotPhase.maximumDocumentsLabel": "最大文档数",
"xpack.indexLifecycleMgmt.hotPhase.maximumIndexSizeDeprecationMessage": "最大索引大小已弃用,将在未来版本中移除。改用最大主分片大小。",
"xpack.indexLifecycleMgmt.hotPhase.maximumIndexSizeLabel": "最大索引大小",
"xpack.indexLifecycleMgmt.hotPhase.maximumIndexSizeUnitsAriaLabel": "最大索引大小单位",
- "xpack.indexLifecycleMgmt.hotPhase.maximumPrimaryShardSizeAriaLabel": "最大主分片大小单位",
"xpack.indexLifecycleMgmt.hotPhase.maximumPrimaryShardSizeLabel": "最大主分片大小",
- "xpack.indexLifecycleMgmt.hotPhase.megabytesLabel": "兆字节",
- "xpack.indexLifecycleMgmt.hotPhase.microsecondsLabel": "微秒",
- "xpack.indexLifecycleMgmt.hotPhase.millisecondsLabel": "毫秒",
- "xpack.indexLifecycleMgmt.hotPhase.minutesLabel": "分钟",
- "xpack.indexLifecycleMgmt.hotPhase.nanosecondsLabel": "纳秒",
- "xpack.indexLifecycleMgmt.hotPhase.petabytesLabel": "万兆字节",
"xpack.indexLifecycleMgmt.hotPhase.rolloverFieldTitle": "滚动更新",
- "xpack.indexLifecycleMgmt.hotPhase.secondsLabel": "秒",
- "xpack.indexLifecycleMgmt.hotPhase.terabytesLabel": "兆兆字节",
"xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.actionStatusTitle": "操作状态",
"xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.currentActionHeader": "当前操作",
"xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.currentActionTimeHeader": "当前操作名称",
@@ -12842,7 +12821,6 @@
"xpack.indexLifecycleMgmt.searchableSnapshot.disallowedCalloutBody": "要在此阶段使用可搜索快照,必须在热阶段禁用可搜索快照。",
"xpack.indexLifecycleMgmt.searchableSnapshot.disallowedCalloutTitle": "可搜索快照已禁用",
"xpack.indexLifecycleMgmt.searchSnapshotlicenseCheckErrorMessage": "要使用可搜索快照,至少需要企业级许可证。",
- "xpack.indexLifecycleMgmt.shrink.indexFieldLabel": "缩小索引",
"xpack.indexLifecycleMgmt.shrink.numberOfPrimaryShardsLabel": "主分片数目",
"xpack.indexLifecycleMgmt.templateNotFoundMessage": "找不到模板 {name}。",
"xpack.indexLifecycleMgmt.timeline.coldPhaseSectionTitle": "冷阶段",