[ 
https://issues.apache.org/jira/browse/FLINK-5810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15985065#comment-15985065
 ] 

ASF GitHub Bot commented on FLINK-5810:
---------------------------------------

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

    https://github.com/apache/flink/pull/3394#discussion_r113495941
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/TaskManagerRegistration.java
 ---
    @@ -0,0 +1,89 @@
    +/*
    + * 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.resourcemanager.slotmanager;
    +
    +import org.apache.flink.runtime.clusterframework.types.SlotID;
    +import org.apache.flink.runtime.instance.InstanceID;
    +import 
org.apache.flink.runtime.resourcemanager.registration.TaskExecutorConnection;
    +import org.apache.flink.util.Preconditions;
    +
    +import java.util.HashSet;
    +import java.util.Set;
    +import java.util.UUID;
    +import java.util.concurrent.ScheduledFuture;
    +
    +public class TaskManagerRegistration {
    +
    +   private final TaskExecutorConnection taskManagerConnection;
    +
    +   private final HashSet<SlotID> slots;
    +
    +   private UUID timeoutIdentifier;
    +
    +   private ScheduledFuture<?> timeoutFuture;
    +
    +   public TaskManagerRegistration(TaskExecutorConnection 
taskManagerConnection) {
    +           this.taskManagerConnection = 
Preconditions.checkNotNull(taskManagerConnection);
    +
    +           slots = new HashSet<>(4);
    +
    +           timeoutIdentifier = null;
    +           timeoutFuture = null;
    +   }
    +
    +   public TaskExecutorConnection getTaskManagerConnection() {
    +           return taskManagerConnection;
    +   }
    +
    +   public InstanceID getInstanceId() {
    +           return taskManagerConnection.getInstanceID();
    +   }
    +
    +   public UUID getTimeoutIdentifier() {
    +           return timeoutIdentifier;
    +   }
    +
    +   public Set<SlotID> getSlots() {
    +           return slots;
    +   }
    +
    +   public boolean removeSlot(SlotID slotId) {
    +           return slots.remove(slotId);
    +   }
    +
    +   public void addSlot(SlotID slotId) {
    +           slots.add(slotId);
    +   }
    +
    +   public void cancelTimeout() {
    +           if (null != timeoutFuture) {
    +                   timeoutFuture.cancel(true);
    --- End diff --
    
    True, will fix this.


> Harden SlotManager
> ------------------
>
>                 Key: FLINK-5810
>                 URL: https://issues.apache.org/jira/browse/FLINK-5810
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Distributed Coordination
>    Affects Versions: 1.3.0
>            Reporter: Till Rohrmann
>            Assignee: Till Rohrmann
>
> Harden the {{SlotManager}} logic to better cope with lost messages.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to