[45/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b6c305f8/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java deleted file mode 100755 index 59fce55..000 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java +++ /dev/null @@ -1,2400 +0,0 @@ -/* - * 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.geode.admin.internal; - -import org.apache.geode.CancelException; -import org.apache.geode.SystemFailure; -import org.apache.geode.admin.*; -import org.apache.geode.admin.Alert; -import org.apache.geode.admin.AlertListener; -import org.apache.geode.cache.persistence.PersistentID; -import org.apache.geode.distributed.DistributedMember; -import org.apache.geode.distributed.FutureCancelledException; -import org.apache.geode.distributed.internal.*; -import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.internal.Assert; -import org.apache.geode.internal.Banner; -import org.apache.geode.internal.admin.*; -import org.apache.geode.internal.admin.remote.*; -import org.apache.geode.internal.cache.persistence.PersistentMemberPattern; -import org.apache.geode.internal.i18n.LocalizedStrings; -import org.apache.geode.internal.logging.InternalLogWriter; -import org.apache.geode.internal.logging.LogService; -import org.apache.geode.internal.logging.LogWriterFactory; -import org.apache.geode.internal.logging.log4j.LocalizedMessage; -import org.apache.geode.internal.logging.log4j.LogMarker; -import org.apache.geode.internal.logging.log4j.LogWriterAppender; -import org.apache.geode.internal.logging.log4j.LogWriterAppenders; -import org.apache.geode.internal.util.concurrent.FutureResult; -import org.apache.logging.log4j.Logger; - -import java.io.File; -import java.io.IOException; -import java.net.InetAddress; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.concurrent.*; - -import static org.apache.geode.distributed.ConfigurationProperties.*; - -/** - * Represents a GemFire distributed system for remote administration/management. - * - * @since GemFire 3.5 - */ -public class AdminDistributedSystemImpl implements org.apache.geode.admin.AdminDistributedSystem, -org.apache.geode.internal.admin.JoinLeaveListener, -org.apache.geode.internal.admin.AlertListener, - org.apache.geode.distributed.internal.InternalDistributedSystem.DisconnectListener { - - private static final Logger logger = LogService.getLogger(); - - /** String identity of this distributed system */ - private String id; - - /** Latest alert broadcast by any system members */ - private Alert latestAlert; - - // - - - /** Internal admin agent to delegate low-level work to */ - private volatile GfManagerAgent gfManagerAgent; - - /** Monitors the health of this distributed system */ - private GemFireHealth health; - - /** Set of non-Manager members in this system */ - private final Set applicationSet = new HashSet(); - - /** Set of DistributionLocators for this system */ - private final Set locatorSet = new HashSet(); - - /** Set of dedicated CacheServer members in this system */ - private final Set cacheServerSet = new HashSet(); - - /** Configuration defining this distributed system */ - private final DistributedSystemConfigImpl config; - - /** Controller for starting and stopping managed entities */ - private ManagedEntityController controller; - - /** Log file collator for gathering and merging system member logs */ - private LogCollator logCollator = new LogCollator(); - - /** - * The level above which alerts will be delivered to the alert listeners - */ - private AlertLevel alertLevel = AlertLevel.WARNING; - - /** The alert listeners registered on this distributed system. */ - private volatile Set alertListeners = Collections.emptySet(); - private final Object
[45/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6bb27bf1/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java b/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java deleted file mode 100644 index eae674b..000 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.geode.admin.internal; - -import java.util.Map; -import java.util.Set; - -import org.apache.geode.cache.persistence.PersistentID; -import org.apache.geode.distributed.DistributedMember; - -public class BackupDataStoreResult { - - private MapexistingDataStores; - - private Map successfulMembers; - - public BackupDataStoreResult(Map existingDataStores, - Map successfulMembers) { -this.existingDataStores = existingDataStores; -this.successfulMembers = successfulMembers; - } - - public Map getExistingDataStores() { -return this.existingDataStores; - } - - public Map getSuccessfulMembers() { -return this.successfulMembers; - } - - public String toString() { -return new StringBuilder().append(getClass().getSimpleName()).append("[") -.append("existingDataStores=").append(this.existingDataStores) -.append("; successfulMembers=").append(this.successfulMembers).append("]").toString(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6bb27bf1/geode-core/src/main/java/org/apache/geode/admin/internal/BackupStatusImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupStatusImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/BackupStatusImpl.java deleted file mode 100644 index 4256c3c..000 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupStatusImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.geode.admin.internal; - -import java.io.Serializable; -import java.util.Map; -import java.util.Set; - -import org.apache.geode.admin.BackupStatus; -import org.apache.geode.cache.persistence.PersistentID; -import org.apache.geode.distributed.DistributedMember; - -/** - * Holds the result of a backup operation. - * - * - */ -public class BackupStatusImpl implements BackupStatus, Serializable { - private static final long serialVersionUID = 3704162840296921840L; - - private Map backedUpDiskStores; - private Set offlineDiskStores; - - public BackupStatusImpl(Map backedUpDiskStores, - Set offlineDiskStores) { -super(); -this.backedUpDiskStores = backedUpDiskStores; -this.offlineDiskStores = offlineDiskStores; - } - - public Map getBackedUpDiskStores() { -return backedUpDiskStores; - } - - public Set getOfflineDiskStores() { -return offlineDiskStores; - } - - @Override - public String toString() { -return "BackupStatus[backedUpDiskStores=" + backedUpDiskStores + ",
[45/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthEvaluator.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthEvaluator.java deleted file mode 100644 index a352616..000 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthEvaluator.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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.geode.admin.internal; - -import org.apache.geode.admin.DistributedSystemHealthConfig; -import org.apache.geode.distributed.internal.DM; -import org.apache.geode.distributed.internal.DistributionConfig; -import org.apache.geode.distributed.internal.DistributionManager; -import org.apache.geode.distributed.internal.MembershipListener; -import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.internal.i18n.LocalizedStrings; - -import java.util.List; -import java.util.Set; - -/** - * Contains the logic for evaluating the health of an entire GemFire distributed system according to - * the thresholds provided in a {@link DistributedSystemHealthConfig}. - * - * - * - * Note that unlike other evaluators, the DistributedSystemHealthEvaluator resides in - * the "administrator" VM and not in the member VMs. This is because there only needs to be one - * DistributedSystemHealthEvaluator per distributed system. - * - * - * @since GemFire 3.5 - */ -class DistributedSystemHealthEvaluator extends AbstractHealthEvaluator -implements MembershipListener { - - /** The config from which we get the evaluation criteria */ - private DistributedSystemHealthConfig config; - - /** - * The distribution manager with which this MembershipListener is registered - */ - private DM dm; - - /** The description of the distributed system being evaluated */ - private String description; - - /** - * The number of application members that have unexpectedly left since the previous evaluation - */ - private int crashedApplications; - - /// Constructors /// - - /** - * Creates a new DistributedSystemHealthEvaluator - */ - DistributedSystemHealthEvaluator(DistributedSystemHealthConfig config, DM dm) { -super(null, dm); - -this.config = config; -this.dm = dm; -this.dm.addMembershipListener(this); - -StringBuffer sb = new StringBuffer(); -sb.append("Distributed System "); - -String desc = null; -if (dm instanceof DistributionManager) { - desc = ((DistributionManager) dm).getDistributionConfigDescription(); -} - -if (desc != null) { - sb.append(desc); - -} else { - DistributionConfig dsc = dm.getSystem().getConfig(); - String locators = dsc.getLocators(); - if (locators == null || locators.equals("")) { -sb.append("using multicast "); -sb.append(dsc.getMcastAddress()); -sb.append(":"); -sb.append(dsc.getMcastPort()); - - } else { -sb.append("using locators "); -sb.append(locators); - } -} - -this.description = sb.toString(); - } - - Instance Methods - - @Override - protected String getDescription() { -return this.description; - } - - /** - * Checks to make sure that the number of application members of the distributed system that have - * left unexpected since the last evaluation is less than the - * {@linkplain DistributedSystemHealthConfig#getMaxDepartedApplications threshold}. If not, the - * status is "poor" health. - */ - void checkDepartedApplications(List status) { -synchronized (this) { - long threshold = this.config.getMaxDepartedApplications(); - if (this.crashedApplications > threshold) { -String s = - LocalizedStrings.DistributedSystemHealth_THE_NUMBER_OF_APPLICATIONS_THAT_HAVE_LEFT_THE_DISTRIBUTED_SYSTEM_0_EXCEEDS_THE_THRESHOLD_1 -