flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm <...@git.apache.org>
Subject [GitHub] flink pull request #2427: [FLINK-4516] [cluster management]leader election o...
Date Tue, 30 Aug 2016 14:50:11 GMT
Github user mxm commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2427#discussion_r76810632
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/rpc/resourcemanager/ResourceManager.java
---
    @@ -116,4 +142,78 @@ public SlotAssignment requestSlot(SlotRequest slotRequest) {
     
     		return new TaskExecutorRegistrationSuccess(new InstanceID(), 5000);
     	}
    +
    +	/**
    +	 * Callback method when current resourceManager is granted leadership
    +	 *
    +	 * @param newLeaderSessionID unique leadershipID
    +	 */
    +	void handleGrantLeadership(final UUID newLeaderSessionID) {
    +		runAsync(new Runnable() {
    +			@Override
    +			public void run() {
    +				log.info("ResourceManager {} was granted leadership with leader session ID {}", getAddress(),
newLeaderSessionID);
    +				leaderSessionID = newLeaderSessionID;
    +				// confirming the leader session ID might be blocking,
    +				leaderElectionService.confirmLeaderSessionID(newLeaderSessionID);
    +			}
    +		});
    +	}
    +
    +	/**
    +	 * Callback method when current resourceManager lose leadership.
    +	 */
    +	void handleRevokeLeadership() {
    --- End diff --
    
    This method can be private.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message