zentol commented on a change in pull request #14851: URL: https://github.com/apache/flink/pull/14851#discussion_r570889432
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/declarative/allocator/SharedSlot.java ########## @@ -0,0 +1,145 @@ +/* + * 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.runtime.scheduler.declarative.allocator; + +import org.apache.flink.runtime.jobmanager.scheduler.Locality; +import org.apache.flink.runtime.jobmaster.LogicalSlot; +import org.apache.flink.runtime.jobmaster.SlotOwner; +import org.apache.flink.runtime.jobmaster.SlotRequestId; +import org.apache.flink.runtime.jobmaster.slotpool.PhysicalSlot; +import org.apache.flink.runtime.jobmaster.slotpool.SingleLogicalSlot; +import org.apache.flink.util.Preconditions; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** Shared slot implementation for the declarative scheduler. */ +class SharedSlot implements SlotOwner, PhysicalSlot.Payload { + private static final Logger LOG = LoggerFactory.getLogger(SharedSlot.class); + + private final SlotRequestId physicalSlotRequestId; + + private final PhysicalSlot physicalSlot; + + private final Runnable externalReleaseCallback; + + private final Map<SlotRequestId, LogicalSlot> allocatedLogicalSlots; + + private final boolean slotWillBeOccupiedIndefinitely; + + private State state; + + public SharedSlot( + SlotRequestId physicalSlotRequestId, Review comment: But then the logging is different to the other SharedSlot implementation which would be a bit unfortunate. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
