reswqa commented on code in PR #24541: URL: https://github.com/apache/flink/pull/24541#discussion_r1599437315
########## flink-core-api/src/main/java/org/apache/flink/api/common/operators/SlotSharingGroupDescriptor.java: ########## @@ -0,0 +1,238 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF 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.apache.flink.api.common.operators; + +import org.apache.flink.annotation.Experimental; +import org.apache.flink.configuration.MemorySize; + +import javax.annotation.Nullable; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +/** + * The descriptor that describe the name and the different resource components of a slot sharing + * group. + */ +@Experimental +public class SlotSharingGroupDescriptor { + private final String name; + + /** How many cpu cores are needed. Can be null only if it is unknown. */ + @Nullable // can be null only for UNKNOWN + private final Double cpuCores; + + /** How much task heap memory is needed. */ + @Nullable // can be null only for UNKNOWN + private final MemorySize taskHeapMemory; + + /** How much task off-heap memory is needed. */ + @Nullable // can be null only for UNKNOWN + private final MemorySize taskOffHeapMemory; + + /** How much managed memory is needed. */ + @Nullable // can be null only for UNKNOWN + private final MemorySize managedMemory; + + /** A extensible field for user specified resources from {@link SlotSharingGroupDescriptor}. */ + private final Map<String, Double> externalResources = new HashMap<>(); + + private SlotSharingGroupDescriptor( + String name, + @Nullable Double cpuCores, + @Nullable MemorySize taskHeapMemory, + @Nullable MemorySize taskOffHeapMemory, + @Nullable MemorySize managedMemory, + @Nullable Map<String, Double> extendedResources) { + this.name = name; + this.cpuCores = cpuCores; + this.taskHeapMemory = taskHeapMemory; + this.taskOffHeapMemory = taskOffHeapMemory; + this.managedMemory = managedMemory; + this.externalResources.putAll(extendedResources); Review Comment: Yes, I shall remove the`@Nullable` marker from ctr. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
