@@ -267,14 +267,14 @@ public void restoreSnapshot(
267267 * @param projectId project for the restore
268268 * @param request restore request
269269 * @param listener restore listener
270- * @param updater handler that allows callers to make modifications to {@link Metadata }
270+ * @param updater handler that allows callers to make modifications to {@link ProjectMetadata }
271271 * in the same cluster state update as the restore operation
272272 */
273273 public void restoreSnapshot (
274274 final ProjectId projectId ,
275275 final RestoreSnapshotRequest request ,
276276 final ActionListener <RestoreCompletionResponse > listener ,
277- final BiConsumer <ClusterState , Metadata .Builder > updater
277+ final BiConsumer <ClusterState , ProjectMetadata .Builder > updater
278278 ) {
279279 assert Repository .assertSnapshotMetaThread ();
280280
@@ -368,8 +368,8 @@ public void restoreSnapshot(
368368 * @param repository the repository to restore from
369369 * @param request restore request
370370 * @param repositoryData current repository data for the repository to restore from
371- * @param updater handler that allows callers to make modifications to {@link Metadata } in the same cluster state update as the
372- * restore operation
371+ * @param updater handler that allows callers to make modifications to {@link ProjectMetadata } in the same cluster state update
372+ * as the restore operation
373373 * @param listener listener to resolve once restore has been started
374374 * @throws IOException on failure to load metadata from the repository
375375 */
@@ -378,7 +378,7 @@ private void startRestore(
378378 Repository repository ,
379379 RestoreSnapshotRequest request ,
380380 RepositoryData repositoryData ,
381- BiConsumer <ClusterState , Metadata .Builder > updater ,
381+ BiConsumer <ClusterState , ProjectMetadata .Builder > updater ,
382382 ActionListener <RestoreCompletionResponse > listener
383383 ) throws IOException {
384384 assert Repository .assertSnapshotMetaThread ();
@@ -1371,7 +1371,7 @@ private final class RestoreSnapshotStateTask extends ClusterStateUpdateTask {
13711371
13721372 private final Collection <DataStream > dataStreamsToRestore ;
13731373
1374- private final BiConsumer <ClusterState , Metadata .Builder > updater ;
1374+ private final BiConsumer <ClusterState , ProjectMetadata .Builder > updater ;
13751375
13761376 private final AllocationActionListener <RestoreCompletionResponse > listener ;
13771377 private final Settings settings ;
@@ -1387,7 +1387,7 @@ private final class RestoreSnapshotStateTask extends ClusterStateUpdateTask {
13871387 SnapshotInfo snapshotInfo ,
13881388 Metadata metadata ,
13891389 Collection <DataStream > dataStreamsToRestore ,
1390- BiConsumer <ClusterState , Metadata .Builder > updater ,
1390+ BiConsumer <ClusterState , ProjectMetadata .Builder > updater ,
13911391 Settings settings ,
13921392 ActionListener <RestoreCompletionResponse > listener
13931393 ) {
@@ -1586,7 +1586,7 @@ && isSystemIndex(snapshotIndexMetadata) == false) {
15861586 );
15871587 }
15881588
1589- updater .accept (currentState , mdBuilder );
1589+ updater .accept (currentState , mdBuilder . getProject ( projectId ) );
15901590 final ClusterState updatedClusterState = builder .metadata (mdBuilder )
15911591 .blocks (blocks )
15921592 .putRoutingTable (projectId , rtBuilder .build ())
0 commit comments