You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by se...@apache.org on 2016/11/04 12:12:43 UTC

aurora git commit: Populate curator latches with scheduler information

Repository: aurora
Updated Branches:
  refs/heads/master 171a8f7ca -> c46b6c293


Populate curator latches with scheduler information

Example:

  (CONNECTED) /> get aurora/scheduler/member_0000000173
  {"serviceEndpoint":{"host":"aurora.local","port":8081},"additionalEndpoints":{"http":{"host":"aurora.local","port":8081}},"status":"ALIVE"}
  (CONNECTED) /> get aurora/scheduler/_c_fe00a931-df92-4041-97db-9ef27a56e264-latch-0000000172
  aurora.local

Bugs closed: AURORA-1785

Reviewed at https://reviews.apache.org/r/52665/


Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/c46b6c29
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/c46b6c29
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/c46b6c29

Branch: refs/heads/master
Commit: c46b6c2931f91218f21d8e0f8ed89e7bedebdd60
Parents: 171a8f7
Author: Jing Chen <mi...@gmail.com>
Authored: Fri Nov 4 13:12:20 2016 +0100
Committer: Stephan Erb <se...@apache.org>
Committed: Fri Nov 4 13:12:20 2016 +0100

----------------------------------------------------------------------
 .../aurora/scheduler/discovery/CuratorSingletonService.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/c46b6c29/src/main/java/org/apache/aurora/scheduler/discovery/CuratorSingletonService.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/discovery/CuratorSingletonService.java b/src/main/java/org/apache/aurora/scheduler/discovery/CuratorSingletonService.java
index 4040067..321bbb3 100644
--- a/src/main/java/org/apache/aurora/scheduler/discovery/CuratorSingletonService.java
+++ b/src/main/java/org/apache/aurora/scheduler/discovery/CuratorSingletonService.java
@@ -117,8 +117,8 @@ class CuratorSingletonService implements SingletonService {
     }
   }
 
-  private final LeaderLatch leaderLatch;
   private final Advertiser advertiser;
+  private final CuratorFramework client;
   private final String groupPath;
 
   /**
@@ -134,9 +134,8 @@ class CuratorSingletonService implements SingletonService {
       String groupPath,
       String memberToken,
       Codec<ServiceInstance> codec) {
-
-    leaderLatch = new LeaderLatch(client, groupPath);
     advertiser = new Advertiser(client, groupPath, memberToken, codec);
+    this.client = client;
     this.groupPath = PathUtils.validatePath(groupPath);
   }
 
@@ -151,6 +150,7 @@ class CuratorSingletonService implements SingletonService {
     requireNonNull(additionalEndpoints);
     requireNonNull(listener);
 
+    LeaderLatch leaderLatch = new LeaderLatch(client, groupPath, endpoint.getHostName());
     Closer closer = Closer.create();
     leaderLatch.addListener(new LeaderLatchListener() {
       @Override