flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-4516) ResourceManager leadership election
Date Wed, 31 Aug 2016 10:15:20 GMT

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

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

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

    https://github.com/apache/flink/pull/2427#discussion_r76961323
  
    --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/rpc/resourcemanager/ResourceManagerHATest.java
---
    @@ -0,0 +1,68 @@
    +/*
    + * 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.rpc.resourcemanager;
    +
    +import org.apache.flink.runtime.highavailability.TestingHighAvailabilityServices;
    +import org.apache.flink.runtime.leaderelection.TestingLeaderElectionService;
    +import org.apache.flink.runtime.rpc.RpcService;
    +import org.apache.flink.runtime.rpc.TestingSerialRpcService;
    +import org.junit.After;
    +import org.junit.Assert;
    +import org.junit.Before;
    +import org.junit.Test;
    +
    +import java.util.UUID;
    +
    +/**
    + * resourceManager HA test, including grant leadership and revoke leadership
    + */
    +public class ResourceManagerHATest {
    +
    +	private RpcService rpcService;
    +
    +	@Before
    +	public void setup() throws Exception {
    +		rpcService = new TestingSerialRpcService();
    --- End diff --
    
    I think it would suffice to use a mocked `RpcService` for the test, e.g. `Mockito.mock(RpcService.class)`.
Nevertheless, the serial rpc service could be useful in other tests which don't need a full
AkkaRpcService.


> ResourceManager leadership election
> -----------------------------------
>
>                 Key: FLINK-4516
>                 URL: https://issues.apache.org/jira/browse/FLINK-4516
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Cluster Management
>            Reporter: zhangjing
>            Assignee: zhangjing
>
> 1. When a resourceManager is started, it starts the leadership election service first
and take part in contending for leadership
> 2. Every resourceManager contains a ResourceManagerLeaderContender, when it is granted
leadership, it will start SlotManager and other main components. when it is revoked leadership,
it will stop all its components and clear everything.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message