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

    https://github.com/apache/flink/pull/5107#discussion_r155229002
  
    --- Diff: 
flink-runtime/src/test/java/org/apache/flink/runtime/testutils/InMemorySubmittedJobGraphStore.java
 ---
    @@ -0,0 +1,90 @@
    +/*
    + * 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.testutils;
    +
    +import org.apache.flink.api.common.JobID;
    +import org.apache.flink.runtime.jobmanager.SubmittedJobGraph;
    +import org.apache.flink.runtime.jobmanager.SubmittedJobGraphStore;
    +import org.apache.flink.util.Preconditions;
    +
    +import javax.annotation.Nullable;
    +
    +import java.util.Collection;
    +import java.util.Collections;
    +import java.util.HashMap;
    +import java.util.HashSet;
    +import java.util.Map;
    +
    +import static java.util.Objects.requireNonNull;
    +
    +/**
    + * In-Memory implementation of {@link SubmittedJobGraphStore} for testing 
purposes.
    + */
    +public class InMemorySubmittedJobGraphStore implements 
SubmittedJobGraphStore {
    +
    +   private final Map<JobID, SubmittedJobGraph> storedJobs = new 
HashMap<>();
    +
    +   private boolean started;
    +
    +   @Override
    +   public synchronized void start(@Nullable SubmittedJobGraphListener 
jobGraphListener) throws Exception {
    --- End diff --
    
    I think we should also trigger `SubmittedJobGraphListener` notifications 
when a job is added or removed from this store to make it behave similarly to 
the `ZooKeeperSubmittedJobGraphStore`.


---

Reply via email to