incubator-geode git commit: GEODE-2104: Fix parsing of options following --J
Repository: incubator-geode Updated Branches: refs/heads/develop bb3db4a6a -> 4a913fe7a GEODE-2104: Fix parsing of options following --J This closes #286 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/4a913fe7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/4a913fe7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/4a913fe7 Branch: refs/heads/develop Commit: 4a913fe7a65ea4d5d91ff04f671bf94205b60b62 Parents: bb3db4a Author: Jared StewartAuthored: Tue Nov 15 10:57:11 2016 -0800 Committer: Kirk Lund Committed: Tue Nov 15 17:02:09 2016 -0800 -- .../internal/cli/util/HyphenFormatter.java | 6 +- .../internal/cli/util/HyphenFormatterTest.java | 66 2 files changed, 69 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4a913fe7/geode-core/src/main/java/org/apache/geode/management/internal/cli/util/HyphenFormatter.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/util/HyphenFormatter.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/util/HyphenFormatter.java index 80816e9..7f7bf5c 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/util/HyphenFormatter.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/util/HyphenFormatter.java @@ -15,6 +15,7 @@ package org.apache.geode.management.internal.cli.util; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -24,7 +25,7 @@ import java.util.regex.Pattern; */ public class HyphenFormatter { - private static final String OPTION_PATTERN = "\\-\\-[a-zA-Z]+\\-?[a-zA-Z]*\\="; + private static final String OPTION_PATTERN = "--[a-zA-Z]+[a-zA-Z\\-]*=*"; private static final String QUOTE = "\""; private static final String EQUAL_HYPHEN = "=-"; @@ -67,13 +68,12 @@ public class HyphenFormatter { private List split(String cmd) { List strings = new ArrayList<>(); - Matcher matcher = Pattern.compile(OPTION_PATTERN).matcher(cmd); int index = 0; // first index of --option= while (matcher.find()) { - if (matcher.start() - index > 0) { + if (matcher.start() > index) { String option = cmd.substring(index, matcher.start()).trim(); strings.add(option); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4a913fe7/geode-core/src/test/java/org/apache/geode/management/internal/cli/util/HyphenFormatterTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/util/HyphenFormatterTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/util/HyphenFormatterTest.java index c9a3268..55fe9cf 100644 --- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/util/HyphenFormatterTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/util/HyphenFormatterTest.java @@ -207,4 +207,70 @@ public class HyphenFormatterTest { assertThat(formattedCmd).as(cmd).isEqualTo(expected); } + @Test + public void optionAfterOneJOption() { +String cmd = "start locator --name=loc1 --J=-Dfoo=bar --http-service=8080"; +String formattedCmd = this.formatter.formatCommand(cmd); +String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --http-service=8080"; +assertThat(formattedCmd).as(cmd).isEqualTo(expected); + } + + @Test + public void optionWithMoreThanOneHyphen() { +String cmd = "start locator --name=loc1 --http-service-port=8080"; +String formattedCmd = this.formatter.formatCommand(cmd); +String expected = "start locator --name=loc1 --http-service-port=8080"; +assertThat(formattedCmd).as(cmd).isEqualTo(expected); + } + + @Test + public void optionWithOneHyphenAfterOneJOption() { +String cmd = "start server --name=me3 --J=-Dgemfire.jmx-manager=true --redis-port=8080"; +String formattedCmd = this.formatter.formatCommand(cmd); +String expected = +"start server --name=me3 --J=\"-Dgemfire.jmx-manager=true\" --redis-port=8080"; +assertThat(formattedCmd).as(cmd).isEqualTo(expected); + } + + @Test // reproduces GEODE-2104 + public void optionWithMoreThanOneHyphenAfterOneJOption() { +String cmd = "start server --name=me3 --J=-Dgemfire.jmx-manager=true --http-service-port=8080"; +String formattedCmd = this.formatter.formatCommand(cmd); +String expected = +"start server --name=me3 --J=\"-Dgemfire.jmx-manager=true\"
[46/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/RegionSubRegionSnapshot.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java b/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java deleted file mode 100644 index 19f89b2..000 --- a/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java +++ /dev/null @@ -1,183 +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; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import org.apache.geode.DataSerializable; -import org.apache.geode.DataSerializer; -import org.apache.geode.cache.Region; -import org.apache.geode.i18n.LogWriterI18n; -import org.apache.geode.internal.cache.PartitionedRegion; - -/** - * Class RegionSubRegionSnapshot provides information about Regions. This - * also provides the information about sub regions This class is used by the monitoring tool. - * - * - * @since GemFire 5.7 - * @deprecated as of 7.0 use the management - * package instead - */ -public class RegionSubRegionSnapshot implements DataSerializable { - private static final long serialVersionUID = -8052137675270041871L; - - public RegionSubRegionSnapshot() { -this.parent = null; -this.subRegionSnapshots = new HashSet(); - } - - public RegionSubRegionSnapshot(Region reg) { -this(); -this.name = reg.getName(); -if (reg instanceof PartitionedRegion) { - PartitionedRegion p_reg = (PartitionedRegion) reg; - this.entryCount = p_reg.entryCount(true); -} else { - this.entryCount = reg.entrySet().size(); -} -final LogWriterI18n logger = reg.getCache().getLoggerI18n(); -if ((logger != null) && logger.fineEnabled()) { - logger.fine("RegionSubRegionSnapshot Region entry count =" + this.entryCount + " for region =" - + this.name); -} - } - - /** - * add the snapshot of sub region - * - * @param snap snapshot of sub region - * @return true if operation is successful - */ - public boolean addSubRegion(RegionSubRegionSnapshot snap) { -if (subRegionSnapshots.contains(snap)) { - return true; -} - -if (subRegionSnapshots.add(snap)) { - snap.setParent(this); - return true; -} - -return false; - } - - /** - * @return get entry count of region - */ - public final int getEntryCount() { -return entryCount; - } - - /** - * @param entryCount entry count of region - */ - public final void setEntryCount(int entryCount) { -this.entryCount = entryCount; - } - - /** - * @return name of region - */ - public final String getName() { -return name; - } - - /** - * @param name name of region - */ - public final void setName(String name) { -this.name = name; - } - - /** - * @return subRegionSnapshots of all the sub regions - */ - public final Set getSubRegionSnapshots() { -return subRegionSnapshots; - } - - /** - * @param subRegionSnapshots subRegionSnapshots of all the sub regions - */ - public final void setSubRegionSnapshots(Set subRegionSnapshots) { -this.subRegionSnapshots = subRegionSnapshots; - } - - /** - * @return snapshot of parent region - */ - public final RegionSubRegionSnapshot getParent() { -return parent; - } - - /** - * @param parent snapshot of parent region - */ - public final void setParent(RegionSubRegionSnapshot parent) { -this.parent = parent; - } - - /** - * - * @return full path of region - */ - public String getFullPath() { -return (getParent() == null ? "/" : getParent().getFullPath()) + getName() + "/"; - } - - public void toData(DataOutput out) throws IOException { -DataSerializer.writeString(this.name, out); -out.writeInt(this.entryCount); -DataSerializer.writeHashSet((HashSet) this.subRegionSnapshots, out); - } - - public void fromData(DataInput in) throws IOException, ClassNotFoundException { -this.name =
[26/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/internal/admin/api/impl/BackupDataStoreHelper.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java new file mode 100644 index 000..bf2d484 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java @@ -0,0 +1,74 @@ +/* + * 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.internal.admin.api.impl; + +import java.io.File; +import java.util.Map; +import java.util.Set; + +import org.apache.geode.cache.persistence.PersistentID; +import org.apache.geode.distributed.DistributedLockService; +import org.apache.geode.distributed.DistributedMember; +import org.apache.geode.distributed.internal.DM; +import org.apache.geode.internal.Assert; + +public class BackupDataStoreHelper { + + public static String LOCK_SERVICE_NAME = BackupDataStoreHelper.class.getSimpleName(); + + private static String LOCK_NAME = LOCK_SERVICE_NAME + "_token"; + + private static Object LOCK_SYNC = new Object(); + + @SuppressWarnings("rawtypes") + public static BackupDataStoreResult backupAllMembers(DM dm, Set recipients, File targetDir, + File baselineDir) { +FlushToDiskRequest.send(dm, recipients); + +boolean abort = true; +MapsuccessfulMembers; +Map existingDataStores; +try { + existingDataStores = PrepareBackupRequest.send(dm, recipients); + abort = false; +} finally { + successfulMembers = FinishBackupRequest.send(dm, recipients, targetDir, baselineDir, abort); +} +return new BackupDataStoreResult(existingDataStores, successfulMembers); + } + + private static DistributedLockService getLockService(DM dm) { +DistributedLockService dls = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME); +if (dls == null) { + synchronized (LOCK_SYNC) { +dls = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME); +if (dls == null) { + // Create the DistributedLockService + dls = DistributedLockService.create(LOCK_SERVICE_NAME, dm.getSystem()); +} + } +} +Assert.assertTrue(dls != null); +return dls; + } + + public static boolean obtainLock(DM dm) { +return getLockService(dm).lock(LOCK_NAME, 0, -1); + } + + public static void releaseLock(DM dm) { +getLockService(dm).unlock(LOCK_NAME); + } +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b6c305f8/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java new file mode 100644 index 000..b61e5c8 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java @@ -0,0 +1,48 @@ +/* + * 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.internal.admin.api.impl; + +import java.util.Map; +import java.util.Set; + +import
[23/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/internal/admin/api/impl/ManagedSystemMemberImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedSystemMemberImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedSystemMemberImpl.java new file mode 100644 index 000..abc6d01 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedSystemMemberImpl.java @@ -0,0 +1,258 @@ +/* + * 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.internal.admin.api.impl; + +import org.apache.geode.internal.admin.api.AdminException; +import org.apache.geode.internal.admin.api.ConfigurationParameter; +import org.apache.geode.internal.admin.api.ManagedEntityConfig; +import org.apache.geode.internal.admin.GemFireVM; + +import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS; + +/** + * A SystemMember that is also managed (or manageable) by the admin API. + * + * This class must be public so that its methods can be invoked reflectively (for MBean operations) + * on instances of its subclasses. + * + * @since GemFire 4.0 + */ +public abstract class ManagedSystemMemberImpl extends SystemMemberImpl +implements InternalManagedEntity { + + /** Controller for starting and stopping local or remote managers */ + protected ManagedEntityController controller; + + /** The state of this managed entity (see bug 32455) */ + private int state = UNKNOWN; + + /** A lock that is obtained while this entity's state changes */ + private final Object stateChange = new Object(); + + // Constructors // + + /** + * Creates a new ManagedSystemMemberImpl that represents an existing member of an + * AdminDistributedSystem. + */ + protected ManagedSystemMemberImpl(AdminDistributedSystemImpl system, GemFireVM vm) + throws AdminException { + +super(system, vm); +this.controller = system.getEntityController(); + } + + /** + * Creates a new ManagedSystemMemberImpl that represents a non-existing member with + * the given ManagedEntityConfig that has not yet been started. + */ + protected ManagedSystemMemberImpl(AdminDistributedSystemImpl system, ManagedEntityConfig config) + throws AdminException { + +super(system); +this.internalId = null; +this.id = getNewId(); +this.host = config.getHost(); +this.name = this.id; +this.controller = system.getEntityController(); + } + + // Instance Methods // + + public String getWorkingDirectory() { +return this.getEntityConfig().getWorkingDirectory(); + } + + public void setWorkingDirectory(String workingDirectory) { +this.getEntityConfig().setWorkingDirectory(workingDirectory); + } + + public String getProductDirectory() { +return this.getEntityConfig().getProductDirectory(); + } + + public void setProductDirectory(String productDirectory) { +this.getEntityConfig().setProductDirectory(productDirectory); + } + + @Override + public String getHost() { +return this.getEntityConfig().getHost(); + } + + public int setState(int state) { +if (this.stateChange == null) { + // The initial state is set in the constructor before + // stateChange is initialized. + int oldState = this.state; + this.state = state; + return oldState; + +} else { + synchronized (this.stateChange) { +int oldState = this.state; +this.state = state; + +this.stateChange.notifyAll(); + +return oldState; + } +} + } + + /** + * Returns whether or not this managed system member needs to be stopped. If this member is + * stopped or is stopping, then it does not need to be stopped. Otherwise, it will atomically + * place this member in the {@link #STOPPING} state. See bug 32455. + */ + protected boolean needToStop() { +synchronized (this.stateChange) { + if (this.state == STOPPED || this.state == STOPPING) { +return false; + + } else { +
[18/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/internal/admin/api/jmx/impl/AgentLauncher.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentLauncher.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentLauncher.java new file mode 100644 index 000..932fe21 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentLauncher.java @@ -0,0 +1,918 @@ +/* + * 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.internal.admin.api.jmx.impl; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.PrintStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.SortedMap; +import java.util.StringTokenizer; +import java.util.TreeMap; + +import org.apache.logging.log4j.Logger; + +import org.apache.geode.GemFireException; +import org.apache.geode.SystemFailure; +import org.apache.geode.internal.admin.api.AdminException; +import org.apache.geode.internal.admin.api.jmx.Agent; +import org.apache.geode.internal.admin.api.jmx.AgentConfig; +import org.apache.geode.internal.admin.api.jmx.AgentFactory; +import org.apache.geode.distributed.internal.DistributionManager; +import org.apache.geode.internal.OSProcess; +import org.apache.geode.internal.PureJavaMode; +import org.apache.geode.internal.net.SocketCreator; +import org.apache.geode.internal.i18n.LocalizedStrings; +import org.apache.geode.internal.logging.LogService; +import org.apache.geode.internal.util.IOUtils; +import org.apache.geode.internal.util.JavaCommandBuilder; + +/** + * A command line utility inspired by the CacheServerLauncher that is responsible for + * administering a stand-along GemFire JMX {@link Agent}. + * + * + * @since GemFire 3.5 + */ +public class AgentLauncher { + + private static final Logger logger = LogService.getLogger(); + + /** Should the launch command be printed? */ + public static final boolean PRINT_LAUNCH_COMMAND = + Boolean.getBoolean(AgentLauncher.class.getSimpleName() + ".PRINT_LAUNCH_COMMAND"); + + /* constants used to define state */ + static final int SHUTDOWN = 0; + static final int STARTING = 1; + static final int RUNNING = 2; + static final int SHUTDOWN_PENDING = 3; + static final int SHUTDOWN_PENDING_AFTER_FAILED_STARTUP = 4; + static final int UNKNOWN = 6; + + /** Agent configuration options */ + static final String AGENT_PROPS = "agent-props"; + + /** + * A flag to indicate if the current log file should be kept. Used only when 'start' is used to + * fork off the 'server' + */ + static final String APPENDTO_LOG_FILE = "appendto-log-file"; + + /** optional and additional classpath entries */ + static final String CLASSPATH = "classpath"; + + /** The directory argument */ + static final String DIR = "dir"; + + /** Extra VM arguments */ + static final String VMARGS = "vmargs"; + + /** The directory in which the agent's output resides */ + private File workingDirectory = null; + + /** The Status object for the agent */ + private Status status = null; + + /** base name for the agent to be launched */ + private final String basename; + + /** The name for the start up log file */ + private final String startLogFileName; + + /** The name of the status file */ + private final String statusFileName; + + /** + * Instantiates an AgentLauncher for execution and control of the GemFire JMX Agent process. This + * constructor is package private to prevent direct instantiation or subclassing by classes + * outside this package, but does allow the class to be tested as needed. + * + * + * @param basename base name for the application to be launched + */ + AgentLauncher(final
[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
[48/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal
GEODE-288: move admin packages to internal * org.apache.geode.admin (old Admin API) moves to org.apache.geode.internal.admin.api * org.apache.geode.admin.internal (old Amin API implementation) moves to org.apache.geode.internal.admin.api.impl * org.apache.geode.admin.jmx (old JMX API) moves to org.apache.geode.internal.admin.api.jmx * org.apache.geode.admin.jmx.internal (old JMX API implementation) moves to org.apache.geode.internal.admin.api.jmx.impl Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/b6c305f8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/b6c305f8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/b6c305f8 Branch: refs/heads/feature/GEODE-288 Commit: b6c305f88b9708d8bfeb9d5d8bff9fc950bf4d5c Parents: 0c9002b Author: Kirk LundAuthored: Wed Oct 26 15:10:49 2016 -0700 Committer: Kirk Lund Committed: Tue Nov 15 12:23:50 2016 -0800 -- geode-core/build.gradle |1 - .../java/org/apache/geode/DataSerializer.java |2 +- .../org/apache/geode/admin/AdminConfig.java | 148 -- .../geode/admin/AdminDistributedSystem.java | 434 .../admin/AdminDistributedSystemFactory.java| 148 -- .../org/apache/geode/admin/AdminException.java | 81 - .../apache/geode/admin/AdminXmlException.java | 44 - .../main/java/org/apache/geode/admin/Alert.java | 53 - .../java/org/apache/geode/admin/AlertLevel.java | 168 -- .../org/apache/geode/admin/AlertListener.java | 30 - .../org/apache/geode/admin/BackupStatus.java| 46 - .../geode/admin/CacheDoesNotExistException.java | 80 - .../apache/geode/admin/CacheHealthConfig.java | 151 -- .../org/apache/geode/admin/CacheServer.java | 43 - .../apache/geode/admin/CacheServerConfig.java | 50 - .../java/org/apache/geode/admin/CacheVm.java| 35 - .../org/apache/geode/admin/CacheVmConfig.java | 51 - .../geode/admin/ConfigurationParameter.java | 72 - .../geode/admin/DistributedSystemConfig.java| 626 - .../admin/DistributedSystemHealthConfig.java| 74 - .../apache/geode/admin/DistributionLocator.java | 45 - .../geode/admin/DistributionLocatorConfig.java | 81 - .../org/apache/geode/admin/GemFireHealth.java | 209 -- .../apache/geode/admin/GemFireHealthConfig.java | 54 - .../apache/geode/admin/GemFireMemberStatus.java | 670 - .../org/apache/geode/admin/ManagedEntity.java | 100 - .../apache/geode/admin/ManagedEntityConfig.java | 88 - .../apache/geode/admin/MemberHealthConfig.java | 142 - .../admin/OperationCancelledException.java | 47 - .../geode/admin/RegionNotFoundException.java| 39 - .../geode/admin/RegionSubRegionSnapshot.java| 183 -- .../geode/admin/RuntimeAdminException.java | 48 - .../java/org/apache/geode/admin/Statistic.java | 64 - .../apache/geode/admin/StatisticResource.java | 82 - .../org/apache/geode/admin/SystemMember.java| 145 -- .../geode/admin/SystemMemberBridgeServer.java | 307 --- .../apache/geode/admin/SystemMemberCache.java | 183 -- .../geode/admin/SystemMemberCacheEvent.java | 33 - .../geode/admin/SystemMemberCacheListener.java | 76 - .../geode/admin/SystemMemberCacheServer.java| 308 --- .../apache/geode/admin/SystemMemberRegion.java | 314 --- .../geode/admin/SystemMemberRegionEvent.java| 31 - .../apache/geode/admin/SystemMemberType.java| 150 -- .../geode/admin/SystemMembershipEvent.java | 42 - .../geode/admin/SystemMembershipListener.java | 59 - .../UnmodifiableConfigurationException.java | 81 - .../admin/internal/AbstractHealthEvaluator.java | 170 -- .../internal/AdminDistributedSystemImpl.java| 2400 - .../admin/internal/BackupDataStoreHelper.java | 74 - .../admin/internal/BackupDataStoreResult.java | 48 - .../geode/admin/internal/BackupStatusImpl.java | 59 - .../admin/internal/CacheHealthConfigImpl.java | 91 - .../admin/internal/CacheHealthEvaluator.java| 306 --- .../admin/internal/CacheServerConfigImpl.java | 133 - .../geode/admin/internal/CacheServerImpl.java | 190 -- .../internal/ConfigurationParameterImpl.java| 282 -- .../ConfigurationParameterListener.java | 30 - .../DisabledManagedEntityController.java| 94 - .../internal/DistributedSystemConfigImpl.java | 1109 .../DistributedSystemHealthConfigImpl.java | 53 - .../DistributedSystemHealthEvaluator.java | 167 -- .../DistributedSystemHealthMonitor.java | 461 .../internal/DistributionLocatorConfigImpl.java | 194 -- .../admin/internal/DistributionLocatorImpl.java | 329 --- .../EnabledManagedEntityController.java | 385 --- .../admin/internal/FinishBackupRequest.java | 173 --
[24/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/internal/admin/api/impl/GemFireHealthImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthImpl.java new file mode 100644 index 000..fc40261 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthImpl.java @@ -0,0 +1,514 @@ +/* + * 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.internal.admin.api.impl; + +import org.apache.geode.CancelException; +import org.apache.geode.internal.Assert; +import org.apache.geode.internal.admin.*; +import org.apache.geode.internal.admin.api.AdminDistributedSystem; +import org.apache.geode.internal.admin.api.DistributedSystemHealthConfig; +import org.apache.geode.internal.admin.api.GemFireHealth; +import org.apache.geode.internal.admin.api.GemFireHealthConfig; +import org.apache.geode.internal.i18n.LocalizedStrings; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.*; + +/** + * Provides the implementation of the GemFireHealth administration API. This class is + * responsible for {@linkplain GemFireVM#addHealthListener sending} the {@link GemFireHealthConfig}s + * to the remote member VM in which the health is calcualted. + * + * + * @since GemFire 3.5 + */ +public class GemFireHealthImpl implements GemFireHealth, JoinLeaveListener, HealthListener { + + /** The distributed system whose health is being monitored */ + private final GfManagerAgent agent; + + /** The default configuration for checking GemFire health */ + protected GemFireHealthConfig defaultConfig; + + /** + * Maps the name of a host to its GemFireHealthConfig. Note that the mappings are + * created lazily. + */ + private final Map hostConfigs; + + /** + * Maps the name of a host to all of the members (GemFireVMs) that run on that host. + */ + private final Map hostMembers; + + /** The members that are known to be in {@link #OKAY_HEALTH}. */ + private Collection okayHealth; + + /** The members that are known to be in {@link #POOR_HEALTH}. */ + private Collection poorHealth; + + /** The overall health of GemFire */ + private GemFireHealth.Health overallHealth; + + /** Is this GemFireHealthImpl closed? */ + private boolean isClosed; + + /** + * The configuration specifying how the health of the distributed system should be computed. + */ + protected volatile DistributedSystemHealthConfig dsHealthConfig; + + /** Monitors the health of the entire distributed system */ + private DistributedSystemHealthMonitor dsHealthMonitor = null; + + /** + * The distributed system whose health is monitored by this GemFireHealth. + */ + private final AdminDistributedSystem system; + + + /// Constructors /// + + /** + * Creates a new GemFireHealthImpl that monitors the health of member of the given + * distributed system. + */ + protected GemFireHealthImpl(GfManagerAgent agent, AdminDistributedSystem system) { +// agent.getDM().getLogger().info("Creating GemFireHealthImpl", +// new Exception("Stack trace")); + +this.agent = agent; +this.system = system; + +this.hostConfigs = new HashMap(); +this.hostMembers = new HashMap(); +this.okayHealth = new HashSet(); +this.poorHealth = new HashSet(); +this.overallHealth = GOOD_HEALTH; +this.isClosed = false; + +GemFireVM[] apps = this.agent.listApplications(); +for (int i = 0; i < apps.length; i++) { + GemFireVM member = apps[i]; + this.noteNewMember(member); +} + +agent.addJoinLeaveListener(this); +setDefaultGemFireHealthConfig(createGemFireHealthConfig(null)); +setDistributedSystemHealthConfig(createDistributedSystemHealthConfig()); + } + + @Override + public String toString() { +StringBuffer sb = new StringBuffer(); +sb.append("closed=" + isClosed); +sb.append("; hostMembers=" + hostMembers); +sb.append("; okayHealth=" +
[47/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/CacheVmConfig.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/CacheVmConfig.java b/geode-core/src/main/java/org/apache/geode/admin/CacheVmConfig.java deleted file mode 100755 index 81f4a38..000 --- a/geode-core/src/main/java/org/apache/geode/admin/CacheVmConfig.java +++ /dev/null @@ -1,51 +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; - -/** - * Configuration for a GemFire cache server VM that is managed by the administration API. The VM may - * or may not be running. - * - * @see AdminDistributedSystem#addCacheVm() - * - * @since GemFire 5.7 - * @deprecated as of 7.0 use the management - * package instead - */ -public interface CacheVmConfig extends ManagedEntityConfig { - /** - * Returns the cache.xml declarative caching initialization file used to configure - * this cache server VM. By default, a cache server VM is started without an XML file. - */ - public String getCacheXMLFile(); - - /** - * Sets the cache.xml declarative caching initialization file used to configure this - * cache server VM. - */ - public void setCacheXMLFile(String cacheXml); - - /** - * Returns the location(s) of user classes (such as cache loaders) required by the cache server - * VM. - */ - public String getClassPath(); - - /** - * Sets the location(s) of user classes (such as cache loaders) required by the cache server VM. - */ - public void setClassPath(String classpath); -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b6c305f8/geode-core/src/main/java/org/apache/geode/admin/ConfigurationParameter.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/ConfigurationParameter.java b/geode-core/src/main/java/org/apache/geode/admin/ConfigurationParameter.java deleted file mode 100755 index 74e1510..000 --- a/geode-core/src/main/java/org/apache/geode/admin/ConfigurationParameter.java +++ /dev/null @@ -1,72 +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; - -/** - * A single configuration parameter of a {@link SystemMember}. - * - * @since GemFire 3.5 - * - * @deprecated as of 7.0 use the management - * package instead - */ -public interface ConfigurationParameter { - - /** Gets the identifying name of this configuration parameter. */ - public String getName(); - - /** Gets the full description of this configuration parameter */ - public String getDescription(); - - /** Gets the current value */ - public Object getValue(); - - /** Gets the current value as a string */ - public String getValueAsString(); - - /** Gets the class type of the value */ - public Class getValueType(); - - /** True if this is modifiable; false if read-only */ - public boolean isModifiable(); - - /** Returns true if this config parameter uses a string array for value. */ - public boolean isArray(); - - /** Returns true if this config parameter represents an InetAddress value. */ - public boolean isInetAddress(); - - /** Returns true if this config parameter represents a File value. */ - public boolean isFile(); - - /** Returns true if this config parameter represents an octal value. */ -
[30/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/internal/admin/api/AlertLevel.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertLevel.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertLevel.java new file mode 100755 index 000..1bcc0e6 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertLevel.java @@ -0,0 +1,168 @@ +/* + * 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.internal.admin.api; + +import org.apache.geode.internal.admin.Alert; +import org.apache.geode.internal.i18n.LocalizedStrings; + +/** + * Type-safe enumeration for {@link org.apache.geode.internal.admin.api.Alert Alert} level. + * + * @since GemFire 3.5 + * @deprecated as of 7.0 use the management + * package instead + */ +public class AlertLevel implements java.io.Serializable { + private static final long serialVersionUID = -4752438966587392126L; + + public static final AlertLevel WARNING = new AlertLevel(Alert.WARNING, "WARNING"); + public static final AlertLevel ERROR = new AlertLevel(Alert.ERROR, "ERROR"); + public static final AlertLevel SEVERE = new AlertLevel(Alert.SEVERE, "SEVERE"); + + public static final AlertLevel OFF = new AlertLevel(Alert.OFF, "OFF"); + + /** The severity level of this AlertLevel. Greater is more severe. */ + private final transient int severity; + + /** The name of this AlertLevel. */ + private final transient String name; + + // The 4 declarations below are necessary for serialization + /** int used as ordinal to represent this AlertLevel */ + public final int ordinal = nextOrdinal++; + + private static int nextOrdinal = 0; + + private static final AlertLevel[] VALUES = {WARNING, ERROR, SEVERE, OFF}; + + private Object readResolve() throws java.io.ObjectStreamException { +return VALUES[ordinal]; // Canonicalize + } + + /** Creates a new instance of AlertLevel. */ + private AlertLevel(int severity, String name) { +this.severity = severity; +this.name = name; + } + + /** Return the AlertLevel represented by specified ordinal */ + public static AlertLevel fromOrdinal(int ordinal) { +return VALUES[ordinal]; + } + + /** + * Returns the AlertLevel for the given severity + * + * @throws IllegalArgumentException If there is no alert level with the given + * severity + */ + public static AlertLevel forSeverity(int severity) { +switch (severity) { + case Alert.WARNING: +return AlertLevel.WARNING; + case Alert.ERROR: +return AlertLevel.ERROR; + case Alert.SEVERE: +return AlertLevel.SEVERE; + case Alert.OFF: +return AlertLevel.OFF; + default: +throw new IllegalArgumentException(LocalizedStrings.AlertLevel_UNKNOWN_ALERT_SEVERITY_0 +.toLocalizedString(Integer.valueOf(severity))); +} + } + + /** + * Returns the AlertLevel with the given name + * + * @throws IllegalArgumentException If there is no alert level named name + */ + public static AlertLevel forName(String name) { +for (int i = 0; i < VALUES.length; i++) { + AlertLevel level = VALUES[i]; + if (level.getName().equalsIgnoreCase(name)) { +return level; + } +} + +throw new IllegalArgumentException( + LocalizedStrings.AlertLevel_THERE_IS_NO_ALERT_LEVEL_0.toLocalizedString(name)); + } + + public int getSeverity() { +return this.severity; + } + + public String getName() { +return this.name; + } + + public static AlertLevel[] values() { +return VALUES; + } + + /** + * Returns a string representation for this alert level. + * + * @return the name of this alert level + */ + @Override + public String toString() { +return this.name /* + "=" + this.severity */; + } + + /** + * Indicates whether some other object is "equal to" this one. + * + * @param other the reference object with which to compare. + * @return true if this object is the same as the obj argument; false otherwise. + */ + @Override + public boolean equals(Object
[44/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/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/b6c305f8/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 + ",
[43/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/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 -
[34/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/jmx/internal/MX4JModelMBean.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java deleted file mode 100755 index d3f4ab2..000 --- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java +++ /dev/null @@ -1,1232 +0,0 @@ -/* - * Copyright (C) MX4J. All rights reserved. - * - * This software is distributed under the terms of the MX4J License version 1.0. See the terms of - * the MX4J License in the documentation provided with this software. - */ - -package org.apache.geode.admin.jmx.internal; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Date; -import java.util.Iterator; - -import javax.management.Attribute; -import javax.management.AttributeChangeNotification; -import javax.management.AttributeChangeNotificationFilter; -import javax.management.AttributeList; -import javax.management.AttributeNotFoundException; -import javax.management.Descriptor; -import javax.management.InstanceNotFoundException; -import javax.management.InvalidAttributeValueException; -import javax.management.ListenerNotFoundException; -import javax.management.MBeanAttributeInfo; -import javax.management.MBeanException; -import javax.management.MBeanInfo; -import javax.management.MBeanNotificationInfo; -import javax.management.MBeanOperationInfo; -import javax.management.MBeanRegistration; -import javax.management.MBeanRegistrationException; -import javax.management.MBeanServer; -import javax.management.MalformedObjectNameException; -import javax.management.Notification; -import javax.management.NotificationBroadcasterSupport; -import javax.management.NotificationEmitter; -import javax.management.NotificationFilter; -import javax.management.NotificationListener; -import javax.management.ObjectName; -import javax.management.ReflectionException; -import javax.management.RuntimeErrorException; -import javax.management.RuntimeOperationsException; -import javax.management.ServiceNotFoundException; -import javax.management.loading.ClassLoaderRepository; -import javax.management.modelmbean.InvalidTargetObjectTypeException; -import javax.management.modelmbean.ModelMBean; -import javax.management.modelmbean.ModelMBeanAttributeInfo; -import javax.management.modelmbean.ModelMBeanInfo; -import javax.management.modelmbean.ModelMBeanOperationInfo; - -import mx4j.ImplementationException; -import mx4j.log.FileLogger; -import mx4j.log.Log; -import mx4j.log.Logger; -import mx4j.log.MBeanLogger; -import mx4j.persist.FilePersister; -import mx4j.persist.MBeanPersister; -import mx4j.persist.PersisterMBean; -import mx4j.util.Utils; - -import org.apache.geode.internal.i18n.LocalizedStrings; - -/** - * @author mailto:biorn_stee...@users.sourceforge.net;>Simone Bordet - * @version $Revision: 1.14 $ - */ -public class MX4JModelMBean implements ModelMBean, MBeanRegistration, NotificationEmitter { - private static final String OBJECT_RESOURCE_TYPE = "ObjectReference"; - - private static final int ALWAYS_STALE = 1; - private static final int NEVER_STALE = 2; - private static final int STALE = 3; - private static final int NOT_STALE = 4; - - private static final int PERSIST_NEVER = -1; - private static final int PERSIST_ON_TIMER = -2; - private static final int PERSIST_ON_UPDATE = -3; - private static final int PERSIST_NO_MORE_OFTEN_THAN = -4; - - private MBeanServer m_mbeanServer; - private Object m_managedResource; - private boolean m_canBeRegistered; - private ModelMBeanInfo m_modelMBeanInfo; - private NotificationBroadcasterSupport m_attributeChangeBroadcaster = - new NotificationBroadcasterSupport(); - private NotificationBroadcasterSupport m_generalBroadcaster = - new NotificationBroadcasterSupport(); - - public MX4JModelMBean() throws MBeanException, RuntimeOperationsException { -try { - load(); -} catch (Exception x) { - Logger logger = getLogger(); - logger.warn(LocalizedStrings.MX4JModelMBean_CANNOT_RESTORE_PREVIOUSLY_SAVED_STATUS - .toLocalizedString(), x); -} - } - - public MX4JModelMBean(ModelMBeanInfo info) throws MBeanException, RuntimeOperationsException { -if (info == null) - throw new RuntimeOperationsException(new IllegalArgumentException( - LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_PARAMETER_CANT_BE_NULL - .toLocalizedString())); -else - setModelMBeanInfo(info); - } - - private Logger getLogger() { -return Log.getLogger(getClass().getName()); - } - - public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { -if (m_canBeRegistered) { - m_mbeanServer = server; - return name; -}
[27/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/internal/admin/api/impl/AdminDistributedSystemImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AdminDistributedSystemImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AdminDistributedSystemImpl.java new file mode 100755 index 000..ef0012f --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AdminDistributedSystemImpl.java @@ -0,0 +1,2418 @@ +/* + * 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.internal.admin.api.impl; + +import org.apache.geode.CancelException; +import org.apache.geode.SystemFailure; +import org.apache.geode.internal.admin.api.AdminException; +import org.apache.geode.internal.admin.api.Alert; +import org.apache.geode.internal.admin.api.AlertLevel; +import org.apache.geode.internal.admin.api.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.api.AdminDistributedSystem; +import org.apache.geode.internal.admin.api.BackupStatus; +import org.apache.geode.internal.admin.api.CacheServer; +import org.apache.geode.internal.admin.api.CacheServerConfig; +import org.apache.geode.internal.admin.api.CacheVm; +import org.apache.geode.internal.admin.api.ConfigurationParameter; +import org.apache.geode.internal.admin.api.DistributedSystemConfig; +import org.apache.geode.internal.admin.api.DistributionLocator; +import org.apache.geode.internal.admin.api.DistributionLocatorConfig; +import org.apache.geode.internal.admin.api.GemFireHealth; +import org.apache.geode.internal.admin.api.ManagedEntity; +import org.apache.geode.internal.admin.api.ManagedEntityConfig; +import org.apache.geode.internal.admin.api.OperationCancelledException; +import org.apache.geode.internal.admin.api.RuntimeAdminException; +import org.apache.geode.internal.admin.api.SystemMember; +import org.apache.geode.internal.admin.api.SystemMemberCacheListener; +import org.apache.geode.internal.admin.api.SystemMembershipEvent; +import org.apache.geode.internal.admin.api.SystemMembershipListener; +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 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
[10/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/test/java/org/apache/geode/admin/internal/HealthEvaluatorTestCase.java -- diff --git a/geode-core/src/test/java/org/apache/geode/admin/internal/HealthEvaluatorTestCase.java b/geode-core/src/test/java/org/apache/geode/admin/internal/HealthEvaluatorTestCase.java deleted file mode 100644 index c61cbd0..000 --- a/geode-core/src/test/java/org/apache/geode/admin/internal/HealthEvaluatorTestCase.java +++ /dev/null @@ -1,71 +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.distributed.DistributedSystem; -import org.apache.geode.distributed.internal.InternalDistributedSystem; -import org.junit.After; -import org.junit.Before; - -import java.util.Properties; - -import static org.apache.geode.distributed.ConfigurationProperties.*; - -/** - * Superclass of tests for the {@linkplain org.apache.geode.admin.internal.AbstractHealthEvaluator - * health evaluator} classes. - * - * - * @since GemFire 3.5 - */ -public abstract class HealthEvaluatorTestCase { - - /** The DistributedSystem used for this test */ - protected InternalDistributedSystem system; - - /** - * Creates a "loner" DistributedSystem for this test. - */ - @Before - public void setUp() { -Properties props = getProperties(); -system = (InternalDistributedSystem) DistributedSystem.connect(props); - } - - /** - * Closes the "loner" DistributedSystem - */ - @After - public void tearDown() { -if (this.system != null) { - this.system.disconnect(); -} - -this.system = null; - } - - /** - * Creates the Properties objects used to connect to the distributed system. - */ - protected Properties getProperties() { -Properties props = new Properties(); -props.setProperty(MCAST_PORT, "0"); -props.setProperty(LOCATORS, ""); -props.setProperty(STATISTIC_SAMPLING_ENABLED, "true"); - -return props; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b6c305f8/geode-core/src/test/java/org/apache/geode/admin/internal/MemberHealthEvaluatorJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/admin/internal/MemberHealthEvaluatorJUnitTest.java b/geode-core/src/test/java/org/apache/geode/admin/internal/MemberHealthEvaluatorJUnitTest.java deleted file mode 100644 index d20ce36..000 --- a/geode-core/src/test/java/org/apache/geode/admin/internal/MemberHealthEvaluatorJUnitTest.java +++ /dev/null @@ -1,96 +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 static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import org.apache.geode.admin.GemFireHealth; -import org.apache.geode.admin.GemFireHealthConfig; -import org.apache.geode.internal.statistics.GemFireStatSampler; -import org.apache.geode.internal.statistics.platform.ProcessStats; -import org.apache.geode.internal.PureJavaMode; -import org.apache.geode.test.junit.categories.IntegrationTest; - -/** - * Contains simple tests for the {@link MemberHealthEvaluator}. - *
[33/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/jmx/internal/MemberInfoWithStatsMBean.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java deleted file mode 100644 index 40a514a..000 --- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java +++ /dev/null @@ -1,1347 +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.jmx.internal; - -import static org.apache.geode.distributed.ConfigurationProperties.*; - -import org.apache.geode.admin.*; -import org.apache.geode.admin.jmx.Agent; -import org.apache.geode.cache.InterestPolicy; -import org.apache.geode.cache.SubscriptionAttributes; -import org.apache.geode.distributed.internal.DistributionConfig; -import org.apache.geode.internal.GemFireVersion; -import org.apache.geode.internal.admin.remote.ClientHealthStats; -import org.apache.geode.internal.i18n.LocalizedStrings; -import org.apache.geode.internal.logging.LogService; -import org.apache.geode.internal.logging.log4j.LocalizedMessage; -import mx4j.AbstractDynamicMBean; -import org.apache.logging.log4j.Logger; - -import javax.management.*; -import java.net.InetAddress; -import java.text.MessageFormat; -import java.util.*; -import java.util.concurrent.atomic.AtomicLong; - -/** - * This class uses the JMX Attributes/Operations that use (return/throw) GemFire types. This is the - * single MBean accessible with ObjectName string {@link MemberInfoWithStatsMBean#MBEAN_NAME}}. This - * MBean can be used to retrieve the all member details as plain java types. - * - * This MBean also acts as a Notification Hub for all the Notifications that are defined for Admin - * Distributed System. - * - * - * @since GemFire 6.5 - */ -public class MemberInfoWithStatsMBean extends AbstractDynamicMBean implements NotificationEmitter { - private static final Logger logger = LogService.getLogger(); - - /* constants defining max no of attributes/operations/notifications */ - private static final int MAX_ATTRIBUTES_COUNT = 3; - private static final int MAX_OPERATIONS_COUNT = 3; - private static final int MAX_NOTIFICATIONS_COUNT = 9; - - private static final String NOT_AVAILABLE_STR = "N/A"; - private static final String NOT_AVAILABLE = null; - private static final Number NOT_AVAILABLE_NUMBER = null; - - /* - * String constant used for a region that is used on admin side just as a root for rootRegions - * defined on the member - */ - private static final String PLACE_HOLDER_ROOT_REGION = "/Root/"; - - /* String that are used to form QueryExp/ObjectName for querying MBeanServer */ - private static final String REGION_QUERY_EXPRESSION = "*GemFire.Cache*:*,owner={0},type=Region"; - private static final String STATS_QUERY_EXPRESSION = "*GemFire.Statistic*:*,source={0},name={1}"; - - /** mbean name string for this MBean */ - /* default */static final String MBEAN_NAME = "GemFire:type=MemberInfoWithStatsMBean"; - - /** ObjectName handle for this MBean */ - private ObjectName objectName; - - /** version of the GemFire Enterprise system that is running */ - private String version; - private int refreshInterval; - private String id; - - private Agent agent; - private AdminDistributedSystemJmxImpl adminDSJmx; - - private NotificationForwarder forwarder; - private boolean isInitialized;// needs synchronization? - - /** - * Default Constructor - * - * @param agent Admin Agent instance - * @throws OperationsException if ObjectName can't be formed for this MBean - * @throws MBeanRegistrationException - * @throws AdminException - */ - MemberInfoWithStatsMBean(Agent agent) - throws OperationsException, MBeanRegistrationException, AdminException { -this.agent = agent; -this.objectName = ObjectName.getInstance(MBEAN_NAME); -this.version = GemFireVersion.getGemFireVersion(); -this.refreshInterval = -1; -this.id = NOT_AVAILABLE_STR; -this.forwarder = new
[09/50] [abbrv] incubator-geode git commit: GEODE-1617: add test for region names
GEODE-1617: add test for region names Added comprehensive test to validate region names This closes #285 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/0c9002b2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/0c9002b2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/0c9002b2 Branch: refs/heads/feature/GEODE-288 Commit: 0c9002b205e64cb248ab6ab26f2df27bf821c54c Parents: b35e2a4 Author: Kevin DulingAuthored: Tue Nov 15 09:33:59 2016 -0800 Committer: Kirk Lund Committed: Tue Nov 15 12:02:53 2016 -0800 -- .../geode/internal/cache/LocalRegion.java | 2 +- .../cache/RegionNameValidationJUnitTest.java| 91 2 files changed, 92 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c9002b2/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java index fd4b6c7..80fc5da 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java @@ -7578,7 +7578,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory, this.entries.removeEntry(event.getKey(), re, false); } - static void validateRegionName(String name, InternalRegionArguments internalRegionArgs) { + public static void validateRegionName(String name, InternalRegionArguments internalRegionArgs) { if (name == null) { throw new IllegalArgumentException( LocalizedStrings.LocalRegion_NAME_CANNOT_BE_NULL.toLocalizedString()); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c9002b2/geode-core/src/test/java/org/apache/geode/cache/RegionNameValidationJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/cache/RegionNameValidationJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/RegionNameValidationJUnitTest.java new file mode 100644 index 000..365b68c --- /dev/null +++ b/geode-core/src/test/java/org/apache/geode/cache/RegionNameValidationJUnitTest.java @@ -0,0 +1,91 @@ +/* + * 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.cache; + +import static org.junit.Assert.fail; + +import org.apache.geode.internal.cache.InternalRegionArguments; +import org.apache.geode.internal.cache.LocalRegion; +import org.apache.geode.test.junit.categories.UnitTest; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +@Category(UnitTest.class) +public class RegionNameValidationJUnitTest { + private static final Pattern NAME_PATTERN = Pattern.compile("[aA-zZ0-9-_.]+"); + private static final String REGION_NAME = "MyRegion"; + + + @Test + public void testInvalidNames() { +InternalRegionArguments ira = new InternalRegionArguments(); +ira.setInternalRegion(false); +try { + LocalRegion.validateRegionName(null, ira); + fail(); +} catch (IllegalArgumentException ignore) { +} +try { + LocalRegion.validateRegionName("", ira); + fail(); +} catch (IllegalArgumentException ignore) { +} +try { + LocalRegion.validateRegionName("FOO" + Region.SEPARATOR, ira); + fail(); +} catch (IllegalArgumentException ignore) { +} + + } + + @Test + public void testExternalRegionNames() { +InternalRegionArguments ira = new InternalRegionArguments(); +ira.setInternalRegion(false); +validateCharacters(ira); +try { + LocalRegion.validateRegionName("__InvalidInternalRegionName", ira); + fail(); +} catch (IllegalArgumentException ignore) { +} + } +
[50/50] [abbrv] incubator-geode git commit: Fix format
Fix format Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/c672bf2b Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/c672bf2b Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/c672bf2b Branch: refs/heads/feature/GEODE-288 Commit: c672bf2b852b95c5d5fce617538b4ce1a616c7d7 Parents: c56dbaf Author: Kirk LundAuthored: Tue Nov 15 13:21:21 2016 -0800 Committer: Kirk Lund Committed: Tue Nov 15 13:21:21 2016 -0800 -- .../apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c672bf2b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java index 91b8bec..5a0d3fc 100644 --- a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java @@ -122,7 +122,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase { } public void createPool(final String poolName, final String[] servers, final int[] ports, - final boolean subscriptionEnabled) { + final boolean subscriptionEnabled) { // Create Cache. getCache(true); @@ -685,7 +685,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase { } private void executeQueriesForClientServerQueriesWithParams(SelectResults results, - QueryService qService, Object[][] params, int[] expectedResults) { + QueryService qService, Object[][] params, int[] expectedResults) { for (int i = 0; i < queryString.length; i++) { try { logger.info("### Executing Query :" + queryString[i]);
[04/50] [abbrv] incubator-geode git commit: GEODE-2101 Improve WAN topology terminology in docs
GEODE-2101 Improve WAN topology terminology in docs The terms parallel and serial are not right, so change them: - a parallel multi-site topology is a fully connected mesh - a serial multi-site topology is a ring Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/c9e3b054 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/c9e3b054 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/c9e3b054 Branch: refs/heads/feature/GEODE-288 Commit: c9e3b05405a2e82a00f9b3ac15ed259a2829a053 Parents: ddc4819 Author: Karen MillerAuthored: Mon Nov 14 10:07:14 2016 -0800 Committer: Karen Miller Committed: Mon Nov 14 15:56:24 2016 -0800 -- .../multisite_topologies.html.md.erb| 69 1 file changed, 55 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c9e3b054/geode-docs/topologies_and_comm/multi_site_configuration/multisite_topologies.html.md.erb -- diff --git a/geode-docs/topologies_and_comm/multi_site_configuration/multisite_topologies.html.md.erb b/geode-docs/topologies_and_comm/multi_site_configuration/multisite_topologies.html.md.erb index 4b5753b..b710b8d 100644 --- a/geode-docs/topologies_and_comm/multi_site_configuration/multisite_topologies.html.md.erb +++ b/geode-docs/topologies_and_comm/multi_site_configuration/multisite_topologies.html.md.erb @@ -27,41 +27,82 @@ This section describes Geode's support for various topologies. Depending on your - When a Geode site receives a message from a gateway sender, it forwards it to the other sites it knows about, excluding those sites that it knows have already seen the message. Each message contains the initial sender's ID and the ID of each of the sites the initial sender sent to, so no site forwards to those sites. However, messages do not pick up the ID of the sites they pass through, so it is possible in certain topologies for more than one copy of a message to be sent to one site. - In some configurations, the loss of one site affects how other sites communicate with one another. -## Parallel Multi-site Topology - -A parallel network topology is one where all sites know about each other. This is a robust configuration, where any one of the sites can go down without disrupting communication between the other sites. A parallel topology also guarantees that no site receives multiple copies of the same message. - -The parallel topology for three sites is shown in this figure. In this scenario, if site 1 sends an update to site 2, site 2 forwards to site 3. If site 1 sends an update to sites 2 and 3, neither forwards to the other. Likewise for any other initiating site. If any site is removed, the remaining two maintain a parallel topology. +## Fully Connected Mesh Topology + +A fully connected mesh network topology is one in which all sites +know about each other. +This is a robust configuration, +as any one of the sites can go down without disrupting communication +between the other sites. +A fully connected mesh topology also guarantees that no site receives +multiple copies of the same message. + +A fully connected mesh with three sites is shown in this figure. +In this scenario, if site 1 sends an update to site 2, +site 2 forwards to site 3. +If site 1 sends an update to sites 2 and 3, +neither forwards to the other. +This is likewise true for any other initiating site. +If any site is removed, the remaining two are still fully connected. -## Serial Multi-site Topology +## Ring Topology -A serial network topology is one where each site only knows about one other site. Data is passed from one site to the next serially. This figure shows the topology for three sites. In this scenario, if site 1 sends updates to site 2, site 2 forwards to site 3. Site 3 does not send the updates back to site 1. +A ring topology is one in which each site forwards information +to one other site, +and the sites are connected in a circular manner. +This figure shows a ring with three sites. +In this topology, if site 1 sends updates to site 2, +site 2 forwards the updates to site 3. +No updates are forwarded to the original sender, +so site 3 does not send the updates back to site 1. -The serial topology guarantees that every site receives one copy of each message sent by any site. With a serial installation, every site must stay up to maintain the topology. The failure of any site breaks the serial link. If site 2 went down, for example, site 3 could send to site 1, but site 1 could not send to site 3. +A ring topology guarantees that every site receives one copy of +each message sent by any site. +In a
[20/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/internal/admin/api/jmx/impl/AgentConfigImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentConfigImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentConfigImpl.java new file mode 100644 index 000..5652b1a --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentConfigImpl.java @@ -0,0 +1,1911 @@ +/* + * 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.internal.admin.api.jmx.impl; + +import static org.apache.geode.distributed.ConfigurationProperties.*; +import static org.apache.geode.distributed.internal.DistributionConfig.*; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.net.InetAddress; +import java.net.URL; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.Properties; +import java.util.StringTokenizer; + +import org.apache.geode.GemFireIOException; +import org.apache.geode.internal.admin.api.DistributedSystemConfig; +import org.apache.geode.internal.admin.api.DistributionLocatorConfig; +import org.apache.geode.internal.admin.api.impl.DistributedSystemConfigImpl; +import org.apache.geode.internal.admin.api.impl.InetAddressUtil; +import org.apache.geode.internal.admin.api.jmx.Agent; +import org.apache.geode.internal.admin.api.jmx.AgentConfig; +import org.apache.geode.internal.ClassPathLoader; +import org.apache.geode.internal.i18n.LocalizedStrings; +import org.apache.geode.internal.util.IOUtils; + +/** + * Provides the JMX Agent configuration properties. + * + * Supports importing of persisted properties from an external configuration file. + * + * Select values can also be overridden with command line arguments. See remarks on individual + * properties for further information. + * + * Extends and implements DistributedSystemConfig. + * + * @since GemFire 3.5 (in which it was named AgentConfig) + */ +public class AgentConfigImpl extends DistributedSystemConfigImpl implements AgentConfig { + + // - + // Static class variable(s) + // - + + /** + * Command-line arg to enable agent debugging + */ + public static final String AGENT_DEBUG = "agent-debug"; + + /** + * The name of the "propertyFile" property. May specify as cmd-line arg + */ + public static final String PROPERTY_FILE_NAME = "property-file"; + + /** + * The name of the "gfAgentPropertyFile" property, can be specified as System Property + */ + public static final String AGENT_PROPSFILE_PROPERTY_NAME = "gfAgentPropertyFile"; + + // - + // DistributionLocator properties... + // - + + /** + * The name of the "locator.host-" property + */ + public static final String LOCATOR_HOST_NAME = "locator.host-"; + /** + * The name of the "locator.port-" property + */ + public static final String LOCATOR_PORT_NAME = "locator.port-"; + /** + * The name of the "locator.product-directory-" property + */ + public static final String LOCATOR_PRODUCT_DIRECTORY_NAME = "locator.product-directory-"; + /** + * The name of the "locator.working-directory-" property + */ + public static final String LOCATOR_WORKING_DIRECTORY_NAME = "locator.working-directory-"; + /** + * The name of the "locator.remote-command-" property + */ + public static final String LOCATOR_REMOTE_COMMAND = "locator.remote-command-"; + /** + * The name of the "locator.bind-address-" property + */ + public static final String LOCATOR_BIND_ADDRESS = "locator.bind-address-"; + /** + * the properties used in configuring a locator's distributed system + */ + public static final String LOCATOR_DS_PROPERTIES =
[02/50] [abbrv] incubator-geode git commit: GEODE-2102: annotate flaky test with FlakyTest category
GEODE-2102: annotate flaky test with FlakyTest category Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/8c383ee3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/8c383ee3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/8c383ee3 Branch: refs/heads/feature/GEODE-288 Commit: 8c383ee358d7b972e89458e6670395a97a27c477 Parents: 95a07d2 Author: Kirk LundAuthored: Mon Nov 14 10:34:11 2016 -0800 Committer: Kirk Lund Committed: Mon Nov 14 10:35:01 2016 -0800 -- .../internal/cli/commands/DiskStoreCommandsDUnitTest.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c383ee3/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java index 83923ba..901ed29 100644 --- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java @@ -102,6 +102,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase { final List filesToBeDeleted = new CopyOnWriteArrayList(); + @Category(FlakyTest.class) // GEODE-2102 @Test public void testMissingDiskStore() { final String regionName = "testShowMissingDiskStoreRegion";
[35/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/jmx/internal/GemFireHealthConfigJmxImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl.java deleted file mode 100644 index 6c44811..000 --- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl.java +++ /dev/null @@ -1,211 +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.jmx.internal; - -import javax.management.ObjectName; -import javax.management.modelmbean.ModelMBean; - -import org.apache.geode.admin.AdminException; -import org.apache.geode.admin.GemFireHealth; -import org.apache.geode.admin.GemFireHealthConfig; -import org.apache.geode.admin.internal.GemFireHealthConfigImpl; - -/** - * The JMX "managed resource" that represents the configuration for the health of GemFire. - * Basically, it provides the behavior of GemFireHealthConfigImpl, but does some JMX - * stuff like registering beans with the agent. - * - * - * - * Unlike other ManagedResources this class cannot simply subclass - * GemFireHealthImpl because it instances are serialized and sent to other VMs. This is - * problematic because the other VMs most likely do not have JMX classes like - * ModelMBean on their classpaths. So, instead we delegate all of the - * GemFireHealthConfig behavior to another object which IS serialized. - * - * @see GemFireHealthJmxImpl#createDistributedSystemHealthConfig - * - * - * @since GemFire 3.5 - */ -@edu.umd.cs.findbugs.annotations.SuppressWarnings( -justification = "This class is deprecated. Also, any further changes so close to the release is inadvisable.") -public class GemFireHealthConfigJmxImpl -implements GemFireHealthConfig, ManagedResource, java.io.Serializable { - - private static final long serialVersionUID = 1482719647163239953L; - - /** The GemFireHealth that we help configure */ - private GemFireHealth health; - - /** The name of the MBean that will manage this resource */ - private String mbeanName; - - /** The ModelMBean that is configured to manage this resource */ - private ModelMBean modelMBean; - - /** The delegate that contains the real config state */ - private GemFireHealthConfig delegate; - - /** The object name of this managed resource */ - private ObjectName objectName; - - /// Constructors /// - - /** - * Creates a new GemFireHealthConfigJmxImpl that configures the health monitoring of - * components running on the given host. - */ - GemFireHealthConfigJmxImpl(GemFireHealthJmxImpl health, String hostName) throws AdminException { - -this.delegate = new GemFireHealthConfigImpl(hostName); -this.health = health; -this.mbeanName = new StringBuffer().append(MBEAN_NAME_PREFIX).append("GemFireHealthConfig,id=") - .append(MBeanUtil.makeCompliantMBeanNameProperty(health.getDistributedSystem().getId())) -.append(",host=") -.append((hostName == null ? "default" : MBeanUtil.makeCompliantMBeanNameProperty(hostName))) -.toString(); -this.objectName = MBeanUtil.createMBean(this); - } - - // Instance Methods // - - /** - * Applies the changes made to this config back to the health monitor. - * - * @see GemFireHealth#setDistributedSystemHealthConfig - */ - public void applyChanges() { -String hostName = this.getHostName(); -if (hostName == null) { - this.health.setDefaultGemFireHealthConfig(this); - -} else { - this.health.setGemFireHealthConfig(hostName, this); -} - } - - public String getMBeanName() { -return this.mbeanName; - } - - public ModelMBean getModelMBean() { -return this.modelMBean; - } - - public ObjectName getObjectName() { -return this.objectName; - } - - public void setModelMBean(ModelMBean modelMBean) { -this.modelMBean = modelMBean; - } - - public ManagedResourceType getManagedResourceType()
[28/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/internal/admin/api/SystemMemberCacheServer.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheServer.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheServer.java new file mode 100755 index 000..ba31538 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheServer.java @@ -0,0 +1,308 @@ +/* + * 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.internal.admin.api; + +import org.apache.geode.cache.server.ServerLoadProbe; + +/** + * Administrative interface that represents a {@link org.apache.geode.cache.server.CacheServer + * CacheServer} that serves the contents of a system member's cache to clients. + * + * @see SystemMemberCache#addCacheServer + * + * @since GemFire 5.7 + * @deprecated as of 7.0 use the management + * package instead + */ +public interface SystemMemberCacheServer { + + /** + * Returns the port on which this cache server listens for clients to connect. + */ + public int getPort(); + + /** + * Sets the port on which this cache server listens for clients to connect. + * + * @throws AdminException If this cache server is running + */ + public void setPort(int port) throws AdminException; + + /** + * Starts this cache server. Once the server is running, its configuration cannot be changed. + * + * @throws AdminException If an error occurs while starting the cache server + */ + public void start() throws AdminException; + + /** + * Returns whether or not this cache server is running + */ + public boolean isRunning(); + + /** + * Stops this cache server. Note that the CacheServer can be reconfigured and + * restarted if desired. + */ + public void stop() throws AdminException; + + /** + * Updates the information about this cache server. + */ + public void refresh(); + + /** + * Returns a string representing the ip address or host name that this server will listen on. + * + * @return the ip address or host name that this server is to listen on + * @since GemFire 5.7 + */ + public String getBindAddress(); + + /** + * Sets the ip address or host name that this server is to listen on for client connections. + * + * Setting a specific bind address will cause the cache server to always use this address and + * ignore any address specified by "server-bind-address" or "bind-address" in the + * gemfire.properties file (see + * {@link org.apache.geode.distributed.DistributedSystem} for a description of these properties). + * + * A null value will be treated the same as the default "". + * + * The default value does not override the gemfire.properties. If you wish to override the + * properties and want to have your server bind to all local addresses then use this string + * "0.0.0.0". + * + * @param address the ip address or host name that this server is to listen on + * @throws AdminException if this cache server is running + * @since GemFire 5.7 + */ + public void setBindAddress(String address) throws AdminException; + + /** + * Returns a string representing the ip address or host name that server locators will tell + * clients that this server is listening on. + * + * @return the ip address or host name to give to clients so they can connect to this server + * @since GemFire 5.7 + */ + public String getHostnameForClients(); + + /** + * Sets the ip address or host name that this server is to listen on for client connections. + * + * Setting a specific hostname-for-clients will cause server locators to use this value when + * telling clients how to connect to this server. + * + * The default value causes the bind-address to be given to clients + * + * A null value will be treated the same as the default "". + * + * @param name the ip address or host name that will be given to clients so they can connect to + *this server + * @throws AdminException if this
[40/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/SystemMemberRegionImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java deleted file mode 100644 index fbf0839..000 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java +++ /dev/null @@ -1,371 +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.*; -import org.apache.geode.cache.*; -// import org.apache.geode.internal.Assert; -// import org.apache.geode.internal.admin.*; -import org.apache.geode.internal.admin.remote.*; - -import java.io.File; -import java.util.*; - -/** - * View of a region in a GemFire system member's cache. - * - * @since GemFire 3.5 - */ -public class SystemMemberRegionImpl implements SystemMemberRegion { - - private AdminRegion r; - private RegionAttributes ra; - private CacheStatistics rs; - private Set subregionNames; - private Set subregionFullPaths; - private int entryCount; - private int subregionCount; - - /** The cache to which this region belongs */ - private final SystemMemberCacheImpl cache; - - // constructors - public SystemMemberRegionImpl(SystemMemberCacheImpl cache, Region r) { -this.cache = cache; -this.r = (AdminRegion) r; - } - - private void refreshFields() { -this.ra = this.r.getAttributes(); -if (getStatisticsEnabled() && !this.ra.getDataPolicy().withPartitioning()) { - this.rs = this.r.getStatistics(); -} else { - this.rs = null; -} -{ // set subregionNames - Set s = this.r.subregions(false); - Set names = new TreeSet(); - Set paths = new TreeSet(); - Iterator it = s.iterator(); - while (it.hasNext()) { -Region r = (Region) it.next(); -String name = r.getName(); -names.add(name); -paths.add(this.getFullPath() + Region.SEPARATOR_CHAR + name); - } - this.subregionNames = names; - this.subregionFullPaths = paths; -} -try { - int[] sizes = this.r.sizes(); - this.entryCount = sizes[0]; - this.subregionCount = sizes[1]; -} catch (CacheException ignore) { - this.entryCount = 0; - this.subregionCount = 0; -} - } - - // attributes - public String getName() { -return this.r.getName(); - } - - public String getFullPath() { -return this.r.getFullPath(); - } - - public java.util.Set getSubregionNames() { -return this.subregionNames; - } - - public java.util.Set getSubregionFullPaths() { -return this.subregionFullPaths; - } - - public String getUserAttribute() { -return (String) r.getUserAttribute(); - } - - public String getCacheLoader() { -Object o = this.ra.getCacheLoader(); -if (o == null) { - return ""; -} else { - return o.toString(); -} - } - - public String getCacheWriter() { -Object o = this.ra.getCacheWriter(); -if (o == null) { - return ""; -} else { - return o.toString(); -} - } - - public String getKeyConstraint() { -Class constraint = this.ra.getKeyConstraint(); -if (constraint == null) { - return ""; -} else { - return constraint.getName(); -} - } - - public String getValueConstraint() { -Class constraint = this.ra.getValueConstraint(); -if (constraint == null) { - return ""; -} else { - return constraint.getName(); -} - } - - public boolean getEarlyAck() { -return this.ra.getEarlyAck(); - } - - public int getRegionTimeToLiveTimeLimit() { -return this.ra.getRegionTimeToLive().getTimeout(); - } - - public ExpirationAction getRegionTimeToLiveAction() { -return this.ra.getRegionTimeToLive().getAction(); - } - - public int getEntryTimeToLiveTimeLimit() { -return this.ra.getEntryTimeToLive().getTimeout(); - } - - public ExpirationAction getEntryTimeToLiveAction() { -return this.ra.getEntryTimeToLive().getAction(); - } - - public
[49/50] [abbrv] incubator-geode git commit: Fix QueryUsingPoolDUnitTest by undoing admin pkg changes in strings
Fix QueryUsingPoolDUnitTest by undoing admin pkg changes in strings Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/c56dbaf7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/c56dbaf7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/c56dbaf7 Branch: refs/heads/feature/GEODE-288 Commit: c56dbaf72d8b8f783a622ed0a21f949a72182304 Parents: b6c305f Author: Kirk LundAuthored: Mon Nov 7 12:31:24 2016 -0800 Committer: Kirk Lund Committed: Tue Nov 15 12:23:50 2016 -0800 -- .../query/dunit/QueryUsingPoolDUnitTest.java| 31 ++-- 1 file changed, 15 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c56dbaf7/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java index ade1450..91b8bec 100644 --- a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java @@ -122,7 +122,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase { } public void createPool(final String poolName, final String[] servers, final int[] ports, - final boolean subscriptionEnabled) { + final boolean subscriptionEnabled) { // Create Cache. getCache(true); @@ -198,7 +198,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase { } queryString = - "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct * from " + "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct * from " + regionName; try { @@ -212,7 +212,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase { assertTrue(!results.getCollectionType().allowsDuplicates()); queryString = - "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct * from " + "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct * from " + regionName + " where ticker = 'ibm'"; try { Query query = qService.newQuery(queryString); @@ -224,7 +224,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase { assertTrue(!results.getCollectionType().allowsDuplicates()); queryString = - "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct * from " + "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct * from " + regionName + " where ticker = 'IBM'"; try { Query query = qService.newQuery(queryString); @@ -236,7 +236,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase { assertTrue(!results.getCollectionType().allowsDuplicates()); queryString = - "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct * from " + "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct * from " + regionName + " where price > 49"; try { Query query = qService.newQuery(queryString); @@ -248,7 +248,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase { assertTrue(!results.getCollectionType().allowsDuplicates()); queryString = - "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct * from " + "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct * from " + regionName + " where price = 50"; try { Query query = qService.newQuery(queryString); @@ -260,7 +260,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase { assertTrue(!results.getCollectionType().allowsDuplicates()); queryString = - "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct * from " + "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct * from " + regionName + " where ticker = 'ibm' and price = 50"; try { Query query = qService.newQuery(queryString); @@ -318,7 +318,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase { } queryString = - "import
[38/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/jmx/internal/AgentConfigImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java deleted file mode 100644 index 4e53b07..000 --- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java +++ /dev/null @@ -1,1915 +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.jmx.internal; - -import static org.apache.geode.distributed.ConfigurationProperties.*; -import static org.apache.geode.distributed.internal.DistributionConfig.*; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.net.InetAddress; -import java.net.URL; -import java.util.Enumeration; -import java.util.Iterator; -import java.util.Properties; -import java.util.StringTokenizer; - -import org.apache.geode.GemFireIOException; -import org.apache.geode.admin.DistributedSystemConfig; -import org.apache.geode.admin.DistributionLocatorConfig; -import org.apache.geode.admin.internal.DistributedSystemConfigImpl; -import org.apache.geode.admin.internal.InetAddressUtil; -import org.apache.geode.admin.jmx.Agent; -import org.apache.geode.admin.jmx.AgentConfig; -import org.apache.geode.internal.ClassPathLoader; -import org.apache.geode.internal.i18n.LocalizedStrings; -import org.apache.geode.internal.util.IOUtils; - -/** - * Provides the JMX Agent configuration properties. - * - * Supports importing of persisted properties from an external configuration file. - * - * Select values can also be overridden with command line arguments. See remarks on individual - * properties for further information. - * - * Extends and implements DistributedSystemConfig. - * - * @since GemFire 3.5 (in which it was named AgentConfig) - */ -public class AgentConfigImpl extends DistributedSystemConfigImpl implements AgentConfig { - - // - - // Static class variable(s) - // - - - /** - * Command-line arg to enable agent debugging - */ - public static final String AGENT_DEBUG = "agent-debug"; - - /** - * The name of the "propertyFile" property. May specify as cmd-line arg - */ - public static final String PROPERTY_FILE_NAME = "property-file"; - - /** - * The name of the "gfAgentPropertyFile" property, can be specified as System Property - */ - public static final String AGENT_PROPSFILE_PROPERTY_NAME = "gfAgentPropertyFile"; - - // - - // DistributionLocator properties... - // - - - /** - * The name of the "locator.host-" property - */ - public static final String LOCATOR_HOST_NAME = "locator.host-"; - /** - * The name of the "locator.port-" property - */ - public static final String LOCATOR_PORT_NAME = "locator.port-"; - /** - * The name of the "locator.product-directory-" property - */ - public static final String LOCATOR_PRODUCT_DIRECTORY_NAME = "locator.product-directory-"; - /** - * The name of the "locator.working-directory-" property - */ - public static final String LOCATOR_WORKING_DIRECTORY_NAME = "locator.working-directory-"; - /** - * The name of the "locator.remote-command-" property - */ - public static final String LOCATOR_REMOTE_COMMAND = "locator.remote-command-"; - /** - * The name of the "locator.bind-address-" property - */ - public static final String LOCATOR_BIND_ADDRESS = "locator.bind-address-"; - /** - * the properties used in configuring a locator's distributed system - */ - public static final String LOCATOR_DS_PROPERTIES = "locator.ds-properties"; - - /** - * The default log file for stand-alone JMX agents - */ - /* package scope */ -
[19/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal
to check to see if the JVM + // is still usable: + SystemFailure.checkFailure(); + logger.error(LocalizedStrings.AgentImpl_FAILED_TO_START_RMICONNECTORSERVER, t); + throw new StartupException( + LocalizedStrings.AgentImpl_FAILED_TO_START_RMI_SERVICE.toLocalizedString(), t); +} + } + + /** + * Starts the optional third-party AdventNet SNMP Adaptor. + * + * If {@link AgentConfig#isSnmpEnabled} returns false, then this adaptor will not be started. + */ + private void startSnmpAdaptor() { +if (!this.agentConfig.isSnmpEnabled()) + return; +try { + ObjectName objName = getSnmpAdaptorName(); + + // make sure this adaptor is not already registered... + if (getMBeanServer().isRegistered(objName)) { +// dunno how we got here... +logger.info(LocalizedMessage + .create(LocalizedStrings.AgentImpl_SNMPADAPTOR_ALREADY_REGISTERED_AS__0, objName)); +return; + } + + String className = "com.adventnet.adaptors.snmp.snmpsupport.SmartSnmpAdaptor"; + String snmpDir = this.agentConfig.getSnmpDirectory(); + // ex:/merry2/users/klund/agent + + // validate the directory... + if (snmpDir == null || snmpDir.length() == 0) { +throw new IllegalArgumentException( + LocalizedStrings.AgentImpl_SNMPDIRECTORY_MUST_BE_SPECIFIED_BECAUSE_SNMP_IS_ENABLED +.toLocalizedString()); + } + File root = new File(snmpDir); + if (!root.exists()) { +throw new IllegalArgumentException( + LocalizedStrings.AgentImpl_SNMPDIRECTORY_DOES_NOT_EXIST.toLocalizedString()); + } + + // create the adaptor... + String[] sigs = new String[] {"java.lang.String"}; + Object[] args = new Object[] {snmpDir}; + + String bindAddress = this.agentConfig.getSnmpBindAddress(); + if (bindAddress != null && bindAddress.length() > 0) { +sigs = new String[] {"java.lang.String", sigs[0]}; +args = new Object[] {bindAddress, args[0]}; + } + + // go... + getMBeanServer().createMBean(className, objName, args, sigs); +} catch (VirtualMachineError err) { + SystemFailure.initiateFailure(err); + // If this ever returns, rethrow the error. We're poisoned + // now, so don't let this thread continue. + throw err; +} catch (Throwable t) { + // Whenever you catch Error or Throwable, you must also + // catch VirtualMachineError (see above). However, there is + // _still_ a possibility that you are dealing with a cascading + // error condition, so you also need to check to see if the JVM + // is still usable: + SystemFailure.checkFailure(); + logger.error(LocalizedMessage + .create(LocalizedStrings.AgentImpl_FAILED_TO_START_SNMPADAPTOR__0, t.getMessage())); + throw new StartupException(LocalizedStrings.AgentImpl_FAILED_TO_START_SNMPADAPTOR__0 + .toLocalizedString(t.getMessage()), t); +} + } + + /** + * Defines and starts the JMX Http Adaptor service from MX4J. + * + * If {@link AgentConfig#isHttpEnabled} returns false, then this adaptor will not be started. + */ + private void startHttpAdaptor() { +if (!this.agentConfig.isHttpEnabled()) + return; +try { + ObjectName objName = getHttpAdaptorName(); + + // make sure this adaptor is not already registered... + if (getMBeanServer().isRegistered(objName)) { +// dunno how we got here... +logger.info(LocalizedMessage + .create(LocalizedStrings.AgentImpl_HTTPADAPTOR_ALREADY_REGISTERED_AS__0, objName)); +return; + } + + this.httpAdaptor = new HttpAdaptor(); + + // validate and set host and port values... + if (this.agentConfig.getHttpPort() > 0) { +this.httpAdaptor.setPort(this.agentConfig.getHttpPort()); +logger.info(LogMarker.CONFIG, + LocalizedMessage.create(LocalizedStrings.AgentImpl_HTTP_ADAPTOR_LISTENING_ON_PORT__0, +this.agentConfig.getHttpPort())); + } else { + logger.error(LocalizedMessage.create(LocalizedStrings.AgentImpl_INCORRECT_PORT_VALUE__0, +this.agentConfig.getHttpPort())); + } + + if (this.agentConfig.getHttpBindAddress() != null) { +String host = this.agentConfig.getHttpBindAddress(); +logger.info(LogMarker.CONFIG, LocalizedMessage + .create(LocalizedStrings.AgentImpl_HTTP_ADAPTOR_LISTENING_ON_ADDRESS__0, host)); +this.httpAdaptor.setHost(host); + } else { + logger.error(LocalizedMessage.create(LocalizedStrings.AgentImpl_INCORRECT_NULL_HOSTNAME)); + } + + // SSL support... + MX4JServerSocketFactory socketFactory = + new MX4JServerSocketFactory(this.agentConfig.isAgentSSLEnabled(), + this.agentConfig.isHttp
[08/50] [abbrv] incubator-geode git commit: GEODE-2110 Revised wording of gfsh start server --password
GEODE-2110 Revised wording of gfsh start server --password Added a note to make it clear that specifying --password on the command line means that a clear text password is visible. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/b35e2a44 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/b35e2a44 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/b35e2a44 Branch: refs/heads/feature/GEODE-288 Commit: b35e2a448311db6994f907464528266e897f0a46 Parents: cc996a6 Author: Karen MillerAuthored: Tue Nov 15 10:49:14 2016 -0800 Committer: Karen Miller Committed: Tue Nov 15 11:11:21 2016 -0800 -- geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b35e2a44/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb -- diff --git a/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb b/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb index e80e94a..30ef7c5 100644 --- a/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb +++ b/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb @@ -774,7 +774,9 @@ then gfsh will prompt for the password. \-\-password -The password portion of the credential to use in authenticating to the cluster. +The password portion of the credential to use in authenticating to +the cluster. +Note that this is a clear text password that may be visible to others.
[14/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/internal/admin/api/jmx/impl/StatisticAttributeInfo.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticAttributeInfo.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticAttributeInfo.java new file mode 100755 index 000..ec675f1 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticAttributeInfo.java @@ -0,0 +1,71 @@ +/* + * 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.internal.admin.api.jmx.impl; + +import org.apache.geode.internal.admin.api.Statistic; +import org.apache.geode.internal.Assert; + +import javax.management.Descriptor; +import javax.management.modelmbean.DescriptorSupport; +import javax.management.modelmbean.ModelMBeanAttributeInfo; + +/** + * Subclass of AttributeInfo with {@link Statistic} added for use as the + * {@link javax.management.modelmbean.ModelMBeanAttributeInfo} descriptor's targetObject + * value. + * + * @since GemFire 3.5 + * + */ +class StatisticAttributeInfo extends org.apache.commons.modeler.AttributeInfo { + private static final long serialVersionUID = 28022387514935560L; + + private Statistic stat; + + public StatisticAttributeInfo() { +super(); + } + + public Statistic getStat() { +return this.stat; + } + + public void setStat(Statistic stat) { +// System.out.println(">> stat = " + stat); +Assert.assertTrue(stat != null, "Attempting to set stat to null"); +this.stat = stat; + } + + @Override + public ModelMBeanAttributeInfo createAttributeInfo() { +Descriptor desc = new DescriptorSupport(new String[] {"name=" + this.displayName, +"descriptorType=attribute", "currencyTimeLimit=-1", // always stale +"displayName=" + this.displayName, "getMethod=getValue"}); + +Assert.assertTrue(this.stat != null, "Stat target object is null!"); +desc.setField("targetObject", this.stat); + +ModelMBeanAttributeInfo info = new ModelMBeanAttributeInfo(this.displayName, // name +this.type, // type +this.description, // description +this.readable, // isReadable +this.writeable, // isWritable +this.is, // isIs +desc); + +return info; + } +} + http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b6c305f8/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticResourceJmxImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticResourceJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticResourceJmxImpl.java new file mode 100755 index 000..f7b776b --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticResourceJmxImpl.java @@ -0,0 +1,342 @@ +/* + * 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.internal.admin.api.jmx.impl; + +import javax.management.Notification; +import javax.management.ObjectName; +import javax.management.modelmbean.ModelMBean; +import javax.naming.OperationNotSupportedException; + +import org.apache.commons.modeler.ManagedBean; +import org.apache.logging.log4j.Logger; + +import
[42/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/GemFireHealthImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java deleted file mode 100644 index efeee66..000 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java +++ /dev/null @@ -1,511 +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.admin.*; -import org.apache.geode.internal.Assert; -import org.apache.geode.internal.admin.*; -import org.apache.geode.internal.i18n.LocalizedStrings; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.*; - -/** - * Provides the implementation of the GemFireHealth administration API. This class is - * responsible for {@linkplain GemFireVM#addHealthListener sending} the {@link GemFireHealthConfig}s - * to the remote member VM in which the health is calcualted. - * - * - * @since GemFire 3.5 - */ -public class GemFireHealthImpl implements GemFireHealth, JoinLeaveListener, HealthListener { - - /** The distributed system whose health is being monitored */ - private final GfManagerAgent agent; - - /** The default configuration for checking GemFire health */ - protected GemFireHealthConfig defaultConfig; - - /** - * Maps the name of a host to its GemFireHealthConfig. Note that the mappings are - * created lazily. - */ - private final Map hostConfigs; - - /** - * Maps the name of a host to all of the members (GemFireVMs) that run on that host. - */ - private final Map hostMembers; - - /** The members that are known to be in {@link #OKAY_HEALTH}. */ - private Collection okayHealth; - - /** The members that are known to be in {@link #POOR_HEALTH}. */ - private Collection poorHealth; - - /** The overall health of GemFire */ - private GemFireHealth.Health overallHealth; - - /** Is this GemFireHealthImpl closed? */ - private boolean isClosed; - - /** - * The configuration specifying how the health of the distributed system should be computed. - */ - protected volatile DistributedSystemHealthConfig dsHealthConfig; - - /** Monitors the health of the entire distributed system */ - private DistributedSystemHealthMonitor dsHealthMonitor = null; - - /** - * The distributed system whose health is monitored by this GemFireHealth. - */ - private final AdminDistributedSystem system; - - - /// Constructors /// - - /** - * Creates a new GemFireHealthImpl that monitors the health of member of the given - * distributed system. - */ - protected GemFireHealthImpl(GfManagerAgent agent, AdminDistributedSystem system) { -// agent.getDM().getLogger().info("Creating GemFireHealthImpl", -// new Exception("Stack trace")); - -this.agent = agent; -this.system = system; - -this.hostConfigs = new HashMap(); -this.hostMembers = new HashMap(); -this.okayHealth = new HashSet(); -this.poorHealth = new HashSet(); -this.overallHealth = GOOD_HEALTH; -this.isClosed = false; - -GemFireVM[] apps = this.agent.listApplications(); -for (int i = 0; i < apps.length; i++) { - GemFireVM member = apps[i]; - this.noteNewMember(member); -} - -agent.addJoinLeaveListener(this); -setDefaultGemFireHealthConfig(createGemFireHealthConfig(null)); -setDistributedSystemHealthConfig(createDistributedSystemHealthConfig()); - } - - @Override - public String toString() { -StringBuffer sb = new StringBuffer(); -sb.append("closed=" + isClosed); -sb.append("; hostMembers=" + hostMembers); -sb.append("; okayHealth=" + okayHealth); -sb.append("; poorHealth=" + poorHealth); -sb.append("; overallHealth=" + overallHealth); -sb.append("; diagnosis=" + getDiagnosis()); -return sb.toString(); - } - // Instance Methods // - - /** - * Returns the
[31/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/jmx/internal/package.html -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/package.html b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/package.html deleted file mode 100755 index bc2b2f2..000 --- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/package.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - -Contains the implementation of the external JMX APIs from -org.apache.geode.admin.jmx. - -JMX Support in GemFire - -Our goal was to provide JMX administrative support in GemFire. The design was influenced by these important factors: - - -1) Requirement to not impact performance of the product -2) Desire to introduce JMX without altering the existing product or the management console -3) Similar functionality already existed in the console and the internal.admin pkg which the console uses -4) Requirement to also introduce a simple and usable Admin API which or may not be related to JMX - - -From a functional stand point, the JMX support was supposed to provide most of the same administrative and operational monitoring that the console already provides. In some cases we limited the functionality due to security concerns and in others because it was hard to express the features as JMX beans. The JMX Agent also provides some functionality (such as Health monitoring) that is not currently in the console. - -The Agent communicates with the distributed system using the same distribution manager {@link org.apache.geode.distributed.internal.DistributionManager} as the console uses and thus has the same requirements that determine what distributed system it can manage. Although the Console currently supports managing multiple distributed systems, we decided that a given Agent should only be able to manage a single system. We have not tested the use of more than one Agent for the same system, however nothing currently prohibits this. - -We decided to develop a simple public Admin API which in essence wraps the internal.admin API that the Console currently uses extensively. The Admin API also contains implementations of new functionality not in internal.admin. Our JMX support is an extension to this Admin API. In an overly simplified view, the GemFire JMX MBeans are ModelMBeans that manage instances of the Admin API objects housed in the Agent's MBeanServer. - -The selected architecture consists of a Daemon Agent, which exists in a separate VM that GemFire does not depend on. This Agent hosts an MBeanServer, instances of any and all MBeans registered for managing a GemFire distributed system, and server connectors/adaptors that various types of clients can connect to. - -The two server connectors we selected are the HttpAdaptor and the RMI Connector. The HttpAdaptor provides an HTML user interface of all MBeans in the MBeanServer. Although this generic UI is not as rich as an RMI client (or the GemFire Console) could be, it provides a functional and easy to use UI with no development required. The JMX Remote specification details the standard connectors. Although the HttpAdaptor is not required by this Sun spec. it is included in some form with all JMX implementations that I investigated. It should be noted that our JMX Agent currently starts up the HttpAdaptor, but not the RMI Connector. The latter is deferred as later work since some form of client must be developed for testing. Further research may also uncover a generic, configurable open-source RMI client for JMX. The GemFire Console could in theory be reworked as an RMI Connector client, but this is not currently planned. - -Two open-source JMX implementations made it to our final review for consideration: http://www.xmojo.org;>XMOJO and http://www.mx4j.org;>MX4J. The decision to go with MX4J was based mainly on our perceptions of MX4J being more active and widespread in use. Additionally, XMOJO is associated with http://www.adventnet.com/;>AdventNet which produces commercial products. This made MX4J seem more true to open-source and safer from corporate tampering. - -ModelMBeans are very dynamic and capable of managing aggregate resources. Use of a ModelMBean entails specifying meta-data to an instance of javax.management.modelmbean.RequiredModelMBean. This meta-data identifies the manageble resource(s) which can consist of a single object, or many objects, including those in one VM or in any number of distributed VMs. We decided to subclass classes in the Admin API in order to massage them a little and make them easier to use as a managed resource by the ModelMBean. For example, org.apache.geode.admin.GemFireManager represents a type of member in a GemFire system which manages shared memory. When an MBean is registered for managing the
[11/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/resources/org/apache/geode/admin/jmx/mbeans-descriptors.xml -- diff --git a/geode-core/src/main/resources/org/apache/geode/admin/jmx/mbeans-descriptors.xml b/geode-core/src/main/resources/org/apache/geode/admin/jmx/mbeans-descriptors.xml deleted file mode 100755 index b54716f..000 --- a/geode-core/src/main/resources/org/apache/geode/admin/jmx/mbeans-descriptors.xml +++ /dev/null @@ -1,1452 +0,0 @@ - -http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd;> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - gemfire.distributedsystem.member.joined - - - - - - - - - gemfire.distributedsystem.member.left - - - - - - - - - gemfire.distributedsystem.member.crashed - - - - - - - - - gemfire.distributedsystem.alert - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - gemfire.distributedsystem.cache.created - - - - - - - - - gemfire.distributedsystem.cache.closed - - - - - - - - - gemfire.distributedsystem.cache.region.created - - - - - - - - - gemfire.distributedsystem.cache.region.lost - - - - - - - - - gemfire.distributedsystem.cache.client.joined - - - - - - - - - gemfire.distributedsystem.cache.client.left - - - - - - - - - gemfire.distributedsystem.cache.client.crashed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - gemfire.distributedsystem.cache.created - - - - - - - - - gemfire.distributedsystem.cache.closed - - - - - - - - - gemfire.distributedsystem.cache.region.created - - - - - - - - - gemfire.distributedsystem.cache.region.lost - - - - - - - - - gemfire.distributedsystem.cache.client.joined - - - - - - - - - gemfire.distributedsystem.cache.client.left - - - - - - - - - gemfire.distributedsystem.cache.client.crashed - - -
[37/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal
to check to see if the JVM - // is still usable: - SystemFailure.checkFailure(); - logger.error(LocalizedStrings.AgentImpl_FAILED_TO_START_RMICONNECTORSERVER, t); - throw new StartupException( - LocalizedStrings.AgentImpl_FAILED_TO_START_RMI_SERVICE.toLocalizedString(), t); -} - } - - /** - * Starts the optional third-party AdventNet SNMP Adaptor. - * - * If {@link AgentConfig#isSnmpEnabled} returns false, then this adaptor will not be started. - */ - private void startSnmpAdaptor() { -if (!this.agentConfig.isSnmpEnabled()) - return; -try { - ObjectName objName = getSnmpAdaptorName(); - - // make sure this adaptor is not already registered... - if (getMBeanServer().isRegistered(objName)) { -// dunno how we got here... -logger.info(LocalizedMessage - .create(LocalizedStrings.AgentImpl_SNMPADAPTOR_ALREADY_REGISTERED_AS__0, objName)); -return; - } - - String className = "com.adventnet.adaptors.snmp.snmpsupport.SmartSnmpAdaptor"; - String snmpDir = this.agentConfig.getSnmpDirectory(); - // ex:/merry2/users/klund/agent - - // validate the directory... - if (snmpDir == null || snmpDir.length() == 0) { -throw new IllegalArgumentException( - LocalizedStrings.AgentImpl_SNMPDIRECTORY_MUST_BE_SPECIFIED_BECAUSE_SNMP_IS_ENABLED -.toLocalizedString()); - } - File root = new File(snmpDir); - if (!root.exists()) { -throw new IllegalArgumentException( - LocalizedStrings.AgentImpl_SNMPDIRECTORY_DOES_NOT_EXIST.toLocalizedString()); - } - - // create the adaptor... - String[] sigs = new String[] {"java.lang.String"}; - Object[] args = new Object[] {snmpDir}; - - String bindAddress = this.agentConfig.getSnmpBindAddress(); - if (bindAddress != null && bindAddress.length() > 0) { -sigs = new String[] {"java.lang.String", sigs[0]}; -args = new Object[] {bindAddress, args[0]}; - } - - // go... - getMBeanServer().createMBean(className, objName, args, sigs); -} catch (VirtualMachineError err) { - SystemFailure.initiateFailure(err); - // If this ever returns, rethrow the error. We're poisoned - // now, so don't let this thread continue. - throw err; -} catch (Throwable t) { - // Whenever you catch Error or Throwable, you must also - // catch VirtualMachineError (see above). However, there is - // _still_ a possibility that you are dealing with a cascading - // error condition, so you also need to check to see if the JVM - // is still usable: - SystemFailure.checkFailure(); - logger.error(LocalizedMessage - .create(LocalizedStrings.AgentImpl_FAILED_TO_START_SNMPADAPTOR__0, t.getMessage())); - throw new StartupException(LocalizedStrings.AgentImpl_FAILED_TO_START_SNMPADAPTOR__0 - .toLocalizedString(t.getMessage()), t); -} - } - - /** - * Defines and starts the JMX Http Adaptor service from MX4J. - * - * If {@link AgentConfig#isHttpEnabled} returns false, then this adaptor will not be started. - */ - private void startHttpAdaptor() { -if (!this.agentConfig.isHttpEnabled()) - return; -try { - ObjectName objName = getHttpAdaptorName(); - - // make sure this adaptor is not already registered... - if (getMBeanServer().isRegistered(objName)) { -// dunno how we got here... -logger.info(LocalizedMessage - .create(LocalizedStrings.AgentImpl_HTTPADAPTOR_ALREADY_REGISTERED_AS__0, objName)); -return; - } - - this.httpAdaptor = new HttpAdaptor(); - - // validate and set host and port values... - if (this.agentConfig.getHttpPort() > 0) { -this.httpAdaptor.setPort(this.agentConfig.getHttpPort()); -logger.info(LogMarker.CONFIG, - LocalizedMessage.create(LocalizedStrings.AgentImpl_HTTP_ADAPTOR_LISTENING_ON_PORT__0, -this.agentConfig.getHttpPort())); - } else { - logger.error(LocalizedMessage.create(LocalizedStrings.AgentImpl_INCORRECT_PORT_VALUE__0, -this.agentConfig.getHttpPort())); - } - - if (this.agentConfig.getHttpBindAddress() != null) { -String host = this.agentConfig.getHttpBindAddress(); -logger.info(LogMarker.CONFIG, LocalizedMessage - .create(LocalizedStrings.AgentImpl_HTTP_ADAPTOR_LISTENING_ON_ADDRESS__0, host)); -this.httpAdaptor.setHost(host); - } else { - logger.error(LocalizedMessage.create(LocalizedStrings.AgentImpl_INCORRECT_NULL_HOSTNAME)); - } - - // SSL support... - MX4JServerSocketFactory socketFactory = - new MX4JServerSocketFactory(this.agentConfig.isAgentSSLEnabled(), - this.agentConfig.isHttpSSLRequireAuth(), this.agentConfig.getAgentSSLProtocols(), - this.agentConfig.getAgent
[15/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/internal/admin/api/jmx/impl/MemberInfoWithStatsMBean.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MemberInfoWithStatsMBean.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MemberInfoWithStatsMBean.java new file mode 100644 index 000..95fd01c --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MemberInfoWithStatsMBean.java @@ -0,0 +1,1355 @@ +/* + * 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.internal.admin.api.jmx.impl; + +import static org.apache.geode.distributed.ConfigurationProperties.*; + +import org.apache.geode.internal.admin.api.AdminDistributedSystem; +import org.apache.geode.internal.admin.api.AdminException; +import org.apache.geode.internal.admin.api.CacheVm; +import org.apache.geode.internal.admin.api.ConfigurationParameter; +import org.apache.geode.internal.admin.api.GemFireMemberStatus; +import org.apache.geode.internal.admin.api.RegionSubRegionSnapshot; +import org.apache.geode.internal.admin.api.StatisticResource; +import org.apache.geode.internal.admin.api.SystemMember; +import org.apache.geode.internal.admin.api.SystemMemberCacheServer; +import org.apache.geode.internal.admin.api.jmx.Agent; +import org.apache.geode.cache.InterestPolicy; +import org.apache.geode.cache.SubscriptionAttributes; +import org.apache.geode.distributed.internal.DistributionConfig; +import org.apache.geode.internal.GemFireVersion; +import org.apache.geode.internal.admin.remote.ClientHealthStats; +import org.apache.geode.internal.i18n.LocalizedStrings; +import org.apache.geode.internal.logging.LogService; +import org.apache.geode.internal.logging.log4j.LocalizedMessage; +import mx4j.AbstractDynamicMBean; +import org.apache.logging.log4j.Logger; + +import javax.management.*; +import java.net.InetAddress; +import java.text.MessageFormat; +import java.util.*; +import java.util.concurrent.atomic.AtomicLong; + +/** + * This class uses the JMX Attributes/Operations that use (return/throw) GemFire types. This is the + * single MBean accessible with ObjectName string {@link MemberInfoWithStatsMBean#MBEAN_NAME}}. This + * MBean can be used to retrieve the all member details as plain java types. + * + * This MBean also acts as a Notification Hub for all the Notifications that are defined for Admin + * Distributed System. + * + * + * @since GemFire 6.5 + */ +public class MemberInfoWithStatsMBean extends AbstractDynamicMBean implements NotificationEmitter { + private static final Logger logger = LogService.getLogger(); + + /* constants defining max no of attributes/operations/notifications */ + private static final int MAX_ATTRIBUTES_COUNT = 3; + private static final int MAX_OPERATIONS_COUNT = 3; + private static final int MAX_NOTIFICATIONS_COUNT = 9; + + private static final String NOT_AVAILABLE_STR = "N/A"; + private static final String NOT_AVAILABLE = null; + private static final Number NOT_AVAILABLE_NUMBER = null; + + /* + * String constant used for a region that is used on admin side just as a root for rootRegions + * defined on the member + */ + private static final String PLACE_HOLDER_ROOT_REGION = "/Root/"; + + /* String that are used to form QueryExp/ObjectName for querying MBeanServer */ + private static final String REGION_QUERY_EXPRESSION = "*GemFire.Cache*:*,owner={0},type=Region"; + private static final String STATS_QUERY_EXPRESSION = "*GemFire.Statistic*:*,source={0},name={1}"; + + /** mbean name string for this MBean */ + /* default */static final String MBEAN_NAME = "GemFire:type=MemberInfoWithStatsMBean"; + + /** ObjectName handle for this MBean */ + private ObjectName objectName; + + /** version of the GemFire Enterprise system that is running */ + private String version; + private int refreshInterval; + private String id; + + private Agent agent; + private AdminDistributedSystemJmxImpl adminDSJmx; + + private NotificationForwarder forwarder; + private boolean isInitialized;// needs synchronization? +
[12/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/resources/org/apache/geode/admin/api/jmx/mbeans-descriptors.xml -- diff --git a/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/mbeans-descriptors.xml b/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/mbeans-descriptors.xml new file mode 100755 index 000..1735f5f --- /dev/null +++ b/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/mbeans-descriptors.xml @@ -0,0 +1,1452 @@ + +http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd;> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gemfire.distributedsystem.member.joined + + + + + + + + + gemfire.distributedsystem.member.left + + + + + + + + + gemfire.distributedsystem.member.crashed + + + + + + + + + gemfire.distributedsystem.alert + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gemfire.distributedsystem.cache.created + + + + + + + + + gemfire.distributedsystem.cache.closed + + + + + + + + + gemfire.distributedsystem.cache.region.created + + + + + + + + + gemfire.distributedsystem.cache.region.lost + + + + + + + + + gemfire.distributedsystem.cache.client.joined + + + + + + + + + gemfire.distributedsystem.cache.client.left + + + + + + + + + gemfire.distributedsystem.cache.client.crashed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gemfire.distributedsystem.cache.created + + + + + + + + + gemfire.distributedsystem.cache.closed + + + + + + + + + gemfire.distributedsystem.cache.region.created + + + + + + + + + gemfire.distributedsystem.cache.region.lost + + + + + + + + + gemfire.distributedsystem.cache.client.joined + + + + + + + + + gemfire.distributedsystem.cache.client.left + + + + + + + + +
[36/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/jmx/internal/AgentLauncher.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java deleted file mode 100644 index 6a1bd63..000 --- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java +++ /dev/null @@ -1,918 +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.jmx.internal; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.PrintStream; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Properties; -import java.util.SortedMap; -import java.util.StringTokenizer; -import java.util.TreeMap; - -import org.apache.logging.log4j.Logger; - -import org.apache.geode.GemFireException; -import org.apache.geode.SystemFailure; -import org.apache.geode.admin.AdminException; -import org.apache.geode.admin.jmx.Agent; -import org.apache.geode.admin.jmx.AgentConfig; -import org.apache.geode.admin.jmx.AgentFactory; -import org.apache.geode.distributed.internal.DistributionManager; -import org.apache.geode.internal.OSProcess; -import org.apache.geode.internal.PureJavaMode; -import org.apache.geode.internal.net.SocketCreator; -import org.apache.geode.internal.i18n.LocalizedStrings; -import org.apache.geode.internal.logging.LogService; -import org.apache.geode.internal.util.IOUtils; -import org.apache.geode.internal.util.JavaCommandBuilder; - -/** - * A command line utility inspired by the CacheServerLauncher that is responsible for - * administering a stand-along GemFire JMX {@link Agent}. - * - * - * @since GemFire 3.5 - */ -public class AgentLauncher { - - private static final Logger logger = LogService.getLogger(); - - /** Should the launch command be printed? */ - public static final boolean PRINT_LAUNCH_COMMAND = - Boolean.getBoolean(AgentLauncher.class.getSimpleName() + ".PRINT_LAUNCH_COMMAND"); - - /* constants used to define state */ - static final int SHUTDOWN = 0; - static final int STARTING = 1; - static final int RUNNING = 2; - static final int SHUTDOWN_PENDING = 3; - static final int SHUTDOWN_PENDING_AFTER_FAILED_STARTUP = 4; - static final int UNKNOWN = 6; - - /** Agent configuration options */ - static final String AGENT_PROPS = "agent-props"; - - /** - * A flag to indicate if the current log file should be kept. Used only when 'start' is used to - * fork off the 'server' - */ - static final String APPENDTO_LOG_FILE = "appendto-log-file"; - - /** optional and additional classpath entries */ - static final String CLASSPATH = "classpath"; - - /** The directory argument */ - static final String DIR = "dir"; - - /** Extra VM arguments */ - static final String VMARGS = "vmargs"; - - /** The directory in which the agent's output resides */ - private File workingDirectory = null; - - /** The Status object for the agent */ - private Status status = null; - - /** base name for the agent to be launched */ - private final String basename; - - /** The name for the start up log file */ - private final String startLogFileName; - - /** The name of the status file */ - private final String statusFileName; - - /** - * Instantiates an AgentLauncher for execution and control of the GemFire JMX Agent process. This - * constructor is package private to prevent direct instantiation or subclassing by classes - * outside this package, but does allow the class to be tested as needed. - * - * - * @param basename base name for the application to be launched - */ - AgentLauncher(final String basename) { -assert basename != null : "The base name used by the AgentLauncher to
[41/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/ManagedSystemMemberImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java deleted file mode 100644 index 02e7ae4..000 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java +++ /dev/null @@ -1,258 +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.AdminException; -import org.apache.geode.admin.ConfigurationParameter; -import org.apache.geode.admin.ManagedEntityConfig; -import org.apache.geode.internal.admin.GemFireVM; - -import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS; - -/** - * A SystemMember that is also managed (or manageable) by the admin API. - * - * This class must be public so that its methods can be invoked reflectively (for MBean operations) - * on instances of its subclasses. - * - * @since GemFire 4.0 - */ -public abstract class ManagedSystemMemberImpl extends SystemMemberImpl -implements InternalManagedEntity { - - /** Controller for starting and stopping local or remote managers */ - protected ManagedEntityController controller; - - /** The state of this managed entity (see bug 32455) */ - private int state = UNKNOWN; - - /** A lock that is obtained while this entity's state changes */ - private final Object stateChange = new Object(); - - // Constructors // - - /** - * Creates a new ManagedSystemMemberImpl that represents an existing member of an - * AdminDistributedSystem. - */ - protected ManagedSystemMemberImpl(AdminDistributedSystemImpl system, GemFireVM vm) - throws AdminException { - -super(system, vm); -this.controller = system.getEntityController(); - } - - /** - * Creates a new ManagedSystemMemberImpl that represents a non-existing member with - * the given ManagedEntityConfig that has not yet been started. - */ - protected ManagedSystemMemberImpl(AdminDistributedSystemImpl system, ManagedEntityConfig config) - throws AdminException { - -super(system); -this.internalId = null; -this.id = getNewId(); -this.host = config.getHost(); -this.name = this.id; -this.controller = system.getEntityController(); - } - - // Instance Methods // - - public String getWorkingDirectory() { -return this.getEntityConfig().getWorkingDirectory(); - } - - public void setWorkingDirectory(String workingDirectory) { -this.getEntityConfig().setWorkingDirectory(workingDirectory); - } - - public String getProductDirectory() { -return this.getEntityConfig().getProductDirectory(); - } - - public void setProductDirectory(String productDirectory) { -this.getEntityConfig().setProductDirectory(productDirectory); - } - - @Override - public String getHost() { -return this.getEntityConfig().getHost(); - } - - public int setState(int state) { -if (this.stateChange == null) { - // The initial state is set in the constructor before - // stateChange is initialized. - int oldState = this.state; - this.state = state; - return oldState; - -} else { - synchronized (this.stateChange) { -int oldState = this.state; -this.state = state; - -this.stateChange.notifyAll(); - -return oldState; - } -} - } - - /** - * Returns whether or not this managed system member needs to be stopped. If this member is - * stopped or is stopping, then it does not need to be stopped. Otherwise, it will atomically - * place this member in the {@link #STOPPING} state. See bug 32455. - */ - protected boolean needToStop() { -synchronized (this.stateChange) { - if (this.state == STOPPED || this.state == STOPPING) { -return false; - - } else { -setState(STOPPING); -return true; - } -} - } - - /** - *
[01/50] [abbrv] incubator-geode git commit: reformatted recent commit with spotlessApply [Forced Update!]
Repository: incubator-geode Updated Branches: refs/heads/feature/GEODE-288 cba0bd53c -> c672bf2b8 (forced update) reformatted recent commit with spotlessApply I actually reformatted this in Idea with the recommended format config loaded but apparently it's not in line with what the Spotless config requires and caused a build to fail. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/95a07d20 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/95a07d20 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/95a07d20 Branch: refs/heads/feature/GEODE-288 Commit: 95a07d207931582dc2606e71cdc56e61dbed6088 Parents: 665570e Author: Bruce SchuchardtAuthored: Mon Nov 14 10:31:57 2016 -0800 Committer: Bruce Schuchardt Committed: Mon Nov 14 10:31:57 2016 -0800 -- .../membership/gms/membership/GMSJoinLeaveJUnitTest.java | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/95a07d20/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java index 4143be1..4fa6f07 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java @@ -487,7 +487,7 @@ public class GMSJoinLeaveJUnitTest { view.getCrashedMembers().contains(mockMembers[0])); } -// @Category(FlakyTest.class) // GEODE-2074: timed out waiting for view #7 + // @Category(FlakyTest.class) // GEODE-2074: timed out waiting for view #7 @Test public void testDuplicateJoinRequestDoesNotCauseNewView() throws Exception { initMocks(); @@ -532,9 +532,8 @@ public class GMSJoinLeaveJUnitTest { && (!gmsJoinLeave.getViewRequests().isEmpty() || gmsJoinLeave.getView().getViewId() != viewId)) { if (sleeps++ > 20) { -throw new RuntimeException( -"timeout waiting for view #" + viewId + " current view: " + gmsJoinLeave.getView() -+ "; view requests: " + gmsJoinLeave.getViewRequests()); +throw new RuntimeException("timeout waiting for view #" + viewId + " current view: " ++ gmsJoinLeave.getView() + "; view requests: " + gmsJoinLeave.getViewRequests()); } Thread.sleep(1000); }
[05/50] [abbrv] incubator-geode git commit: GEODE-2088: Correctly throw TransactionDataRebalancedException when bucket is moved during rebalance.
GEODE-2088: Correctly throw TransactionDataRebalancedException when bucket is moved during rebalance. Turns out the transaction layer code has already handled when to throw TransactionDataNotColocatedException in getTransactionException method call in TXStateProxyImpl by checking whether the key is colocated with the keys already touched in the transaction. Only need to make sure that piece of code will be executed by throwing correct TransactionException. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/139398a1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/139398a1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/139398a1 Branch: refs/heads/feature/GEODE-288 Commit: 139398a1f5af656c59eeacdb2dd9283a7145d992 Parents: c9e3b05 Author: eshuAuthored: Tue Nov 15 08:34:34 2016 -0800 Committer: eshu Committed: Tue Nov 15 08:34:34 2016 -0800 -- .../apache/geode/internal/cache/PartitionedRegion.java | 4 ++-- .../org/apache/geode/disttx/PRDistTXDUnitTest.java | 4 .../geode/disttx/PRDistTXWithVersionsDUnitTest.java| 4 .../internal/cache/execute/PRTransactionDUnitTest.java | 13 +++-- 4 files changed, 21 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/139398a1/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java index 96c58d5..7c3f19b 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java @@ -4001,8 +4001,8 @@ public class PartitionedRegion extends LocalRegion } else { // with transaction if (prce instanceof BucketNotFoundException) { -TransactionException ex = new TransactionDataNotColocatedException( - LocalizedStrings.PartitionedRegion_KEY_0_NOT_COLOCATED_WITH_TRANSACTION +TransactionException ex = new TransactionDataRebalancedException( + LocalizedStrings.PartitionedRegion_TRANSACTIONAL_DATA_MOVED_DUE_TO_REBALANCING .toLocalizedString(key)); ex.initCause(prce); throw ex; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/139398a1/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java b/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java index ed8d3c6..1061cd5 100644 --- a/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java @@ -45,6 +45,10 @@ public class PRDistTXDUnitTest extends PRTransactionDUnitTest { @Ignore("[DISTTX] TODO test overridden and intentionally left blank as it does not apply to disttx.") @Test + public void testTxWithGetOnMovedBucketUsingBucketReadHook() {} + + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as it does not apply to disttx.") + @Test public void testTxWithContainsValueForKeyOnMovedBucket() {} @Ignore("[DISTTX] TODO test overridden and intentionally left blank as it does not apply to disttx.") http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/139398a1/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java index 4e6f846..34c28f4 100644 --- a/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java @@ -45,6 +45,10 @@ public class PRDistTXWithVersionsDUnitTest extends PRTransactionWithVersionsDUni @Ignore("[DISTTX] TODO test overridden and intentionally left blank as it does not apply to disttx.") @Test + public void testTxWithGetOnMovedBucketUsingBucketReadHook() {} + + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as it does not apply to disttx.") + @Test public void testTxWithContainsValueForKeyOnMovedBucket() {} @Ignore("[DISTTX] TODO test overridden and intentionally left blank as
[25/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/internal/admin/api/impl/DistributedSystemHealthConfigImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthConfigImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthConfigImpl.java new file mode 100644 index 000..d38d5cb --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthConfigImpl.java @@ -0,0 +1,53 @@ +/* + * 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.internal.admin.api.impl; + +import org.apache.geode.internal.admin.api.DistributedSystemHealthConfig; + +/** + * The implementation of DistributedSystemHealthConfig. Note that because it never + * leaves the management VM, it is not Serializable and is not part of the + * {@link GemFireHealthConfigImpl} class hierarchy. + * + * + * @since GemFire 3.5 + */ +public class DistributedSystemHealthConfigImpl implements DistributedSystemHealthConfig { + + /** + * The maximum number of application members that can unexceptedly leave a healthy the distributed + * system. + */ + private long maxDepartedApplications = DEFAULT_MAX_DEPARTED_APPLICATIONS; + + // Constructors // + + /** + * Creates a new DistributedSystemHealthConfigImpl with the default configuration. + */ + protected DistributedSystemHealthConfigImpl() { + + } + + / Instance Methods / + + public long getMaxDepartedApplications() { +return this.maxDepartedApplications; + } + + public void setMaxDepartedApplications(long maxDepartedApplications) { +this.maxDepartedApplications = maxDepartedApplications; + } +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b6c305f8/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthEvaluator.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthEvaluator.java new file mode 100644 index 000..5087933 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthEvaluator.java @@ -0,0 +1,167 @@ +/* + * 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.internal.admin.api.impl; + +import org.apache.geode.internal.admin.api.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
[29/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/internal/admin/api/GemFireMemberStatus.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java new file mode 100755 index 000..6bac386 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java @@ -0,0 +1,670 @@ +/* + * 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.internal.admin.api; + +import org.apache.geode.cache.Cache; +import org.apache.geode.cache.Region; +import org.apache.geode.cache.client.PoolManager; +import org.apache.geode.cache.server.CacheServer; +import org.apache.geode.distributed.DistributedSystem; +import org.apache.geode.distributed.Locator; +import org.apache.geode.distributed.internal.DM; +import org.apache.geode.distributed.internal.DistributionConfig; +import org.apache.geode.distributed.internal.InternalDistributedSystem; +import org.apache.geode.distributed.internal.membership.InternalDistributedMember; +import org.apache.geode.internal.net.SocketCreator; +import org.apache.geode.internal.admin.ClientHealthMonitoringRegion; +import org.apache.geode.internal.admin.remote.ClientHealthStats; +import org.apache.geode.internal.cache.*; +import org.apache.geode.internal.cache.tier.InternalClientMembership; +import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; + +import java.io.IOException; +import java.io.Serializable; +import java.net.InetAddress; +import java.util.*; + +/** + * Class GemFireMemberStatus provides the status of a specific GemFire member VM. This + * VM can be a peer, a client, a server and/or a gateway. + * + * @deprecated as of 7.0 use the management + * package instead + */ +public class GemFireMemberStatus implements Serializable { + private static final long serialVersionUID = 3389997790525991310L; + + /** + * Notifies whether this member is a client to a cache server. + */ + protected boolean _isClient; + + /** + * Notifies whether this member is a cache server. + */ + protected boolean _isServer; + + /** + * Notifies whether this member is a hub for WAN gateways. + */ + protected boolean _isGatewayHub; + + /** + * Notifies whether this member is a locator. + */ + protected boolean _isLocator; + + protected boolean _isPrimaryGatewayHub; + + protected Object/* GatewayHubStatus */ _gatewayHubStatus; + + protected boolean _isConnected; + protected Serializable _memberId; + protected Set _connectedPeers; + protected Set _connectedServers; + protected Set _unconnectedServers; + protected Set _connectedClients; + protected Map _connectedIncomingGateways; + protected Map _outgoingGateways; + + protected Map _clientHostNames; + protected Map _clientQueueSizes; + protected Map _gatewayQueueSizes; + protected Map _regionStatuses; + protected Map _clientHealthStats; + + protected String _memberName; + protected int _mcastPort; + protected int _serverPort; + protected InetAddress _mcastAddress; + protected String _bindAddress; + protected String _locators; + protected InetAddress _hostAddress; + + protected long _maximumHeapSize; + protected long _freeHeapSize; + + protected long upTime = -1; + + protected transient final Cache cache; + + public GemFireMemberStatus() { +this(null); + } + + public GemFireMemberStatus(Cache cache) { +this.cache = cache; +DistributedSystem ds = null; +if (cache != null) { + ds = cache.getDistributedSystem(); +} +initialize(ds); + } + + public boolean getIsConnected() { +return this._isConnected; + } + + protected void setIsConnected(boolean isConnected) { +this._isConnected = isConnected; + } + + /** + * Returns whether this member is a client to a cache server + * + * @return whether this member is a client to a cache server + */ + public boolean getIsClient() { +return this._isClient; + } + + /** + * Sets whether this member is a client to a cache server +
[06/50] [abbrv] incubator-geode git commit: GEODE-2110 Add gfsh start server user and password options
GEODE-2110 Add gfsh start server user and password options Modifies gfsh start server command reference page to add the two missing options: --user and --password Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/6118a6a9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/6118a6a9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/6118a6a9 Branch: refs/heads/feature/GEODE-288 Commit: 6118a6a95cad3bc4708c535cabb9f9bdc9d10738 Parents: 139398a Author: Karen MillerAuthored: Mon Nov 14 17:41:55 2016 -0800 Committer: Karen Miller Committed: Tue Nov 15 08:51:33 2016 -0800 -- .../gfsh/command-pages/start.html.md.erb | 15 +++ 1 file changed, 15 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6118a6a9/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb -- diff --git a/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb b/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb index 06dfce4..e80e94a 100644 --- a/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb +++ b/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb @@ -501,6 +501,7 @@ start server --name=value [--assign-buckets(=value)] [--bind-address=value] [--socket-buffer-size=value] [--lock-memory=value] [--off-heap-memory-size=value] [--start-rest-api=value] [--http-service-port=value] [--http-service-bind-address=value] +[--user=value] [--password=value] ``` @@ -763,6 +764,20 @@ See Overview of all local addresses + +\-\-user +The user name of the credential to use in authenticating to the cluster. +When specified, if the --password option is not also specified, +then gfsh will prompt for the password. + + + + +\-\-password +The password portion of the credential to use in authenticating to the cluster. + + +
[22/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/internal/admin/api/impl/SystemMemberRegionImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionImpl.java new file mode 100644 index 000..87a06b8 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionImpl.java @@ -0,0 +1,372 @@ +/* + * 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.internal.admin.api.impl; + +import org.apache.geode.cache.*; +// import org.apache.geode.internal.Assert; +// import org.apache.geode.internal.admin.*; +import org.apache.geode.internal.admin.api.AdminException; +import org.apache.geode.internal.admin.api.SystemMemberRegion; +import org.apache.geode.internal.admin.remote.*; + +import java.io.File; +import java.util.*; + +/** + * View of a region in a GemFire system member's cache. + * + * @since GemFire 3.5 + */ +public class SystemMemberRegionImpl implements SystemMemberRegion { + + private AdminRegion r; + private RegionAttributes ra; + private CacheStatistics rs; + private Set subregionNames; + private Set subregionFullPaths; + private int entryCount; + private int subregionCount; + + /** The cache to which this region belongs */ + private final SystemMemberCacheImpl cache; + + // constructors + public SystemMemberRegionImpl(SystemMemberCacheImpl cache, Region r) { +this.cache = cache; +this.r = (AdminRegion) r; + } + + private void refreshFields() { +this.ra = this.r.getAttributes(); +if (getStatisticsEnabled() && !this.ra.getDataPolicy().withPartitioning()) { + this.rs = this.r.getStatistics(); +} else { + this.rs = null; +} +{ // set subregionNames + Set s = this.r.subregions(false); + Set names = new TreeSet(); + Set paths = new TreeSet(); + Iterator it = s.iterator(); + while (it.hasNext()) { +Region r = (Region) it.next(); +String name = r.getName(); +names.add(name); +paths.add(this.getFullPath() + Region.SEPARATOR_CHAR + name); + } + this.subregionNames = names; + this.subregionFullPaths = paths; +} +try { + int[] sizes = this.r.sizes(); + this.entryCount = sizes[0]; + this.subregionCount = sizes[1]; +} catch (CacheException ignore) { + this.entryCount = 0; + this.subregionCount = 0; +} + } + + // attributes + public String getName() { +return this.r.getName(); + } + + public String getFullPath() { +return this.r.getFullPath(); + } + + public java.util.Set getSubregionNames() { +return this.subregionNames; + } + + public java.util.Set getSubregionFullPaths() { +return this.subregionFullPaths; + } + + public String getUserAttribute() { +return (String) r.getUserAttribute(); + } + + public String getCacheLoader() { +Object o = this.ra.getCacheLoader(); +if (o == null) { + return ""; +} else { + return o.toString(); +} + } + + public String getCacheWriter() { +Object o = this.ra.getCacheWriter(); +if (o == null) { + return ""; +} else { + return o.toString(); +} + } + + public String getKeyConstraint() { +Class constraint = this.ra.getKeyConstraint(); +if (constraint == null) { + return ""; +} else { + return constraint.getName(); +} + } + + public String getValueConstraint() { +Class constraint = this.ra.getValueConstraint(); +if (constraint == null) { + return ""; +} else { + return constraint.getName(); +} + } + + public boolean getEarlyAck() { +return this.ra.getEarlyAck(); + } + + public int getRegionTimeToLiveTimeLimit() { +return this.ra.getRegionTimeToLive().getTimeout(); + } + + public ExpirationAction getRegionTimeToLiveAction() { +return this.ra.getRegionTimeToLive().getAction(); + } + + public int getEntryTimeToLiveTimeLimit() { +return this.ra.getEntryTimeToLive().getTimeout(); + }
[21/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/internal/admin/api/jmx/impl/AdminDistributedSystemJmxImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AdminDistributedSystemJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AdminDistributedSystemJmxImpl.java new file mode 100755 index 000..7998091 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AdminDistributedSystemJmxImpl.java @@ -0,0 +1,2289 @@ +/* + * 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.internal.admin.api.jmx.impl; + +import org.apache.geode.DataSerializer; +import org.apache.geode.SystemFailure; +import org.apache.geode.internal.admin.api.AdminException; +import org.apache.geode.internal.admin.api.CacheServer; +import org.apache.geode.internal.admin.api.CacheServerConfig; +import org.apache.geode.internal.admin.api.CacheVm; +import org.apache.geode.internal.admin.api.CacheVmConfig; +import org.apache.geode.internal.admin.api.DistributedSystemConfig; +import org.apache.geode.internal.admin.api.DistributionLocator; +import org.apache.geode.internal.admin.api.DistributionLocatorConfig; +import org.apache.geode.internal.admin.api.GemFireHealth; +import org.apache.geode.internal.admin.api.SystemMember; +import org.apache.geode.internal.admin.api.SystemMemberCacheEvent; +import org.apache.geode.internal.admin.api.SystemMemberCacheListener; +import org.apache.geode.internal.admin.api.SystemMemberRegionEvent; +import org.apache.geode.internal.admin.api.SystemMemberType; +import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl; +import org.apache.geode.internal.admin.api.impl.CacheServerConfigImpl; +import org.apache.geode.internal.admin.api.impl.DistributionLocatorImpl; +import org.apache.geode.cache.persistence.PersistentID; +import org.apache.geode.distributed.DistributedMember; +import org.apache.geode.distributed.internal.DistributionConfig; +import org.apache.geode.distributed.internal.InternalDistributedSystem; +import org.apache.geode.distributed.internal.membership.InternalDistributedMember; +import org.apache.geode.internal.Assert; +import org.apache.geode.internal.admin.Alert; +import org.apache.geode.internal.admin.*; +import org.apache.geode.internal.admin.remote.UpdateAlertDefinitionMessage; +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.log4j.LocalizedMessage; +import org.apache.logging.log4j.Logger; + +import javax.management.*; +import javax.management.modelmbean.ModelMBean; +import javax.management.openmbean.*; +import java.io.*; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * Provides MBean support for managing a GemFire distributed system. + * + * TODO: refactor to implement DistributedSystem and delegate to instance of DistributedSystemImpl. + * Wrap all delegate calls w/ e.printStackTrace() since the HttpAdaptor devours them (what to do w/ + * template methods then?) + * + * @since GemFire 3.5 + */ +public class AdminDistributedSystemJmxImpl extends AdminDistributedSystemImpl +implements ManagedResource, DistributedSystemConfig, StatAlertsAggregator { + + private static final Logger logger = LogService.getLogger(); + + private Properties mailProps; + + // The file name where the StatAlertDefinitions would be serialized + private String statAlertDefnSerFile = System.getProperty("user.dir"); + + /** + * Simple counter incrementing on each notification. This this currently resets at every restart + * of Agent + */ + private final AtomicInteger notificationSequenceNumber = new AtomicInteger(); + + /** + * Variable to indicate if there are no Rmi clients connected. + */ + private volatile boolean isRmiClientCountZero; + + /** + * Variable to indicate if Statistics Alert definitions could be
[17/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/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl.java new file mode 100644 index 000..23e9038 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl.java @@ -0,0 +1,211 @@ +/* + * 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.internal.admin.api.jmx.impl; + +import javax.management.ObjectName; +import javax.management.modelmbean.ModelMBean; + +import org.apache.geode.internal.admin.api.AdminException; +import org.apache.geode.internal.admin.api.GemFireHealth; +import org.apache.geode.internal.admin.api.GemFireHealthConfig; +import org.apache.geode.internal.admin.api.impl.GemFireHealthConfigImpl; + +/** + * The JMX "managed resource" that represents the configuration for the health of GemFire. + * Basically, it provides the behavior of GemFireHealthConfigImpl, but does some JMX + * stuff like registering beans with the agent. + * + * + * + * Unlike other ManagedResources this class cannot simply subclass + * GemFireHealthImpl because it instances are serialized and sent to other VMs. This is + * problematic because the other VMs most likely do not have JMX classes like + * ModelMBean on their classpaths. So, instead we delegate all of the + * GemFireHealthConfig behavior to another object which IS serialized. + * + * @see GemFireHealthJmxImpl#createDistributedSystemHealthConfig + * + * + * @since GemFire 3.5 + */ +@edu.umd.cs.findbugs.annotations.SuppressWarnings( +justification = "This class is deprecated. Also, any further changes so close to the release is inadvisable.") +public class GemFireHealthConfigJmxImpl +implements GemFireHealthConfig, ManagedResource, java.io.Serializable { + + private static final long serialVersionUID = 1482719647163239953L; + + /** The GemFireHealth that we help configure */ + private GemFireHealth health; + + /** The name of the MBean that will manage this resource */ + private String mbeanName; + + /** The ModelMBean that is configured to manage this resource */ + private ModelMBean modelMBean; + + /** The delegate that contains the real config state */ + private GemFireHealthConfig delegate; + + /** The object name of this managed resource */ + private ObjectName objectName; + + /// Constructors /// + + /** + * Creates a new GemFireHealthConfigJmxImpl that configures the health monitoring of + * components running on the given host. + */ + GemFireHealthConfigJmxImpl(GemFireHealthJmxImpl health, String hostName) throws AdminException { + +this.delegate = new GemFireHealthConfigImpl(hostName); +this.health = health; +this.mbeanName = new StringBuffer().append(MBEAN_NAME_PREFIX).append("GemFireHealthConfig,id=") + .append(MBeanUtil.makeCompliantMBeanNameProperty(health.getDistributedSystem().getId())) +.append(",host=") +.append((hostName == null ? "default" : MBeanUtil.makeCompliantMBeanNameProperty(hostName))) +.toString(); +this.objectName = MBeanUtil.createMBean(this); + } + + // Instance Methods // + + /** + * Applies the changes made to this config back to the health monitor. + * + * @see GemFireHealth#setDistributedSystemHealthConfig + */ + public void applyChanges() { +String hostName = this.getHostName(); +if (hostName == null) { + this.health.setDefaultGemFireHealthConfig(this); + +} else { + this.health.setGemFireHealthConfig(hostName, this); +} + } + + public String getMBeanName() { +return this.mbeanName; + } + + public ModelMBean getModelMBean() { +return this.modelMBean; + } + + public ObjectName getObjectName() { +return this.objectName; + } + + public void setModelMBean(ModelMBean modelMBean) { +
[03/50] [abbrv] incubator-geode git commit: GEODE-2105 Remove docs about log collection utility
GEODE-2105 Remove docs about log collection utility The log collection utility is not part of the release, so remove the documentation. The content removed by this commit has been placed on the feature/GEODE-79 branch. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/ddc4819b Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/ddc4819b Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/ddc4819b Branch: refs/heads/feature/GEODE-288 Commit: ddc4819b01470825997b8504c0971d04ddfab2f3 Parents: 8c383ee Author: Karen MillerAuthored: Mon Nov 14 14:52:20 2016 -0800 Committer: Karen Miller Committed: Mon Nov 14 14:52:20 2016 -0800 -- .../source/subnavs/geode-subnav.erb | 3 - .../logging/log_collection_utility.html.md.erb | 71 geode-docs/managing/logging/logging.html.md.erb | 4 -- 3 files changed, 78 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ddc4819b/geode-book/master_middleman/source/subnavs/geode-subnav.erb -- diff --git a/geode-book/master_middleman/source/subnavs/geode-subnav.erb b/geode-book/master_middleman/source/subnavs/geode-subnav.erb index 959fdf3..2983460 100644 --- a/geode-book/master_middleman/source/subnavs/geode-subnav.erb +++ b/geode-book/master_middleman/source/subnavs/geode-subnav.erb @@ -792,9 +792,6 @@ limitations under the License. Advanced UsersâConfiguring Log4j 2 for Geode - -Log Collection Utility - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ddc4819b/geode-docs/managing/logging/log_collection_utility.html.md.erb -- diff --git a/geode-docs/managing/logging/log_collection_utility.html.md.erb b/geode-docs/managing/logging/log_collection_utility.html.md.erb deleted file mode 100644 index e83634f..000 --- a/geode-docs/managing/logging/log_collection_utility.html.md.erb +++ /dev/null @@ -1,71 +0,0 @@ -title: Log Collection Utility - - - -To aid in the troubleshooting of Apache Geode issues, you can use the provided log collection utility to gather and upload log files and other troubleshooting artifacts. This tool is only supported on Linux machines. - -This utility is used to gather log files and other troubleshooting artifacts from a Geode cluster. - -The tool goes through and collects all files ending with `.log`, `.err`, .`cfg`, `.gfs`, `.stack`, `.xml`, `.properties,` and `.txt` from the working directories of running Geode processes. It also obtains thread dumps for each Geode process but will not collect heap dumps. - -The collection utility copies all log and artifact files to its host machine and then compresses all the files. You should ensure that the machine running the utility has sufficient disk space to hold all the collected log and artifact files from the cluster. - -In default mode, the tool requires that a Geode process is running on each machine where the tool is gathering logs and artifact files. If you would like to collect log and artifact files from a machine or machines where Geode processes are not running, use *Static Copy Mode* by specifying the `-m` option and providing a file that lists log and artifact file locations. - -The utility is provided in `$GEMFIRE/tools/LogCollectionUtility`. - -## Usage - -``` pre -java -jar gfe-logcollect.jar -c -o [OPTIONS] - -Required arguments: --c company name to append to output filename --o output directory to store all collected log files - -Optional arguments: --a comma separated list of hosts with no spaces. EG. host1,host2,host3 (defaults to localhost) --u username to use to connect via ssh (defaults to current user) --i identity file to use for PKI based ssh (defaults to ~/.ssh/id_[dsa|rsa] --p prompt for a password to use for ssh connections --t ticket number to append to created zip file --d don't clean up collected log files after the zip has been created --s send the zip file to Pivotal support --f ftp server to upload collected logs to. Defaults to ftp.gemstone.com --v print version of this utility --h print this help information - -Static Copy Mode --m Use a file with log locations instead of scanning for logs. - Entries should be in the format hostname:/log/location -``` - -## Known Limitations -
[07/50] [abbrv] incubator-geode git commit: GEODE-2112: Improved cleanup for UITests
GEODE-2112: Improved cleanup for UITests UITests were failing when more than one was run because they all share a base class that was not properly cleaned up. This closes #284 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/cc996a61 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/cc996a61 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/cc996a61 Branch: refs/heads/feature/GEODE-288 Commit: cc996a61d72123c358ced362fb884169e068bcff Parents: 6118a6a Author: Jared StewartAuthored: Mon Nov 14 16:06:49 2016 -0800 Committer: Kirk Lund Committed: Tue Nov 15 09:32:22 2016 -0800 -- .../tools/pulse/tests/ui/PulseAbstractTest.java | 21 1 file changed, 13 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/cc996a61/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAbstractTest.java -- diff --git a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAbstractTest.java b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAbstractTest.java index 9116a80..89ccb3f 100644 --- a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAbstractTest.java +++ b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAbstractTest.java @@ -224,8 +224,18 @@ public abstract class PulseAbstractTest extends PulseBaseTest { @AfterClass public static void tearDownAfterClass() throws Exception { -driver.close(); -jetty.stop(); +if (driver != null) { + driver.close(); + driver = null; +} +if (jetty != null) { + jetty.stop(); + jetty = null; +} +if (server != null) { + server.stop(); + server = null; +} } @Before @@ -402,10 +412,7 @@ public abstract class PulseAbstractTest extends PulseBaseTest { @Test public void testClusterGridViewMemberID() throws InterruptedException { searchByIdAndClick("default_grid_button"); -List elements = driver.findElements(By.xpath("//table[@id='memberList']/tbody/tr")); // gives - // me - // 11 - // rows +List elements = driver.findElements(By.xpath("//table[@id='memberList']/tbody/tr")); for (int memberCount = 1; memberCount < elements.size(); memberCount++) { String memberId = driver @@ -932,7 +939,6 @@ public abstract class PulseAbstractTest extends PulseBaseTest { String loadAvgM1 = JMXProperties.getInstance().getProperty("member.M" + (i) + ".loadAverage"); assertEquals(df2.format(Double.valueOf(loadAvgM1)), LoadAvgM1); - String ThreadsM1 = driver .findElement( By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 3) + "]/div[2]/div")) @@ -1035,7 +1041,6 @@ public abstract class PulseAbstractTest extends PulseBaseTest { wait.until(ExpectedConditions .visibilityOf(driver.findElement(By.xpath("//label[text()='Data Browser']"; - // Verify all elements must be displayed on data browser screen assertTrue(driver.findElement(By.xpath("//a[text()='Data Regions']")).isDisplayed()); assertTrue(driver.findElement(By.id("linkColocatedRegions")).isDisplayed());
[16/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/internal/admin/api/jmx/impl/MX4JModelMBean.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JModelMBean.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JModelMBean.java new file mode 100755 index 000..2facc17 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JModelMBean.java @@ -0,0 +1,1232 @@ +/* + * Copyright (C) MX4J. All rights reserved. + * + * This software is distributed under the terms of the MX4J License version 1.0. See the terms of + * the MX4J License in the documentation provided with this software. + */ + +package org.apache.geode.internal.admin.api.jmx.impl; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Date; +import java.util.Iterator; + +import javax.management.Attribute; +import javax.management.AttributeChangeNotification; +import javax.management.AttributeChangeNotificationFilter; +import javax.management.AttributeList; +import javax.management.AttributeNotFoundException; +import javax.management.Descriptor; +import javax.management.InstanceNotFoundException; +import javax.management.InvalidAttributeValueException; +import javax.management.ListenerNotFoundException; +import javax.management.MBeanAttributeInfo; +import javax.management.MBeanException; +import javax.management.MBeanInfo; +import javax.management.MBeanNotificationInfo; +import javax.management.MBeanOperationInfo; +import javax.management.MBeanRegistration; +import javax.management.MBeanRegistrationException; +import javax.management.MBeanServer; +import javax.management.MalformedObjectNameException; +import javax.management.Notification; +import javax.management.NotificationBroadcasterSupport; +import javax.management.NotificationEmitter; +import javax.management.NotificationFilter; +import javax.management.NotificationListener; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.RuntimeErrorException; +import javax.management.RuntimeOperationsException; +import javax.management.ServiceNotFoundException; +import javax.management.loading.ClassLoaderRepository; +import javax.management.modelmbean.InvalidTargetObjectTypeException; +import javax.management.modelmbean.ModelMBean; +import javax.management.modelmbean.ModelMBeanAttributeInfo; +import javax.management.modelmbean.ModelMBeanInfo; +import javax.management.modelmbean.ModelMBeanOperationInfo; + +import mx4j.ImplementationException; +import mx4j.log.FileLogger; +import mx4j.log.Log; +import mx4j.log.Logger; +import mx4j.log.MBeanLogger; +import mx4j.persist.FilePersister; +import mx4j.persist.MBeanPersister; +import mx4j.persist.PersisterMBean; +import mx4j.util.Utils; + +import org.apache.geode.internal.i18n.LocalizedStrings; + +/** + * @author mailto:biorn_stee...@users.sourceforge.net;>Simone Bordet + * @version $Revision: 1.14 $ + */ +public class MX4JModelMBean implements ModelMBean, MBeanRegistration, NotificationEmitter { + private static final String OBJECT_RESOURCE_TYPE = "ObjectReference"; + + private static final int ALWAYS_STALE = 1; + private static final int NEVER_STALE = 2; + private static final int STALE = 3; + private static final int NOT_STALE = 4; + + private static final int PERSIST_NEVER = -1; + private static final int PERSIST_ON_TIMER = -2; + private static final int PERSIST_ON_UPDATE = -3; + private static final int PERSIST_NO_MORE_OFTEN_THAN = -4; + + private MBeanServer m_mbeanServer; + private Object m_managedResource; + private boolean m_canBeRegistered; + private ModelMBeanInfo m_modelMBeanInfo; + private NotificationBroadcasterSupport m_attributeChangeBroadcaster = + new NotificationBroadcasterSupport(); + private NotificationBroadcasterSupport m_generalBroadcaster = + new NotificationBroadcasterSupport(); + + public MX4JModelMBean() throws MBeanException, RuntimeOperationsException { +try { + load(); +} catch (Exception x) { + Logger logger = getLogger(); + logger.warn(LocalizedStrings.MX4JModelMBean_CANNOT_RESTORE_PREVIOUSLY_SAVED_STATUS + .toLocalizedString(), x); +} + } + + public MX4JModelMBean(ModelMBeanInfo info) throws MBeanException, RuntimeOperationsException { +if (info == null) + throw new RuntimeOperationsException(new IllegalArgumentException( + LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_PARAMETER_CANT_BE_NULL + .toLocalizedString())); +else + setModelMBeanInfo(info); + } + + private Logger getLogger() { +return Log.getLogger(getClass().getName()); + } + + public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { +if (m_canBeRegistered) { + m_mbeanServer
[50/50] [abbrv] incubator-geode git commit: Convert from ManagementTestCase to ManagementTestRule
Convert from ManagementTestCase to ManagementTestRule Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/22f577eb Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/22f577eb Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/22f577eb Branch: refs/heads/feature/GEODE-1930 Commit: 22f577eb3df264afad754bfaff7eee4f529de9c7 Parents: 0c9002b Author: Kirk LundAuthored: Mon Oct 31 13:45:28 2016 -0700 Committer: Kirk Lund Committed: Tue Nov 15 12:26:26 2016 -0800 -- .../RestAPIsAndInterOpsDUnitTest.java | 110 +- geode-core/build.gradle |1 + .../org/apache/geode/management/JVMMetrics.java |3 +- .../org/apache/geode/management/OSMetrics.java |5 +- .../internal/SystemManagementService.java |2 +- .../DistributedLockServiceDUnitTest.java| 18 +- .../cache/ConnectDisconnectDUnitTest.java | 26 +- ...gionBucketCreationDistributionDUnitTest.java | 10 +- .../cache/locks/TXLockServiceDUnitTest.java | 18 +- .../management/CacheManagementDUnitTest.java| 987 +- .../management/ClientHealthStatsDUnitTest.java | 559 +++--- .../management/CompositeTypeTestDUnitTest.java | 189 +- .../management/DLockManagementDUnitTest.java| 520 ++ .../management/DiskManagementDUnitTest.java | 789 +++- .../management/DistributedSystemDUnitTest.java | 952 +++--- .../geode/management/JMXMBeanDUnitTest.java |2 +- .../management/LocatorManagementDUnitTest.java | 417 ++--- .../geode/management/ManagementTestBase.java| 545 ++ .../geode/management/ManagementTestRule.java| 430 + .../org/apache/geode/management/Manager.java| 31 + .../org/apache/geode/management/Member.java | 31 + .../management/OffHeapManagementDUnitTest.java | 373 ++-- .../geode/management/QueryDataDUnitTest.java| 1202 +--- .../management/RegionManagementDUnitTest.java | 1754 -- .../stats/DistributedSystemStatsDUnitTest.java | 104 +- .../QueryDataFunctionApplyLimitClauseTest.java | 12 +- .../internal/pulse/TestClientIdsDUnitTest.java | 88 +- .../pulse/TestSubscriptionsDUnitTest.java | 292 +-- .../geode/test/dunit/AsyncInvocation.java | 63 +- .../org/apache/geode/test/dunit/Invoke.java |6 +- .../java/org/apache/geode/test/dunit/VM.java|7 +- .../java/org/apache/geode/test/dunit/Wait.java |2 + .../cache/internal/JUnit4CacheTestCase.java |5 + .../internal/JUnit4DistributedTestCase.java |4 +- .../dunit/rules/DistributedDisconnectRule.java |4 +- .../DistributedRestoreSystemProperties.java |4 +- .../geode/test/dunit/rules/DistributedRule.java | 68 + .../test/dunit/rules/DistributedRunRules.java | 76 + .../test/dunit/rules/DistributedStatement.java | 76 + .../test/dunit/rules/DistributedTestRule.java | 192 ++ .../DistributedUseJacksonForJsonPathRule.java | 51 + .../dunit/rules/DistributedWrapperRule.java | 52 + .../geode/test/dunit/rules/RemoteInvoker.java | 16 +- .../apache/geode/test/dunit/rules/WhichVMs.java | 58 + .../rules/tests/DistributedTestRuleTest.java| 54 + .../test/dunit/standalone/DUnitLauncher.java| 70 +- geode-junit/build.gradle|1 + .../junit/rules/UseJacksonForJsonPathRule.java | 128 ++ .../SerializableExternalResource.java | 25 +- .../serializable/SerializableStatement.java | 27 + .../management/LuceneManagementDUnitTest.java | 32 +- gradle/dependency-versions.properties |3 +- 52 files changed, 4838 insertions(+), 5656 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java -- diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java index c90a7a4..b989206 100644 --- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java +++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java @@ -65,7 +65,6 @@ import org.apache.geode.distributed.DistributedSystem; import org.apache.geode.internal.AvailablePort; import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.internal.cache.GemFireCacheImpl; -import org.apache.geode.management.ManagementTestBase; import
[49/50] [abbrv] incubator-geode git commit: Convert from ManagementTestCase to ManagementTestRule
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java index a3c8b27..2c7ae07 100644 --- a/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java @@ -14,13 +14,25 @@ */ package org.apache.geode.management; +import static java.util.concurrent.TimeUnit.*; import static org.apache.geode.distributed.ConfigurationProperties.*; -import static org.apache.geode.test.dunit.Assert.*; +import static org.apache.geode.test.dunit.Host.*; +import static org.apache.geode.test.dunit.IgnoredException.*; +import static org.apache.geode.test.dunit.Invoke.*; +import static org.apache.geode.test.dunit.NetworkUtils.*; +import static org.assertj.core.api.Assertions.*; +import java.io.Serializable; import java.util.Collection; -import java.util.Iterator; import java.util.Properties; +import javax.management.ObjectName; + +import com.jayway.awaitility.Awaitility; +import com.jayway.awaitility.core.ConditionFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -29,22 +41,17 @@ import org.apache.geode.cache.EntryEvent; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionFactory; import org.apache.geode.cache.RegionShortcut; +import org.apache.geode.cache.client.ClientCache; import org.apache.geode.cache.client.ClientCacheFactory; import org.apache.geode.cache.client.ClientRegionFactory; import org.apache.geode.cache.client.ClientRegionShortcut; import org.apache.geode.cache.server.CacheServer; import org.apache.geode.cache.util.CacheListenerAdapter; import org.apache.geode.distributed.DistributedMember; -import org.apache.geode.internal.cache.GemFireCacheImpl; import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier; import org.apache.geode.internal.cache.tier.sockets.CacheClientProxy; -import org.apache.geode.internal.i18n.LocalizedStrings; -import org.apache.geode.test.dunit.Host; -import org.apache.geode.test.dunit.IgnoredException; +import org.apache.geode.management.internal.SystemManagementService; import org.apache.geode.test.dunit.VM; -import org.apache.geode.test.dunit.Wait; -import org.apache.geode.test.dunit.WaitCriterion; -import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase; import org.apache.geode.test.junit.categories.DistributedTest; import org.apache.geode.test.junit.categories.FlakyTest; @@ -52,415 +59,343 @@ import org.apache.geode.test.junit.categories.FlakyTest; * Client health stats check */ @Category(DistributedTest.class) -@SuppressWarnings("serial") -public class ClientHealthStatsDUnitTest extends JUnit4DistributedTestCase { - - private static final String k1 = "k1"; - private static final String k2 = "k2"; - private static final String client_k1 = "client-k1"; - private static final String client_k2 = "client-k2"; +@SuppressWarnings({ "serial", "unused" }) +public class ClientHealthStatsDUnitTest implements Serializable { - /** name of the test region */ - private static final String REGION_NAME = "ClientHealthStatsDUnitTest_Region"; + private static final int NUMBER_PUTS = 100; - private static VM client = null; - private static VM client2 = null; - private static VM managingNode = null; + private static final String KEY1 = "KEY1"; + private static final String KEY2 = "KEY2"; + private static final String VALUE1 = "VALUE1"; + private static final String VALUE2 = "VALUE2"; - private static ManagementTestBase helper = new ManagementTestBase() {}; + private static final String REGION_NAME = ClientHealthStatsDUnitTest.class.getSimpleName() + "_Region"; - private static int numOfCreates = 0; - private static int numOfUpdates = 0; - private static int numOfInvalidates = 0; - private static boolean lastKeyReceived = false; + // client1VM and client2VM VM fields + private static ClientCache clientCache; - private static GemFireCacheImpl cache = null; + // TODO: assert following values in each client VM + private static int numOfCreates; + private static int numOfUpdates; + private static int numOfInvalidates; + private static boolean lastKeyReceived; - private VM server = null; + private VM managerVM; + private VM serverVM; + private VM client1VM; + private VM client2VM; - @Override - public final void postSetUp() throws Exception { -disconnectAllFromDS(); + private String hostName; -final Host host = Host.getHost(0); -managingNode = host.getVM(0); -server = host.getVM(1); -
[25/50] [abbrv] incubator-geode git commit: Addressing Review comments.
Addressing Review comments. This closes #278 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e9c57169 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e9c57169 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e9c57169 Branch: refs/heads/feature/GEODE-1930 Commit: e9c571692c9875f1ec5113c06703703b7206099f Parents: 86f4755 Author: adongreAuthored: Sun Nov 6 17:27:55 2016 +0530 Committer: Anthony Baker Committed: Sat Nov 12 07:56:16 2016 -0800 -- .../CreateAlterDestroyRegionCommands.java | 22 ++-- .../cli/functions/RegionCreateFunction.java | 18 +--- ...eateAlterDestroyRegionCommandsDUnitTest.java | 6 +++--- 3 files changed, 19 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e9c57169/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java index 58af6cb..358cdc1 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java @@ -31,7 +31,6 @@ import javax.management.MBeanServer; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; -import joptsimple.internal.Strings; import org.apache.geode.cache.*; import org.springframework.shell.core.annotation.CliAvailabilityIndicator; import org.springframework.shell.core.annotation.CliCommand; @@ -905,26 +904,17 @@ public class CreateAlterDestroyRegionCommands extends AbstractCommandsSupport { } if (regionFunctionArgs.hasPartitionAttributes()) { - boolean partitionResolverFailure = false; if (regionFunctionArgs.isPartitionResolverSet()) { String partitionResolverClassName = regionFunctionArgs.getPartitionResolver(); -Object partitionResolver = null; - try { - Class compressorClass = - (Class) ClassPathLoader.getLatest().forName(partitionResolverClassName); - partitionResolver = compressorClass.newInstance(); -} catch (InstantiationException e) { - partitionResolverFailure = true; -} catch (IllegalAccessException e) { - partitionResolverFailure = true; -} catch (ClassNotFoundException e) { - partitionResolverFailure = true; -} -if (partitionResolverFailure || !(partitionResolver instanceof PartitionResolver)) { + Class resolverClass = (Class) ClassPathLoader + .getLatest().forName(partitionResolverClassName); + PartitionResolver partitionResolver = resolverClass.newInstance(); +} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new IllegalArgumentException( CliStrings.format(CliStrings.CREATE_REGION__MSG__INVALID_PARTITION_RESOLVER, - new Object[] {regionFunctionArgs.getCompressor()})); + new Object[] {regionFunctionArgs.getCompressor()}), + e); } } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e9c57169/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionCreateFunction.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionCreateFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionCreateFunction.java index b925936..c99f84a 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionCreateFunction.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionCreateFunction.java @@ -16,8 +16,8 @@ package org.apache.geode.management.internal.cli.functions; import java.util.Set; -import joptsimple.internal.Strings; import org.apache.geode.internal.ClassPathLoader; +import org.apache.geode.internal.lang.StringUtils; import org.apache.logging.log4j.Logger; import org.apache.geode.cache.Cache; @@ -409,8 +409,8 @@ public class RegionCreateFunction extends FunctionAdapter implements InternalEnt } if (regionCreateArgs.isPartitionResolverSet()) { - Class partitionResolverClass =
[44/50] [abbrv] incubator-geode git commit: Convert from ManagementTestCase to ManagementTestRule
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/RegionManagementDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/RegionManagementDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/RegionManagementDUnitTest.java index fcdc3a4..92624a4 100644 --- a/geode-core/src/test/java/org/apache/geode/management/RegionManagementDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/RegionManagementDUnitTest.java @@ -12,22 +12,46 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ +/* + * 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.management; -import static org.junit.Assert.*; +import static java.util.concurrent.TimeUnit.MINUTES; +import static org.apache.geode.cache.Region.*; +import static org.apache.geode.test.dunit.Host.*; +import static org.apache.geode.test.dunit.Invoke.invokeInEveryVM; +import static org.assertj.core.api.Assertions.*; +import java.lang.management.ManagementFactory; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.concurrent.atomic.AtomicReference; -import javax.management.InstanceNotFoundException; -import javax.management.MBeanServer; -import javax.management.MalformedObjectNameException; import javax.management.Notification; import javax.management.NotificationListener; import javax.management.ObjectName; +import com.jayway.awaitility.Awaitility; +import com.jayway.awaitility.core.ConditionFactory; +import org.junit.After; +import org.junit.Before; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -41,1325 +65,1063 @@ import org.apache.geode.cache.PartitionAttributes; import org.apache.geode.cache.PartitionAttributesFactory; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionAttributes; +import org.apache.geode.cache.RegionFactory; +import org.apache.geode.cache.RegionShortcut; import org.apache.geode.cache.Scope; import org.apache.geode.cache.query.data.Portfolio; import org.apache.geode.distributed.DistributedMember; -import org.apache.geode.distributed.internal.InternalDistributedSystem; +import org.apache.geode.distributed.internal.DM; +import org.apache.geode.internal.cache.AbstractRegion; import org.apache.geode.internal.cache.GemFireCacheImpl; -import org.apache.geode.internal.cache.LocalRegion; import org.apache.geode.internal.cache.TestObjectSizerImpl; import org.apache.geode.internal.cache.lru.LRUStatistics; import org.apache.geode.internal.cache.partitioned.fixed.SingleHopQuarterPartitionResolver; import org.apache.geode.management.internal.MBeanJMXAdapter; import org.apache.geode.management.internal.SystemManagementService; -import org.apache.geode.test.dunit.Assert; import org.apache.geode.test.dunit.LogWriterUtils; -import org.apache.geode.test.dunit.SerializableRunnable; import org.apache.geode.test.dunit.VM; import org.apache.geode.test.dunit.Wait; import org.apache.geode.test.dunit.WaitCriterion; import org.apache.geode.test.junit.categories.DistributedTest; -import org.apache.geode.test.junit.categories.FlakyTest; /** - * This class checks and verifies various data and operations exposed through RegionMXBean - * interface. - * - * Goal of the Test : RegionMBean gets created once region is created. Data like Region Attributes - * data and stats are of proper value - * - * + * This class checks and verifies various data and operations exposed through + * RegionMXBean interface. + * + * Goal of the Test : RegionMBean gets created once region is created. Data like + * Region Attributes data and stats are of proper value */ @Category(DistributedTest.class) +@SuppressWarnings({ "serial", "unused" }) public class RegionManagementDUnitTest extends ManagementTestBase { - private static final long serialVersionUID = 1L; - - private final String VERIFY_CONFIG_METHOD = "verifyConfigData"; + private static final String
[16/50] [abbrv] incubator-geode git commit: GEODE-2089 entry-idle-time on client side cache is not working as expected
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapLongKey.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapLongKey.java index 5bf2887..5c50d76 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapLongKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapLongKey.java @@ -22,7 +22,6 @@ import org.apache.geode.internal.cache.lru.EnableLRU; import org.apache.geode.internal.cache.persistence.DiskRecoveryStore; import org.apache.geode.internal.InternalStatisticsDisabledException; import org.apache.geode.internal.cache.lru.LRUClockNode; -import org.apache.geode.internal.cache.lru.NewLRUClockHand; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.versions.VersionSource; import org.apache.geode.internal.cache.versions.VersionStamp; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapObjectKey.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapObjectKey.java index 099c493..b07e2dd 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapObjectKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapObjectKey.java @@ -22,7 +22,6 @@ import org.apache.geode.internal.cache.lru.EnableLRU; import org.apache.geode.internal.cache.persistence.DiskRecoveryStore; import org.apache.geode.internal.InternalStatisticsDisabledException; import org.apache.geode.internal.cache.lru.LRUClockNode; -import org.apache.geode.internal.cache.lru.NewLRUClockHand; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.versions.VersionSource; import org.apache.geode.internal.cache.versions.VersionStamp; @@ -312,10 +311,10 @@ public class VersionedStatsDiskLRURegionEntryHeapObjectKey } @Override - protected final void setLastModified(long lastModified) { + protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { _setLastModified(lastModified); if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) { - setLastAccessed(lastModified); + setLastAccessed(lastAccessed); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey1.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey1.java index 6ca9e57..165980a 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey1.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey1.java @@ -22,7 +22,6 @@ import org.apache.geode.internal.cache.lru.EnableLRU; import org.apache.geode.internal.cache.persistence.DiskRecoveryStore; import org.apache.geode.internal.InternalStatisticsDisabledException; import org.apache.geode.internal.cache.lru.LRUClockNode; -import org.apache.geode.internal.cache.lru.NewLRUClockHand; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.versions.VersionSource; import org.apache.geode.internal.cache.versions.VersionStamp; @@ -329,10 +328,10 @@ public class VersionedStatsDiskLRURegionEntryHeapStringKey1 } @Override - protected final void setLastModified(long lastModified) { + protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { _setLastModified(lastModified); if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) { - setLastAccessed(lastModified); + setLastAccessed(lastAccessed); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey2.java -- diff --git
[24/50] [abbrv] incubator-geode git commit: Fixing test org.apache.geode.codeAnalysis.AnalyzeSerializablesJUnitTest testSerializables
Fixing test org.apache.geode.codeAnalysis.AnalyzeSerializablesJUnitTest testSerializables Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/86f47558 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/86f47558 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/86f47558 Branch: refs/heads/feature/GEODE-1930 Commit: 86f47558912711853e432fbb6daf90ac33e95afa Parents: 95ad164 Author: adongreAuthored: Sat Oct 29 08:35:39 2016 +0530 Committer: Anthony Baker Committed: Sat Nov 12 07:55:23 2016 -0800 -- .../geode/codeAnalysis/sanctionedSerializables.txt | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/86f47558/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt -- diff --git a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt index 03bb3ea..8167ed3 100644 --- a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt +++ b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt @@ -136,7 +136,6 @@ org/apache/geode/cache/persistence/PersistentReplicatesOfflineException,true,620 org/apache/geode/cache/persistence/RevokeFailedException,true,-2629287782021455875 org/apache/geode/cache/persistence/RevokedPersistentDataException,true,0 org/apache/geode/cache/query/AmbiguousNameException,true,5635771575414148564 -org/apache/geode/cache/query/CqAttributesFactory$CqAttributesImpl,true,-959395592883099100,clSync:java/lang/Object,cqListeners:java/util/ArrayList,dataPolicyHasBeenSet:boolean org/apache/geode/cache/query/CqClosedException,true,-3793993436374495840 org/apache/geode/cache/query/CqException,true,-5905461592471139171 org/apache/geode/cache/query/CqExistsException,true,-4805225282677926623 @@ -246,7 +245,6 @@ org/apache/geode/internal/CopyOnWriteHashSet,true,8591978652141659932 org/apache/geode/internal/DSFIDNotFoundException,true,130596009484324655,dsfid:int,versionOrdinal:short org/apache/geode/internal/InternalDataSerializer$SERIALIZATION_VERSION,false org/apache/geode/internal/InternalStatisticsDisabledException,true,4146181546364258311 -org/apache/geode/internal/LinuxProcFsStatistics$CPU,false org/apache/geode/internal/ObjIdConcurrentMap,true,7249069246763182397,segmentMask:int,segmentShift:int,segments:org/apache/geode/internal/ObjIdConcurrentMap$Segment[] org/apache/geode/internal/ObjIdConcurrentMap$Segment,true,2249069246763182397,loadFactor:float org/apache/geode/internal/SystemAdmin$CombinedResources,false @@ -441,7 +439,6 @@ org/apache/geode/internal/memcached/ResponseStatus$4,false org/apache/geode/internal/memcached/ResponseStatus$5,false org/apache/geode/internal/memcached/ResponseStatus$6,false org/apache/geode/internal/memcached/commands/ClientError,true,-2426928000696680541 -org/apache/geode/internal/net/SSLEnabledComponent,false,constant:java/lang/String org/apache/geode/internal/offheap/MemoryBlock$State,false org/apache/geode/internal/offheap/OffHeapStorage$1,false org/apache/geode/internal/offheap/OffHeapStorage$2,false @@ -598,10 +595,10 @@ org/apache/geode/management/internal/cli/functions/RebalanceFunction,true,1 org/apache/geode/management/internal/cli/functions/RegionAlterFunction,true,-4846425364943216425 org/apache/geode/management/internal/cli/functions/RegionCreateFunction,true,8746830191680509335 org/apache/geode/management/internal/cli/functions/RegionDestroyFunction,true,9172773671865750685 -org/apache/geode/management/internal/cli/functions/RegionFunctionArgs,true,-5158224572470173267,asyncEventQueueIds:java/util/Set,cacheListeners:java/util/Set,cacheLoader:java/lang/String,cacheWriter:java/lang/String,cloningEnabled:java/lang/Boolean,compressor:java/lang/String,concurrencyChecksEnabled:java/lang/Boolean,concurrencyLevel:java/lang/Integer,diskStore:java/lang/String,diskSynchronous:java/lang/Boolean,enableAsyncConflation:java/lang/Boolean,enableSubscriptionConflation:java/lang/Boolean,entryExpirationIdleTime:org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$ExpirationAttrs,entryExpirationTTL:org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$ExpirationAttrs,evictionMax:java/lang/Integer,gatewaySenderIds:java/util/Set,isSetCloningEnabled:boolean,isSetCompressor:boolean,isSetConcurrencyChecksEnabled:boolean,isSetConcurrencyLevel:boolean,isSetDiskSynchronous:boolean,isSetEnableAsyncConflation:boolean,isSetEnableSubscriptionConflation:
[32/50] [abbrv] incubator-geode git commit: GEODE-2088: Correctly throw TransactionDataRebalancedException when bucket is moved during rebalance.
GEODE-2088: Correctly throw TransactionDataRebalancedException when bucket is moved during rebalance. Turns out the transaction layer code has already handled when to throw TransactionDataNotColocatedException in getTransactionException method call in TXStateProxyImpl by checking whether the key is colocated with the keys already touched in the transaction. Only need to make sure that piece of code will be executed by throwing correct TransactionException. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/139398a1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/139398a1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/139398a1 Branch: refs/heads/feature/GEODE-1930 Commit: 139398a1f5af656c59eeacdb2dd9283a7145d992 Parents: c9e3b05 Author: eshuAuthored: Tue Nov 15 08:34:34 2016 -0800 Committer: eshu Committed: Tue Nov 15 08:34:34 2016 -0800 -- .../apache/geode/internal/cache/PartitionedRegion.java | 4 ++-- .../org/apache/geode/disttx/PRDistTXDUnitTest.java | 4 .../geode/disttx/PRDistTXWithVersionsDUnitTest.java| 4 .../internal/cache/execute/PRTransactionDUnitTest.java | 13 +++-- 4 files changed, 21 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/139398a1/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java index 96c58d5..7c3f19b 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java @@ -4001,8 +4001,8 @@ public class PartitionedRegion extends LocalRegion } else { // with transaction if (prce instanceof BucketNotFoundException) { -TransactionException ex = new TransactionDataNotColocatedException( - LocalizedStrings.PartitionedRegion_KEY_0_NOT_COLOCATED_WITH_TRANSACTION +TransactionException ex = new TransactionDataRebalancedException( + LocalizedStrings.PartitionedRegion_TRANSACTIONAL_DATA_MOVED_DUE_TO_REBALANCING .toLocalizedString(key)); ex.initCause(prce); throw ex; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/139398a1/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java b/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java index ed8d3c6..1061cd5 100644 --- a/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXDUnitTest.java @@ -45,6 +45,10 @@ public class PRDistTXDUnitTest extends PRTransactionDUnitTest { @Ignore("[DISTTX] TODO test overridden and intentionally left blank as it does not apply to disttx.") @Test + public void testTxWithGetOnMovedBucketUsingBucketReadHook() {} + + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as it does not apply to disttx.") + @Test public void testTxWithContainsValueForKeyOnMovedBucket() {} @Ignore("[DISTTX] TODO test overridden and intentionally left blank as it does not apply to disttx.") http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/139398a1/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java index 4e6f846..34c28f4 100644 --- a/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/disttx/PRDistTXWithVersionsDUnitTest.java @@ -45,6 +45,10 @@ public class PRDistTXWithVersionsDUnitTest extends PRTransactionWithVersionsDUni @Ignore("[DISTTX] TODO test overridden and intentionally left blank as it does not apply to disttx.") @Test + public void testTxWithGetOnMovedBucketUsingBucketReadHook() {} + + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as it does not apply to disttx.") + @Test public void testTxWithContainsValueForKeyOnMovedBucket() {} @Ignore("[DISTTX] TODO test overridden and intentionally left blank as
[10/50] [abbrv] incubator-geode git commit: GEODE-1785: add script to generate region entry source
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapLongKey.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapLongKey.java index 6eb8ad2..7184106 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapLongKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapLongKey.java @@ -46,7 +46,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key string2: KEY_STRING2 /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run - * bin/generateRegionEntryClasses.sh from the directory that contains your build.xml. + * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VersionedThinLRURegionEntryOffHeapLongKey extends VersionedThinLRURegionEntryOffHeap { public VersionedThinLRURegionEntryOffHeapLongKey(RegionEntryContext context, long key, http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapObjectKey.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapObjectKey.java index f55965e..f1aea63 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapObjectKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapObjectKey.java @@ -46,7 +46,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key string2: KEY_STRING2 /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run - * bin/generateRegionEntryClasses.sh from the directory that contains your build.xml. + * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VersionedThinLRURegionEntryOffHeapObjectKey extends VersionedThinLRURegionEntryOffHeap { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey1.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey1.java index 3dbc946..b517e63 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey1.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey1.java @@ -46,7 +46,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key string2: KEY_STRING2 /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run - * bin/generateRegionEntryClasses.sh from the directory that contains your build.xml. + * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VersionedThinLRURegionEntryOffHeapStringKey1 extends VersionedThinLRURegionEntryOffHeap { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey2.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey2.java index 162e103..d433994 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey2.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey2.java @@ -46,7 +46,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key string2: KEY_STRING2 /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run - * bin/generateRegionEntryClasses.sh from the directory that contains your build.xml. + * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level
[26/50] [abbrv] incubator-geode git commit: GEODE-2078: Fix manifest classpath
GEODE-2078: Fix manifest classpath The manifest classpath for *-dependencies.jar was pulling in dependencies from geode-pulse and geode-web-api. Filter out those projects before collecting the jars. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/366f0894 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/366f0894 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/366f0894 Branch: refs/heads/feature/GEODE-1930 Commit: 366f0894e6ddfdd4321cc40cdd4dcd46499a97fe Parents: e9c5716 Author: Anthony BakerAuthored: Mon Nov 7 20:01:07 2016 -0800 Committer: Anthony Baker Committed: Sat Nov 12 09:46:31 2016 -0800 -- geode-assembly/build.gradle | 92 1 file changed, 47 insertions(+), 45 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/366f0894/geode-assembly/build.gradle -- diff --git a/geode-assembly/build.gradle b/geode-assembly/build.gradle index cc2518b..d255b4c 100644 --- a/geode-assembly/build.gradle +++ b/geode-assembly/build.gradle @@ -126,56 +126,58 @@ task defaultCacheConfig(type: JavaExec, dependsOn: classes) { def cp = { // first add all the dependent project jars def jars = configurations.archives.dependencies.collect { it.dependencyProject } -.findAll { !it.name.contains('web') } +.findAll { !(it.name.contains('web') || it.name.contains('pulse')) } .collect { it.jar.archiveName } .join(' ') // then add all the dependencies of the dependent jars jars += ' ' + configurations.archives.dependencies.collect { -it.dependencyProject.configurations.runtime.collect { it.getName() }.findAll { - // depedencies from geode-core - it.contains('antlr') || - it.contains('commons-io') || - it.contains('commons-lang') || - it.contains('commons-logging') || - it.contains('fastutil') || - it.contains('jackson-annotations') || - it.contains('jackson-core') || - it.contains('jackson-databind') || - it.contains('jansi') || - it.contains('javax.resource-api') || - it.contains('javax.servlet-api') || - it.contains('javax.transaction-api') || - it.contains('jetty-http') || - it.contains('jetty-io') || - it.contains('jetty-security') || - it.contains('jetty-server') || - it.contains('jetty-servlet') || - it.contains('jetty-webapp') || - it.contains('jetty-util') || - it.contains('jetty-xml') || - it.contains('jline') || - it.contains('jna') || - it.contains('jopt-simple') || - it.contains('log4j-api') || - it.contains('log4j-core') || - it.contains('log4j-jcl') || - it.contains('log4j-jul') || - it.contains('log4j-slf4j-impl') || - it.contains('shiro') || - it.contains('slf4j-api') || - it.contains('spring-core') || - it.contains('spring-shell') || - it.contains('snappy') || - it.contains('hbase') || - it.contains('jgroups') || - it.contains('netty') || - - // dependencies from geode-lucene - it.contains('lucene-analyzers-common') || - it.contains('lucene-core') || - it.contains('lucene-queries') || - it.contains('lucene-queryparser') +it.dependencyProject.findAll { !(it.name.contains('web-api') || it.name.contains('pulse')) } + .collect { it.configurations.runtime.collect { it.getName() }.findAll { +// depedencies from geode-core +it.contains('antlr') || +it.contains('commons-io') || +it.contains('commons-lang') || +it.contains('commons-logging') || +it.contains('fastutil') || +it.contains('jackson-annotations') || +it.contains('jackson-core') || +it.contains('jackson-databind') || +it.contains('jansi') || +it.contains('javax.resource-api') || +it.contains('javax.servlet-api') || +it.contains('javax.transaction-api') || +it.contains('jetty-http') || +it.contains('jetty-io') || +it.contains('jetty-security') || +it.contains('jetty-server') || +it.contains('jetty-servlet') || +it.contains('jetty-webapp') || +it.contains('jetty-util') || +it.contains('jetty-xml') || +it.contains('jline') || +it.contains('jna') || +it.contains('jopt-simple') || +it.contains('log4j-api') || +it.contains('log4j-core') || +it.contains('log4j-jcl') || +it.contains('log4j-jul') || +it.contains('log4j-slf4j-impl') || +it.contains('shiro') || +it.contains('slf4j-api') || +it.contains('spring-core') || +
[28/50] [abbrv] incubator-geode git commit: reformatted recent commit with spotlessApply
reformatted recent commit with spotlessApply I actually reformatted this in Idea with the recommended format config loaded but apparently it's not in line with what the Spotless config requires and caused a build to fail. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/95a07d20 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/95a07d20 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/95a07d20 Branch: refs/heads/feature/GEODE-1930 Commit: 95a07d207931582dc2606e71cdc56e61dbed6088 Parents: 665570e Author: Bruce SchuchardtAuthored: Mon Nov 14 10:31:57 2016 -0800 Committer: Bruce Schuchardt Committed: Mon Nov 14 10:31:57 2016 -0800 -- .../membership/gms/membership/GMSJoinLeaveJUnitTest.java | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/95a07d20/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java index 4143be1..4fa6f07 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java @@ -487,7 +487,7 @@ public class GMSJoinLeaveJUnitTest { view.getCrashedMembers().contains(mockMembers[0])); } -// @Category(FlakyTest.class) // GEODE-2074: timed out waiting for view #7 + // @Category(FlakyTest.class) // GEODE-2074: timed out waiting for view #7 @Test public void testDuplicateJoinRequestDoesNotCauseNewView() throws Exception { initMocks(); @@ -532,9 +532,8 @@ public class GMSJoinLeaveJUnitTest { && (!gmsJoinLeave.getViewRequests().isEmpty() || gmsJoinLeave.getView().getViewId() != viewId)) { if (sleeps++ > 20) { -throw new RuntimeException( -"timeout waiting for view #" + viewId + " current view: " + gmsJoinLeave.getView() -+ "; view requests: " + gmsJoinLeave.getViewRequests()); +throw new RuntimeException("timeout waiting for view #" + viewId + " current view: " ++ gmsJoinLeave.getView() + "; view requests: " + gmsJoinLeave.getViewRequests()); } Thread.sleep(1000); }
[40/50] [abbrv] incubator-geode git commit: Fix formatting
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/ManagementTestBase.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/ManagementTestBase.java b/geode-core/src/test/java/org/apache/geode/management/ManagementTestBase.java index 6b86f45..ef1c4fa 100644 --- a/geode-core/src/test/java/org/apache/geode/management/ManagementTestBase.java +++ b/geode-core/src/test/java/org/apache/geode/management/ManagementTestBase.java @@ -60,9 +60,9 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase { private static final int MAX_WAIT = 70 * 1000; -// protected static DistributedSystem ds; + // protected static DistributedSystem ds; protected static ManagementService managementService; -// protected static Cache cache; + // protected static Cache cache; /** * List containing all the Managed Node VM @@ -80,7 +80,8 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase { protected static VM locatorVM; @Rule - public DistributedRestoreSystemProperties restoreSystemProperties = new DistributedRestoreSystemProperties(); + public DistributedRestoreSystemProperties restoreSystemProperties = + new DistributedRestoreSystemProperties(); @Override public final void postSetUp() throws Exception { @@ -208,8 +209,10 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase { Wait.waitForCriterion(new WaitCriterion() { @Override public String description() { -return "Waiting for the proxy of " + objectName.getCanonicalName() + " to get propagated to Manager"; +return "Waiting for the proxy of " + objectName.getCanonicalName() ++ " to get propagated to Manager"; } + @Override public boolean done() { SystemManagementService service = (SystemManagementService) managementService; @@ -228,12 +231,12 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase { protected void startManagingNode(final VM vm1) { vm1.invoke("Start Being Managing Node", () -> { Cache existingCache = GemFireCacheImpl.getInstance(); - //if (existingCache != null && !existingCache.isClosed()) { + // if (existingCache != null && !existingCache.isClosed()) { managementService = ManagementService.getManagementService(existingCache); SystemManagementService service = (SystemManagementService) managementService; service.createManager(); service.startManager(); - //} + // } }); } @@ -266,7 +269,8 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase { /** * Creates a Distributed region */ - protected void createDistributedRegion(final VM vm, final String regionName) throws InterruptedException { + protected void createDistributedRegion(final VM vm, final String regionName) + throws InterruptedException { AsyncInvocation future = createDistributedRegionAsync(vm, regionName); future.join(MAX_WAIT); if (future.isAlive()) { @@ -294,7 +298,8 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase { /** * Creates a Sub region */ - protected void createSubRegion(final VM vm, final String parentRegionPath, final String subregionName) throws Exception { + protected void createSubRegion(final VM vm, final String parentRegionPath, + final String subregionName) throws Exception { vm.invoke("Create Sub region", () -> { GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); SystemManagementService service = (SystemManagementService) getManagementService(); @@ -343,10 +348,12 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase { public String description() { return "Waiting All members to intimate DistributedSystemMBean"; } + @Override public boolean done() { if (bean.listMemberObjectNames() != null) { - LogWriterUtils.getLogWriter().info("Member Length " + bean.listMemberObjectNames().length); + LogWriterUtils.getLogWriter() + .info("Member Length " + bean.listMemberObjectNames().length); } if (bean.listMemberObjectNames().length >= expectedCount) { return true; @@ -359,7 +366,8 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase { assertNotNull(bean.getManagerObjectName()); } - protected static void waitForRefresh(final int expectedRefreshCount, final ObjectName objectName) { + protected static void waitForRefresh(final int expectedRefreshCount, + final ObjectName objectName) { final ManagementService service = getManagementService(); Wait.waitForCriterion(new WaitCriterion() { @@ -403,7 +411,8 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase {
[06/50] [abbrv] incubator-geode git commit: GEODE-2014: explicitly declare spring-web as a direct dependency rather than a transitive one.
GEODE-2014: explicitly declare spring-web as a direct dependency rather than a transitive one. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/5907e988 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/5907e988 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/5907e988 Branch: refs/heads/feature/GEODE-1930 Commit: 5907e988bfa56550cb8faae789dec564c3ed5d43 Parents: a515ee0 Author: Jinmei LiaoAuthored: Tue Nov 8 14:29:26 2016 -0800 Committer: Jinmei Liao Committed: Wed Nov 9 08:13:45 2016 -0800 -- geode-web-api/build.gradle | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/5907e988/geode-web-api/build.gradle -- diff --git a/geode-web-api/build.gradle b/geode-web-api/build.gradle index 9b15516..f74b86f 100755 --- a/geode-web-api/build.gradle +++ b/geode-web-api/build.gradle @@ -42,6 +42,7 @@ dependencies { compile 'org.springframework.security:spring-security-core:' + project.'spring-security.version' compile 'org.springframework.security:spring-security-web:' + project.'spring-security.version' compile 'org.springframework.security:spring-security-config:' + project.'spring-security.version' + compile 'org.springframework:spring-web:' + project.'springframework.version' compile 'org.springframework:spring-webmvc:' + project.'springframework.version' compile('org.springframework.hateoas:spring-hateoas:' + project.'spring-hateoas.version') { exclude module: 'aopalliance'
[11/50] [abbrv] incubator-geode git commit: GEODE-1785: add script to generate region entry source
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey2.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey2.java index 5900041..1790185 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey2.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey2.java @@ -48,7 +48,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key string2: KEY_STRING2 /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run - * bin/generateRegionEntryClasses.sh from the directory that contains your build.xml. + * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VersionedStatsDiskLRURegionEntryOffHeapStringKey2 extends VersionedStatsDiskLRURegionEntryOffHeap { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapUUIDKey.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapUUIDKey.java index 125cf69..537ef5b 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapUUIDKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapUUIDKey.java @@ -49,7 +49,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key string2: KEY_STRING2 /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run - * bin/generateRegionEntryClasses.sh from the directory that contains your build.xml. + * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VersionedStatsDiskLRURegionEntryOffHeapUUIDKey extends VersionedStatsDiskLRURegionEntryOffHeap { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapIntKey.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapIntKey.java index da721a7..cec2536 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapIntKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapIntKey.java @@ -42,7 +42,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key string2: KEY_STRING2 /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run - * bin/generateRegionEntryClasses.sh from the directory that contains your build.xml. + * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VersionedStatsDiskRegionEntryHeapIntKey extends VersionedStatsDiskRegionEntryHeap { public VersionedStatsDiskRegionEntryHeapIntKey(RegionEntryContext context, int key, http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapLongKey.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapLongKey.java index b9178bb..bc606e1 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapLongKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapLongKey.java @@ -42,7 +42,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key string2: KEY_STRING2 /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run - * bin/generateRegionEntryClasses.sh from the directory that contains your build.xml. + * ./dev-tools/generateRegionEntryClasses.sh (it must be run
[12/50] [abbrv] incubator-geode git commit: GEODE-1785: add script to generate region entry source
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapIntKey.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapIntKey.java index a77b0fb..70df05c 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapIntKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapIntKey.java @@ -35,7 +35,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key string2: KEY_STRING2 /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run - * bin/generateRegionEntryClasses.sh from the directory that contains your build.xml. + * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VMStatsRegionEntryHeapIntKey extends VMStatsRegionEntryHeap { public VMStatsRegionEntryHeapIntKey(RegionEntryContext context, int key, Object value) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapLongKey.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapLongKey.java index 51944a4..91998f2 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapLongKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapLongKey.java @@ -35,7 +35,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key string2: KEY_STRING2 /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run - * bin/generateRegionEntryClasses.sh from the directory that contains your build.xml. + * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VMStatsRegionEntryHeapLongKey extends VMStatsRegionEntryHeap { public VMStatsRegionEntryHeapLongKey(RegionEntryContext context, long key, Object value) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapObjectKey.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapObjectKey.java index 9aaca74..0bab150 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapObjectKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapObjectKey.java @@ -35,7 +35,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key string2: KEY_STRING2 /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run - * bin/generateRegionEntryClasses.sh from the directory that contains your build.xml. + * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VMStatsRegionEntryHeapObjectKey extends VMStatsRegionEntryHeap { public VMStatsRegionEntryHeapObjectKey(RegionEntryContext context, Object key, Object value) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey1.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey1.java index d5fb7c3..1227752 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey1.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey1.java @@ -35,7 +35,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key string2: KEY_STRING2 /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run - * bin/generateRegionEntryClasses.sh from the directory that contains your build.xml. + * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VMStatsRegionEntryHeapStringKey1 extends VMStatsRegionEntryHeap { public
[47/50] [abbrv] incubator-geode git commit: Convert from ManagementTestCase to ManagementTestRule
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/LocatorManagementDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/LocatorManagementDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/LocatorManagementDUnitTest.java index 336a6b1..1a2e3d7 100644 --- a/geode-core/src/test/java/org/apache/geode/management/LocatorManagementDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/LocatorManagementDUnitTest.java @@ -14,54 +14,82 @@ */ package org.apache.geode.management; +import static java.util.concurrent.TimeUnit.*; import static org.apache.geode.distributed.ConfigurationProperties.*; -import static org.junit.Assert.*; +import static org.apache.geode.internal.AvailablePortHelper.*; +import static org.apache.geode.test.dunit.Host.*; +import static org.apache.geode.test.dunit.NetworkUtils.*; +import static org.assertj.core.api.Assertions.*; import java.io.File; -import java.io.IOException; +import java.io.Serializable; import java.net.InetAddress; -import java.net.UnknownHostException; import java.util.Properties; +import javax.management.ObjectName; + +import com.jayway.awaitility.Awaitility; +import com.jayway.awaitility.core.ConditionFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.apache.geode.distributed.DistributedMember; import org.apache.geode.distributed.Locator; import org.apache.geode.distributed.internal.DistributionConfig; +import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.InternalLocator; -import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.internal.cache.GemFireCacheImpl; -import org.apache.geode.management.internal.ManagementConstants; -import org.apache.geode.test.dunit.Assert; +import org.apache.geode.management.internal.SystemManagementService; import org.apache.geode.test.dunit.Host; -import org.apache.geode.test.dunit.LogWriterUtils; -import org.apache.geode.test.dunit.SerializableCallable; import org.apache.geode.test.dunit.VM; -import org.apache.geode.test.dunit.Wait; -import org.apache.geode.test.dunit.WaitCriterion; import org.apache.geode.test.junit.categories.DistributedTest; +import org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder; +import org.apache.geode.test.junit.rules.serializable.SerializableTestName; /** - * Test cases - * - * DistributedSystem Cache Locator no no yes yes no yes yes yes yes + * Distributed tests for managing {@code Locator} with {@link LocatorMXBean}. */ @Category(DistributedTest.class) -public class LocatorManagementDUnitTest extends ManagementTestBase { +@SuppressWarnings({ "serial", "unused" }) +public class LocatorManagementDUnitTest implements Serializable { + + private static final int MAX_WAIT_MILLIS = 120 * 1000; + + private static final int ZERO = 0; + + @Manager + private VM managerVM; + @Member + private VM[] membersVM; + private VM locatorVM; - private static final int MAX_WAIT = 8 * ManagementConstants.REFRESH_TIME; + private String hostName; + private int port; - private VM locator; + @Rule + public ManagementTestRule managementTestRule = ManagementTestRule.builder().build(); - @Override - protected final void postSetUpManagementTestBase() throws Exception { -locator = managedNode1; + @Rule + public SerializableTemporaryFolder temporaryFolder = new SerializableTemporaryFolder(); + + @Rule + public SerializableTestName testName = new SerializableTestName(); + + @Before + public void before() throws Exception { +//this.managerVM = managingNode; +//this.membersVM = getManagedNodeList().toArray(new VM[getManagedNodeList().size()]); +this.locatorVM = this.membersVM[0]; +this.hostName = getServerHostName(getHost(0)); +this.port = getRandomAvailableTCPPort(); } - @Override - protected final void preTearDownManagementTestBase() throws Exception { -stopLocator(locator); + @After + public void after() throws Exception { +stopLocator(this.locatorVM); } /** @@ -69,46 +97,52 @@ public class LocatorManagementDUnitTest extends ManagementTestBase { */ @Test public void testPeerLocation() throws Exception { -int locPort = AvailablePortHelper.getRandomAvailableTCPPort(); -startLocator(locator, true, locPort); -locatorMBeanExist(locator, locPort, true); +startLocator(this.locatorVM, true, this.port); + +verifyLocalLocatorMXBean(this.locatorVM, this.port, true); -Host host = Host.getHost(0); -String host0 = getServerHostName(host); Properties props = new Properties(); props.setProperty(MCAST_PORT, "0"); -props.setProperty(LOCATORS, host0 + "[" + locPort +
[41/50] [abbrv] incubator-geode git commit: Fix formatting
Fix formatting Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e0212110 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e0212110 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e0212110 Branch: refs/heads/feature/GEODE-1930 Commit: e02121109aabe614bf763ee8ce2caa900e3efc90 Parents: 7737e8a Author: Kirk LundAuthored: Mon Nov 7 12:33:04 2016 -0800 Committer: Kirk Lund Committed: Tue Nov 15 12:26:26 2016 -0800 -- .../RestAPIsAndInterOpsDUnitTest.java | 64 ++- .../org/apache/geode/management/OSMetrics.java | 2 +- .../internal/SystemManagementService.java | 3 +- .../DistributedLockServiceDUnitTest.java| 18 +- .../cache/ConnectDisconnectDUnitTest.java | 26 +- ...gionBucketCreationDistributionDUnitTest.java | 8 +- .../cache/locks/TXLockServiceDUnitTest.java | 18 +- .../management/CacheManagementDUnitTest.java| 124 +++--- .../management/ClientHealthStatsDUnitTest.java | 54 ++- .../management/CompositeTypeTestDUnitTest.java | 16 +- .../management/DLockManagementDUnitTest.java| 69 ++-- .../management/DiskManagementDUnitTest.java | 44 +-- .../management/DistributedSystemDUnitTest.java | 105 +++-- .../management/LocatorManagementDUnitTest.java | 55 +-- .../geode/management/ManagementTestBase.java| 31 +- .../geode/management/ManagementTestRule.java| 69 ++-- .../org/apache/geode/management/Manager.java| 22 +- .../org/apache/geode/management/Member.java | 22 +- .../management/OffHeapManagementDUnitTest.java | 76 ++-- .../geode/management/QueryDataDUnitTest.java| 254 .../management/RegionManagementDUnitTest.java | 385 --- .../stats/DistributedSystemStatsDUnitTest.java | 12 +- .../QueryDataFunctionApplyLimitClauseTest.java | 11 +- .../internal/pulse/TestClientIdsDUnitTest.java | 42 +- .../pulse/TestSubscriptionsDUnitTest.java | 26 +- .../geode/test/dunit/AsyncInvocation.java | 29 +- .../java/org/apache/geode/test/dunit/VM.java| 10 +- .../geode/test/dunit/rules/DistributedRule.java | 46 ++- .../test/dunit/rules/DistributedRunRules.java | 28 +- .../test/dunit/rules/DistributedStatement.java | 23 +- .../test/dunit/rules/DistributedTestRule.java | 94 ++--- .../DistributedUseJacksonForJsonPathRule.java | 23 +- .../dunit/rules/DistributedWrapperRule.java | 27 +- .../apache/geode/test/dunit/rules/WhichVMs.java | 31 +- .../rules/tests/DistributedTestRuleTest.java| 22 +- .../test/dunit/standalone/DUnitLauncher.java| 11 +- .../junit/rules/UseJacksonForJsonPathRule.java | 28 +- .../SerializableExternalResource.java | 3 +- .../serializable/SerializableStatement.java | 22 +- .../management/LuceneManagementDUnitTest.java | 15 +- 40 files changed, 1124 insertions(+), 844 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java -- diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java index b989206..1802140 100644 --- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java +++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java @@ -85,43 +85,33 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase { public static final String PEOPLE_REGION_NAME = "People"; - private static final String findAllPeopleQuery = "/queries?id=findAllPeople=SELECT%20*%20FROM%20/People"; - private static final String findPeopleByGenderQuery = "/queries?id=filterByGender=SELECT%20*%20from%20/People%20where%20gender=$1"; - private static final String findPeopleByLastNameQuery = "/queries?id=filterByLastName=SELECT%20*%20from%20/People%20where%20lastName=$1"; - - private static final String[] PARAM_QUERY_IDS_ARRAY = { "findAllPeople", - "filterByGender", "filterByLastName" }; - - final static String QUERY_ARGS = "[" - + "{" - + "\"@type\": \"string\"," - + "\"@value\": \"Patel\"" - + "}" - + "]"; - - final static String PERSON_AS_JSON_CAS = "{" - + "\"@old\" :" - + "{" - + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\"," - + "\"id\": 101," + " \"firstName\": \"Mithali\"," - + " \"middleName\": \"Dorai\"," + " \"lastName\":
[17/50] [abbrv] incubator-geode git commit: GEODE-2089 entry-idle-time on client side cache is not working as expected
GEODE-2089 entry-idle-time on client side cache is not working as expected When we pull an entry in from another cache in LocalRegion.findObjectInSystem() we end up invoking updateStatsForPut and then updateStatsForGet. The former method installs a lastModifiedTime from the version tag that came from the other cache and this is used in updateStatsForPut to schedule an expiry-task for the entry. Then updateStatsForGet is invoked to set the lastAccessed time of the entry to the current time. However, by the time this is done the entry may have already been removed by the expiry-task if the lastModified time was too far in the past. The fix is to establish both the lastModified and lastAccessed times in updateStatsForPut. I've included two of the "leaf" RegionEntry classes in the diff but all of them had to be modified in the same way. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e584c4e6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e584c4e6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e584c4e6 Branch: refs/heads/feature/GEODE-1930 Commit: e584c4e658a082155613323748f4d849bc531bdb Parents: aac49f3 Author: Bruce SchuchardtAuthored: Thu Nov 10 14:42:19 2016 -0800 Committer: Bruce Schuchardt Committed: Thu Nov 10 14:44:11 2016 -0800 -- .../internal/cache/AbstractRegionEntry.java | 24 - .../geode/internal/cache/AbstractRegionMap.java | 10 +- .../geode/internal/cache/LeafRegionEntry.cpp| 4 +- .../geode/internal/cache/LocalRegion.java | 6 +- .../internal/cache/NonLocalRegionEntry.java | 3 +- .../org/apache/geode/internal/cache/Oplog.java | 2 +- .../geode/internal/cache/ProxyRegionMap.java| 2 +- .../geode/internal/cache/RegionEntry.java | 2 +- .../VMStatsDiskLRURegionEntryHeapIntKey.java| 5 +- .../VMStatsDiskLRURegionEntryHeapLongKey.java | 5 +- .../VMStatsDiskLRURegionEntryHeapObjectKey.java | 5 +- ...VMStatsDiskLRURegionEntryHeapStringKey1.java | 5 +- ...VMStatsDiskLRURegionEntryHeapStringKey2.java | 5 +- .../VMStatsDiskLRURegionEntryHeapUUIDKey.java | 5 +- .../VMStatsDiskLRURegionEntryOffHeapIntKey.java | 5 +- ...VMStatsDiskLRURegionEntryOffHeapLongKey.java | 5 +- ...StatsDiskLRURegionEntryOffHeapObjectKey.java | 5 +- ...tatsDiskLRURegionEntryOffHeapStringKey1.java | 5 +- ...tatsDiskLRURegionEntryOffHeapStringKey2.java | 5 +- ...VMStatsDiskLRURegionEntryOffHeapUUIDKey.java | 5 +- .../cache/VMStatsDiskRegionEntryHeapIntKey.java | 4 +- .../VMStatsDiskRegionEntryHeapLongKey.java | 4 +- .../VMStatsDiskRegionEntryHeapObjectKey.java| 4 +- .../VMStatsDiskRegionEntryHeapStringKey1.java | 4 +- .../VMStatsDiskRegionEntryHeapStringKey2.java | 4 +- .../VMStatsDiskRegionEntryHeapUUIDKey.java | 4 +- .../VMStatsDiskRegionEntryOffHeapIntKey.java| 4 +- .../VMStatsDiskRegionEntryOffHeapLongKey.java | 4 +- .../VMStatsDiskRegionEntryOffHeapObjectKey.java | 4 +- ...VMStatsDiskRegionEntryOffHeapStringKey1.java | 4 +- ...VMStatsDiskRegionEntryOffHeapStringKey2.java | 4 +- .../VMStatsDiskRegionEntryOffHeapUUIDKey.java | 4 +- .../cache/VMStatsLRURegionEntryHeapIntKey.java | 5 +- .../cache/VMStatsLRURegionEntryHeapLongKey.java | 5 +- .../VMStatsLRURegionEntryHeapObjectKey.java | 5 +- .../VMStatsLRURegionEntryHeapStringKey1.java| 5 +- .../VMStatsLRURegionEntryHeapStringKey2.java| 5 +- .../cache/VMStatsLRURegionEntryHeapUUIDKey.java | 5 +- .../VMStatsLRURegionEntryOffHeapIntKey.java | 5 +- .../VMStatsLRURegionEntryOffHeapLongKey.java| 5 +- .../VMStatsLRURegionEntryOffHeapObjectKey.java | 5 +- .../VMStatsLRURegionEntryOffHeapStringKey1.java | 5 +- .../VMStatsLRURegionEntryOffHeapStringKey2.java | 5 +- .../VMStatsLRURegionEntryOffHeapUUIDKey.java| 5 +- .../cache/VMStatsRegionEntryHeapIntKey.java | 4 +- .../cache/VMStatsRegionEntryHeapLongKey.java| 4 +- .../cache/VMStatsRegionEntryHeapObjectKey.java | 4 +- .../cache/VMStatsRegionEntryHeapStringKey1.java | 4 +- .../cache/VMStatsRegionEntryHeapStringKey2.java | 4 +- .../cache/VMStatsRegionEntryHeapUUIDKey.java| 4 +- .../cache/VMStatsRegionEntryOffHeapIntKey.java | 4 +- .../cache/VMStatsRegionEntryOffHeapLongKey.java | 4 +- .../VMStatsRegionEntryOffHeapObjectKey.java | 4 +- .../VMStatsRegionEntryOffHeapStringKey1.java| 4 +- .../VMStatsRegionEntryOffHeapStringKey2.java| 4 +- .../cache/VMStatsRegionEntryOffHeapUUIDKey.java | 4 +- .../internal/cache/ValidatingDiskRegion.java| 2 +- ...sionedStatsDiskLRURegionEntryHeapIntKey.java | 5 +- ...ionedStatsDiskLRURegionEntryHeapLongKey.java | 1 - ...nedStatsDiskLRURegionEntryHeapObjectKey.java | 5 +- ...edStatsDiskLRURegionEntryHeapStringKey1.java | 5 +-
[43/50] [abbrv] incubator-geode git commit: Convert from ManagementTestCase to ManagementTestRule
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/bean/stats/DistributedSystemStatsDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/bean/stats/DistributedSystemStatsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/bean/stats/DistributedSystemStatsDUnitTest.java index d2e797e..92d685a 100644 --- a/geode-core/src/test/java/org/apache/geode/management/bean/stats/DistributedSystemStatsDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/bean/stats/DistributedSystemStatsDUnitTest.java @@ -14,98 +14,66 @@ */ package org.apache.geode.management.bean.stats; -import org.junit.experimental.categories.Category; -import org.junit.Test; - +import static com.jayway.awaitility.Awaitility.*; import static org.junit.Assert.*; -import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase; -import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase; -import org.apache.geode.test.junit.categories.DistributedTest; - +import java.lang.management.ManagementFactory; import java.util.Set; +import java.util.concurrent.TimeUnit; import javax.management.ObjectName; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + import org.apache.geode.distributed.DistributedMember; -import org.apache.geode.internal.cache.DiskStoreStats; import org.apache.geode.internal.cache.GemFireCacheImpl; import org.apache.geode.management.DistributedSystemMXBean; -import org.apache.geode.management.ManagementTestBase; +import org.apache.geode.management.ManagementService; +import org.apache.geode.management.ManagementTestRule; +import org.apache.geode.management.Manager; +import org.apache.geode.management.Member; import org.apache.geode.management.MemberMXBean; import org.apache.geode.management.internal.SystemManagementService; -import org.apache.geode.management.internal.beans.MemberMBean; -import org.apache.geode.management.internal.beans.MemberMBeanBridge; -import org.apache.geode.test.dunit.Assert; -import org.apache.geode.test.dunit.SerializableRunnable; import org.apache.geode.test.dunit.VM; +import org.apache.geode.test.junit.categories.DistributedTest; -/** - */ @Category(DistributedTest.class) -public class DistributedSystemStatsDUnitTest extends ManagementTestBase { +@SuppressWarnings("serial") +public class DistributedSystemStatsDUnitTest { - private static final long serialVersionUID = 1L; + @Manager + private VM manager; - public DistributedSystemStatsDUnitTest() { -super(); - } + @Member + private VM[] members; + + @Rule + public ManagementTestRule managementTestRule = ManagementTestRule.builder().build(); @Test public void testDistributedSystemStats() throws Exception { -initManagement(true); - -for (VM vm : managedNodeList) { - setDiskStats(vm); -} -verifyDiskStats(managingNode); - } +this.manager.invoke("verifyMBeans", () -> { + GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); + assertNotNull(cache); - @SuppressWarnings("serial") - public void setDiskStats(VM vm1) throws Exception { -vm1.invoke(new SerializableRunnable("Set Member Stats") { - public void run() { -MemberMBean bean = (MemberMBean) managementService.getMemberMXBean(); -MemberMBeanBridge bridge = bean.getBridge(); -DiskStoreStats diskStoreStats = new DiskStoreStats(basicGetSystem(), "test"); -bridge.addDiskStoreStats(diskStoreStats); -diskStoreStats.startRead(); -diskStoreStats.startWrite(); -diskStoreStats.startBackup(); -diskStoreStats.startRecovery(); -diskStoreStats.incWrittenBytes(20, true); -diskStoreStats.startFlush(); -diskStoreStats.setQueueSize(10); - } -}); - } + SystemManagementService service = (SystemManagementService) ManagementService.getManagementService(cache); + DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean(); + assertNotNull(distributedSystemMXBean); - @SuppressWarnings("serial") - public void verifyDiskStats(VM vm1) throws Exception { -vm1.invoke(new SerializableRunnable("Set Member Stats") { - public void run() { -GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); + Set otherMemberSet = cache.getDistributionManager().getOtherNormalDistributionManagerIds(); + assertEquals(3, otherMemberSet.size()); -SystemManagementService service = (SystemManagementService) getManagementService(); -DistributedSystemMXBean bean = service.getDistributedSystemMXBean(); -assertNotNull(bean); -Set otherMemberSet = - cache.getDistributionManager().getOtherNormalDistributionManagerIds(); + for (DistributedMember member : otherMemberSet) { +
[48/50] [abbrv] incubator-geode git commit: Convert from ManagementTestCase to ManagementTestRule
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/DiskManagementDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/DiskManagementDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/DiskManagementDUnitTest.java index bcfadde..bfeebea 100644 --- a/geode-core/src/test/java/org/apache/geode/management/DiskManagementDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/DiskManagementDUnitTest.java @@ -14,24 +14,25 @@ */ package org.apache.geode.management; -import org.junit.experimental.categories.Category; -import org.junit.Test; - -import static org.junit.Assert.*; - -import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase; -import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase; -import org.apache.geode.test.junit.categories.DistributedTest; +import static java.util.concurrent.TimeUnit.*; +import static org.assertj.core.api.Assertions.*; import java.io.File; -import java.util.Arrays; -import java.util.List; +import java.io.Serializable; import java.util.Map; import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; import javax.management.ObjectName; -import org.apache.geode.LogWriter; +import com.jayway.awaitility.Awaitility; +import com.jayway.awaitility.core.ConditionFactory; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + import org.apache.geode.cache.Cache; import org.apache.geode.cache.DataPolicy; import org.apache.geode.cache.DiskStore; @@ -40,674 +41,366 @@ import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionFactory; import org.apache.geode.cache.Scope; import org.apache.geode.distributed.DistributedMember; -import org.apache.geode.internal.cache.DiskRegion; import org.apache.geode.internal.cache.DiskRegionStats; import org.apache.geode.internal.cache.DistributedRegion; import org.apache.geode.internal.cache.GemFireCacheImpl; -import org.apache.geode.internal.cache.LocalRegion; import org.apache.geode.internal.cache.persistence.PersistentMemberID; import org.apache.geode.internal.cache.persistence.PersistentMemberManager; -import org.apache.geode.management.internal.MBeanJMXAdapter; +import org.apache.geode.internal.process.ProcessUtils; +import org.apache.geode.management.internal.SystemManagementService; import org.apache.geode.test.dunit.AsyncInvocation; -import org.apache.geode.test.dunit.SerializableCallable; -import org.apache.geode.test.dunit.SerializableRunnable; import org.apache.geode.test.dunit.VM; -import org.apache.geode.test.dunit.Wait; -import org.apache.geode.test.dunit.WaitCriterion; +import org.apache.geode.test.junit.categories.DistributedTest; +import org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder; /** - * Test cases to cover all test cases which pertains to disk from Management layer - * - * + * Test cases to cover all test cases which pertains to disk from Management + * layer */ @Category(DistributedTest.class) -public class DiskManagementDUnitTest extends ManagementTestBase { - - /** - * - */ - private static final long serialVersionUID = 1L; - - // This must be bigger than the dunit ack-wait-threshold for the revoke - // tests. The command line is setting the ack-wait-threshold to be - // 60 seconds. - private static final int MAX_WAIT = 70 * 1000; - - boolean testFailed = false; +@SuppressWarnings({ "serial", "unused" }) +public class DiskManagementDUnitTest implements Serializable { - String failureCause = ""; - static final String REGION_NAME = "region"; + private static final String REGION_NAME = DiskManagementDUnitTest.class.getSimpleName() + "_region"; private File diskDir; - protected static LogWriter logWriter; + @Manager + private VM managerVM; - public DiskManagementDUnitTest() throws Exception { -super(); + @Member + private VM[] memberVMs; -diskDir = new File("diskDir-" + getName()).getAbsoluteFile(); -org.apache.geode.internal.FileUtil.delete(diskDir); -diskDir.mkdir(); -diskDir.deleteOnExit(); - } + @Rule + public ManagementTestRule managementTestRule = ManagementTestRule.builder().start(true).build(); - @Override - protected final void postSetUpManagementTestBase() throws Exception { -failureCause = ""; -testFailed = false; - } + @Rule + public SerializableTemporaryFolder temporaryFolder = new SerializableTemporaryFolder(); - @Override - protected final void postTearDownManagementTestBase() throws Exception { -org.apache.geode.internal.FileUtil.delete(diskDir); + @Before + public void before() throws Exception { +this.diskDir = this.temporaryFolder.newFolder("diskDir"); } /** - * Tests Disk
[39/50] [abbrv] incubator-geode git commit: Fix formatting
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/RegionManagementDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/RegionManagementDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/RegionManagementDUnitTest.java index 92624a4..3dc92b6 100644 --- a/geode-core/src/test/java/org/apache/geode/management/RegionManagementDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/RegionManagementDUnitTest.java @@ -13,20 +13,18 @@ * the License. */ /* - * 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 + * 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 + * 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. + * 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.management; @@ -85,14 +83,14 @@ import org.apache.geode.test.dunit.WaitCriterion; import org.apache.geode.test.junit.categories.DistributedTest; /** - * This class checks and verifies various data and operations exposed through - * RegionMXBean interface. + * This class checks and verifies various data and operations exposed through RegionMXBean + * interface. * - * Goal of the Test : RegionMBean gets created once region is created. Data like - * Region Attributes data and stats are of proper value + * Goal of the Test : RegionMBean gets created once region is created. Data like Region Attributes + * data and stats are of proper value */ @Category(DistributedTest.class) -@SuppressWarnings({ "serial", "unused" }) +@SuppressWarnings({"serial", "unused"}) public class RegionManagementDUnitTest extends ManagementTestBase { private static final String REGION_NAME = "MANAGEMENT_TEST_REGION"; @@ -104,13 +102,16 @@ public class RegionManagementDUnitTest extends ManagementTestBase { private static final String REGION_PATH = SEPARATOR + REGION_NAME; private static final String PARTITIONED_REGION_PATH = SEPARATOR + PARTITIONED_REGION_NAME; private static final String FIXED_PR_PATH = SEPARATOR + FIXED_PR_NAME; - private static final String LOCAL_SUB_REGION_PATH = SEPARATOR + LOCAL_REGION_NAME + SEPARATOR + LOCAL_SUB_REGION_NAME; + private static final String LOCAL_SUB_REGION_PATH = + SEPARATOR + LOCAL_REGION_NAME + SEPARATOR + LOCAL_SUB_REGION_NAME; // field used in manager VM private static Region fixedPartitionedRegion; - private static final AtomicReferenceMEMBER_NOTIFICATIONS_REF = new AtomicReference<>(); - private static final AtomicReference
SYSTEM_NOTIFICATIONS_REF = new AtomicReference<>(); + private static final AtomicReference
MEMBER_NOTIFICATIONS_REF = + new AtomicReference<>(); + private static final AtomicReference
SYSTEM_NOTIFICATIONS_REF = + new AtomicReference<>(); @Manager private VM managerVM; @@ -231,12 +232,13 @@ public class RegionManagementDUnitTest extends ManagementTestBase { int primaryIndex = 0; for (VM memberVM : this.memberVMs) { - List fixedPartitionAttributesList = createFixedPartitionList(primaryIndex + 1); + List fixedPartitionAttributesList = + createFixedPartitionList(primaryIndex + 1); memberVM.invoke(() -> createFixedPartitionRegion(fixedPartitionAttributesList)); primaryIndex++; } -//// TODO: Workaround for bug 46683. Reenable validation when bug is fixed. +// // TODO: Workaround for bug 46683. Reenable validation when bug is fixed.
[21/50] [abbrv] incubator-geode git commit: Fix documentation typo. Region attribute compressor uses lower case 'c', and the example used upper case 'C'.
Fix documentation typo. Region attribute compressor uses lower case 'c', and the example used upper case 'C'. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/57313004 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/57313004 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/57313004 Branch: refs/heads/feature/GEODE-1930 Commit: 573130045a5375fa4acd3767928d6df6c2f56499 Parents: d65b79a Author: Karen MillerAuthored: Fri Nov 11 10:05:22 2016 -0800 Committer: Karen Miller Committed: Fri Nov 11 10:05:22 2016 -0800 -- .../managing/region_compression/region_compression.html.md.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57313004/geode-docs/managing/region_compression/region_compression.html.md.erb -- diff --git a/geode-docs/managing/region_compression/region_compression.html.md.erb b/geode-docs/managing/region_compression/region_compression.html.md.erb index c85d1e1..0d28a2e 100644 --- a/geode-docs/managing/region_compression/region_compression.html.md.erb +++ b/geode-docs/managing/region_compression/region_compression.html.md.erb @@ -89,9 +89,9 @@ To enable compression on your region, set the following region attribute in your version="1.0â lock-lease="120" lock-timeout= "60" search-timeout= "300" is-server= "true" copy-on-read= "false" > - + org.apache.geode.compression.SnappyCompressor - + ...
[35/50] [abbrv] incubator-geode git commit: GEODE-2110 Revised wording of gfsh start server --password
GEODE-2110 Revised wording of gfsh start server --password Added a note to make it clear that specifying --password on the command line means that a clear text password is visible. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/b35e2a44 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/b35e2a44 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/b35e2a44 Branch: refs/heads/feature/GEODE-1930 Commit: b35e2a448311db6994f907464528266e897f0a46 Parents: cc996a6 Author: Karen MillerAuthored: Tue Nov 15 10:49:14 2016 -0800 Committer: Karen Miller Committed: Tue Nov 15 11:11:21 2016 -0800 -- geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b35e2a44/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb -- diff --git a/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb b/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb index e80e94a..30ef7c5 100644 --- a/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb +++ b/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb @@ -774,7 +774,9 @@ then gfsh will prompt for the password. \-\-password -The password portion of the credential to use in authenticating to the cluster. +The password portion of the credential to use in authenticating to +the cluster. +Note that this is a clear text password that may be visible to others.
[33/50] [abbrv] incubator-geode git commit: GEODE-2110 Add gfsh start server user and password options
GEODE-2110 Add gfsh start server user and password options Modifies gfsh start server command reference page to add the two missing options: --user and --password Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/6118a6a9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/6118a6a9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/6118a6a9 Branch: refs/heads/feature/GEODE-1930 Commit: 6118a6a95cad3bc4708c535cabb9f9bdc9d10738 Parents: 139398a Author: Karen MillerAuthored: Mon Nov 14 17:41:55 2016 -0800 Committer: Karen Miller Committed: Tue Nov 15 08:51:33 2016 -0800 -- .../gfsh/command-pages/start.html.md.erb | 15 +++ 1 file changed, 15 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6118a6a9/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb -- diff --git a/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb b/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb index 06dfce4..e80e94a 100644 --- a/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb +++ b/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb @@ -501,6 +501,7 @@ start server --name=value [--assign-buckets(=value)] [--bind-address=value] [--socket-buffer-size=value] [--lock-memory=value] [--off-heap-memory-size=value] [--start-rest-api=value] [--http-service-port=value] [--http-service-bind-address=value] +[--user=value] [--password=value] ``` @@ -763,6 +764,20 @@ See Overview of all local addresses + +\-\-user +The user name of the credential to use in authenticating to the cluster. +When specified, if the --password option is not also specified, +then gfsh will prompt for the password. + + + + +\-\-password +The password portion of the credential to use in authenticating to the cluster. + + +
[07/50] [abbrv] incubator-geode git commit: GEODE-1570: add a test to verify rest security with SSL, fix the format.
GEODE-1570: add a test to verify rest security with SSL, fix the format. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/7973d578 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/7973d578 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/7973d578 Branch: refs/heads/feature/GEODE-1930 Commit: 7973d578ec16b8c9d185d8e291193b8828fde856 Parents: 5907e98 Author: Jinmei LiaoAuthored: Wed Nov 9 10:45:53 2016 -0800 Committer: Jinmei Liao Committed: Wed Nov 9 10:45:53 2016 -0800 -- .../org/apache/geode/rest/internal/web/GeodeRestClient.java | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7973d578/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/GeodeRestClient.java -- diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/GeodeRestClient.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/GeodeRestClient.java index 4510e20..1671e53 100644 --- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/GeodeRestClient.java +++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/GeodeRestClient.java @@ -152,7 +152,7 @@ public class GeodeRestClient { if (useHttps) { SSLContext ctx = SSLContext.getInstance("TLS"); - ctx.init(new KeyManager[0], new TrustManager[]{new DefaultTrustManager()}, + ctx.init(new KeyManager[0], new TrustManager[] {new DefaultTrustManager()}, new SecureRandom()); clientBuilder.setSSLContext(ctx); clientBuilder.setSSLHostnameVerifier(new NoopHostnameVerifier()); @@ -165,13 +165,11 @@ public class GeodeRestClient { @Override public void checkClientTrusted(X509Certificate[] arg0, String arg1) -throws CertificateException { -} +throws CertificateException {} @Override public void checkServerTrusted(X509Certificate[] arg0, String arg1) -throws CertificateException { -} +throws CertificateException {} @Override public X509Certificate[] getAcceptedIssuers() {
[34/50] [abbrv] incubator-geode git commit: GEODE-2112: Improved cleanup for UITests
GEODE-2112: Improved cleanup for UITests UITests were failing when more than one was run because they all share a base class that was not properly cleaned up. This closes #284 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/cc996a61 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/cc996a61 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/cc996a61 Branch: refs/heads/feature/GEODE-1930 Commit: cc996a61d72123c358ced362fb884169e068bcff Parents: 6118a6a Author: Jared StewartAuthored: Mon Nov 14 16:06:49 2016 -0800 Committer: Kirk Lund Committed: Tue Nov 15 09:32:22 2016 -0800 -- .../tools/pulse/tests/ui/PulseAbstractTest.java | 21 1 file changed, 13 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/cc996a61/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAbstractTest.java -- diff --git a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAbstractTest.java b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAbstractTest.java index 9116a80..89ccb3f 100644 --- a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAbstractTest.java +++ b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAbstractTest.java @@ -224,8 +224,18 @@ public abstract class PulseAbstractTest extends PulseBaseTest { @AfterClass public static void tearDownAfterClass() throws Exception { -driver.close(); -jetty.stop(); +if (driver != null) { + driver.close(); + driver = null; +} +if (jetty != null) { + jetty.stop(); + jetty = null; +} +if (server != null) { + server.stop(); + server = null; +} } @Before @@ -402,10 +412,7 @@ public abstract class PulseAbstractTest extends PulseBaseTest { @Test public void testClusterGridViewMemberID() throws InterruptedException { searchByIdAndClick("default_grid_button"); -List elements = driver.findElements(By.xpath("//table[@id='memberList']/tbody/tr")); // gives - // me - // 11 - // rows +List elements = driver.findElements(By.xpath("//table[@id='memberList']/tbody/tr")); for (int memberCount = 1; memberCount < elements.size(); memberCount++) { String memberId = driver @@ -932,7 +939,6 @@ public abstract class PulseAbstractTest extends PulseBaseTest { String loadAvgM1 = JMXProperties.getInstance().getProperty("member.M" + (i) + ".loadAverage"); assertEquals(df2.format(Double.valueOf(loadAvgM1)), LoadAvgM1); - String ThreadsM1 = driver .findElement( By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 3) + "]/div[2]/div")) @@ -1035,7 +1041,6 @@ public abstract class PulseAbstractTest extends PulseBaseTest { wait.until(ExpectedConditions .visibilityOf(driver.findElement(By.xpath("//label[text()='Data Browser']"; - // Verify all elements must be displayed on data browser screen assertTrue(driver.findElement(By.xpath("//a[text()='Data Regions']")).isDisplayed()); assertTrue(driver.findElement(By.id("linkColocatedRegions")).isDisplayed());
[31/50] [abbrv] incubator-geode git commit: GEODE-2101 Improve WAN topology terminology in docs
GEODE-2101 Improve WAN topology terminology in docs The terms parallel and serial are not right, so change them: - a parallel multi-site topology is a fully connected mesh - a serial multi-site topology is a ring Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/c9e3b054 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/c9e3b054 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/c9e3b054 Branch: refs/heads/feature/GEODE-1930 Commit: c9e3b05405a2e82a00f9b3ac15ed259a2829a053 Parents: ddc4819 Author: Karen MillerAuthored: Mon Nov 14 10:07:14 2016 -0800 Committer: Karen Miller Committed: Mon Nov 14 15:56:24 2016 -0800 -- .../multisite_topologies.html.md.erb| 69 1 file changed, 55 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c9e3b054/geode-docs/topologies_and_comm/multi_site_configuration/multisite_topologies.html.md.erb -- diff --git a/geode-docs/topologies_and_comm/multi_site_configuration/multisite_topologies.html.md.erb b/geode-docs/topologies_and_comm/multi_site_configuration/multisite_topologies.html.md.erb index 4b5753b..b710b8d 100644 --- a/geode-docs/topologies_and_comm/multi_site_configuration/multisite_topologies.html.md.erb +++ b/geode-docs/topologies_and_comm/multi_site_configuration/multisite_topologies.html.md.erb @@ -27,41 +27,82 @@ This section describes Geode's support for various topologies. Depending on your - When a Geode site receives a message from a gateway sender, it forwards it to the other sites it knows about, excluding those sites that it knows have already seen the message. Each message contains the initial sender's ID and the ID of each of the sites the initial sender sent to, so no site forwards to those sites. However, messages do not pick up the ID of the sites they pass through, so it is possible in certain topologies for more than one copy of a message to be sent to one site. - In some configurations, the loss of one site affects how other sites communicate with one another. -## Parallel Multi-site Topology - -A parallel network topology is one where all sites know about each other. This is a robust configuration, where any one of the sites can go down without disrupting communication between the other sites. A parallel topology also guarantees that no site receives multiple copies of the same message. - -The parallel topology for three sites is shown in this figure. In this scenario, if site 1 sends an update to site 2, site 2 forwards to site 3. If site 1 sends an update to sites 2 and 3, neither forwards to the other. Likewise for any other initiating site. If any site is removed, the remaining two maintain a parallel topology. +## Fully Connected Mesh Topology + +A fully connected mesh network topology is one in which all sites +know about each other. +This is a robust configuration, +as any one of the sites can go down without disrupting communication +between the other sites. +A fully connected mesh topology also guarantees that no site receives +multiple copies of the same message. + +A fully connected mesh with three sites is shown in this figure. +In this scenario, if site 1 sends an update to site 2, +site 2 forwards to site 3. +If site 1 sends an update to sites 2 and 3, +neither forwards to the other. +This is likewise true for any other initiating site. +If any site is removed, the remaining two are still fully connected. -## Serial Multi-site Topology +## Ring Topology -A serial network topology is one where each site only knows about one other site. Data is passed from one site to the next serially. This figure shows the topology for three sites. In this scenario, if site 1 sends updates to site 2, site 2 forwards to site 3. Site 3 does not send the updates back to site 1. +A ring topology is one in which each site forwards information +to one other site, +and the sites are connected in a circular manner. +This figure shows a ring with three sites. +In this topology, if site 1 sends updates to site 2, +site 2 forwards the updates to site 3. +No updates are forwarded to the original sender, +so site 3 does not send the updates back to site 1. -The serial topology guarantees that every site receives one copy of each message sent by any site. With a serial installation, every site must stay up to maintain the topology. The failure of any site breaks the serial link. If site 2 went down, for example, site 3 could send to site 1, but site 1 could not send to site 3. +A ring topology guarantees that every site receives one copy of +each message sent by any site. +In a
[38/50] [abbrv] incubator-geode git commit: Fix formatting
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/test/dunit/rules/WhichVMs.java -- diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/WhichVMs.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/WhichVMs.java index 4ee6020..1048f2e 100644 --- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/WhichVMs.java +++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/WhichVMs.java @@ -1,18 +1,16 @@ /* - * 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 + * 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 + * 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. + * 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.test.dunit.rules; @@ -25,22 +23,23 @@ import java.io.Serializable; * * TODO: add ability to specify order */ -public class WhichVMs implements Serializable{ +public class WhichVMs implements Serializable { private boolean controllerVM; private boolean everyVM; private boolean locatorVM; - public WhichVMs() { - } + public WhichVMs() {} public WhichVMs addControllerVM() { this.controllerVM = true; return this; } + public WhichVMs addEveryVM() { this.everyVM = true; return this; } + public WhichVMs addLocatorVM() { this.locatorVM = true; return this; @@ -49,9 +48,11 @@ public class WhichVMs implements Serializable{ public boolean controllerVM() { return this.controllerVM; } + public boolean everyVM() { return this.everyVM; } + public boolean locatorVM() { return this.locatorVM; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/test/dunit/rules/tests/DistributedTestRuleTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/tests/DistributedTestRuleTest.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/tests/DistributedTestRuleTest.java index 8352db2..7dded64 100644 --- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/tests/DistributedTestRuleTest.java +++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/tests/DistributedTestRuleTest.java @@ -1,18 +1,16 @@ /* - * 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 + * 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 + * 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
[30/50] [abbrv] incubator-geode git commit: GEODE-2105 Remove docs about log collection utility
GEODE-2105 Remove docs about log collection utility The log collection utility is not part of the release, so remove the documentation. The content removed by this commit has been placed on the feature/GEODE-79 branch. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/ddc4819b Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/ddc4819b Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/ddc4819b Branch: refs/heads/feature/GEODE-1930 Commit: ddc4819b01470825997b8504c0971d04ddfab2f3 Parents: 8c383ee Author: Karen MillerAuthored: Mon Nov 14 14:52:20 2016 -0800 Committer: Karen Miller Committed: Mon Nov 14 14:52:20 2016 -0800 -- .../source/subnavs/geode-subnav.erb | 3 - .../logging/log_collection_utility.html.md.erb | 71 geode-docs/managing/logging/logging.html.md.erb | 4 -- 3 files changed, 78 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ddc4819b/geode-book/master_middleman/source/subnavs/geode-subnav.erb -- diff --git a/geode-book/master_middleman/source/subnavs/geode-subnav.erb b/geode-book/master_middleman/source/subnavs/geode-subnav.erb index 959fdf3..2983460 100644 --- a/geode-book/master_middleman/source/subnavs/geode-subnav.erb +++ b/geode-book/master_middleman/source/subnavs/geode-subnav.erb @@ -792,9 +792,6 @@ limitations under the License. Advanced UsersâConfiguring Log4j 2 for Geode - -Log Collection Utility - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ddc4819b/geode-docs/managing/logging/log_collection_utility.html.md.erb -- diff --git a/geode-docs/managing/logging/log_collection_utility.html.md.erb b/geode-docs/managing/logging/log_collection_utility.html.md.erb deleted file mode 100644 index e83634f..000 --- a/geode-docs/managing/logging/log_collection_utility.html.md.erb +++ /dev/null @@ -1,71 +0,0 @@ -title: Log Collection Utility - - - -To aid in the troubleshooting of Apache Geode issues, you can use the provided log collection utility to gather and upload log files and other troubleshooting artifacts. This tool is only supported on Linux machines. - -This utility is used to gather log files and other troubleshooting artifacts from a Geode cluster. - -The tool goes through and collects all files ending with `.log`, `.err`, .`cfg`, `.gfs`, `.stack`, `.xml`, `.properties,` and `.txt` from the working directories of running Geode processes. It also obtains thread dumps for each Geode process but will not collect heap dumps. - -The collection utility copies all log and artifact files to its host machine and then compresses all the files. You should ensure that the machine running the utility has sufficient disk space to hold all the collected log and artifact files from the cluster. - -In default mode, the tool requires that a Geode process is running on each machine where the tool is gathering logs and artifact files. If you would like to collect log and artifact files from a machine or machines where Geode processes are not running, use *Static Copy Mode* by specifying the `-m` option and providing a file that lists log and artifact file locations. - -The utility is provided in `$GEMFIRE/tools/LogCollectionUtility`. - -## Usage - -``` pre -java -jar gfe-logcollect.jar -c -o [OPTIONS] - -Required arguments: --c company name to append to output filename --o output directory to store all collected log files - -Optional arguments: --a comma separated list of hosts with no spaces. EG. host1,host2,host3 (defaults to localhost) --u username to use to connect via ssh (defaults to current user) --i identity file to use for PKI based ssh (defaults to ~/.ssh/id_[dsa|rsa] --p prompt for a password to use for ssh connections --t ticket number to append to created zip file --d don't clean up collected log files after the zip has been created --s send the zip file to Pivotal support --f ftp server to upload collected logs to. Defaults to ftp.gemstone.com --v print version of this utility --h print this help information - -Static Copy Mode --m Use a file with log locations instead of scanning for logs. - Entries should be in the format hostname:/log/location -``` - -## Known Limitations -
[05/50] [abbrv] incubator-geode git commit: GEODE-1570: add a test to verify rest security with SSL.
GEODE-1570: add a test to verify rest security with SSL. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/a515ee06 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/a515ee06 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/a515ee06 Branch: refs/heads/feature/GEODE-1930 Commit: a515ee06deeca3adf0ba053883a488787267ebcb Parents: 08bbbe2 Author: Jinmei LiaoAuthored: Mon Nov 7 18:10:52 2016 -0800 Committer: Jinmei Liao Committed: Wed Nov 9 08:11:07 2016 -0800 -- .../rest/internal/web/GeodeRestClient.java | 154 +++ .../internal/web/RestSecurityWithSSLTest.java | 85 ++ .../src/test/resources/ssl/trusted.keystore | Bin 0 -> 2241 bytes .../SecurityClusterConfigDUnitTest.java | 32 ++-- .../test/dunit/rules/LocatorStarterRule.java| 14 ++ 5 files changed, 205 insertions(+), 80 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a515ee06/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/GeodeRestClient.java -- diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/GeodeRestClient.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/GeodeRestClient.java index 071b95c..4510e20 100644 --- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/GeodeRestClient.java +++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/GeodeRestClient.java @@ -15,13 +15,10 @@ package org.apache.geode.rest.internal.web; -import org.apache.http.HttpEntity; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; import org.apache.http.auth.AuthScope; import org.apache.http.auth.UsernamePasswordCredentials; -import org.apache.http.client.AuthCache; -import org.apache.http.client.ClientProtocolException; import org.apache.http.client.CredentialsProvider; import org.apache.http.client.methods.HttpDelete; import org.apache.http.client.methods.HttpGet; @@ -30,46 +27,85 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.conn.ssl.NoopHostnameVerifier; import org.apache.http.entity.StringEntity; -import org.apache.http.impl.auth.BasicScheme; -import org.apache.http.impl.client.BasicAuthCache; import org.apache.http.impl.client.BasicCredentialsProvider; -import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClients; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.json.JSONTokener; -import org.junit.Assert; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; -import java.net.MalformedURLException; import java.nio.charset.StandardCharsets; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import javax.net.ssl.KeyManager; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; public class GeodeRestClient { - - public final static String PROTOCOL = "http"; public final static String CONTEXT = "/geode/v1"; private int restPort = 0; private String bindAddress = null; + private String protocol = "http"; + private boolean useHttps = false; + private KeyStore keyStore; public GeodeRestClient(String bindAddress, int restPort) { this.bindAddress = bindAddress; this.restPort = restPort; } - public HttpResponse doHEAD(String query, String username, String password) - throws MalformedURLException { + public GeodeRestClient(String bindAddress, int restPort, boolean useHttps) { +if (useHttps) { + this.protocol = "https"; + this.useHttps = true; +} else { + this.protocol = "http"; + this.useHttps = false; +} +this.bindAddress = bindAddress; +this.restPort = restPort; + } + + public static String getContentType(HttpResponse response) { +return response.getEntity().getContentType().getValue(); + } + + /** + * Retrieve the status code of the HttpResponse + * + * @param response The HttpResponse message received from the server + * @return a numeric value + */ + public static int getCode(HttpResponse response) { +return response.getStatusLine().getStatusCode(); + } + + public static JSONObject getJsonObject(HttpResponse response) throws
[42/50] [abbrv] incubator-geode git commit: Fix TestClientIdsDUnitTest
Fix TestClientIdsDUnitTest Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/7737e8a2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/7737e8a2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/7737e8a2 Branch: refs/heads/feature/GEODE-1930 Commit: 7737e8a21881f6176853c6e206142f537c10bed2 Parents: b286fe7 Author: Kirk LundAuthored: Mon Nov 7 11:50:39 2016 -0800 Committer: Kirk Lund Committed: Tue Nov 15 12:26:26 2016 -0800 -- .../geode/management/ManagementTestRule.java| 6 + .../internal/pulse/TestClientIdsDUnitTest.java | 297 +++ 2 files changed, 107 insertions(+), 196 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7737e8a2/geode-core/src/test/java/org/apache/geode/management/ManagementTestRule.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/ManagementTestRule.java b/geode-core/src/test/java/org/apache/geode/management/ManagementTestRule.java index 630c95e..ac60d0c 100644 --- a/geode-core/src/test/java/org/apache/geode/management/ManagementTestRule.java +++ b/geode-core/src/test/java/org/apache/geode/management/ManagementTestRule.java @@ -32,6 +32,8 @@ import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.Statement; import org.apache.geode.cache.Cache; +import org.apache.geode.cache.client.ClientCache; +import org.apache.geode.cache.client.ClientCacheFactory; import org.apache.geode.distributed.DistributedMember; import org.apache.geode.distributed.DistributedSystemDisconnectedException; import org.apache.geode.distributed.internal.DM; @@ -171,6 +173,10 @@ public class ManagementTestRule implements MethodRule, Serializable { return this.helper.getCache(); } + public ClientCache getClientCache() { +return this.helper.getClientCache(new ClientCacheFactory()); + } + public boolean hasCache() { //Cache cache = GemFireCacheImpl.getInstance(); //if (cache != null && !cache.isClosed()) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7737e8a2/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestClientIdsDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestClientIdsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestClientIdsDUnitTest.java index 9e98024..3591cb5 100644 --- a/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestClientIdsDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestClientIdsDUnitTest.java @@ -14,11 +14,22 @@ */ package org.apache.geode.management.internal.pulse; +import static java.util.concurrent.TimeUnit.MINUTES; import static org.apache.geode.distributed.ConfigurationProperties.*; +import static org.apache.geode.test.dunit.NetworkUtils.getServerHostName; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.*; +import java.io.IOException; +import java.io.Serializable; import java.util.Properties; +import javax.management.ObjectName; + +import com.jayway.awaitility.Awaitility; +import com.jayway.awaitility.core.ConditionFactory; +import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -29,247 +40,141 @@ import org.apache.geode.cache.DataPolicy; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionAttributes; import org.apache.geode.cache.Scope; +import org.apache.geode.cache.client.ClientCache; +import org.apache.geode.cache.client.ClientRegionFactory; +import org.apache.geode.cache.client.ClientRegionShortcut; import org.apache.geode.cache.client.PoolManager; import org.apache.geode.cache.client.internal.PoolImpl; import org.apache.geode.cache.server.CacheServer; import org.apache.geode.distributed.DistributedMember; -import org.apache.geode.distributed.DistributedSystem; -import org.apache.geode.internal.AvailablePort; import org.apache.geode.internal.cache.GemFireCacheImpl; import org.apache.geode.management.CacheServerMXBean; -import org.apache.geode.management.MBeanUtil; -import org.apache.geode.management.ManagementTestBase; -import org.apache.geode.management.internal.cli.CliUtil; +import org.apache.geode.management.ManagementTestRule; +import org.apache.geode.management.Manager; +import org.apache.geode.management.internal.SystemManagementService; import org.apache.geode.test.dunit.Assert; import org.apache.geode.test.dunit.Host; -import
[18/50] [abbrv] incubator-geode git commit: GEODE-1993: postprocess region/key in developer rest api
GEODE-1993: postprocess region/key in developer rest api * This closes #276 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/bd229d76 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/bd229d76 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/bd229d76 Branch: refs/heads/feature/GEODE-1930 Commit: bd229d7681376a11ba2e37747e48844ffe65584c Parents: e584c4e Author: Kevin DulingAuthored: Fri Oct 28 13:27:56 2016 -0700 Committer: Jinmei Liao Committed: Thu Nov 10 14:59:47 2016 -0800 -- .../web/RestSecurityPostProcessorTest.java | 188 +++ .../rest/internal/web/controllers/Customer.java | 26 ++- .../web/controllers/RedactingPostProcessor.java | 67 +++ .../RestAPIsQueryAndFEJUnitTest.java| 61 +++--- .../cache/query/internal/CompiledValue.java | 9 +- .../cache/query/internal/DefaultQuery.java | 39 +++- .../security/IntegratedSecurityService.java | 4 +- .../apache/geode/security/PostProcessor.java| 2 +- .../PdxLocalQueryVersionedClassDUnitTest.java | 5 +- .../ClientServerFunctionExecutionDUnitTest.java | 19 +- .../internal/cache/functions/TestFunction.java | 1 - .../security/NoShowValue1PostProcessor.java | 4 - .../apache/geode/security/PDXPostProcessor.java | 10 +- .../web/controllers/AbstractBaseController.java | 37 ++-- .../controllers/FunctionAccessController.java | 15 +- .../web/controllers/PdxBasedCrudController.java | 21 +-- .../web/controllers/QueryAccessController.java | 24 ++- .../web/security/RestSecurityService.java | 8 +- .../rest/internal/web/util/JsonWriter.java | 51 ++--- 19 files changed, 442 insertions(+), 149 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java -- diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java new file mode 100644 index 000..72b589f --- /dev/null +++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java @@ -0,0 +1,188 @@ +/* + * 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.rest.internal.web; + +import static org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS; +import static org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT; +import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER; +import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR; +import static org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API; +import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode; +import static org.apache.geode.rest.internal.web.GeodeRestClient.getContentType; +import static org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray; +import static org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.apache.geode.cache.Region; +import org.apache.geode.cache.RegionShortcut; +import org.apache.geode.internal.AvailablePortHelper; +import org.apache.geode.rest.internal.web.controllers.Customer; +import org.apache.geode.rest.internal.web.controllers.RedactingPostProcessor; +import org.apache.geode.security.templates.SampleSecurityManager; +import org.apache.geode.test.dunit.rules.ServerStarterRule; +import org.apache.geode.test.junit.categories.IntegrationTest; +import org.apache.geode.test.junit.categories.SecurityTest; +import org.apache.http.HttpResponse; +import org.json.JSONArray; +import org.json.JSONObject; +import
[45/50] [abbrv] incubator-geode git commit: Convert from ManagementTestCase to ManagementTestRule
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/QueryDataDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/QueryDataDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/QueryDataDUnitTest.java index 1773a27..e6f6361 100644 --- a/geode-core/src/test/java/org/apache/geode/management/QueryDataDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/QueryDataDUnitTest.java @@ -14,895 +14,655 @@ */ package org.apache.geode.management; -import static org.apache.geode.cache.query.Utils.createPortfoliosAndPositions; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.IOException; +import static com.jayway.jsonpath.matchers.JsonPathMatchers.*; +import static java.util.concurrent.TimeUnit.*; +import static org.apache.geode.cache.FixedPartitionAttributes.*; +import static org.apache.geode.cache.query.Utils.*; +import static org.apache.geode.management.internal.ManagementConstants.*; +import static org.apache.geode.management.internal.ManagementStrings.*; +import static org.assertj.core.api.Assertions.assertThat; +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.assertThat; + +import java.io.Serializable; import java.util.ArrayList; +import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +import javax.management.ObjectName; + +import com.jayway.awaitility.Awaitility; +import com.jayway.awaitility.core.ConditionFactory; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; import org.apache.geode.cache.Cache; import org.apache.geode.cache.CacheException; -import org.apache.geode.cache.CacheFactory; import org.apache.geode.cache.DataPolicy; +import org.apache.geode.cache.EntryOperation; import org.apache.geode.cache.FixedPartitionAttributes; import org.apache.geode.cache.PartitionAttributesFactory; +import org.apache.geode.cache.PartitionResolver; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionFactory; import org.apache.geode.cache.RegionShortcut; -import org.apache.geode.cache.query.data.Portfolio; -import org.apache.geode.cache.query.dunit.QueryUsingFunctionContextDUnitTest; -import org.apache.geode.cache30.CacheSerializableRunnable; +import org.apache.geode.cache.query.data.Portfolio; // TODO import org.apache.geode.distributed.DistributedMember; import org.apache.geode.internal.cache.BucketRegion; -import org.apache.geode.internal.cache.GemFireCacheImpl; import org.apache.geode.internal.cache.PartitionedRegion; import org.apache.geode.internal.cache.PartitionedRegionHelper; -import org.apache.geode.internal.cache.partitioned.fixed.SingleHopQuarterPartitionResolver; -import org.apache.geode.management.internal.ManagementConstants; -import org.apache.geode.management.internal.ManagementStrings; +import org.apache.geode.internal.cache.partitioned.fixed.SingleHopQuarterPartitionResolver; // TODO import org.apache.geode.management.internal.SystemManagementService; import org.apache.geode.management.internal.beans.BeanUtilFuncs; import org.apache.geode.management.internal.cli.json.TypedJson; import org.apache.geode.pdx.PdxInstance; import org.apache.geode.pdx.PdxInstanceFactory; import org.apache.geode.pdx.internal.PdxInstanceFactoryImpl; -import org.apache.geode.test.dunit.LogWriterUtils; -import org.apache.geode.test.dunit.SerializableRunnable; -import org.apache.geode.test.dunit.Wait; -import org.apache.geode.test.dunit.WaitCriterion; +import org.apache.geode.test.dunit.VM; +import org.apache.geode.test.dunit.rules.DistributedUseJacksonForJsonPathRule; import org.apache.geode.test.junit.categories.DistributedTest; -import org.apache.geode.test.junit.categories.FlakyTest; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; -import org.junit.Test; -import org.junit.experimental.categories.Category; +import org.apache.geode.test.junit.rules.serializable.SerializableTestName; /** - * - * + * Distributed tests for {@link DistributedSystemMXBean#queryData(String, String, int)}. + * + * + * Test Basic Json Strings for Partitioned Regions + * Test Basic Json Strings for Replicated Regions + * Test for all Region Types + * Test for primitive types + * Test for Nested Objects + * Test for Enums + * Test for collections + * Test for huge collection + * Test PDX types + * Test different projects type e.g. SelectResult, normal bean etc.. + * Test Colocated Regions
[13/50] [abbrv] incubator-geode git commit: GEODE-1785: add script to generate region entry source
GEODE-1785: add script to generate region entry source Added generateRegionEntryClasses.sh and LeafRegionEntry.cpp. To modify the leaf subclasses of AbstractRegionEntry edit LeafeRegionEntry.cpp, run dev-tools/generatedRegionEntryClasses.sh, and then do a gradlew spotlessApply since the generated code needs to be formatted. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/df2f0c96 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/df2f0c96 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/df2f0c96 Branch: refs/heads/feature/GEODE-1930 Commit: df2f0c964d4fe62fa12b69266747deeccef3aac5 Parents: 88e5d0f Author: Darrel SchneiderAuthored: Wed Nov 9 14:34:33 2016 -0800 Committer: Darrel Schneider Committed: Thu Nov 10 10:16:01 2016 -0800 -- dev-tools/generateRegionEntryClasses.sh | 64 ++ .../geode/internal/cache/LeafRegionEntry.cpp| 866 +++ .../VMStatsDiskLRURegionEntryHeapIntKey.java| 2 +- .../VMStatsDiskLRURegionEntryHeapLongKey.java | 2 +- .../VMStatsDiskLRURegionEntryHeapObjectKey.java | 2 +- ...VMStatsDiskLRURegionEntryHeapStringKey1.java | 2 +- ...VMStatsDiskLRURegionEntryHeapStringKey2.java | 2 +- .../VMStatsDiskLRURegionEntryHeapUUIDKey.java | 2 +- .../VMStatsDiskLRURegionEntryOffHeapIntKey.java | 2 +- ...VMStatsDiskLRURegionEntryOffHeapLongKey.java | 2 +- ...StatsDiskLRURegionEntryOffHeapObjectKey.java | 2 +- ...tatsDiskLRURegionEntryOffHeapStringKey1.java | 2 +- ...tatsDiskLRURegionEntryOffHeapStringKey2.java | 2 +- ...VMStatsDiskLRURegionEntryOffHeapUUIDKey.java | 2 +- .../cache/VMStatsDiskRegionEntryHeapIntKey.java | 2 +- .../VMStatsDiskRegionEntryHeapLongKey.java | 2 +- .../VMStatsDiskRegionEntryHeapObjectKey.java| 2 +- .../VMStatsDiskRegionEntryHeapStringKey1.java | 2 +- .../VMStatsDiskRegionEntryHeapStringKey2.java | 2 +- .../VMStatsDiskRegionEntryHeapUUIDKey.java | 2 +- .../VMStatsDiskRegionEntryOffHeapIntKey.java| 2 +- .../VMStatsDiskRegionEntryOffHeapLongKey.java | 2 +- .../VMStatsDiskRegionEntryOffHeapObjectKey.java | 2 +- ...VMStatsDiskRegionEntryOffHeapStringKey1.java | 2 +- ...VMStatsDiskRegionEntryOffHeapStringKey2.java | 2 +- .../VMStatsDiskRegionEntryOffHeapUUIDKey.java | 2 +- .../cache/VMStatsLRURegionEntryHeapIntKey.java | 2 +- .../cache/VMStatsLRURegionEntryHeapLongKey.java | 2 +- .../VMStatsLRURegionEntryHeapObjectKey.java | 2 +- .../VMStatsLRURegionEntryHeapStringKey1.java| 2 +- .../VMStatsLRURegionEntryHeapStringKey2.java| 2 +- .../cache/VMStatsLRURegionEntryHeapUUIDKey.java | 2 +- .../VMStatsLRURegionEntryOffHeapIntKey.java | 2 +- .../VMStatsLRURegionEntryOffHeapLongKey.java| 2 +- .../VMStatsLRURegionEntryOffHeapObjectKey.java | 2 +- .../VMStatsLRURegionEntryOffHeapStringKey1.java | 2 +- .../VMStatsLRURegionEntryOffHeapStringKey2.java | 2 +- .../VMStatsLRURegionEntryOffHeapUUIDKey.java| 2 +- .../cache/VMStatsRegionEntryHeapIntKey.java | 2 +- .../cache/VMStatsRegionEntryHeapLongKey.java| 2 +- .../cache/VMStatsRegionEntryHeapObjectKey.java | 2 +- .../cache/VMStatsRegionEntryHeapStringKey1.java | 2 +- .../cache/VMStatsRegionEntryHeapStringKey2.java | 2 +- .../cache/VMStatsRegionEntryHeapUUIDKey.java| 2 +- .../cache/VMStatsRegionEntryOffHeapIntKey.java | 2 +- .../cache/VMStatsRegionEntryOffHeapLongKey.java | 2 +- .../VMStatsRegionEntryOffHeapObjectKey.java | 2 +- .../VMStatsRegionEntryOffHeapStringKey1.java| 2 +- .../VMStatsRegionEntryOffHeapStringKey2.java| 2 +- .../cache/VMStatsRegionEntryOffHeapUUIDKey.java | 2 +- .../VMThinDiskLRURegionEntryHeapIntKey.java | 2 +- .../VMThinDiskLRURegionEntryHeapLongKey.java| 2 +- .../VMThinDiskLRURegionEntryHeapObjectKey.java | 2 +- .../VMThinDiskLRURegionEntryHeapStringKey1.java | 2 +- .../VMThinDiskLRURegionEntryHeapStringKey2.java | 2 +- .../VMThinDiskLRURegionEntryHeapUUIDKey.java| 2 +- .../VMThinDiskLRURegionEntryOffHeapIntKey.java | 2 +- .../VMThinDiskLRURegionEntryOffHeapLongKey.java | 2 +- ...MThinDiskLRURegionEntryOffHeapObjectKey.java | 2 +- ...ThinDiskLRURegionEntryOffHeapStringKey1.java | 2 +- ...ThinDiskLRURegionEntryOffHeapStringKey2.java | 2 +- .../VMThinDiskLRURegionEntryOffHeapUUIDKey.java | 2 +- .../cache/VMThinDiskRegionEntryHeapIntKey.java | 2 +- .../cache/VMThinDiskRegionEntryHeapLongKey.java | 2 +- .../VMThinDiskRegionEntryHeapObjectKey.java | 2 +- .../VMThinDiskRegionEntryHeapStringKey1.java| 2 +- .../VMThinDiskRegionEntryHeapStringKey2.java| 2 +- .../cache/VMThinDiskRegionEntryHeapUUIDKey.java | 2 +- .../VMThinDiskRegionEntryOffHeapIntKey.java |
[02/50] [abbrv] incubator-geode git commit: GEODE-2068 Improve documentation on serial/parallel gateway senders
GEODE-2068 Improve documentation on serial/parallel gateway senders No parallel senders for distributed regions. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/9092b4d7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/9092b4d7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/9092b4d7 Branch: refs/heads/feature/GEODE-1930 Commit: 9092b4d79f1ae96fc4d3f677d09946e96b573a5e Parents: e7d5c6a Author: Karen MillerAuthored: Thu Nov 3 16:42:25 2016 -0700 Committer: Karen Miller Committed: Tue Nov 8 13:25:59 2016 -0800 -- .../topology_concepts/multisite_overview.html.md.erb | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9092b4d7/geode-docs/topologies_and_comm/topology_concepts/multisite_overview.html.md.erb -- diff --git a/geode-docs/topologies_and_comm/topology_concepts/multisite_overview.html.md.erb b/geode-docs/topologies_and_comm/topology_concepts/multisite_overview.html.md.erb index 2ad9a38..f250f80 100644 --- a/geode-docs/topologies_and_comm/topology_concepts/multisite_overview.html.md.erb +++ b/geode-docs/topologies_and_comm/topology_concepts/multisite_overview.html.md.erb @@ -57,26 +57,21 @@ Geode provides two types of gateway sender configurations: *serial* gateway send ## Serial Gateway Senders -A *serial gateway sender* distributes region events from a single Geode server in the local cluster to a remote Geode cluster. Although multiple regions can use the same serial gateway for distribution, a serial gateway uses a single logical event queue to dispatch events for all regions that use the gateway sender. +A *serial gateway sender* funnels region events through a single Geode server in the local cluster to a gateway receiver in the remote Geode cluster. Although multiple regions can use the same serial gateway for distribution, a serial gateway uses a single logical event queue to dispatch events for all regions that use the gateway sender. -Because a serial gateway sender distributes all of a region's events from a single member, it provides the most control over ordering region events as they are distributed across the WAN. However, a serial gateway sender provides only a finite amount of throughput for distributing events. As you add more regions and servers to the local cluster, you may need to configure additional serial gateway senders manually and isolate individual regions on specific serial gateway senders to handle the increased distribution traffic. +Because a serial gateway sender has a single distribution point, it provides the most control over ordering region events as they are distributed across the WAN. However, a serial gateway sender provides only a finite amount of throughput, so it may be a performance bottleneck. As you add more regions and servers to the local cluster, you may need to configure additional serial gateway senders manually and isolate individual regions on specific serial gateway senders to handle the increased distribution traffic. ## Parallel Gateway Senders -A *parallel gateway sender* distributes region events simultaneously from each Geode server that hosts the region. For a partitioned region, this means that each server that hosts buckets for the region uses its own logical queue to distribute events for those buckets. As you add new servers to scale the partitioned region, WAN distribution throughput scales automatically with each new instance of the parallel gateway sender. +A *parallel gateway sender* distributes region events from each of the Geode servers that host a partitioned region. For a partitioned region, each server that hosts primary buckets for the region uses its own logical queue to distribute events for those buckets. As you add new servers to scale the partitioned region, WAN distribution throughput scales automatically with each new instance of the parallel gateway sender. -A parallel gateway sender uses multiple queues on multiple Geode members to simultaneously distribute region events to a remote Geode cluster. Each queue distributes only part of the events for a configured region. For example, for a partitioned region, each queue distributes only those events for the local partition. - -Distributed, non-replicated regions can also use a parallel gateway sender for distribution. With a distributed region, Geode creates a separate gateway sender and queue on each member that hosts the region, and then hashes region events to place them into a distinct queue. This provides a level of scalability for distributed
[01/50] [abbrv] incubator-geode git commit: GEODE-2005: Fix javadocs warnings in IntegratedSecurityService [Forced Update!]
Repository: incubator-geode Updated Branches: refs/heads/feature/GEODE-1930 77400c3e0 -> e02121109 (forced update) GEODE-2005: Fix javadocs warnings in IntegratedSecurityService Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e7d5c6aa Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e7d5c6aa Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e7d5c6aa Branch: refs/heads/feature/GEODE-1930 Commit: e7d5c6aaf0a688546fe8be5b84b80f80f7bda73b Parents: 0fb5093 Author: Kirk LundAuthored: Tue Nov 8 10:59:43 2016 -0800 Committer: Kirk Lund Committed: Tue Nov 8 11:00:42 2016 -0800 -- .../apache/geode/internal/security/IntegratedSecurityService.java | 2 -- 1 file changed, 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e7d5c6aa/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java b/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java index 7a898d1..57cb2db 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java +++ b/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java @@ -441,8 +441,6 @@ public class IntegratedSecurityService implements SecurityService { /** * If Shiro's security manager is configured, then return true, otherwise, return false; - * - * @return */ public boolean isIntegratedSecurity() { if (isIntegratedSecurity != null) {
[23/50] [abbrv] incubator-geode git commit: Adding option partition-resolver in gfsh while creating a region.
Adding option partition-resolver in gfsh while creating a region. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/95ad1643 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/95ad1643 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/95ad1643 Branch: refs/heads/feature/GEODE-1930 Commit: 95ad1643874cd37d8c3b9dbcae8923ea58fe5be7 Parents: 3db9b30 Author: adongreAuthored: Fri Oct 28 16:04:15 2016 +0530 Committer: Anthony Baker Committed: Sat Nov 12 07:55:22 2016 -0800 -- .../CreateAlterDestroyRegionCommands.java | 45 +-- .../cli/functions/RegionCreateFunction.java | 42 ++ .../cli/functions/RegionFunctionArgs.java | 42 +- .../internal/cli/i18n/CliStrings.java | 21 +++ .../geode/redis/internal/RegionProvider.java| 2 +- ...eateAlterDestroyRegionCommandsDUnitTest.java | 129 ++- .../cli/commands/golden-help-offline.properties | 12 +- 7 files changed, 263 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/95ad1643/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java index 5dba0d8..58af6cb 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java @@ -31,19 +31,13 @@ import javax.management.MBeanServer; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; +import joptsimple.internal.Strings; +import org.apache.geode.cache.*; import org.springframework.shell.core.annotation.CliAvailabilityIndicator; import org.springframework.shell.core.annotation.CliCommand; import org.springframework.shell.core.annotation.CliOption; import org.apache.geode.LogWriter; -import org.apache.geode.cache.Cache; -import org.apache.geode.cache.CacheFactory; -import org.apache.geode.cache.DataPolicy; -import org.apache.geode.cache.ExpirationAttributes; -import org.apache.geode.cache.Region; -import org.apache.geode.cache.RegionAttributes; -import org.apache.geode.cache.RegionShortcut; -import org.apache.geode.cache.Scope; import org.apache.geode.cache.execute.ResultCollector; import org.apache.geode.compression.Compressor; import org.apache.geode.distributed.DistributedMember; @@ -199,6 +193,9 @@ public class CreateAlterDestroyRegionCommands extends AbstractCommandsSupport { unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE, specifiedDefaultValue = "true", help = CliStrings.CREATE_REGION__OFF_HEAP__HELP) Boolean offHeap, + @CliOption(key = CliStrings.CREATE_REGION__PARTITION_RESOLVER, + unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE, + help = CliStrings.CREATE_REGION__PARTITION_RESOLVER__HELP) String partitionResolver, @CliOption(key = CliStrings.CREATE_REGION__REGIONEXPIRATIONIDLETIME, unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE, help = CliStrings.CREATE_REGION__REGIONEXPIRATIONIDLETIME__HELP) Integer regionExpirationIdleTime, @@ -299,7 +296,7 @@ public class CreateAlterDestroyRegionCommands extends AbstractCommandsSupport { asyncEventQueueIds, gatewaySenderIds, concurrencyChecksEnabled, cloningEnabled, concurrencyLevel, prColocatedWith, prLocalMaxMemory, prRecoveryDelay, prRedundantCopies, prStartupRecoveryDelay, prTotalMaxMemory, prTotalNumBuckets, offHeap, mcastEnabled, -regionAttributes); +regionAttributes, partitionResolver); if (regionAttributes.getPartitionAttributes() == null @@ -318,7 +315,7 @@ public class CreateAlterDestroyRegionCommands extends AbstractCommandsSupport { asyncEventQueueIds, gatewaySenderIds, concurrencyChecksEnabled, cloningEnabled, concurrencyLevel, prColocatedWith, prLocalMaxMemory, prRecoveryDelay, prRedundantCopies, prStartupRecoveryDelay, prTotalMaxMemory, prTotalNumBuckets, null, compressor, offHeap, -mcastEnabled); +mcastEnabled, partitionResolver); if (!regionShortcut.name().startsWith("PARTITION") && regionFunctionArgs.hasPartitionAttributes()) { @@ -369,7 +366,6 @@ public class
[22/50] [abbrv] incubator-geode git commit: GEODE-2094 Update admin/dev REST API documentation
GEODE-2094 Update admin/dev REST API documentation - Add 3 missing gfsh start server options: --http-service-port --http-service-bind-address --start-rest-api - Update examples to use these options, instead of using the older --J=-gemfire. property specification. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/3db9b309 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/3db9b309 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/3db9b309 Branch: refs/heads/feature/GEODE-1930 Commit: 3db9b309740ff10a7bc0bc6c4ad9bcea3124f29a Parents: 5731300 Author: Karen MillerAuthored: Thu Nov 10 14:28:40 2016 -0800 Committer: Karen Miller Committed: Fri Nov 11 14:56:12 2016 -0800 -- .../cluster_config/gfsh_remote.html.md.erb | 6 +++--- geode-docs/rest_apps/setup_config.html.md.erb | 12 ++-- .../gfsh/command-pages/start.html.md.erb| 20 ++-- 3 files changed, 27 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3db9b309/geode-docs/configuring/cluster_config/gfsh_remote.html.md.erb -- diff --git a/geode-docs/configuring/cluster_config/gfsh_remote.html.md.erb b/geode-docs/configuring/cluster_config/gfsh_remote.html.md.erb index c8ea240..a1fab41 100644 --- a/geode-docs/configuring/cluster_config/gfsh_remote.html.md.erb +++ b/geode-docs/configuring/cluster_config/gfsh_remote.html.md.erb @@ -28,13 +28,13 @@ To connect `gfsh` using the HTTP protocol to a remote GemFire cluster: ``` pre gfsh>start server --name=server1 --J=-Dgemfire.jmx-manager=true \ ---J=-Dgemfire.jmx-manager-start=true --J=-Dgemfire.http-service-port=8080 \ ---J=-Dgemfire.http-service-bind-address=myremotecluster.example.com +--J=-Dgemfire.jmx-manager-start=true --http-service-port=8080 \ +--http-service-bind-address=myremotecluster.example.com ``` This command must be executed directly on the host machine that will ultimately act as the remote GemFire server that hosts the HTTP service for remote administration. (You cannot launch a GemFire server remotely.) -3. On your local system, run the `gfsh` `connect` command to connect to the remote system. Include the `--use-http` and `--url` parameters. For example: +3. On your local system, run the `gfsh connect` command to connect to the remote system. Include the `--use-http` and `--url` parameters. For example: ``` pre gfsh>connect --use-http=true --url="http://myremotecluster.example.com:8080/gemfire/v1; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3db9b309/geode-docs/rest_apps/setup_config.html.md.erb -- diff --git a/geode-docs/rest_apps/setup_config.html.md.erb b/geode-docs/rest_apps/setup_config.html.md.erb index 604dd05..71c50f5 100644 --- a/geode-docs/rest_apps/setup_config.html.md.erb +++ b/geode-docs/rest_apps/setup_config.html.md.erb @@ -78,8 +78,8 @@ The following procedure starts up a REST API service-enabled Geode deployment: 2. Start a server node with the Geode property `start-dev-rest-api` set to `true`. For example: ``` pre -gfsh>start server --name=server1 --J=-Dgemfire.start-dev-rest-api=true \ ---J=-Dgemfire.http-service-port=8080 --J=-Dgemfire.http-service-bind-address=localhost +gfsh>start server --name=server1 --start-rest-api=true \ +--http-service-port=8080 --http-service-bind-address=localhost ``` Optionally, you can also configure a `http-service-bind-address` and `http-service-port` to identify the cache server and specific port that will host REST services. If you do not specify the `http-service-port`, the default port is 7070. If you do not specify `http-service-bind-address`, the HTTP service will bind to all local addresses by default. @@ -87,8 +87,8 @@ The following procedure starts up a REST API service-enabled Geode deployment: Any server that hosts data, even a server acting as a JMX manager, can start the developer REST API service. For example, to start the service on a server that is also a JMX manager, you would run: ``` pre -gfsh>start server --name=server1 --J=-Dgemfire.start-dev-rest-api=true \ ---J=-Dgemfire.http-service-port=8080 --J=-Dgemfire.http-service-bind-address=localhost \ +gfsh>start server --name=server1 --start-rest-api=true \ +--http-service-port=8080 --http-service-bind-address=localhost \ --J=-Dgemfire.jmx-manager=true --J=-Dgemfire.jmx-manager-start=true ``` @@ -97,8 +97,8 @@ The following procedure starts up a REST API service-enabled Geode deployment: 3.
[14/50] [abbrv] incubator-geode git commit: GEODE-2084 - When executing a rest api in a browser, the login page presented in the browser is not setting the username/password correctly
GEODE-2084 - When executing a rest api in a browser, the login page presented in the browser is not setting the username/password correctly * Changed RestSecurityConfiguration to not call login(), which will bring up the browsers Authentication dialog instead. * this closes #281 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/aac49f3f Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/aac49f3f Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/aac49f3f Branch: refs/heads/feature/GEODE-1930 Commit: aac49f3f0c17c1e396e6dbe9fb84849bd6c9b2c6 Parents: df2f0c9 Author: Kevin DulingAuthored: Thu Nov 10 10:44:37 2016 -0800 Committer: Jinmei Liao Committed: Thu Nov 10 14:39:13 2016 -0800 -- .../rest/internal/web/security/RestSecurityConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aac49f3f/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/security/RestSecurityConfiguration.java -- diff --git a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/security/RestSecurityConfiguration.java b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/security/RestSecurityConfiguration.java index 3aa5622..f0491b7 100644 --- a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/security/RestSecurityConfiguration.java +++ b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/security/RestSecurityConfiguration.java @@ -56,7 +56,7 @@ public class RestSecurityConfiguration extends WebSecurityConfigurerAdapter { .authorizeRequests() .antMatchers("/ping", "/docs/**", "/swagger-ui.html", "/v2/api-docs/**", "/webjars/springfox-swagger-ui/**", "/swagger-resources/**") - .permitAll().anyRequest().authenticated().and().formLogin().and().csrf().disable(); +.permitAll().anyRequest().authenticated().and().csrf().disable(); if (securityService.isIntegratedSecurity()) { http.httpBasic();
[03/50] [abbrv] incubator-geode git commit: Merge branch 'feature/GEODE-2070' into develop
Merge branch 'feature/GEODE-2070' into develop Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/9dfb4ac2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/9dfb4ac2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/9dfb4ac2 Branch: refs/heads/feature/GEODE-1930 Commit: 9dfb4ac2fa9b5388a745fdd0aa2ba25058d95c2e Parents: 9092b4d 95f56b0 Author: Karen MillerAuthored: Tue Nov 8 13:31:04 2016 -0800 Committer: Karen Miller Committed: Tue Nov 8 13:31:04 2016 -0800 -- .../source/subnavs/geode-subnav.erb | 11 +- .../data_regions/chapter_overview.html.md.erb | 16 +- .../create_a_region_with_API.html.md.erb| 80 --- .../create_a_region_with_cacheXML.html.md.erb | 85 --- .../managing_data_regions.html.md.erb | 221 +++ .../reference/topics/cache_xml.html.md.erb | 2 +- ...chapter_overview_regionshortcuts.html.md.erb | 2 +- .../reference/topics/client-cache.html.md.erb | 4 +- .../reference/topics/gfe_cache_xml.html.md.erb | 2 +- 9 files changed, 181 insertions(+), 242 deletions(-) --
[09/50] [abbrv] incubator-geode git commit: GEODE-2090 Update off-heap statistics documentation
GEODE-2090 Update off-heap statistics documentation - add/correct the gfsh show metrics command reference page to include the offheap category for when the member is specified - in the list of OffHeapMemoryStats, correct the name of a statistic: compactions should be defragmentations Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/88e5d0f1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/88e5d0f1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/88e5d0f1 Branch: refs/heads/feature/GEODE-1930 Commit: 88e5d0f154b919d1f73316cd0ea01970e40a4067 Parents: e7e3723 Author: Karen MillerAuthored: Wed Nov 9 16:36:48 2016 -0800 Committer: Karen Miller Committed: Thu Nov 10 08:58:19 2016 -0800 -- geode-docs/reference/statistics/statistics_list.html.md.erb | 2 +- geode-docs/tools_modules/gfsh/command-pages/show.html.md.erb | 7 +-- 2 files changed, 6 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/88e5d0f1/geode-docs/reference/statistics/statistics_list.html.md.erb -- diff --git a/geode-docs/reference/statistics/statistics_list.html.md.erb b/geode-docs/reference/statistics/statistics_list.html.md.erb index 02ed6a7..7f7b76f 100644 --- a/geode-docs/reference/statistics/statistics_list.html.md.erb +++ b/geode-docs/reference/statistics/statistics_list.html.md.erb @@ -1012,7 +1012,7 @@ These statistics quantify the use of off-heap memory. The primary statistics are | Statistic | Description | |---|-| -| `compactions` | The total number of times the off-heap memory manager has invoked the defragmentation algorithm on the off-heap memory space. | +| `defragmentations` | The total number of times the off-heap memory manager has invoked the defragmentation algorithm on the off-heap memory space. | | `defragmentationsInProgress` | The number of defragmentation operations currently in progress. | | `defragmentationTime` | The total number of nanoseconds spent running the defragmentation algorithm on off-heap memory space fragments.
[04/50] [abbrv] incubator-geode git commit: docs: fix docker scripts for building/viewing docs (Dan S)
docs: fix docker scripts for building/viewing docs (Dan S) Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/08bbbe26 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/08bbbe26 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/08bbbe26 Branch: refs/heads/feature/GEODE-1930 Commit: 08bbbe26163f4f8b899ea0fa4636ff78120822a1 Parents: 9dfb4ac Author: Dave BarnesAuthored: Tue Nov 8 15:05:31 2016 -0800 Committer: Dave Barnes Committed: Tue Nov 8 15:05:31 2016 -0800 -- dev-tools/docker/docs/build-docs.sh | 3 ++- dev-tools/docker/docs/view-docs.sh | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/08bbbe26/dev-tools/docker/docs/build-docs.sh -- diff --git a/dev-tools/docker/docs/build-docs.sh b/dev-tools/docker/docs/build-docs.sh index 4b670b0..abffadc 100755 --- a/dev-tools/docker/docs/build-docs.sh +++ b/dev-tools/docker/docs/build-docs.sh @@ -17,6 +17,8 @@ set -e -x -u +SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + . $SCRIPT_DIR/build-image-common.sh docker run -i -t \ @@ -24,7 +26,6 @@ docker run -i -t \ -w "/home/${USER_NAME}/incubator-geode/geode-book" \ -u "${USER_NAME}" \ -v "$PWD:/home/${USER_NAME}/incubator-geode" \ - -v "/home/${USER_NAME}/.m2:/home/${USER_NAME}/.m2" \ ${IMAGE_NAME}-${USER_NAME} \ bundle exec bookbinder bind local http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/08bbbe26/dev-tools/docker/docs/view-docs.sh -- diff --git a/dev-tools/docker/docs/view-docs.sh b/dev-tools/docker/docs/view-docs.sh index f107ccd..af33c53 100755 --- a/dev-tools/docker/docs/view-docs.sh +++ b/dev-tools/docker/docs/view-docs.sh @@ -26,7 +26,6 @@ docker run -i -t \ -w "/home/${USER_NAME}/incubator-geode/geode-book/final_app/public" \ -u "${USER_NAME}" \ -v "$PWD:/home/${USER_NAME}/incubator-geode" \ - -v "/home/${USER_NAME}/.m2:/home/${USER_NAME}/.m2" \ -p 127.0.0.1:8080:8080 \ ${IMAGE_NAME}-${USER_NAME} \ python -m SimpleHTTPServer 8080
[29/50] [abbrv] incubator-geode git commit: GEODE-2102: annotate flaky test with FlakyTest category
GEODE-2102: annotate flaky test with FlakyTest category Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/8c383ee3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/8c383ee3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/8c383ee3 Branch: refs/heads/feature/GEODE-1930 Commit: 8c383ee358d7b972e89458e6670395a97a27c477 Parents: 95a07d2 Author: Kirk LundAuthored: Mon Nov 14 10:34:11 2016 -0800 Committer: Kirk Lund Committed: Mon Nov 14 10:35:01 2016 -0800 -- .../internal/cli/commands/DiskStoreCommandsDUnitTest.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c383ee3/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java index 83923ba..901ed29 100644 --- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java @@ -102,6 +102,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase { final List filesToBeDeleted = new CopyOnWriteArrayList(); + @Category(FlakyTest.class) // GEODE-2102 @Test public void testMissingDiskStore() { final String regionName = "testShowMissingDiskStoreRegion";
[20/50] [abbrv] incubator-geode git commit: GEODE-2080 Rest POST put call not working with region valueConstraint
GEODE-2080 Rest POST put call not working with region valueConstraint If you set a value constraint on a cache Region you will be unable to store objects in the region via the Rest API. This change-set modifies LocalRegion's constraint check to look for a Rest document and use its type name in the constraint check Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/d65b79a4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/d65b79a4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/d65b79a4 Branch: refs/heads/feature/GEODE-1930 Commit: d65b79a4634325edb73e2136f1e59d6879845faf Parents: e01dbe6 Author: Bruce SchuchardtAuthored: Thu Nov 10 15:10:43 2016 -0800 Committer: Bruce Schuchardt Committed: Thu Nov 10 15:12:25 2016 -0800 -- .../geode/internal/cache/LocalRegion.java | 103 +++ .../geode/pdx/PdxClientServerDUnitTest.java | 72 ++--- 2 files changed, 117 insertions(+), 58 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d65b79a4/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java index d413b3b..fd4b6c7 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java @@ -15,42 +15,7 @@ package org.apache.geode.internal.cache; -import static org.apache.geode.internal.offheap.annotations.OffHeapIdentifier.*; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.AbstractSet; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.Semaphore; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.apache.logging.log4j.Logger; +import static org.apache.geode.internal.offheap.annotations.OffHeapIdentifier.ENTRY_EVENT_NEW_VALUE; import org.apache.geode.CancelCriterion; import org.apache.geode.CancelException; @@ -209,6 +174,42 @@ import org.apache.geode.internal.sequencelog.EntryLogger; import org.apache.geode.internal.util.concurrent.FutureResult; import org.apache.geode.internal.util.concurrent.StoppableCountDownLatch; import org.apache.geode.internal.util.concurrent.StoppableReadWriteLock; +import org.apache.geode.pdx.JSONFormatter; +import org.apache.geode.pdx.PdxInstance; +import org.apache.logging.log4j.Logger; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.AbstractSet; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.Semaphore; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * Implementation of a local scoped-region. Note that this class has a different meaning starting @@ -508,17 +509,11 @@ public class LocalRegion
[19/50] [abbrv] incubator-geode git commit: GEODE-2091: Do not return false when containsValueForKey call failed in a transaction
GEODE-2091: Do not return false when containsValueForKey call failed in a transaction Correctly handle exception to fail the transaction instead of returning null. Add check for colocated buckets so that correct TrasactionException can be thrown. Fix containsKey method call as well. Add test cases in dunit test. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e01dbe6f Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e01dbe6f Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e01dbe6f Branch: refs/heads/feature/GEODE-1930 Commit: e01dbe6f557a11aa99cd6ec4da349a38a97d678e Parents: bd229d7 Author: eshuAuthored: Thu Nov 10 14:57:48 2016 -0800 Committer: eshu Committed: Thu Nov 10 15:02:58 2016 -0800 -- .../geode/internal/cache/TXStateStub.java | 4 + .../cache/tx/PartitionedTXRegionStub.java | 42 +++- .../apache/geode/disttx/PRDistTXDUnitTest.java | 8 + .../disttx/PRDistTXWithVersionsDUnitTest.java | 8 + .../cache/execute/PRTransactionDUnitTest.java | 200 --- 5 files changed, 181 insertions(+), 81 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e01dbe6f/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateStub.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateStub.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateStub.java index a6c78f2..5dd624b 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateStub.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateStub.java @@ -135,6 +135,10 @@ public abstract class TXStateStub implements TXStateInterface { return stub; } + public Map getRegionStubs() { +return this.regionStubs; + } + @Override public String toString() { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e01dbe6f/geode-core/src/main/java/org/apache/geode/internal/cache/tx/PartitionedTXRegionStub.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tx/PartitionedTXRegionStub.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tx/PartitionedTXRegionStub.java index 0e9c128..10ae7a5 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/tx/PartitionedTXRegionStub.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tx/PartitionedTXRegionStub.java @@ -17,6 +17,7 @@ package org.apache.geode.internal.cache.tx; import org.apache.geode.CancelException; import org.apache.geode.cache.CacheClosedException; import org.apache.geode.cache.EntryNotFoundException; +import org.apache.geode.cache.Region; import org.apache.geode.cache.Region.Entry; import org.apache.geode.cache.TransactionDataNodeHasDepartedException; import org.apache.geode.cache.TransactionDataNotColocatedException; @@ -24,6 +25,7 @@ import org.apache.geode.cache.TransactionDataRebalancedException; import org.apache.geode.cache.TransactionException; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.BucketNotFoundException; +import org.apache.geode.internal.cache.ColocationHelper; import org.apache.geode.internal.cache.DataLocationException; import org.apache.geode.internal.cache.DistributedPutAllOperation; import org.apache.geode.internal.cache.DistributedRemoveAllOperation; @@ -46,6 +48,7 @@ import org.apache.geode.internal.cache.tier.sockets.VersionedObjectList; import org.apache.geode.internal.i18n.LocalizedStrings; import org.apache.geode.internal.offheap.annotations.Released; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; @@ -64,6 +67,9 @@ public class PartitionedTXRegionStub extends AbstractPeerTXRegionStub { super(txstate, r); } + public Map getBuckets() { +return buckets; + } public void destroyExistingEntry(EntryEventImpl event, boolean cacheWrite, Object expectedOldValue) { @@ -107,16 +113,15 @@ public class PartitionedTXRegionStub extends AbstractPeerTXRegionStub { } ex = ex.getCause(); } -if (keyInfo != null && !buckets.isEmpty() && !buckets.containsKey(keyInfo.getBucketId())) { - // for parent region if previous ops were successful and for child colocated regions - // where the bucketId was not previously encountered + +if (isKeyInNonColocatedBucket(keyInfo)) { return new TransactionDataNotColocatedException(
[37/50] [abbrv] incubator-geode git commit: Remove unused imports
Remove unused imports Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/b286fe75 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/b286fe75 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/b286fe75 Branch: refs/heads/feature/GEODE-1930 Commit: b286fe75b5f46c100ae9c0a8704430b7793fed25 Parents: 22f577e Author: Kirk LundAuthored: Mon Oct 31 14:07:47 2016 -0700 Committer: Kirk Lund Committed: Tue Nov 15 12:26:26 2016 -0800 -- .../org/apache/geode/management/ClientHealthStatsDUnitTest.java | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b286fe75/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java index 2c7ae07..d6c0f0a 100644 --- a/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java @@ -53,7 +53,6 @@ import org.apache.geode.internal.cache.tier.sockets.CacheClientProxy; import org.apache.geode.management.internal.SystemManagementService; import org.apache.geode.test.dunit.VM; import org.apache.geode.test.junit.categories.DistributedTest; -import org.apache.geode.test.junit.categories.FlakyTest; /** * Client health stats check
[36/50] [abbrv] incubator-geode git commit: GEODE-1617: add test for region names
GEODE-1617: add test for region names Added comprehensive test to validate region names This closes #285 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/0c9002b2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/0c9002b2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/0c9002b2 Branch: refs/heads/feature/GEODE-1930 Commit: 0c9002b205e64cb248ab6ab26f2df27bf821c54c Parents: b35e2a4 Author: Kevin DulingAuthored: Tue Nov 15 09:33:59 2016 -0800 Committer: Kirk Lund Committed: Tue Nov 15 12:02:53 2016 -0800 -- .../geode/internal/cache/LocalRegion.java | 2 +- .../cache/RegionNameValidationJUnitTest.java| 91 2 files changed, 92 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c9002b2/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java index fd4b6c7..80fc5da 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java @@ -7578,7 +7578,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory, this.entries.removeEntry(event.getKey(), re, false); } - static void validateRegionName(String name, InternalRegionArguments internalRegionArgs) { + public static void validateRegionName(String name, InternalRegionArguments internalRegionArgs) { if (name == null) { throw new IllegalArgumentException( LocalizedStrings.LocalRegion_NAME_CANNOT_BE_NULL.toLocalizedString()); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c9002b2/geode-core/src/test/java/org/apache/geode/cache/RegionNameValidationJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/cache/RegionNameValidationJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/RegionNameValidationJUnitTest.java new file mode 100644 index 000..365b68c --- /dev/null +++ b/geode-core/src/test/java/org/apache/geode/cache/RegionNameValidationJUnitTest.java @@ -0,0 +1,91 @@ +/* + * 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.cache; + +import static org.junit.Assert.fail; + +import org.apache.geode.internal.cache.InternalRegionArguments; +import org.apache.geode.internal.cache.LocalRegion; +import org.apache.geode.test.junit.categories.UnitTest; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +@Category(UnitTest.class) +public class RegionNameValidationJUnitTest { + private static final Pattern NAME_PATTERN = Pattern.compile("[aA-zZ0-9-_.]+"); + private static final String REGION_NAME = "MyRegion"; + + + @Test + public void testInvalidNames() { +InternalRegionArguments ira = new InternalRegionArguments(); +ira.setInternalRegion(false); +try { + LocalRegion.validateRegionName(null, ira); + fail(); +} catch (IllegalArgumentException ignore) { +} +try { + LocalRegion.validateRegionName("", ira); + fail(); +} catch (IllegalArgumentException ignore) { +} +try { + LocalRegion.validateRegionName("FOO" + Region.SEPARATOR, ira); + fail(); +} catch (IllegalArgumentException ignore) { +} + + } + + @Test + public void testExternalRegionNames() { +InternalRegionArguments ira = new InternalRegionArguments(); +ira.setInternalRegion(false); +validateCharacters(ira); +try { + LocalRegion.validateRegionName("__InvalidInternalRegionName", ira); + fail(); +} catch (IllegalArgumentException ignore) { +} + }
[27/50] [abbrv] incubator-geode git commit: GEODE-2074 GMSJoinLeaveJUnitTest.testDuplicateJoinRequestDoesNotCauseNewView
GEODE-2074 GMSJoinLeaveJUnitTest.testDuplicateJoinRequestDoesNotCauseNewView I've run this test class hundreds of times with only one failure in a different test. I've also run the individual test many hundreds of times with no failures. Since the ticket didn't include any of the test output or any information about past tests run that could have affected this test I am closing the ticket and modifying the test's failure text to give more information about the state of the Join/Leave processor if the test should fail again. This commit also includes a fix for the other test method that failed. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/665570e4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/665570e4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/665570e4 Branch: refs/heads/feature/GEODE-1930 Commit: 665570e438386a11f2071160e14ef3861bbfba51 Parents: 366f089 Author: Bruce SchuchardtAuthored: Mon Nov 14 10:06:42 2016 -0800 Committer: Bruce Schuchardt Committed: Mon Nov 14 10:10:57 2016 -0800 -- .../membership/gms/membership/GMSJoinLeaveJUnitTest.java | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/665570e4/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java index dac49d5..4143be1 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java @@ -487,7 +487,7 @@ public class GMSJoinLeaveJUnitTest { view.getCrashedMembers().contains(mockMembers[0])); } - @Category(FlakyTest.class) // GEODE-2074: timed out waiting for view #7 +// @Category(FlakyTest.class) // GEODE-2074: timed out waiting for view #7 @Test public void testDuplicateJoinRequestDoesNotCauseNewView() throws Exception { initMocks(); @@ -532,9 +532,9 @@ public class GMSJoinLeaveJUnitTest { && (!gmsJoinLeave.getViewRequests().isEmpty() || gmsJoinLeave.getView().getViewId() != viewId)) { if (sleeps++ > 20) { -System.out.println("view requests: " + gmsJoinLeave.getViewRequests()); -System.out.println("current view: " + gmsJoinLeave.getView()); -throw new RuntimeException("timeout waiting for view #" + viewId); +throw new RuntimeException( +"timeout waiting for view #" + viewId + " current view: " + gmsJoinLeave.getView() ++ "; view requests: " + gmsJoinLeave.getViewRequests()); } Thread.sleep(1000); } @@ -1030,7 +1030,7 @@ public class GMSJoinLeaveJUnitTest { msg.setSender(gmsJoinLeaveMemberId); gmsJoinLeave.processMessage(msg); } - Timeout to = new Timeout(2 * ServiceConfig.MEMBER_REQUEST_COLLECTION_INTERVAL, new Times(1)); + Timeout to = new Timeout(3 * ServiceConfig.MEMBER_REQUEST_COLLECTION_INTERVAL, new Times(1)); verify(messenger, to).send(isA(NetworkPartitionMessage.class)); } finally {
incubator-geode git commit: GEODE-1617: add test for region names
Repository: incubator-geode Updated Branches: refs/heads/develop b35e2a448 -> 0c9002b20 GEODE-1617: add test for region names Added comprehensive test to validate region names This closes #285 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/0c9002b2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/0c9002b2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/0c9002b2 Branch: refs/heads/develop Commit: 0c9002b205e64cb248ab6ab26f2df27bf821c54c Parents: b35e2a4 Author: Kevin DulingAuthored: Tue Nov 15 09:33:59 2016 -0800 Committer: Kirk Lund Committed: Tue Nov 15 12:02:53 2016 -0800 -- .../geode/internal/cache/LocalRegion.java | 2 +- .../cache/RegionNameValidationJUnitTest.java| 91 2 files changed, 92 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c9002b2/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java index fd4b6c7..80fc5da 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java @@ -7578,7 +7578,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory, this.entries.removeEntry(event.getKey(), re, false); } - static void validateRegionName(String name, InternalRegionArguments internalRegionArgs) { + public static void validateRegionName(String name, InternalRegionArguments internalRegionArgs) { if (name == null) { throw new IllegalArgumentException( LocalizedStrings.LocalRegion_NAME_CANNOT_BE_NULL.toLocalizedString()); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c9002b2/geode-core/src/test/java/org/apache/geode/cache/RegionNameValidationJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/cache/RegionNameValidationJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/RegionNameValidationJUnitTest.java new file mode 100644 index 000..365b68c --- /dev/null +++ b/geode-core/src/test/java/org/apache/geode/cache/RegionNameValidationJUnitTest.java @@ -0,0 +1,91 @@ +/* + * 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.cache; + +import static org.junit.Assert.fail; + +import org.apache.geode.internal.cache.InternalRegionArguments; +import org.apache.geode.internal.cache.LocalRegion; +import org.apache.geode.test.junit.categories.UnitTest; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +@Category(UnitTest.class) +public class RegionNameValidationJUnitTest { + private static final Pattern NAME_PATTERN = Pattern.compile("[aA-zZ0-9-_.]+"); + private static final String REGION_NAME = "MyRegion"; + + + @Test + public void testInvalidNames() { +InternalRegionArguments ira = new InternalRegionArguments(); +ira.setInternalRegion(false); +try { + LocalRegion.validateRegionName(null, ira); + fail(); +} catch (IllegalArgumentException ignore) { +} +try { + LocalRegion.validateRegionName("", ira); + fail(); +} catch (IllegalArgumentException ignore) { +} +try { + LocalRegion.validateRegionName("FOO" + Region.SEPARATOR, ira); + fail(); +} catch (IllegalArgumentException ignore) { +} + + } + + @Test + public void testExternalRegionNames() { +InternalRegionArguments ira = new InternalRegionArguments(); +ira.setInternalRegion(false); +validateCharacters(ira); +try { + LocalRegion.validateRegionName("__InvalidInternalRegionName",
[incubator-geode] Git Push Summary
Repository: incubator-geode Updated Branches: refs/heads/feature/GEODE-2104 [created] 8c383ee35
incubator-geode git commit: GEODE-2102: annotate flaky test with FlakyTest category
Repository: incubator-geode Updated Branches: refs/heads/develop 95a07d207 -> 8c383ee35 GEODE-2102: annotate flaky test with FlakyTest category Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/8c383ee3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/8c383ee3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/8c383ee3 Branch: refs/heads/develop Commit: 8c383ee358d7b972e89458e6670395a97a27c477 Parents: 95a07d2 Author: Kirk LundAuthored: Mon Nov 14 10:34:11 2016 -0800 Committer: Kirk Lund Committed: Mon Nov 14 10:35:01 2016 -0800 -- .../internal/cli/commands/DiskStoreCommandsDUnitTest.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c383ee3/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java index 83923ba..901ed29 100644 --- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java @@ -102,6 +102,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase { final List filesToBeDeleted = new CopyOnWriteArrayList(); + @Category(FlakyTest.class) // GEODE-2102 @Test public void testMissingDiskStore() { final String regionName = "testShowMissingDiskStoreRegion";
[02/50] [abbrv] incubator-geode git commit: GEODE-2000 client should see server-bind-address in event memberId
GEODE-2000 client should see server-bind-address in event memberId The previous fix for this caused confusion as it changed the server memberId that is used in other places and should remain unchanged. This change set alters just the listener-invocation code in the client cache so that client events are based on the ServerLocation information returned by the Locator or added to the connection pool by applications. Udo worked with me on this and we found the listener invocation code to be somewhat convoluted, mixing server-side notification about clients with client-side notification about servers in the same code. This lead to a bit of refactoring in InternalClientMembership to separate the two. A number of changes had to be made in test code. Some tests were requiring that client-side listeners see the server's exact member ID which is no longer true since the ID being fabricated out of a ServerLocation doesn't have as much detail as the true member ID and so is not equal() to it. Some other test code was creating ServerLocation objects with non-existent host names. This is no longer allowed so we changed these tests to use a numeric IP address. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/87f2fb5f Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/87f2fb5f Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/87f2fb5f Branch: refs/heads/feature/GEODE-1930 Commit: 87f2fb5f32f71b0fda74fa61c1237b41f4c7ef11 Parents: a564a69 Author: Bruce SchuchardtAuthored: Thu Oct 27 09:00:50 2016 -0700 Committer: Bruce Schuchardt Committed: Thu Oct 27 09:03:51 2016 -0700 -- .../internal/DistributionLocatorConfigImpl.java | 23 +- .../client/internal/EndpointManagerImpl.java| 6 +- .../membership/InternalDistributedMember.java | 29 ++- .../cache/tier/InternalClientMembership.java| 139 ++- .../cache/tier/sockets/CacheClientUpdater.java | 2 +- .../internal/cache/tier/sockets/HandShake.java | 4 +- .../cache/tier/sockets/ServerConnection.java| 6 +- .../AutoConnectionSourceImplJUnitTest.java | 55 + .../pooling/ConnectionManagerJUnitTest.java | 7 +- .../PartitionRegionHelperDUnitTest.java | 6 - .../cache30/ClientMembershipDUnitTest.java | 77 +++--- .../internal/DistributionManagerDUnitTest.java | 2 - ...onedRegionQueryEvaluatorIntegrationTest.java | 25 +- ...ersalMembershipListenerAdapterDUnitTest.java | 238 +-- .../java/org/apache/geode/test/fake/Fakes.java | 6 +- 15 files changed, 334 insertions(+), 291 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java index c3cab6f..851693a 100644 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java +++ b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java @@ -14,6 +14,7 @@ */ package org.apache.geode.admin.internal; +import org.apache.geode.GemFireConfigException; import org.apache.geode.admin.DistributionLocator; import org.apache.geode.admin.DistributionLocatorConfig; import org.apache.geode.distributed.internal.tcpserver.*; @@ -66,14 +67,20 @@ public class DistributionLocatorConfigImpl extends ManagedEntityConfigImpl */ static DistributionLocatorConfig createConfigFor(String host, int port, InetAddress bindAddress) { TcpClient client = new TcpClient(); -String[] info = null; -if (bindAddress != null) { - info = client.getInfo(bindAddress, port); -} else { - info = client.getInfo(InetAddressUtil.toInetAddress(host), port); -} -if (info == null) { - return null; +String[] info = new String[] {"unknown", "unknown"}; + +try { + client = new TcpClient(); + if (bindAddress != null) { +info = client.getInfo(bindAddress, port); + } else { +info = client.getInfo(InetAddressUtil.toInetAddress(host), port); + } + if (info == null) { +return null; + } +} catch (GemFireConfigException e) { + // communications are not initialized at this point } DistributionLocatorConfigImpl config = new DistributionLocatorConfigImpl();
[43/50] [abbrv] incubator-geode git commit: Convert from ManagementTestCase to ManagementTestRule
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f3b5664c/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java index a3c8b27..2c7ae07 100644 --- a/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java @@ -14,13 +14,25 @@ */ package org.apache.geode.management; +import static java.util.concurrent.TimeUnit.*; import static org.apache.geode.distributed.ConfigurationProperties.*; -import static org.apache.geode.test.dunit.Assert.*; +import static org.apache.geode.test.dunit.Host.*; +import static org.apache.geode.test.dunit.IgnoredException.*; +import static org.apache.geode.test.dunit.Invoke.*; +import static org.apache.geode.test.dunit.NetworkUtils.*; +import static org.assertj.core.api.Assertions.*; +import java.io.Serializable; import java.util.Collection; -import java.util.Iterator; import java.util.Properties; +import javax.management.ObjectName; + +import com.jayway.awaitility.Awaitility; +import com.jayway.awaitility.core.ConditionFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -29,22 +41,17 @@ import org.apache.geode.cache.EntryEvent; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionFactory; import org.apache.geode.cache.RegionShortcut; +import org.apache.geode.cache.client.ClientCache; import org.apache.geode.cache.client.ClientCacheFactory; import org.apache.geode.cache.client.ClientRegionFactory; import org.apache.geode.cache.client.ClientRegionShortcut; import org.apache.geode.cache.server.CacheServer; import org.apache.geode.cache.util.CacheListenerAdapter; import org.apache.geode.distributed.DistributedMember; -import org.apache.geode.internal.cache.GemFireCacheImpl; import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier; import org.apache.geode.internal.cache.tier.sockets.CacheClientProxy; -import org.apache.geode.internal.i18n.LocalizedStrings; -import org.apache.geode.test.dunit.Host; -import org.apache.geode.test.dunit.IgnoredException; +import org.apache.geode.management.internal.SystemManagementService; import org.apache.geode.test.dunit.VM; -import org.apache.geode.test.dunit.Wait; -import org.apache.geode.test.dunit.WaitCriterion; -import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase; import org.apache.geode.test.junit.categories.DistributedTest; import org.apache.geode.test.junit.categories.FlakyTest; @@ -52,415 +59,343 @@ import org.apache.geode.test.junit.categories.FlakyTest; * Client health stats check */ @Category(DistributedTest.class) -@SuppressWarnings("serial") -public class ClientHealthStatsDUnitTest extends JUnit4DistributedTestCase { - - private static final String k1 = "k1"; - private static final String k2 = "k2"; - private static final String client_k1 = "client-k1"; - private static final String client_k2 = "client-k2"; +@SuppressWarnings({ "serial", "unused" }) +public class ClientHealthStatsDUnitTest implements Serializable { - /** name of the test region */ - private static final String REGION_NAME = "ClientHealthStatsDUnitTest_Region"; + private static final int NUMBER_PUTS = 100; - private static VM client = null; - private static VM client2 = null; - private static VM managingNode = null; + private static final String KEY1 = "KEY1"; + private static final String KEY2 = "KEY2"; + private static final String VALUE1 = "VALUE1"; + private static final String VALUE2 = "VALUE2"; - private static ManagementTestBase helper = new ManagementTestBase() {}; + private static final String REGION_NAME = ClientHealthStatsDUnitTest.class.getSimpleName() + "_Region"; - private static int numOfCreates = 0; - private static int numOfUpdates = 0; - private static int numOfInvalidates = 0; - private static boolean lastKeyReceived = false; + // client1VM and client2VM VM fields + private static ClientCache clientCache; - private static GemFireCacheImpl cache = null; + // TODO: assert following values in each client VM + private static int numOfCreates; + private static int numOfUpdates; + private static int numOfInvalidates; + private static boolean lastKeyReceived; - private VM server = null; + private VM managerVM; + private VM serverVM; + private VM client1VM; + private VM client2VM; - @Override - public final void postSetUp() throws Exception { -disconnectAllFromDS(); + private String hostName; -final Host host = Host.getHost(0); -managingNode = host.getVM(0); -server = host.getVM(1); -