forked from apache/geode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GEODE-870: Handling multiple concurrent locator restarts. Elder locat…
…or nomination
- Loading branch information
Udo Kohlmeyer
committed
Feb 29, 2016
1 parent
34beda8
commit edc1c4c
Showing
9 changed files
with
352 additions
and
370 deletions.
There are no files selected for viewing
96 changes: 0 additions & 96 deletions
96
.../com/gemstone/gemfire/distributed/internal/membership/gms/messages/ViewRejectMessage.java
This file was deleted.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
...m/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeaveHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* 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 com.gemstone.gemfire.distributed.internal.membership.gms.membership; | ||
|
||
import com.gemstone.gemfire.distributed.Locator; | ||
import com.gemstone.gemfire.distributed.internal.DM; | ||
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; | ||
import com.gemstone.gemfire.distributed.internal.membership.gms.Services; | ||
import com.gemstone.gemfire.distributed.internal.membership.gms.mgr.GMSMembershipManager; | ||
|
||
public class GMSJoinLeaveHelper { | ||
public static boolean isViewCreator() { | ||
GMSJoinLeave gmsJoinLeave = getGmsJoinLeave(); | ||
if (gmsJoinLeave != null) { | ||
GMSJoinLeave.ViewCreator viewCreator = gmsJoinLeave.getViewCreator(); | ||
if (viewCreator != null && !viewCreator.isShutdown()) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} | ||
throw new RuntimeException("This should not have happened. There should be a JoinLeave for every DS"); | ||
} | ||
|
||
private static GMSJoinLeave getGmsJoinLeave() { | ||
InternalDistributedSystem distributedSystem = getInternalDistributedSystem(); | ||
DM dm = distributedSystem.getDM(); | ||
GMSMembershipManager membershipManager = (GMSMembershipManager) dm.getMembershipManager(); | ||
Services services = membershipManager.getServices(); | ||
return (GMSJoinLeave) services.getJoinLeave(); | ||
} | ||
|
||
public static Integer getViewId() { | ||
return getGmsJoinLeave().getView().getViewId(); | ||
} | ||
|
||
private static InternalDistributedSystem getInternalDistributedSystem() { | ||
InternalDistributedSystem distributedSystem = InternalDistributedSystem.getAnyInstance(); | ||
if (distributedSystem == null) { | ||
Locator locator = Locator.getLocator(); | ||
return (InternalDistributedSystem) locator.getDistributedSystem(); | ||
} else { | ||
return distributedSystem; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.