From c2d75d9b8befa5bfad8f2d47b9d58062cc2df6fa Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 3 Sep 2024 12:46:36 +0400 Subject: [PATCH] Remove orphaned ClusterState types (#2850) --- .../cluster/_types/ClusterStateBlocksIndex.ts | 46 ------------ .../_types/ClusterStateIndexLifecycle.ts | 41 ---------- .../cluster/_types/ClusterStateIngest.ts | 36 --------- .../cluster/_types/ClusterStateMetadata.ts | 74 ------------------- .../_types/ClusterStateRoutingNodes.ts | 26 ------- .../cluster/_types/ClusterStateSnapshots.ts | 28 ------- 6 files changed, 251 deletions(-) delete mode 100644 specification/cluster/_types/ClusterStateBlocksIndex.ts delete mode 100644 specification/cluster/_types/ClusterStateIndexLifecycle.ts delete mode 100644 specification/cluster/_types/ClusterStateIngest.ts delete mode 100644 specification/cluster/_types/ClusterStateMetadata.ts delete mode 100644 specification/cluster/_types/ClusterStateRoutingNodes.ts delete mode 100644 specification/cluster/_types/ClusterStateSnapshots.ts diff --git a/specification/cluster/_types/ClusterStateBlocksIndex.ts b/specification/cluster/_types/ClusterStateBlocksIndex.ts deleted file mode 100644 index cb70722f5b..0000000000 --- a/specification/cluster/_types/ClusterStateBlocksIndex.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. 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. - */ - -import { RolloverConditions } from '@indices/rollover/types' -import { IndexSettings } from '@indices/_types/IndexSettings' -import { Dictionary } from '@spec_utils/Dictionary' -import { UserDefinedValue } from '@spec_utils/UserDefinedValue' -import { IndexAlias, IndexName, VersionNumber } from '@_types/common' -import { TypeMapping } from '@_types/mapping/TypeMapping' -import { integer } from '@_types/Numeric' - -export class ClusterStateBlockIndex { - description?: string - retryable?: boolean - levels?: string[] - aliases?: Array - aliases_version?: VersionNumber - version?: VersionNumber - mapping_version?: VersionNumber - settings_version?: VersionNumber - routing_num_shards?: VersionNumber - state?: string // TODO: create export enum of values - settings?: Dictionary - in_sync_allocations?: Dictionary - primary_terms?: Dictionary - mappings?: Dictionary - rollover_info?: Dictionary // TODO: not sure if this is correect - timestamp_range?: Dictionary - system?: boolean -} diff --git a/specification/cluster/_types/ClusterStateIndexLifecycle.ts b/specification/cluster/_types/ClusterStateIndexLifecycle.ts deleted file mode 100644 index 94351f2d99..0000000000 --- a/specification/cluster/_types/ClusterStateIndexLifecycle.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. 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. - */ - -import { LifecycleOperationMode } from '@_types/Lifecycle' -import { Phases } from '@ilm/_types/Phase' -import { Dictionary } from '@spec_utils/Dictionary' -import { HttpHeaders, IndexName, VersionNumber } from '@_types/common' -import { DateTime, EpochTime, UnitMillis } from '@_types/Time' - -export class ClusterStateIndexLifecycle { - policies: Dictionary - operation_mode: LifecycleOperationMode -} - -export class ClusterStateIndexLifecycleSummary { - policy: ClusterStateIndexLifecyclePolicy - headers: HttpHeaders - version: VersionNumber - modified_date: EpochTime - modified_date_string?: DateTime -} - -export class ClusterStateIndexLifecyclePolicy { - phases: Phases -} diff --git a/specification/cluster/_types/ClusterStateIngest.ts b/specification/cluster/_types/ClusterStateIngest.ts deleted file mode 100644 index 95fa83ce51..0000000000 --- a/specification/cluster/_types/ClusterStateIngest.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. 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. - */ - -import { ProcessorContainer } from '@ingest/_types/Processors' -import { Id, VersionNumber } from '@_types/common' - -export class ClusterStateIngest { - pipeline: ClusterStateIngestPipeline[] -} - -export class ClusterStateIngestPipeline { - id: Id - config: ClusterStateIngestPipelineConfig -} - -export class ClusterStateIngestPipelineConfig { - description?: string - version?: VersionNumber - processors: ProcessorContainer[] -} diff --git a/specification/cluster/_types/ClusterStateMetadata.ts b/specification/cluster/_types/ClusterStateMetadata.ts deleted file mode 100644 index 6808200584..0000000000 --- a/specification/cluster/_types/ClusterStateMetadata.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. 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. - */ - -import { IndexState } from '@indices/_types/IndexState' -import { Dictionary } from '@spec_utils/Dictionary' -import { UserDefinedValue } from '@spec_utils/UserDefinedValue' -import { Id, IndexName, Name, Uuid } from '@_types/common' -import { integer, long } from '@_types/Numeric' -import { DateTime, EpochTime, UnitMillis } from '@_types/Time' -import { ClusterStateBlockIndex } from './ClusterStateBlocksIndex' -import { ClusterStateIndexLifecycle } from './ClusterStateIndexLifecycle' -import { ClusterStateIngest } from './ClusterStateIngest' - -export class ClusterStateMetadata { - cluster_uuid: Uuid - cluster_uuid_committed: boolean - templates: Dictionary - indices?: Dictionary - 'index-graveyard': ClusterStateMetadataIndexGraveyard - cluster_coordination: ClusterStateMetadataClusterCoordination - ingest?: ClusterStateIngest - repositories?: Dictionary - component_template?: Dictionary - index_template?: Dictionary - index_lifecycle?: ClusterStateIndexLifecycle -} - -export class ClusterStateMetadataIndexGraveyard { - tombstones: Tombstone[] -} - -export class Tombstone { - index: TombstoneIndex - delete_date?: DateTime - delete_date_in_millis: EpochTime -} - -export class TombstoneIndex { - index_name: Name - index_uuid: Uuid -} - -export class ClusterStateMetadataTemplate extends IndexState { - order: integer - version: integer -} - -export class ClusterStateMetadataClusterCoordination { - term: integer - last_committed_config: string[] - last_accepted_config: string[] - voting_config_exclusions: VotingConfigExclusionsItem[] -} - -export class VotingConfigExclusionsItem { - node_id: Id - node_name: Name -} diff --git a/specification/cluster/_types/ClusterStateRoutingNodes.ts b/specification/cluster/_types/ClusterStateRoutingNodes.ts deleted file mode 100644 index 78c8096b78..0000000000 --- a/specification/cluster/_types/ClusterStateRoutingNodes.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. 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. - */ - -import { Dictionary } from '@spec_utils/Dictionary' -import { NodeShard } from '@_types/Node' - -export class ClusterStateRoutingNodes { - unassigned: NodeShard[] - nodes: Dictionary -} diff --git a/specification/cluster/_types/ClusterStateSnapshots.ts b/specification/cluster/_types/ClusterStateSnapshots.ts deleted file mode 100644 index b71fad6de0..0000000000 --- a/specification/cluster/_types/ClusterStateSnapshots.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. 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. - */ - -import { Status } from '@snapshot/_types/SnapshotStatus' - -export class ClusterStateSnapshots { - snapshots: Status[] // TODO: just a guess, but the tests are not exhaustive enough -} - -export class ClusterStateDeletedSnapshots { - snapshot_deletions: string[] // TODO: just a guess, but the tests are not exhaustive enough -}