use of org.apache.geode.management.internal.configuration.domain.SharedConfigurationStatus in project geode by apache.
the class ClusterConfigurationService method getStatus.
/**
* Gets the current status of the ClusterConfigurationService If the status is started , it
* determines if the shared configuration is waiting for new configuration on other locators
*
* @return {@link SharedConfigurationStatus}
*/
public SharedConfigurationStatus getStatus() {
SharedConfigurationStatus scStatus = this.status.get();
if (scStatus == SharedConfigurationStatus.STARTED) {
PersistentMemberManager pmm = this.cache.getPersistentMemberManager();
Map<String, Set<PersistentMemberID>> waitingRegions = pmm.getWaitingRegions();
if (!waitingRegions.isEmpty()) {
this.status.compareAndSet(SharedConfigurationStatus.STARTED, SharedConfigurationStatus.WAITING);
Set<PersistentMemberID> persMemIds = waitingRegions.get(Region.SEPARATOR_CHAR + CONFIG_REGION_NAME);
for (PersistentMemberID persMemId : persMemIds) {
this.newerSharedConfigurationLocatorInfo.add(new PersistentMemberPattern(persMemId));
}
}
}
return this.status.get();
}
use of org.apache.geode.management.internal.configuration.domain.SharedConfigurationStatus in project geode by apache.
the class FetchSharedConfigurationStatusFunction method execute.
@Override
public void execute(FunctionContext context) {
InternalLocator locator = InternalLocator.getLocator();
InternalCache cache = GemFireCacheImpl.getInstance();
DistributedMember member = cache.getDistributedSystem().getDistributedMember();
SharedConfigurationStatus status = locator.getSharedConfigurationStatus().getStatus();
String memberId = member.getName();
if (StringUtils.isBlank(memberId)) {
memberId = member.getId();
}
CliFunctionResult result = new CliFunctionResult(memberId, new String[] { status.name() });
context.getResultSender().lastResult(result);
}
Aggregations