Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5403#discussion_r170252422
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/SlotProfile.java
 ---
    @@ -0,0 +1,275 @@
    +/*
    + * 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.clusterframework.types;
    +
    +import org.apache.flink.annotation.VisibleForTesting;
    +import org.apache.flink.runtime.jobmanager.scheduler.Locality;
    +import org.apache.flink.runtime.jobmaster.SlotContext;
    +import org.apache.flink.runtime.taskmanager.TaskManagerLocation;
    +import org.apache.flink.util.Preconditions;
    +
    +import javax.annotation.Nonnull;
    +import javax.annotation.Nullable;
    +
    +import java.util.Collection;
    +import java.util.Collections;
    +import java.util.HashSet;
    +import java.util.Iterator;
    +import java.util.function.BiFunction;
    +import java.util.function.Function;
    +import java.util.function.Predicate;
    +import java.util.stream.Stream;
    +
    +/**
    + * A slot profile describes the profile of a slot into which a task wants 
to be scheduled. The profile contains
    + * attributes such as resource or locality constraints, some of which may 
be hard or soft. A matcher can be generated
    + * to filter out candidate slots by matching their {@link SlotContext} 
against the slot profile and, potentially,
    + * further requirements.
    + */
    +public class SlotProfile {
    +
    +   /** Singleton object for a slot profile without any requirements. */
    +   private static final SlotProfile NO_REQUIREMENTS = 
noLocality(ResourceProfile.UNKNOWN);
    +
    +   /** This specifies the desired resource profile for the slot. */
    +   @Nonnull
    +   private final ResourceProfile resourceProfile;
    +
    +   /** This specifies the preferred locations for the slot. */
    +   @Nonnull
    +   private final Collection<TaskManagerLocation> preferredLocations;
    +
    +   /** This contains desired allocation ids of the slot. */
    +   @Nonnull
    +   private final Collection<AllocationID> priorAllocations;
    +
    +   public SlotProfile(
    +           @Nonnull ResourceProfile resourceProfile,
    +           @Nonnull Collection<TaskManagerLocation> preferredLocations,
    +           @Nonnull Collection<AllocationID> priorAllocations) {
    --- End diff --
    
    Nit: indentation one level deeper to differentiate from the body.


---

Reply via email to