@@ -1230,6 +1230,7 @@ public static Metadata readFrom(StreamInput in) throws IOException {
1230
1230
}
1231
1231
1232
1232
private static void readBwcCustoms (StreamInput in , Builder builder ) throws IOException {
1233
+ final ProjectMetadata .Builder projectBuilder = builder .getProject (ProjectId .DEFAULT );
1233
1234
final Set <String > clusterScopedNames = in .namedWriteableRegistry ().getReaders (ClusterCustom .class ).keySet ();
1234
1235
final Set <String > projectScopedNames = in .namedWriteableRegistry ().getReaders (ProjectCustom .class ).keySet ();
1235
1236
final int count = in .readVInt ();
@@ -1245,9 +1246,9 @@ private static void readBwcCustoms(StreamInput in, Builder builder) throws IOExc
1245
1246
if (custom instanceof PersistentTasksCustomMetadata persistentTasksCustomMetadata ) {
1246
1247
final var tuple = persistentTasksCustomMetadata .split ();
1247
1248
builder .putCustom (tuple .v1 ().getWriteableName (), tuple .v1 ());
1248
- builder . putProjectCustom (tuple .v2 ().getWriteableName (), tuple .v2 ());
1249
+ projectBuilder . putCustom (tuple .v2 ().getWriteableName (), tuple .v2 ());
1249
1250
} else {
1250
- builder . putProjectCustom (custom .getWriteableName (), custom );
1251
+ projectBuilder . putCustom (custom .getWriteableName (), custom );
1251
1252
}
1252
1253
} else {
1253
1254
throw new IllegalArgumentException ("Unknown custom name [" + name + "]" );
@@ -1552,7 +1553,8 @@ public Builder putCustom(String type, ClusterCustom custom) {
1552
1553
1553
1554
@ Deprecated (forRemoval = true )
1554
1555
public Builder putCustom (String type , ProjectCustom custom ) {
1555
- return putProjectCustom (type , custom );
1556
+ getSingleProject ().putCustom (type , Objects .requireNonNull (custom , type ));
1557
+ return this ;
1556
1558
}
1557
1559
1558
1560
public ClusterCustom getCustom (String type ) {
@@ -1575,12 +1577,6 @@ public Builder customs(Map<String, ClusterCustom> clusterCustoms) {
1575
1577
return this ;
1576
1578
}
1577
1579
1578
- @ Deprecated (forRemoval = true )
1579
- public Builder putProjectCustom (String type , ProjectCustom custom ) {
1580
- getSingleProject ().putCustom (type , Objects .requireNonNull (custom , type ));
1581
- return this ;
1582
- }
1583
-
1584
1580
@ Deprecated (forRemoval = true )
1585
1581
public Builder projectCustoms (Map <String , ProjectCustom > projectCustoms ) {
1586
1582
projectCustoms .forEach ((key , value ) -> Objects .requireNonNull (value , key ));
0 commit comments