You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/11/15 20:48:48 UTC
[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 Lund <kl...@apache.org>
Authored: Tue Nov 8 10:59:43 2016 -0800
Committer: Kirk Lund <kl...@apache.org>
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) {
[08/50] [abbrv] incubator-geode git commit: GEODE-1808 Remove broken
check for jdk1.7.0_72
Posted by kl...@apache.org.
GEODE-1808 Remove broken check for jdk1.7.0_72
The logic for evaluating jdk versions is incorrect for 3-digit builds.
Since we require a jdk1.8 version anyway, remove the 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/e7e37236
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e7e37236
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e7e37236
Branch: refs/heads/feature/GEODE-1930
Commit: e7e372368941dc391669015716e7e03f1e163679
Parents: 7973d57
Author: Anthony Baker <ab...@apache.org>
Authored: Tue Nov 8 09:31:10 2016 -0800
Committer: Anthony Baker <ab...@apache.org>
Committed: Thu Nov 10 07:27:16 2016 -0800
----------------------------------------------------------------------
.../geode/internal/cache/GemFireCacheImpl.java | 2 -
.../cache/MinimumSystemRequirements.java | 90 --------------------
.../internal/lang/SystemUtilsJUnitTest.java | 3 +-
3 files changed, 1 insertion(+), 94 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e7e37236/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
index e1b2007..7b2e7ca 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
@@ -1186,8 +1186,6 @@ public class GemFireCacheImpl
GemFireCacheImpl.instance = this;
GemFireCacheImpl.pdxInstance = this;
- MinimumSystemRequirements.checkAndLog();
-
for (Iterator<CacheLifecycleListener> iter = cacheLifecycleListeners.iterator(); iter
.hasNext();) {
CacheLifecycleListener listener = (CacheLifecycleListener) iter.next();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e7e37236/geode-core/src/main/java/org/apache/geode/internal/cache/MinimumSystemRequirements.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/MinimumSystemRequirements.java b/geode-core/src/main/java/org/apache/geode/internal/cache/MinimumSystemRequirements.java
deleted file mode 100644
index a2c1874..0000000
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/MinimumSystemRequirements.java
+++ /dev/null
@@ -1,90 +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.internal.cache;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.lang.SystemUtils;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-
-/**
- * Checks that minimum system requirements are met.
- *
- *
- * @since GemFire 8.1
- */
-public final class MinimumSystemRequirements {
-
- public static final String JAVA_VERSION = "1.7.0_72";
-
- private static final Logger logger = LogService.getLogger();
-
- private MinimumSystemRequirements() {
- // static only
- }
-
- /**
- * Asserts minimum system requirements, logs any violations and forces exit.
- *
- * @see #checkAndLog()
- *
- * @since GemFire 8.1
- */
- public static void assertLogAndExit() {
- if (!checkAndLog()) {
- System.exit(1);
- }
- }
-
- /**
- * Checks minimum system requirements and logs any violations.
- *
- * @return true if minimum system requirements met, otherwise false.
- *
- * @since GemFire 8.1
- */
- public static boolean checkAndLog() {
- boolean minimumSystemRequirementsMet = true;
-
- minimumSystemRequirementsMet &= checkJavaVersion();
-
- if (!minimumSystemRequirementsMet) {
- logger.warn(LocalizedMessage.create(LocalizedStrings.MinimumSystemRequirements_NOT_MET));
- }
-
- return minimumSystemRequirementsMet;
- }
-
- /**
- * Check Java version at least {@link #JAVA_VERSION}.
- *
- * @return true if minimum system requirements met, otherwise false.
- *
- * @since GemFire 8.1
- */
- private static boolean checkJavaVersion() {
- if (SystemUtils.isJavaVersionAtLeast(JAVA_VERSION)) {
- return true;
- }
-
- logger.warn(LocalizedMessage.create(LocalizedStrings.MinimumSystemRequirements_JAVA_VERSION,
- JAVA_VERSION));
- return false;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e7e37236/geode-core/src/test/java/org/apache/geode/internal/lang/SystemUtilsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/lang/SystemUtilsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/lang/SystemUtilsJUnitTest.java
index fbe18d0..48f176e 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/lang/SystemUtilsJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/lang/SystemUtilsJUnitTest.java
@@ -44,8 +44,7 @@ public class SystemUtilsJUnitTest {
// note, the expected version value should be set to the minimum supported version of the Java
// Runtime Environment
// (JRE) for GemFire
- assertTrue(SystemUtils.isJavaVersionAtLeast("1.7"));
- assertTrue(SystemUtils.isJavaVersionAtLeast("1.7.0_72"));
+ assertTrue(SystemUtils.isJavaVersionAtLeast("1.8"));
// note, the expected version value should be set to the next version of the Java Runtime
// Environment (JRE)
// not currently available.
[06/50] [abbrv] incubator-geode git commit: GEODE-2014: explicitly
declare spring-web as a direct dependency rather than a transitive one.
Posted by kl...@apache.org.
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 Liao <ji...@pivotal.io>
Authored: Tue Nov 8 14:29:26 2016 -0800
Committer: Jinmei Liao <ji...@pivotal.io>
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'
[22/50] [abbrv] incubator-geode git commit: GEODE-2094 Update
admin/dev REST API documentation
Posted by kl...@apache.org.
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 Miller <km...@pivotal.io>
Authored: Thu Nov 10 14:28:40 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
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. You may also need to specify a CLASSPATH to load any functions that need to be made available to your REST services. 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 \
--classpath=/myapps/testfunctions.jar
```
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3db9b309/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 ff703cb..06dfce4 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
@@ -499,6 +499,8 @@ start server --name=value [--assign-buckets(=value)] [--bind-address=value]
[--hostname-for-clients=value] [--max-connections=value]
[--message-time-to-live=value] [--max-message-count=value] [--max-threads=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]
```
<a id="topic_3764EE2DB18B4AE4A625E0354471738A__table_at5_bwg_2w"></a>
@@ -745,11 +747,25 @@ See <a href="../../../configuring/cluster_config/gfsh_persist.html">Overview of
<td>The integer quantity of off-heap memory to be used for storing region values. Specified in Gigabytes with a 'g' suffix, or Megabytes with an 'm' suffix. For example, allocate a 2 Gigabyte off-heap space with <code class="ph codeph">--off-heap-memory-size=2g</code>. The default value of 0 does not use any off-heap memory.</td>
<td>0</td>
</tr>
+<tr class="even">
+<td><span class="keyword parmname">\-\-start-rest-api</span></td>
+<td>When true, starts the REST API service.</td>
+<td>false</td>
+</tr>
+<tr class="even">
+<td><span class="keyword parmname">\-\-http-service-port</span></td>
+<td>Specifies the port on which the HTTP service will listen.</td>
+<td></td>
+</tr>
+<tr class="even">
+<td><span class="keyword parmname">\-\-http-service-bind-address</span></td>
+<td>Specifies the IP address to which the HTTP service will be bound.
+</td>
+<td>all local addresses</td>
+</tr>
</tbody>
</table>
-<span class="tablecap">Table 7. Start Server Parameters</span>
-
### <a id="topic_3764EE2DB18B4AE4A625E0354471738A__section_A50120613D3C4A848463236C4EFF18C7" class="no-quick-link"></a>Examples
``` pre
[17/50] [abbrv] incubator-geode git commit: GEODE-2089
entry-idle-time on client side cache is not working as expected
Posted by kl...@apache.org.
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 Schuchardt <bs...@pivotal.io>
Authored: Thu Nov 10 14:42:19 2016 -0800
Committer: Bruce Schuchardt <bs...@pivotal.io>
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 +-
...edStatsDiskLRURegionEntryHeapStringKey2.java | 5 +-
...ionedStatsDiskLRURegionEntryHeapUUIDKey.java | 5 +-
...nedStatsDiskLRURegionEntryOffHeapIntKey.java | 5 +-
...edStatsDiskLRURegionEntryOffHeapLongKey.java | 5 +-
...StatsDiskLRURegionEntryOffHeapObjectKey.java | 5 +-
...tatsDiskLRURegionEntryOffHeapStringKey1.java | 5 +-
...tatsDiskLRURegionEntryOffHeapStringKey2.java | 5 +-
...edStatsDiskLRURegionEntryOffHeapUUIDKey.java | 5 +-
...VersionedStatsDiskRegionEntryHeapIntKey.java | 4 +-
...ersionedStatsDiskRegionEntryHeapLongKey.java | 4 +-
...sionedStatsDiskRegionEntryHeapObjectKey.java | 4 +-
...ionedStatsDiskRegionEntryHeapStringKey1.java | 4 +-
...ionedStatsDiskRegionEntryHeapStringKey2.java | 4 +-
...ersionedStatsDiskRegionEntryHeapUUIDKey.java | 4 +-
...sionedStatsDiskRegionEntryOffHeapIntKey.java | 4 +-
...ionedStatsDiskRegionEntryOffHeapLongKey.java | 4 +-
...nedStatsDiskRegionEntryOffHeapObjectKey.java | 4 +-
...edStatsDiskRegionEntryOffHeapStringKey1.java | 4 +-
...edStatsDiskRegionEntryOffHeapStringKey2.java | 4 +-
...ionedStatsDiskRegionEntryOffHeapUUIDKey.java | 4 +-
.../VersionedStatsLRURegionEntryHeapIntKey.java | 5 +-
...VersionedStatsLRURegionEntryHeapLongKey.java | 5 +-
...rsionedStatsLRURegionEntryHeapObjectKey.java | 5 +-
...sionedStatsLRURegionEntryHeapStringKey1.java | 5 +-
...sionedStatsLRURegionEntryHeapStringKey2.java | 5 +-
...VersionedStatsLRURegionEntryHeapUUIDKey.java | 5 +-
...rsionedStatsLRURegionEntryOffHeapIntKey.java | 5 +-
...sionedStatsLRURegionEntryOffHeapLongKey.java | 5 +-
...onedStatsLRURegionEntryOffHeapObjectKey.java | 5 +-
...nedStatsLRURegionEntryOffHeapStringKey1.java | 5 +-
...nedStatsLRURegionEntryOffHeapStringKey2.java | 5 +-
...sionedStatsLRURegionEntryOffHeapUUIDKey.java | 5 +-
.../VersionedStatsRegionEntryHeapIntKey.java | 4 +-
.../VersionedStatsRegionEntryHeapLongKey.java | 4 +-
.../VersionedStatsRegionEntryHeapObjectKey.java | 4 +-
...VersionedStatsRegionEntryHeapStringKey1.java | 4 +-
...VersionedStatsRegionEntryHeapStringKey2.java | 4 +-
.../VersionedStatsRegionEntryHeapUUIDKey.java | 4 +-
.../VersionedStatsRegionEntryOffHeapIntKey.java | 4 +-
...VersionedStatsRegionEntryOffHeapLongKey.java | 4 +-
...rsionedStatsRegionEntryOffHeapObjectKey.java | 4 +-
...sionedStatsRegionEntryOffHeapStringKey1.java | 4 +-
...sionedStatsRegionEntryOffHeapStringKey2.java | 4 +-
...VersionedStatsRegionEntryOffHeapUUIDKey.java | 4 +-
...rsionedThinDiskLRURegionEntryHeapIntKey.java | 2 -
...sionedThinDiskLRURegionEntryHeapLongKey.java | 2 -
...onedThinDiskLRURegionEntryHeapObjectKey.java | 2 -
...nedThinDiskLRURegionEntryHeapStringKey1.java | 2 -
...nedThinDiskLRURegionEntryHeapStringKey2.java | 2 -
...sionedThinDiskLRURegionEntryHeapUUIDKey.java | 2 -
...onedThinDiskLRURegionEntryOffHeapIntKey.java | 2 -
...nedThinDiskLRURegionEntryOffHeapLongKey.java | 2 -
...dThinDiskLRURegionEntryOffHeapObjectKey.java | 2 -
...ThinDiskLRURegionEntryOffHeapStringKey1.java | 2 -
...ThinDiskLRURegionEntryOffHeapStringKey2.java | 2 -
...nedThinDiskLRURegionEntryOffHeapUUIDKey.java | 2 -
.../VersionedThinLRURegionEntryHeapIntKey.java | 2 -
.../VersionedThinLRURegionEntryHeapLongKey.java | 2 -
...ersionedThinLRURegionEntryHeapObjectKey.java | 2 -
...rsionedThinLRURegionEntryHeapStringKey1.java | 2 -
...rsionedThinLRURegionEntryHeapStringKey2.java | 2 -
.../VersionedThinLRURegionEntryHeapUUIDKey.java | 2 -
...ersionedThinLRURegionEntryOffHeapIntKey.java | 2 -
...rsionedThinLRURegionEntryOffHeapLongKey.java | 2 -
...ionedThinLRURegionEntryOffHeapObjectKey.java | 2 -
...onedThinLRURegionEntryOffHeapStringKey1.java | 2 -
...onedThinLRURegionEntryOffHeapStringKey2.java | 2 -
...rsionedThinLRURegionEntryOffHeapUUIDKey.java | 2 -
.../geode/cache30/ClientServerCCEDUnitTest.java | 97 +++++++++++++++++++-
130 files changed, 321 insertions(+), 307 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionEntry.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionEntry.java b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionEntry.java
index 41ca8d0..daa31fd 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionEntry.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionEntry.java
@@ -163,16 +163,34 @@ public abstract class AbstractRegionEntry implements RegionEntry, HashEntry<Obje
throw new InternalStatisticsDisabledException();
}
+ /**
+ * This sets the lastModified time for the entry. In subclasses with statistics it will also set
+ * the lastAccessed time unless the system property gemfire.disableAccessTimeUpdateOnPut is set to
+ * true.
+ *
+ * @param lastModified the time of last modification of the entry
+ */
protected void setLastModified(long lastModified) {
+ setLastModifiedAndAccessedTimes(lastModified, lastModified);
+ }
+
+ /**
+ * This sets the lastModified and lastAccessed time for the entry. Subclasses that do not keep
+ * track of lastAccessed time will ignore the second parameter.
+ *
+ * @param lastModified the time of last modification of the entry
+ * @param lastAccessed the time the entry was last accessed
+ */
+ protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
_setLastModified(lastModified);
}
public void txDidDestroy(long currTime) {
- setLastModified(currTime);
+ setLastModifiedAndAccessedTimes(currTime, currTime);
}
- public final void updateStatsForPut(long lastModifiedTime) {
- setLastModified(lastModifiedTime);
+ public final void updateStatsForPut(long lastModifiedTime, long lastAccessedTime) {
+ setLastModifiedAndAccessedTimes(lastModifiedTime, lastAccessedTime);
}
public void setRecentlyUsed() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
index de05b0d..96936eef 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
@@ -3178,7 +3178,7 @@ public abstract class AbstractRegionMap implements RegionMap {
{
long lastMod = owner.cacheTimeMillis();
EntryLogger.logTXPut(_getOwnerObject(), key, nv);
- re.updateStatsForPut(lastMod);
+ re.updateStatsForPut(lastMod, lastMod);
owner.txApplyPutPart2(re, re.getKey(), newValue, lastMod, false, didDestroy,
clearOccured);
}
@@ -3276,9 +3276,9 @@ public abstract class AbstractRegionMap implements RegionMap {
clearOccured = true;
}
{
- long lastMod = System.currentTimeMillis();
+ long lastMod = owner.cacheTimeMillis();
EntryLogger.logTXPut(_getOwnerObject(), key, nv);
- oldRe.updateStatsForPut(lastMod);
+ oldRe.updateStatsForPut(lastMod, lastMod);
owner.txApplyPutPart2(oldRe, oldRe.getKey(), newValue, lastMod, false,
didDestroy, clearOccured);
}
@@ -3342,9 +3342,9 @@ public abstract class AbstractRegionMap implements RegionMap {
clearOccured = true;
}
{
- long lastMod = System.currentTimeMillis();
+ long lastMod = owner.cacheTimeMillis();
EntryLogger.logTXPut(_getOwnerObject(), key, nv);
- newRe.updateStatsForPut(lastMod);
+ newRe.updateStatsForPut(lastMod, lastMod);
owner.txApplyPutPart2(newRe, newRe.getKey(), newValue, lastMod, true, didDestroy,
clearOccured);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/LeafRegionEntry.cpp
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LeafRegionEntry.cpp b/geode-core/src/main/java/org/apache/geode/internal/cache/LeafRegionEntry.cpp
index b8122c3..141e3a4 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LeafRegionEntry.cpp
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LeafRegionEntry.cpp
@@ -499,10 +499,10 @@ public class LEAF_CLASS extends PARENT_CLASS {
}
}
@Override
- protected final void setLastModified(long lastModified) {
+ protected final void setLastModifiedAndAccessedTimes(long lastAccessed) {
_setLastModified(lastModified);
if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
- setLastAccessed(lastModified);
+ setLastAccessed(lastAccessed);
}
}
private volatile long lastAccessed;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/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 e307c86..d413b3b 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
@@ -154,7 +154,6 @@ import org.apache.geode.internal.HeapDataOutputStream;
import org.apache.geode.internal.InternalStatisticsDisabledException;
import org.apache.geode.internal.NanoTimer;
import org.apache.geode.internal.Version;
-import org.apache.geode.internal.admin.ClientHealthMonitoringRegion;
import org.apache.geode.internal.cache.AbstractRegionMap.ARMLockTestHook;
import org.apache.geode.internal.cache.CacheDistributionAdvisor.CacheProfile;
import org.apache.geode.internal.cache.DiskInitFile.DiskRegionFlag;
@@ -7364,13 +7363,14 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
long updateStatsForPut(RegionEntry entry, long p_lastModified, boolean lruRecentUse) {
long lastModified = p_lastModified;
+ long lastAccessed = cacheTimeMillis();
if (lruRecentUse) {
entry.setRecentlyUsed(); // fix for bug 31102
}
if (lastModified == 0L) {
- lastModified = cacheTimeMillis();
+ lastModified = lastAccessed;
}
- entry.updateStatsForPut(lastModified);
+ entry.updateStatsForPut(lastModified, lastAccessed);
if (this.statisticsEnabled && !isProxy()) {
// do not reschedule if there is already a task in the queue.
// this prevents bloat in the TimerTask since cancelled tasks
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/NonLocalRegionEntry.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/NonLocalRegionEntry.java b/geode-core/src/main/java/org/apache/geode/internal/cache/NonLocalRegionEntry.java
index 6de85a1..faec43a 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/NonLocalRegionEntry.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/NonLocalRegionEntry.java
@@ -23,7 +23,6 @@ import java.io.IOException;
import org.apache.geode.DataSerializer;
import org.apache.geode.cache.CacheWriterException;
-import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.cache.EntryNotFoundException;
import org.apache.geode.cache.Region;
@@ -219,7 +218,7 @@ public class NonLocalRegionEntry implements RegionEntry, VersionStamp {
}
// now for the fun part
- public void updateStatsForPut(long lastModifiedTime) {
+ public void updateStatsForPut(long lastModifiedTime, long lastAccessedTime) {
throw new UnsupportedOperationException(
LocalizedStrings.PartitionedRegion_NOT_APPROPRIATE_FOR_PARTITIONEDREGIONNONLOCALREGIONENTRY
.toLocalizedString());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java b/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
index 0233b0f..32d6e30 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
@@ -7162,7 +7162,7 @@ public final class Oplog implements CompactableOplog, Flushable {
}
@Override
- public void updateStatsForPut(long lastModifiedTime) {
+ public void updateStatsForPut(long lastModifiedTime, long lastAccessedTime) {
// TODO Auto-generated method stub
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/ProxyRegionMap.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/ProxyRegionMap.java b/geode-core/src/main/java/org/apache/geode/internal/cache/ProxyRegionMap.java
index b5a3719..92c7b6f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/ProxyRegionMap.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/ProxyRegionMap.java
@@ -438,7 +438,7 @@ final class ProxyRegionMap implements RegionMap {
return;
}
- public void updateStatsForPut(long lastModifiedTime) {
+ public void updateStatsForPut(long lastModifiedTime, long lastAccessedTime) {
// do nothing; called by LocalRegion.updateStatsForPut
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEntry.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEntry.java b/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEntry.java
index 3448d1f..fe0c190 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEntry.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEntry.java
@@ -78,7 +78,7 @@ public interface RegionEntry {
public long getMissCount() throws InternalStatisticsDisabledException;
- public void updateStatsForPut(long lastModifiedTime);
+ public void updateStatsForPut(long lastModifiedTime, long lastAccessedTime);
/**
* @return the version information for this entry
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java
index aa1b513..016392d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java
@@ -21,7 +21,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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -304,10 +303,10 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
}
@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/VMStatsDiskLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java
index ce659c0..4e6f8fa 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java
@@ -21,7 +21,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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -304,10 +303,10 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
}
@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/VMStatsDiskLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java
index 5ea08a9..5fb7e66 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java
@@ -21,7 +21,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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -306,10 +305,10 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
}
@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/VMStatsDiskLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java
index 0f92cb8..dafc106 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java
@@ -21,7 +21,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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -323,10 +322,10 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
}
@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/VMStatsDiskLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java
index b601648..25a6355 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java
@@ -21,7 +21,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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -335,10 +334,10 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
}
@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/VMStatsDiskLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapUUIDKey.java
index 92ad469..fdb5cfb 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapUUIDKey.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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -306,10 +305,10 @@ public class VMStatsDiskLRURegionEntryHeapUUIDKey extends VMStatsDiskLRURegionEn
}
@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/VMStatsDiskLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapIntKey.java
index abba32a..8741b26 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapIntKey.java
@@ -21,7 +21,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.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -363,10 +362,10 @@ public class VMStatsDiskLRURegionEntryOffHeapIntKey extends VMStatsDiskLRURegion
}
@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/VMStatsDiskLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapLongKey.java
index a721a52..b45e619 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapLongKey.java
@@ -21,7 +21,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.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -363,10 +362,10 @@ public class VMStatsDiskLRURegionEntryOffHeapLongKey extends VMStatsDiskLRURegio
}
@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/VMStatsDiskLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapObjectKey.java
index 4d6bfa7..88424a4 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapObjectKey.java
@@ -21,7 +21,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.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -364,10 +363,10 @@ public class VMStatsDiskLRURegionEntryOffHeapObjectKey extends VMStatsDiskLRUReg
}
@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/VMStatsDiskLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey1.java
index 0fbd39c..82ffbd3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey1.java
@@ -21,7 +21,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.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -381,10 +380,10 @@ public class VMStatsDiskLRURegionEntryOffHeapStringKey1 extends VMStatsDiskLRURe
}
@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/VMStatsDiskLRURegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey2.java
index eccc55c..0741319 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey2.java
@@ -21,7 +21,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.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -393,10 +392,10 @@ public class VMStatsDiskLRURegionEntryOffHeapStringKey2 extends VMStatsDiskLRURe
}
@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/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java
index 0593dc7..f0bf1f6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.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.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -365,10 +364,10 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
}
@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/VMStatsDiskRegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java
index b09136a..de8ecb4 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java
@@ -189,10 +189,10 @@ public class VMStatsDiskRegionEntryHeapIntKey extends VMStatsDiskRegionEntryHeap
}
@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/VMStatsDiskRegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java
index 0c8fe86..3b57a84 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java
@@ -189,10 +189,10 @@ public class VMStatsDiskRegionEntryHeapLongKey extends VMStatsDiskRegionEntryHea
}
@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/VMStatsDiskRegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java
index b004295..a9f91b9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java
@@ -189,10 +189,10 @@ public class VMStatsDiskRegionEntryHeapObjectKey extends VMStatsDiskRegionEntryH
}
@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/VMStatsDiskRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java
index d12f2d5..87a4810 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java
@@ -207,10 +207,10 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
}
@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/VMStatsDiskRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java
index 189d41d..5dfaf0f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java
@@ -219,10 +219,10 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
}
@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/VMStatsDiskRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapUUIDKey.java
index 7646f45..1eefa4b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapUUIDKey.java
@@ -191,10 +191,10 @@ public class VMStatsDiskRegionEntryHeapUUIDKey extends VMStatsDiskRegionEntryHea
}
@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/VMStatsDiskRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapIntKey.java
index 71c67fb..85b791e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapIntKey.java
@@ -247,10 +247,10 @@ public class VMStatsDiskRegionEntryOffHeapIntKey extends VMStatsDiskRegionEntryO
}
@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/VMStatsDiskRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapLongKey.java
index 41bb469..49b2b12 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapLongKey.java
@@ -247,10 +247,10 @@ public class VMStatsDiskRegionEntryOffHeapLongKey extends VMStatsDiskRegionEntry
}
@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/VMStatsDiskRegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapObjectKey.java
index 85f0e13..f7d3b96 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapObjectKey.java
@@ -248,10 +248,10 @@ public class VMStatsDiskRegionEntryOffHeapObjectKey extends VMStatsDiskRegionEnt
}
@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/VMStatsDiskRegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey1.java
index 824aabb..9902c2f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey1.java
@@ -265,10 +265,10 @@ public class VMStatsDiskRegionEntryOffHeapStringKey1 extends VMStatsDiskRegionEn
}
@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/VMStatsDiskRegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey2.java
index 10c31ca..4bd9357 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey2.java
@@ -277,10 +277,10 @@ public class VMStatsDiskRegionEntryOffHeapStringKey2 extends VMStatsDiskRegionEn
}
@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/VMStatsDiskRegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapUUIDKey.java
index 0e899fc..fbe196f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapUUIDKey.java
@@ -249,10 +249,10 @@ public class VMStatsDiskRegionEntryOffHeapUUIDKey extends VMStatsDiskRegionEntry
}
@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/VMStatsLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapIntKey.java
index 707adb9..fe90f47 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapIntKey.java
@@ -20,7 +20,6 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.internal.cache.lru.EnableLRU;
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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -209,10 +208,10 @@ public class VMStatsLRURegionEntryHeapIntKey extends VMStatsLRURegionEntryHeap {
}
@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/VMStatsLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapLongKey.java
index 3524bbe..53e40ca 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapLongKey.java
@@ -20,7 +20,6 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.internal.cache.lru.EnableLRU;
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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -209,10 +208,10 @@ public class VMStatsLRURegionEntryHeapLongKey extends VMStatsLRURegionEntryHeap
}
@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/VMStatsLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapObjectKey.java
index a5a0dc0..ad42a88 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapObjectKey.java
@@ -20,7 +20,6 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.internal.cache.lru.EnableLRU;
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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -209,10 +208,10 @@ public class VMStatsLRURegionEntryHeapObjectKey extends VMStatsLRURegionEntryHea
}
@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/VMStatsLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey1.java
index 04ea3d7..3b9fc67 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey1.java
@@ -20,7 +20,6 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.internal.cache.lru.EnableLRU;
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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -227,10 +226,10 @@ public class VMStatsLRURegionEntryHeapStringKey1 extends VMStatsLRURegionEntryHe
}
@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/VMStatsLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java
index 2ca6440..a4cd7e1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java
@@ -20,7 +20,6 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.internal.cache.lru.EnableLRU;
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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -239,10 +238,10 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
}
@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/VMStatsLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapUUIDKey.java
index d1d539e..9b29eb7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapUUIDKey.java
@@ -21,7 +21,6 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.internal.cache.lru.EnableLRU;
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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -211,10 +210,10 @@ public class VMStatsLRURegionEntryHeapUUIDKey extends VMStatsLRURegionEntryHeap
}
@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/VMStatsLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapIntKey.java
index dbb6e7b..641ab31 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapIntKey.java
@@ -20,7 +20,6 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.internal.cache.lru.EnableLRU;
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.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -267,10 +266,10 @@ public class VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOff
}
@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/VMStatsLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapLongKey.java
index 9bf356c..7b6f008 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapLongKey.java
@@ -20,7 +20,6 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.internal.cache.lru.EnableLRU;
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.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -267,10 +266,10 @@ public class VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOf
}
@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/VMStatsLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapObjectKey.java
index 486cbca..655ef11 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapObjectKey.java
@@ -20,7 +20,6 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.internal.cache.lru.EnableLRU;
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.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -268,10 +267,10 @@ public class VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntry
}
@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/VMStatsLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.java
index b4ab253..fde5c86 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.java
@@ -20,7 +20,6 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.internal.cache.lru.EnableLRU;
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.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -285,10 +284,10 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
}
@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/VMStatsLRURegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.java
index fc72ec8..1a6d1bb 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.java
@@ -20,7 +20,6 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.internal.cache.lru.EnableLRU;
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.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -297,10 +296,10 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
}
@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/VMStatsLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapUUIDKey.java
index 8a4f04b..9bf13a3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapUUIDKey.java
@@ -21,7 +21,6 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.internal.cache.lru.EnableLRU;
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.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -269,10 +268,10 @@ public class VMStatsLRURegionEntryOffHeapUUIDKey extends VMStatsLRURegionEntryOf
}
@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/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 70df05c..c5dd2db 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
@@ -110,10 +110,10 @@ public class VMStatsRegionEntryHeapIntKey extends VMStatsRegionEntryHeap {
}
@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/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 91998f2..29b526c 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
@@ -110,10 +110,10 @@ public class VMStatsRegionEntryHeapLongKey extends VMStatsRegionEntryHeap {
}
@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/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 0bab150..6d48091 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
@@ -110,10 +110,10 @@ public class VMStatsRegionEntryHeapObjectKey extends VMStatsRegionEntryHeap {
}
@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/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 1227752..6810d99 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
@@ -128,10 +128,10 @@ public class VMStatsRegionEntryHeapStringKey1 extends VMStatsRegionEntryHeap {
}
@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/VMStatsRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey2.java
index c20bdac..cc1fcc9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey2.java
@@ -140,10 +140,10 @@ public class VMStatsRegionEntryHeapStringKey2 extends VMStatsRegionEntryHeap {
}
@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/VMStatsRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapUUIDKey.java
index e582894..5e498c5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapUUIDKey.java
@@ -112,10 +112,10 @@ public class VMStatsRegionEntryHeapUUIDKey extends VMStatsRegionEntryHeap {
}
@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/VMStatsRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapIntKey.java
index c9248d2..b319d11 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapIntKey.java
@@ -168,10 +168,10 @@ public class VMStatsRegionEntryOffHeapIntKey extends VMStatsRegionEntryOffHeap {
}
@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/VMStatsRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapLongKey.java
index 3084591..0300542 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapLongKey.java
@@ -168,10 +168,10 @@ public class VMStatsRegionEntryOffHeapLongKey extends VMStatsRegionEntryOffHeap
}
@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/VMStatsRegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapObjectKey.java
index 307299c..be89d07 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapObjectKey.java
@@ -168,10 +168,10 @@ public class VMStatsRegionEntryOffHeapObjectKey extends VMStatsRegionEntryOffHea
}
@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/VMStatsRegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey1.java
index 9ad2691..eea14f6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey1.java
@@ -185,10 +185,10 @@ public class VMStatsRegionEntryOffHeapStringKey1 extends VMStatsRegionEntryOffHe
}
@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/VMStatsRegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey2.java
index 3c718b3..d7adbec 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey2.java
@@ -197,10 +197,10 @@ public class VMStatsRegionEntryOffHeapStringKey2 extends VMStatsRegionEntryOffHe
}
@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/VMStatsRegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapUUIDKey.java
index b629978..c7071b7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapUUIDKey.java
@@ -170,10 +170,10 @@ public class VMStatsRegionEntryOffHeapUUIDKey extends VMStatsRegionEntryOffHeap
}
@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/ValidatingDiskRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/ValidatingDiskRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/ValidatingDiskRegion.java
index 1649de8..fe11912 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/ValidatingDiskRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/ValidatingDiskRegion.java
@@ -268,7 +268,7 @@ public class ValidatingDiskRegion extends DiskRegion implements DiskRecoveryStor
}
@Override
- public void updateStatsForPut(long lastModifiedTime) {
+ public void updateStatsForPut(long lastModifiedTime, long lastAccessedTime) {
// TODO Auto-generated method stub
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapIntKey.java
index c99b4a3..1f0fc75 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapIntKey.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 VersionedStatsDiskLRURegionEntryHeapIntKey
}
@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);
}
}
[04/50] [abbrv] incubator-geode git commit: docs: fix docker scripts
for building/viewing docs (Dan S)
Posted by kl...@apache.org.
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 Barnes <db...@pivotal.io>
Authored: Tue Nov 8 15:05:31 2016 -0800
Committer: Dave Barnes <db...@pivotal.io>
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
[26/50] [abbrv] incubator-geode git commit: GEODE-2078: Fix manifest
classpath
Posted by kl...@apache.org.
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 Baker <ab...@apache.org>
Authored: Mon Nov 7 20:01:07 2016 -0800
Committer: Anthony Baker <ab...@apache.org>
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') ||
+ 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')
+ }
}
}.flatten().unique().join(' ')
[43/50] [abbrv] incubator-geode git commit: Convert from
ManagementTestCase to ManagementTestRule
Posted by kl...@apache.org.
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<DistributedMember> otherMemberSet = cache.getDistributionManager().getOtherNormalDistributionManagerIds();
+ assertEquals(3, otherMemberSet.size());
- SystemManagementService service = (SystemManagementService) getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- assertNotNull(bean);
- Set<DistributedMember> otherMemberSet =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
+ for (DistributedMember member : otherMemberSet) {
+ ObjectName memberMXBeanName = service.getMemberMBeanName(member);
+ await().atMost(2, TimeUnit.MINUTES).until(() -> assertTrue(ManagementFactory.getPlatformMBeanServer().isRegistered(memberMXBeanName)));
- for (DistributedMember member : otherMemberSet) {
- ObjectName memberMBeanName;
- try {
- memberMBeanName = service.getMemberMBeanName(member);
- waitForProxy(memberMBeanName, MemberMXBean.class);
- MemberMXBean memberBean = service.getMBeanProxy(memberMBeanName, MemberMXBean.class);
- waitForRefresh(2, memberMBeanName);
- } catch (NullPointerException e) {
- Assert.fail("FAILED WITH EXCEPION", e);
- } catch (Exception e) {
- Assert.fail("FAILED WITH EXCEPION", e);
- }
- }
+ MemberMXBean memberMXBean = service.getMBeanProxy(memberMXBeanName, MemberMXBean.class);
+ assertNotNull(memberMXBean);
+ final long lastRefreshTime = service.getLastUpdateTime(memberMXBeanName);
+ await().atMost(1, TimeUnit.MINUTES).until(() -> assertTrue(service.getLastUpdateTime(memberMXBeanName) > lastRefreshTime));
}
});
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/internal/beans/QueryDataFunctionApplyLimitClauseTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/beans/QueryDataFunctionApplyLimitClauseTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/beans/QueryDataFunctionApplyLimitClauseTest.java
index f4ca239..128280e 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/beans/QueryDataFunctionApplyLimitClauseTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/beans/QueryDataFunctionApplyLimitClauseTest.java
@@ -24,7 +24,6 @@ import org.junit.experimental.categories.Category;
import org.apache.geode.test.junit.categories.UnitTest;
-
@Category(UnitTest.class)
public class QueryDataFunctionApplyLimitClauseTest {
@@ -45,9 +44,7 @@ public class QueryDataFunctionApplyLimitClauseTest {
public void applyLimitClauseDoesNothingIfLimitClauseSpecified() {
String limitClause = " LIMIT 50";
String selectQueryWithLimit = selectQuery + limitClause;
- assertThat(
- QueryDataFunction.applyLimitClause(selectQueryWithLimit, limit_10, queryResultSetLimit_100))
- .isEqualTo(selectQueryWithLimit);
+ assertThat(QueryDataFunction.applyLimitClause(selectQueryWithLimit, limit_10, queryResultSetLimit_100)).isEqualTo(selectQueryWithLimit);
}
@Test
@@ -65,16 +62,13 @@ public class QueryDataFunctionApplyLimitClauseTest {
@Test // GEODE-1907
public void applyLimitClauseAddsQueryResultSetLimitIfMissingSpaceAfterFrom() {
String selectQueryMissingSpaceAfterFrom = "SELECT * FROM/MyRegion";
- assertThat(QueryDataFunction.applyLimitClause(selectQueryMissingSpaceAfterFrom, limit_0,
- queryResultSetLimit_100))
- .isEqualTo(selectQueryMissingSpaceAfterFrom + " LIMIT " + queryResultSetLimit_100);
+ assertThat(QueryDataFunction.applyLimitClause(selectQueryMissingSpaceAfterFrom, limit_0, queryResultSetLimit_100)).isEqualTo(selectQueryMissingSpaceAfterFrom + " LIMIT " + queryResultSetLimit_100);
}
@Test
public void applyLimitClauseDoesNotAddQueryResultSetLimitIfMissingSpaceAfterFromButLimitIsPresent() {
String selectQueryMissingSpaceAfterFromWithLimit = "SELECT * FROM/MyRegion LIMIT " + limit_10;
- assertThat(QueryDataFunction.applyLimitClause(selectQueryMissingSpaceAfterFromWithLimit,
- limit_0, queryResultSetLimit_100)).isEqualTo(selectQueryMissingSpaceAfterFromWithLimit);
+ assertThat(QueryDataFunction.applyLimitClause(selectQueryMissingSpaceAfterFromWithLimit, limit_0, queryResultSetLimit_100)).isEqualTo(selectQueryMissingSpaceAfterFromWithLimit);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/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 9416616..9e98024 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
@@ -56,67 +56,49 @@ import org.apache.geode.test.junit.categories.DistributedTest;
* This is for testing client IDs
*/
@Category(DistributedTest.class)
-public class TestClientIdsDUnitTest extends JUnit4DistributedTestCase {
+@SuppressWarnings("serial")
+public class TestClientIdsDUnitTest extends ManagementTestBase {
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";
-
- /** name of the test region */
private static final String REGION_NAME = "ClientHealthStatsDUnitTest_Region";
private static VM server = null;
-
private static VM client = null;
-
private static VM client2 = null;
- private static VM managingNode = null;
-
- private ManagementTestBase helper;
-
- @Override
- public final void preSetUp() throws Exception {
- this.helper = new ManagementTestBase() {};
- }
-
@Override
- public final void postSetUp() throws Exception {
- final Host host = Host.getHost(0);
- managingNode = host.getVM(0);
- server = host.getVM(1);
- client = host.getVM(2);
- client2 = host.getVM(3);
+ public final void postSetUpManagementTestBase() throws Exception {
+ server = Host.getHost(0).getVM(1);
+ client = Host.getHost(0).getVM(2);
+ client2 = Host.getHost(0).getVM(3);
}
@Override
- public final void preTearDown() throws Exception {
- helper.closeCache(managingNode);
- helper.closeCache(server);
- helper.closeCache(client);
- helper.closeCache(client2);
+ public final void postTearDownManagementTestBase() throws Exception {
+ closeCache(server);
+ closeCache(client);
+ closeCache(client2);
disconnectFromDS();
}
@Test
public void testClientIds() throws Exception {
- helper.createManagementCache(managingNode);
- helper.startManagingNode(managingNode);
+ createManagementCache(managingNode);
+ startManagingNode(managingNode);
int port = (Integer) createServerCache(server);
- DistributedMember serverMember = helper.getMember(server);
+ DistributedMember serverMember = getMember(server);
createClientCache(client, NetworkUtils.getServerHostName(server.getHost()), port);
createClientCache(client2, NetworkUtils.getServerHostName(server.getHost()), port);
put(client);
put(client2);
verifyClientIds(managingNode, serverMember, port);
- helper.stopManagingNode(managingNode);
+ stopManagingNode(managingNode);
}
- @SuppressWarnings("serial")
private Object createServerCache(VM vm) {
return vm.invoke(new SerializableCallable("Create Server Cache") {
public Object call() {
@@ -130,7 +112,6 @@ public class TestClientIdsDUnitTest extends JUnit4DistributedTestCase {
});
}
- @SuppressWarnings("serial")
private void createClientCache(VM vm, final String host, final Integer port1) {
vm.invoke(new SerializableCallable("Create Client Cache") {
@@ -156,7 +137,7 @@ public class TestClientIdsDUnitTest extends JUnit4DistributedTestCase {
}
private Integer createServerCache(DataPolicy dataPolicy) throws Exception {
- Cache cache = helper.createCache(false);
+ Cache cache = createCache(false);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
factory.setDataPolicy(dataPolicy);
@@ -199,7 +180,6 @@ public class TestClientIdsDUnitTest extends JUnit4DistributedTestCase {
/**
* get member id
*/
- @SuppressWarnings("serial")
protected static DistributedMember getMember() throws Exception {
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
return cache.getDistributedSystem().getDistributedMember();
@@ -210,27 +190,22 @@ public class TestClientIdsDUnitTest extends JUnit4DistributedTestCase {
*
* @param vm
*/
- @SuppressWarnings("serial")
- protected void verifyClientIds(final VM vm, final DistributedMember serverMember,
- final int serverPort) {
- SerializableRunnable verifyCacheServerRemote =
- new SerializableRunnable("Verify Cache Server Remote") {
- public void run() {
- try {
- final WaitCriterion waitCriteria = new WaitCriterion() {
- @Override
- public boolean done() {
- CacheServerMXBean bean = null;
- try {
- bean = MBeanUtil.getCacheServerMbeanProxy(serverMember, serverPort);
- if (bean != null) {
- if (bean.getClientIds().length > 0) {
- return true;
- }
- }
- } catch (Exception e) {
- LogWriterUtils.getLogWriter().info("exception occured " + e.getMessage()
- + CliUtil.stackTraceAsString((Throwable) e));
+ protected void verifyClientIds(final VM vm,
+ final DistributedMember serverMember, final int serverPort) {
+ SerializableRunnable verifyCacheServerRemote = new SerializableRunnable(
+ "Verify Cache Server Remote") {
+ public void run() {
+ try {
+ final WaitCriterion waitCriteria = new WaitCriterion() {
+ @Override
+ public boolean done() {
+ CacheServerMXBean bean = null;
+ try {
+ bean = MBeanUtil.getCacheServerMbeanProxy(
+ serverMember, serverPort);
+ if (bean != null) {
+ if( bean.getClientIds().length > 0){
+ return true;
}
return false;
}
@@ -259,7 +234,6 @@ public class TestClientIdsDUnitTest extends JUnit4DistributedTestCase {
*
* @param vm
*/
- @SuppressWarnings("serial")
protected void put(final VM vm) {
SerializableRunnable put = new SerializableRunnable("put") {
public void run() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestSubscriptionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestSubscriptionsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestSubscriptionsDUnitTest.java
index 7d96517..f09e7c9 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestSubscriptionsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestSubscriptionsDUnitTest.java
@@ -15,6 +15,9 @@
package org.apache.geode.management.internal.pulse;
import static org.apache.geode.distributed.ConfigurationProperties.*;
+import static org.apache.geode.test.dunit.Host.*;
+import static org.apache.geode.test.dunit.NetworkUtils.*;
+import static org.apache.geode.test.dunit.Wait.*;
import static org.junit.Assert.*;
import java.util.Properties;
@@ -32,268 +35,175 @@ import org.apache.geode.cache.Scope;
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.DistributedSystemMXBean;
import org.apache.geode.management.ManagementService;
import org.apache.geode.management.ManagementTestBase;
-import org.apache.geode.test.dunit.Assert;
-import org.apache.geode.test.dunit.Host;
-import org.apache.geode.test.dunit.LogWriterUtils;
-import org.apache.geode.test.dunit.NetworkUtils;
-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.dunit.internal.JUnit4DistributedTestCase;
import org.apache.geode.test.junit.categories.DistributedTest;
/**
* This is for testing subscriptions
*/
@Category(DistributedTest.class)
-public class TestSubscriptionsDUnitTest extends JUnit4DistributedTestCase {
+@SuppressWarnings("serial")
+public class TestSubscriptionsDUnitTest extends ManagementTestBase {
- private static final String k1 = "k1";
- private static final String k2 = "k2";
- private static final String client_k1 = "client-k1";
+ private static final String REGION_NAME = TestSubscriptionsDUnitTest.class.getSimpleName() + "_Region";
+
+ private static final String KEY1 = "k1";
+ private static final String KEY2 = "k2";
+ private static final String CLIENT_VALUE1 = "client-k1";
+ private static final String CLIENT_VALUE2 = "client-k2";
- private static final String client_k2 = "client-k2";
- private static final String REGION_NAME =
- TestSubscriptionsDUnitTest.class.getSimpleName() + "_Region";
private static VM server = null;
private static VM client = null;
private static VM client2 = null;
- private static VM managingNode = null;
- private ManagementTestBase helper;
-
- @Override
- public final void preSetUp() throws Exception {
- this.helper = new ManagementTestBase() {};
- }
-
- @Override
- public final void postSetUp() throws Exception {
- final Host host = Host.getHost(0);
- managingNode = host.getVM(0);
- server = host.getVM(1);
- client = host.getVM(2);
- client2 = host.getVM(3);
- }
@Override
- public final void preTearDown() throws Exception {
- helper.closeCache(managingNode);
- helper.closeCache(server);
- helper.closeCache(client);
- helper.closeCache(client2);
- disconnectFromDS();
+ public final void postSetUpManagementTestBase() throws Exception {
+ server = getHost(0).getVM(1);
+ client = getHost(0).getVM(2);
+ client2 = getHost(0).getVM(3);
}
@Test
- public void testNoOfSubscription() throws Exception {
+ public void testNumSubscriptions() throws Exception {
+ createManagementCache(managingNode);
+ startManagingNode(managingNode);
+
+ int port = createServerCache(server);
+ getMember(server);
- helper.createManagementCache(managingNode);
- helper.startManagingNode(managingNode);
+ createClientCache(client, getServerHostName(server.getHost()), port);
+ createClientCache(client2, getServerHostName(server.getHost()), port);
- int port = (Integer) createServerCache(server);
- DistributedMember serverMember = helper.getMember(server);
- createClientCache(client, NetworkUtils.getServerHostName(server.getHost()), port);
- createClientCache(client2, NetworkUtils.getServerHostName(server.getHost()), port);
put(client);
put(client2);
+
registerInterest(client);
registerInterest(client2);
- verifyClientStats(managingNode, serverMember, port);
- helper.stopManagingNode(managingNode);
- }
- @SuppressWarnings("serial")
- private Object createServerCache(VM vm) {
- return vm.invoke(new SerializableCallable("Create Server Cache in TestSubscriptionsDUnitTest") {
+ verifyNumSubscriptions(managingNode);
- public Object call() {
- try {
- return createServerCache();
- } catch (Exception e) {
- fail("Error while createServerCache in TestSubscriptionsDUnitTest" + e);
- }
- return null;
- }
- });
+ stopManagingNode(managingNode);
}
- @SuppressWarnings("serial")
- private void createClientCache(VM vm, final String host, final Integer port1) {
- vm.invoke(new SerializableCallable("Create Client Cache in TestSubscriptionsDUnitTest") {
+ private int createServerCache(VM vm) {
+ return vm.invoke("Create Server Cache in TestSubscriptionsDUnitTest", () -> {
+ return createServerCache();
+ });
+ }
- public Object call() {
- try {
- createClientCache(host, port1);
- } catch (Exception e) {
- fail("Error while createClientCache in TestSubscriptionsDUnitTest " + e);
- }
- return null;
- }
+ private void createClientCache(VM vm, final String host, final int port1) {
+ vm.invoke("Create Client Cache in TestSubscriptionsDUnitTest", () -> {
+ createClientCache(host, port1);
});
}
private Cache createCache(Properties props) throws Exception {
DistributedSystem ds = getSystem(props);
- ds.disconnect();
- ds = getSystem(props);
- assertNotNull(ds);
- Cache cache = (GemFireCacheImpl) CacheFactory.create(ds);
- assertNotNull(cache);
+ Cache cache = CacheFactory.create(ds);
return cache;
}
- private Integer createServerCache(DataPolicy dataPolicy) throws Exception {
- Cache cache = helper.createCache(false);
+ private int createServerCache(DataPolicy dataPolicy) throws Exception {
+ Cache cache = createCache(false);
+
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
factory.setDataPolicy(dataPolicy);
- RegionAttributes attrs = factory.create();
- cache.createRegion(REGION_NAME, attrs);
- int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+
+ cache.createRegion(REGION_NAME, factory.create());
+
CacheServer server1 = cache.addCacheServer();
- server1.setPort(port);
+ server1.setPort(0);
server1.setNotifyBySubscription(true);
server1.start();
- return new Integer(server1.getPort());
+
+ return server1.getPort();
}
- public Integer createServerCache() throws Exception {
+ private int createServerCache() throws Exception {
return createServerCache(DataPolicy.REPLICATE);
}
- public Cache createClientCache(String host, Integer port1) throws Exception {
-
+ private Cache createClientCache(String host, int port1) throws Exception {
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, "");
+
Cache cache = createCache(props);
- PoolImpl p = (PoolImpl) PoolManager.createFactory().addServer(host, port1.intValue())
- .setSubscriptionEnabled(true).setThreadLocalConnections(true).setMinConnections(1)
- .setReadTimeout(20000).setPingInterval(10000).setRetryAttempts(1)
- .setSubscriptionEnabled(true).setStatisticInterval(1000)
- .create("TestSubscriptionsDUnitTest");
+
+ PoolImpl p = (PoolImpl) PoolManager.createFactory()
+ .addServer(host, port1)
+ .setSubscriptionEnabled(true)
+ .setThreadLocalConnections(true)
+ .setMinConnections(1)
+ .setReadTimeout(20000)
+ .setPingInterval(10000)
+ .setRetryAttempts(1)
+ .setSubscriptionEnabled(true)
+ .setStatisticInterval(1000)
+ .create("TestSubscriptionsDUnitTest");
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
factory.setPoolName(p.getName());
RegionAttributes attrs = factory.create();
- Region region = cache.createRegion(REGION_NAME, attrs);
- return cache;
+ cache.createRegion(REGION_NAME, attrs);
+ return cache;
}
- /**
- * get member id
- */
- @SuppressWarnings("serial")
- protected static DistributedMember getMember() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- return cache.getDistributedSystem().getDistributedMember();
- }
+ private void verifyNumSubscriptions(final VM vm) {
+ vm.invoke("TestSubscriptionsDUnitTest Verify Cache Server Remote", () -> {
+ final GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- /**
- * Verify the Cache Server details
- *
- * @param vm
- */
- @SuppressWarnings("serial")
- protected void verifyClientStats(final VM vm, final DistributedMember serverMember,
- final int serverPort) {
- SerializableRunnable verifyCacheServerRemote =
- new SerializableRunnable("TestSubscriptionsDUnitTest Verify Cache Server Remote") {
- public void run() {
- final GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- try {
- final WaitCriterion waitCriteria = new WaitCriterion() {
- @Override
- public boolean done() {
- ManagementService service = ManagementService.getExistingManagementService(cache);
- final DistributedSystemMXBean dsBean = service.getDistributedSystemMXBean();
- if (dsBean != null) {
- if (dsBean.getNumSubscriptions() > 1) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public String description() {
- return "TestSubscriptionsDUnitTest wait for getDistributedSystemMXBean to complete and get results";
- }
- };
- Wait.waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);
- final DistributedSystemMXBean dsBean = ManagementService
- .getExistingManagementService(cache).getDistributedSystemMXBean();
- assertNotNull(dsBean);
- LogWriterUtils.getLogWriter()
- .info("TestSubscriptionsDUnitTest dsBean.getNumSubscriptions() ="
- + dsBean.getNumSubscriptions());
- assertTrue(dsBean.getNumSubscriptions() == 2 ? true : false);
- } catch (Exception e) {
- fail("TestSubscriptionsDUnitTest Error while verifying subscription "
- + e.getMessage());
- }
-
- }
- };
- vm.invoke(verifyCacheServerRemote);
- }
+ waitForCriterion(new WaitCriterion() {
+ @Override
+ public boolean done() {
+ ManagementService service = ManagementService.getExistingManagementService(cache);
+ DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
+ return distributedSystemMXBean != null & distributedSystemMXBean.getNumSubscriptions() > 1;
+ }
+ @Override
+ public String description() {
+ return "TestSubscriptionsDUnitTest wait for getDistributedSystemMXBean to complete and get results";
+ }
+ }, 2 * 60 * 1000, 3000, true);
- /**
- * Verify the Cache Server details
- *
- * @param vm
- */
- @SuppressWarnings("serial")
- protected void registerInterest(final VM vm) {
- SerializableRunnable put =
- new SerializableRunnable("TestSubscriptionsDUnitTest registerInterest") {
- public void run() {
- try {
- Cache cache = GemFireCacheImpl.getInstance();
- Region<Object, Object> r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME);
- assertNotNull(r1);
- r1.registerInterest(k1);
- r1.registerInterest(k2);
- } catch (Exception ex) {
- Assert.fail("TestSubscriptionsDUnitTest failed while register Interest", ex);
- }
- }
-
- };
- vm.invoke(put);
+ DistributedSystemMXBean distributedSystemMXBean = ManagementService.getExistingManagementService(cache).getDistributedSystemMXBean();
+ assertNotNull(distributedSystemMXBean);
+ assertEquals(2, distributedSystemMXBean.getNumSubscriptions());
+ });
}
- @SuppressWarnings("serial")
- protected void put(final VM vm) {
- SerializableRunnable put = new SerializableRunnable("put") {
- public void run() {
- try {
- Cache cache = GemFireCacheImpl.getInstance();
- Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME);
- assertNotNull(r1);
- r1.put(k1, client_k1);
- assertEquals(r1.getEntry(k1).getValue(), client_k1);
- r1.put(k2, client_k2);
- assertEquals(r1.getEntry(k2).getValue(), client_k2);
- } catch (Exception ex) {
- Assert.fail("failed while put", ex);
- }
- }
+ private void registerInterest(final VM vm) {
+ vm.invoke("TestSubscriptionsDUnitTest registerInterest", () -> {
+ Cache cache = GemFireCacheImpl.getInstance();
+ Region<Object, Object> region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
+ assertNotNull(region);
- };
- vm.invoke(put);
+ region.registerInterest(KEY1);
+ region.registerInterest(KEY2);
+ });
}
+ private void put(final VM vm) {
+ vm.invoke("put", () -> {
+ Cache cache = GemFireCacheImpl.getInstance();
+ Region region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
+ assertNotNull(region);
+
+ region.put(KEY1, CLIENT_VALUE1);
+ assertEquals(CLIENT_VALUE1, region.getEntry(KEY1).getValue());
+
+ region.put(KEY2, CLIENT_VALUE2);
+ assertEquals(CLIENT_VALUE2, region.getEntry(KEY2).getValue());
+ });
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java b/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java
index 460b562..88168af 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java
@@ -316,8 +316,63 @@ public class AsyncInvocation<V> implements Future<V> {
}
/**
- * Waits if necessary for the work to complete, and then returns the result of this
- * {@code AsyncInvocation}.
+ * Waits if necessary for at most the given time for the computation
+ * to complete.
+ *
+ * @param timeout the maximum time to wait
+ * @param unit the time unit of the timeout argument
+ *
+ * @return this {@code AsyncInvocation}
+ *
+ * @throws AssertionError wrapping any {@code Exception} thrown by this
+ * {@code AsyncInvocation}.
+ *
+ * @throws CancellationException if the computation was cancelled
+ *
+ * @throws ExecutionException if the computation threw an exception
+ *
+ * @throws InterruptedException if the current thread is interrupted.
+ *
+ * @throws TimeoutException if the wait timed out
+ */
+ public AsyncInvocation<V> await(final long timeout, final TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException {
+ long millis = unit.toMillis(timeout);
+ join(millis);
+ timeoutIfAlive(millis);
+ checkException();
+ return this;
+ }
+
+ /**
+ * Waits if necessary for at most the given time for the computation
+ * to complete.
+ *
+ * @return this {@code AsyncInvocation}
+ *
+ * @throws AssertionError wrapping any {@code Exception} thrown by this
+ * {@code AsyncInvocation}.
+ *
+ * @throws AssertionError wrapping a {@code TimeoutException} if this
+ * {@code AsyncInvocation} fails to complete within the default
+ * timeout of 60 seconds as defined by {@link #DEFAULT_JOIN_MILLIS}.
+ *
+ * @throws CancellationException if the computation was cancelled
+ *
+ * @throws ExecutionException if the computation threw an exception
+ *
+ * @throws InterruptedException if the current thread is interrupted.
+ */
+ public AsyncInvocation<V> await() throws ExecutionException, InterruptedException {
+ try {
+ return await(DEFAULT_JOIN_MILLIS, TimeUnit.MILLISECONDS);
+ } catch (TimeoutException timeoutException) {
+ throw new AssertionError(timeoutException);
+ }
+ }
+
+ /**
+ * Waits if necessary for the work to complete, and then returns the result
+ * of this {@code AsyncInvocation}.
*
* @return the result of this {@code AsyncInvocation}
*
@@ -353,10 +408,6 @@ public class AsyncInvocation<V> implements Future<V> {
*
* @throws AssertionError wrapping any {@code Exception} thrown by this {@code AsyncInvocation}.
*
- * @throws AssertionError wrapping a {@code TimeoutException} if this {@code AsyncInvocation}
- * fails to complete within the default timeout of 60 seconds as defined by
- * {@link #DEFAULT_JOIN_MILLIS}.
- *
* @throws CancellationException if the computation was cancelled
*
* @throws ExecutionException if the computation threw an exception
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/Invoke.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/Invoke.java b/geode-core/src/test/java/org/apache/geode/test/dunit/Invoke.java
index a09f5ff..af7e217 100755
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/Invoke.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/Invoke.java
@@ -22,13 +22,13 @@ import java.util.Map;
* invoke a <code>SerializableRunnable</code> or <code>SerializableCallable</code> in a remote test
* <code>VM</code>.
*
- * These methods can be used directly: <code>Invoke.invokeInEveryVM(...)</code>, however, they are
- * intended to be referenced through static import:
+ * These methods can be used directly: <code>Invoke.invokeInEveryVMAndController(...)</code>,
+ * however, they are intended to be referenced through static import:
*
* <pre>
* import static org.apache.geode.test.dunit.Invoke.*;
* ...
- * invokeInEveryVM(...);
+ * invokeInEveryVMAndController(...);
* </pre>
*
* Extracted from DistributedTestCase.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/VM.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/VM.java b/geode-core/src/test/java/org/apache/geode/test/dunit/VM.java
index 04d2951..375deed 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/VM.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/VM.java
@@ -24,6 +24,7 @@ import java.util.concurrent.Callable;
import com.jayway.awaitility.Awaitility;
import hydra.MethExecutorResult;
+import org.apache.geode.internal.process.PidUnavailableException;
import org.apache.geode.internal.process.ProcessUtils;
import org.apache.geode.test.dunit.standalone.BounceResult;
import org.apache.geode.test.dunit.standalone.RemoteDUnitVMIF;
@@ -91,7 +92,11 @@ public class VM implements Serializable {
* Returns the process id of this {@code VM}.
*/
public int getPid() {
- return this.pid;
+// try {
+ return invoke(() -> ProcessUtils.identifyPid());
+// } catch (PidUnavailableException e) {
+// return this.pid;
+// }
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/Wait.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/Wait.java b/geode-core/src/test/java/org/apache/geode/test/dunit/Wait.java
index f25810e..7d4e6d5 100755
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/Wait.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/Wait.java
@@ -17,6 +17,8 @@ package org.apache.geode.test.dunit;
import static org.apache.geode.test.dunit.Jitter.*;
import static org.junit.Assert.*;
+import java.io.Serializable;
+
import org.apache.logging.log4j.Logger;
import org.apache.geode.internal.cache.LocalRegion;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java b/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java
index 037d73c..a511995 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java
@@ -245,6 +245,11 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
return getCache(false, factory);
}
+ public final Cache getCache(final Properties properties) {
+ getSystem(properties);
+ return getCache();
+ }
+
public final Cache getCache(final boolean client) {
return getCache(client, null);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java b/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java
index 838bb29..475c165 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java
@@ -111,7 +111,7 @@ public abstract class JUnit4DistributedTestCase implements DistributedTestFixtur
}
@Rule
- public SerializableTestName testName = new SerializableTestName();
+ public SerializableTestName testNameForDistributedTestCase = new SerializableTestName();
@BeforeClass
public static final void initializeDistributedTestCase() {
@@ -122,7 +122,7 @@ public abstract class JUnit4DistributedTestCase implements DistributedTestFixtur
if (this.distributedTestFixture != this) {
return this.distributedTestFixture.getName();
}
- return this.testName.getMethodName();
+ return this.testNameForDistributedTestCase.getMethodName();
}
public final Class<? extends DistributedTestFixture> getTestClass() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedDisconnectRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedDisconnectRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedDisconnectRule.java
index ddf37c5..9107d4d 100755
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedDisconnectRule.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedDisconnectRule.java
@@ -43,14 +43,14 @@ public class DistributedDisconnectRule extends DistributedExternalResource {
@Override
protected void before() throws Throwable {
if (this.disconnectBefore) {
- invoker().invokeEverywhere(serializableRunnable());
+ invoker().invokeInEveryVMAndController(serializableRunnable());
}
}
@Override
protected void after() {
if (this.disconnectAfter) {
- invoker().invokeEverywhere(serializableRunnable());
+ invoker().invokeInEveryVMAndController(serializableRunnable());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRestoreSystemProperties.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRestoreSystemProperties.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRestoreSystemProperties.java
index 221b52a..1f2134a 100755
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRestoreSystemProperties.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRestoreSystemProperties.java
@@ -46,7 +46,7 @@ public class DistributedRestoreSystemProperties extends RestoreSystemProperties
@Override
protected void before() throws Throwable {
super.before();
- this.invoker.remoteInvokeInEveryVMAndLocator(new SerializableRunnable() {
+ this.invoker.invokeInEveryVMAndController(new SerializableRunnable() {
@Override
public void run() {
originalProperties = getProperties();
@@ -58,7 +58,7 @@ public class DistributedRestoreSystemProperties extends RestoreSystemProperties
@Override
protected void after() {
super.after();
- this.invoker.remoteInvokeInEveryVMAndLocator(new SerializableRunnable() {
+ this.invoker.invokeInEveryVMAndController(new SerializableRunnable() {
@Override
public void run() {
setProperties(originalProperties);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.java
new file mode 100644
index 0000000..5ab479b
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.java
@@ -0,0 +1,68 @@
+/*
+ * 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.test.dunit.rules;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.junit.Rule;
+
+/**
+ * Annotates a field or method as a type of {@link Rule} that can be invoked
+ * across multiple VMs in a {@code DistributedTest}.
+ *
+ * If there are multiple annotated {@code DistributedRule}s on a class, they
+ * will be applied in order of fields first, then methods. Furthermore, if
+ * there are multiple fields (or methods) they will be applied in an order that
+ * depends on your JVM's implementation of the reflection API, which is
+ * undefined. Rules defined by fields will always be applied before Rules
+ * defined by methods. You can use a {@link org.junit.rules.RuleChain} or
+ * {@link org.apache.geode.test.junit.rules.RuleList} if you want to have
+ * control over the order in which the Rules are applied.
+ *
+ * <p>
+ * For example, here is a test class that makes a unique
+ * {@link org.junit.rules.TemporaryFolder} available to each DUnit VM:
+ * <pre>
+ * {@literal @}Category(DistributedTest.class)
+ * public class EachVMHasItsOwnTemporaryFolder {
+ *
+ * {@literal @}DistributedRule
+ * public TemporaryFolder folder = new TemporaryFolder();
+ *
+ * {@literal @}Rule
+ * public DistributedTestRule distributedTestRule = DistributedTestRule.builder().build();
+ *
+ * {@literal @}Test
+ * public void eachVMHasItsOwnTemporaryFolder() throws Exception {
+ * Host.getHost(0).getVM(0).invoke(() -> {
+ * File gemfireProps = folder.newFile({@literal "}gemfire.properties{@literal "});
+ * File diskDirs = folder.newFolder({@literal "}diskDirs{@literal "});
+ * ...
+ * }
+ * }
+ * }
+ * </pre>
+ *
+ * @see org.apache.geode.test.junit.rules.serializable.SerializableTestRule
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.FIELD, ElementType.METHOD})
+public @interface DistributedRule {
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRunRules.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRunRules.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRunRules.java
new file mode 100644
index 0000000..7490acd
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRunRules.java
@@ -0,0 +1,76 @@
+/*
+ * 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.test.dunit.rules;
+
+import java.io.Serializable;
+
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+
+import org.apache.geode.test.dunit.Host;
+import org.apache.geode.test.dunit.SerializableRunnable;
+
+/**
+ * Runs Rules in specified DUnit VMs.
+ */
+public class DistributedRunRules extends Statement implements Serializable {
+ private final Statement statement;
+ private final WhichVMs whichVMs;
+
+ public DistributedRunRules(final Statement base, final Iterable<TestRule> rules, final Description description, final WhichVMs whichVMs) {
+ this.statement = applyAll(base, rules, description);
+ this.whichVMs = whichVMs;
+ }
+
+ @Override
+ public void evaluate() throws Throwable {
+ if (this.whichVMs.controllerVM()) {
+ this.statement.evaluate();
+ }
+ if (this.whichVMs.everyVM()) {
+ for (int i = 0; i < Host.getHost(0).getVMCount(); i++) {
+ Host.getHost(0).getVM(i).invoke(runnable());
+ }
+ }
+ if (this.whichVMs.locatorVM()) {
+ Host.getHost(0).getLocator().invoke(runnable());
+ }
+ }
+
+ private Statement applyAll(Statement result, final Iterable<TestRule> rules, final Description description) {
+ for (TestRule each : rules) {
+ result = each.apply(result, description);
+ }
+ return result;
+ }
+
+ private SerializableRunnable runnable() {
+ return new SerializableRunnable() {
+ @Override
+ public void run() {
+ try {
+ DistributedRunRules.this.statement.evaluate();
+ } catch (Error | RuntimeException e) {
+ throw e;
+ } catch (Throwable t) {
+ throw new RuntimeException(t);
+ }
+ }
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedStatement.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedStatement.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedStatement.java
new file mode 100644
index 0000000..1c78d00
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedStatement.java
@@ -0,0 +1,76 @@
+/*
+ * 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.test.dunit.rules;
+
+import java.io.Serializable;
+
+import org.junit.runners.model.Statement;
+
+import org.apache.geode.test.dunit.Host;
+import org.apache.geode.test.dunit.SerializableRunnable;
+import org.apache.geode.test.junit.rules.serializable.SerializableStatement;
+
+/**
+ * Invokes Statement in specified DUnit VMs.
+ */
+public class DistributedStatement extends SerializableStatement {
+ private final SerializableStatement next;
+ private final WhichVMs whichVMs;
+
+ /**
+ * Construct a new {@code DistributedStatement} statement.
+ * @param next the next {@code Statement} in the execution chain
+ * @param whichVMs specifies which VMs should invoke the statement
+ */
+ public DistributedStatement(final SerializableStatement next, final WhichVMs whichVMs) {
+ this.next = next;
+ this.whichVMs = whichVMs;
+ }
+
+ /**
+ * Invoke the {@link Statement} in the specified VMs.
+ */
+ @Override
+ public void evaluate() throws Throwable {
+ if (this.whichVMs.controllerVM()) {
+ this.next.evaluate();
+ }
+ if (this.whichVMs.everyVM()) {
+ for (int i = 0; i < Host.getHost(0).getVMCount(); i++) {
+ Host.getHost(0).getVM(i).invoke(runnable());
+ }
+ }
+ if (this.whichVMs.locatorVM()) {
+ Host.getHost(0).getLocator().invoke(runnable());
+ }
+ }
+
+ private SerializableRunnable runnable() {
+ return new SerializableRunnable() {
+ @Override
+ public void run() {
+ try {
+ next.evaluate();
+ } catch (Error | RuntimeException e) {
+ throw e;
+ } catch (Throwable t) {
+ throw new RuntimeException(t);
+ }
+ }
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.java
new file mode 100644
index 0000000..9516cb3
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.java
@@ -0,0 +1,192 @@
+/*
+ * 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.test.dunit.rules;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.Statement;
+import org.junit.runners.model.TestClass;
+
+import org.apache.geode.test.dunit.standalone.DUnitLauncher;
+
+/**
+ * Launches the DUnit framework for a {@code DistributedTest}.
+ *
+ * <p>Enables use of {@link DistributedRule} annotations on any Rules.
+ *
+ * <pre>
+ * {@literal @}Category(DistributedTest.class)
+ * public class QueryDataDUnitTest {
+ *
+ * {@literal @}DistributedRule
+ * public UseJacksonForJsonPathRule useJacksonForJsonPathRule = new UseJacksonForJsonPathRule();
+ *
+ * {@literal @}Rule
+ * public DistributedTestRule distributedTestRule = DistributedTestRule.builder().build();
+ *
+ * ...
+ * }
+ * </pre>
+ * <p>Use the {@code Builder} to specify which {@code VM}s should invoke any
+ * {@code Rule} annotated with {@literal @}DistributedRule. By default,
+ * {@code controllerVM} is {@code true}, {@code everyVM} is {@code true} and
+ * {@code locatorVM} is {@code false}.
+ */
+public class DistributedTestRule implements MethodRule, Serializable {
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ private TestClass testClass;
+
+ private final List<?> rules = new ArrayList<>(); // types are TestRule or MethodRule
+
+ private final RemoteInvoker invoker;
+
+ private final WhichVMs whichVMs;
+
+ // TODO: add ability to specify ordering of DistributedRules
+
+ protected DistributedTestRule(final Builder builder) {
+ this(new RemoteInvoker(), builder);
+ }
+
+ protected DistributedTestRule(final RemoteInvoker invoker, final Builder builder) {
+ this.invoker = invoker;
+
+ this.whichVMs = new WhichVMs();
+ if (builder.controllerVM) {
+ this.whichVMs.addControllerVM();
+ }
+ if (builder.everyVM) {
+ this.whichVMs.addEveryVM();
+ }
+ if (builder.locatorVM) {
+ this.whichVMs.addLocatorVM();
+ }
+ }
+
+ @Override
+ public Statement apply(final Statement base, final FrameworkMethod method, final Object target) {
+ this.testClass = new TestClass(target.getClass());
+ Statement statement = base;
+ statement = withRules(method, target, statement);
+ statement = withDUnit(method, target, statement);
+ return statement;
+ }
+
+ protected Statement withDUnit(final FrameworkMethod method, final Object target, final Statement statement) {
+ return new Statement() {
+ @Override
+ public void evaluate() throws Throwable {
+ setUpDUnit();
+ try {
+ statement.evaluate();
+ } finally {
+ tearDownDUnit();
+ }
+ }
+ };
+ }
+
+ protected void setUpDUnit() throws Exception {
+ DUnitLauncher.launchIfNeeded();
+ // TODO: customize based on fields
+ }
+
+ protected void tearDownDUnit() throws Exception {
+ }
+
+ protected Statement withRules(final FrameworkMethod method, final Object target, final Statement statement) {
+ List<TestRule> testRules = this.testRules(target);
+ Statement result = statement;
+// result = withMethodRules(method, testRules, target, result);
+ result = withTestRules(method, testRules, result);
+
+ return result;
+ }
+
+// protected Statement withMethodRules(final FrameworkMethod method, final List<TestRule> testRules, final Object target, final Statement result) {
+// Statement statement = result;
+// for (MethodRule rule : methodRules(target)) {
+// if (!testRules.contains(rule)) {
+// statement = new DistributedStatement(rule.apply((result, method, target), this.whichVMs);
+// }
+// }
+// return statement;
+// }
+
+ protected Statement withTestRules(final FrameworkMethod method, final List<TestRule> testRules, final Statement statement) {
+ Description description = Description.createTestDescription(this.testClass.getJavaClass(), method.getName(), method.getAnnotations());
+ return testRules.isEmpty() ? statement : new DistributedRunRules(statement, testRules, description, this.whichVMs);
+ }
+
+ protected List<MethodRule> methodRules(final Object target) {
+ List<MethodRule> rules = this.testClass.getAnnotatedMethodValues(target, DistributedRule.class, MethodRule.class);
+ rules.addAll(this.testClass.getAnnotatedFieldValues(target, DistributedRule.class, MethodRule.class));
+ return rules;
+ }
+
+ protected List<TestRule> testRules(final Object target) {
+ List<TestRule> result = this.testClass.getAnnotatedMethodValues(target, DistributedRule.class, TestRule.class);
+ result.addAll(this.testClass.getAnnotatedFieldValues(target, DistributedRule.class, TestRule.class));
+ return result;
+ }
+
+ /**
+ * Builds an instance of {@link DistributedTestRule}.
+ *
+ * <p>By default, {@code controllerVM} is {@code true}, {@code everyVM} is
+ * {@code true} and {@code locatorVM} is {@code false}.
+ */
+ public static class Builder {
+
+ private boolean everyVM = true;
+ private boolean locatorVM = false;
+ private boolean controllerVM = true;
+
+ protected Builder() {
+ }
+
+ public Builder everyVM(final boolean everyVM) {
+ this.everyVM = everyVM;
+ return this;
+ }
+
+ public Builder locatorVM(final boolean locatorVM) {
+ this.locatorVM = locatorVM;
+ return this;
+ }
+
+ public Builder controllerVM(final boolean locatorVM) {
+ this.locatorVM = locatorVM;
+ return this;
+ }
+
+ public DistributedTestRule build() {
+ return new DistributedTestRule(this);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java
new file mode 100644
index 0000000..78841fc
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java
@@ -0,0 +1,51 @@
+/*
+ * 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.test.dunit.rules;
+
+import org.apache.geode.test.junit.rules.UseJacksonForJsonPathRule;
+
+public class DistributedUseJacksonForJsonPathRule extends UseJacksonForJsonPathRule {
+
+ private static UseJacksonForJsonPathRule instance = new UseJacksonForJsonPathRule();
+
+ private final RemoteInvoker invoker;
+
+ public DistributedUseJacksonForJsonPathRule() {
+ this(new RemoteInvoker());
+ }
+
+ public DistributedUseJacksonForJsonPathRule(final RemoteInvoker invoker) {
+ this.invoker = invoker;
+ }
+
+ @Override
+ public void before() {
+ this.invoker.invokeInEveryVMAndController(DistributedUseJacksonForJsonPathRule::invokeBefore);
+ }
+
+ @Override
+ public void after() {
+ this.invoker.invokeInEveryVMAndController(DistributedUseJacksonForJsonPathRule::invokeAfter);
+ }
+
+ private static void invokeBefore() {
+ instance.before();
+ }
+ private static void invokeAfter() {
+ instance.after();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedWrapperRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedWrapperRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedWrapperRule.java
new file mode 100644
index 0000000..45311e1
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedWrapperRule.java
@@ -0,0 +1,52 @@
+/*
+ * 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.test.dunit.rules;
+
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+
+import org.apache.geode.test.junit.rules.UseJacksonForJsonPathRule;
+import org.apache.geode.test.junit.rules.serializable.SerializableExternalResource;
+import org.apache.geode.test.junit.rules.serializable.SerializableStatement;
+import org.apache.geode.test.junit.rules.serializable.SerializableTestRule;
+
+public class DistributedWrapperRule implements SerializableTestRule {
+
+ private static SerializableTestRule instance;
+
+ private final RemoteInvoker invoker;
+ private final WhichVMs whichVMs;
+
+ public DistributedWrapperRule(final SerializableTestRule testRule) {
+ this(testRule, new WhichVMs().addControllerVM().addEveryVM());
+ }
+
+ public DistributedWrapperRule(final SerializableTestRule testRule, final WhichVMs whichVMs) {
+ this(new RemoteInvoker(), testRule, whichVMs);
+ }
+
+ public DistributedWrapperRule(final RemoteInvoker invoker, final SerializableTestRule testRule, final WhichVMs whichVMs) {
+ this.invoker = invoker;
+ instance = testRule;
+ this.whichVMs = whichVMs;
+ }
+
+ @Override
+ public Statement apply(Statement base, Description description){
+ return new DistributedStatement((SerializableStatement) base, whichVMs);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/rules/RemoteInvoker.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/RemoteInvoker.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/RemoteInvoker.java
index 6398e45..866a0d5 100755
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/RemoteInvoker.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/RemoteInvoker.java
@@ -18,7 +18,8 @@ import static org.apache.geode.test.dunit.Invoke.*;
import java.io.Serializable;
-import org.apache.geode.test.dunit.SerializableRunnable;
+import org.apache.geode.test.dunit.Invoke;
+import org.apache.geode.test.dunit.SerializableRunnableIF;
/**
* Provides remote invocation support to a {@code TestRule}. These methods will invoke a
@@ -28,18 +29,21 @@ class RemoteInvoker implements Serializable {
private static final long serialVersionUID = -1759722991299584649L;
- public void invokeEverywhere(final SerializableRunnable runnable) {
+ // controller VM
+ // dunit VMs
+ // locator VM
+
+ public void invokeInEveryVMAndController(final SerializableRunnableIF runnable) {
try {
runnable.run();
} catch (Exception e) {
throw new RuntimeException(e);
}
- invokeInEveryVM(runnable);
- invokeInLocator(runnable);
+ Invoke.invokeInEveryVM(runnable);
}
- public void remoteInvokeInEveryVMAndLocator(final SerializableRunnable runnable) {
- invokeInEveryVM(runnable);
+ public void invokeInEveryVMAndLocator(final SerializableRunnableIF runnable) {
+ Invoke.invokeInEveryVM(runnable);
invokeInLocator(runnable);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/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
new file mode 100644
index 0000000..4ee6020
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/WhichVMs.java
@@ -0,0 +1,58 @@
+/*
+ * 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.test.dunit.rules;
+
+import java.io.Serializable;
+
+/**
+ * Specifies which DUnit VMs will invoke a Rule.
+ *
+ * TODO: add ability to specify specific VMs
+ *
+ * TODO: add ability to specify order
+ */
+public class WhichVMs implements Serializable{
+ private boolean controllerVM;
+ private boolean everyVM;
+ private boolean locatorVM;
+
+ 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;
+ }
+
+ 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/22f577eb/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
new file mode 100644
index 0000000..8352db2
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/tests/DistributedTestRuleTest.java
@@ -0,0 +1,54 @@
+/*
+ * 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.test.dunit.rules.tests;
+
+import java.io.Serializable;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExternalResource;
+
+import org.apache.geode.test.dunit.rules.DistributedRule;
+import org.apache.geode.test.dunit.rules.DistributedTestRule;
+import org.apache.geode.test.junit.rules.serializable.SerializableExternalResource;
+
+public class DistributedTestRuleTest {
+
+ @DistributedRule
+ public SimpleRule simpleRule = new SimpleRule();
+
+ @Rule
+ public DistributedTestRule distributedTestRule = DistributedTestRule.builder().build();
+
+ @Test
+ public void test() throws Exception {
+ System.out.println("KIRK:test");
+ }
+
+ private static class SimpleRule extends SerializableExternalResource {
+ @Override
+ protected void before() throws Throwable {
+ System.out.println("KIRK:before");
+ }
+
+ @Override
+ protected void after() {
+ System.out.println("KIRK:after");
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
index 5a80a64..5c0bbdb 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
@@ -14,41 +14,51 @@
*/
package org.apache.geode.test.dunit.standalone;
-import batterytest.greplogs.ExpectedStrings;
-import batterytest.greplogs.LogConsumer;
-import org.apache.geode.distributed.Locator;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.InternalLocator;
-import org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLeave;
-import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.test.dunit.DUnitEnv;
-import org.apache.geode.test.dunit.Host;
-import org.apache.geode.test.dunit.SerializableCallable;
-import org.apache.geode.test.dunit.VM;
-import hydra.MethExecutorResult;
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.core.appender.FileAppender;
-import org.apache.logging.log4j.core.config.LoggerConfig;
-import org.apache.logging.log4j.core.layout.PatternLayout;
-import org.junit.Assert;
+import static org.apache.geode.distributed.ConfigurationProperties.*;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
import java.lang.reflect.Method;
import java.net.InetAddress;
import java.net.URISyntaxException;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
-import java.rmi.*;
+import java.rmi.AccessException;
+import java.rmi.AlreadyBoundException;
+import java.rmi.NotBoundException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import java.util.List;
import java.util.Properties;
-import static org.apache.geode.distributed.ConfigurationProperties.*;
+import batterytest.greplogs.ExpectedStrings;
+import batterytest.greplogs.LogConsumer;
+import hydra.MethExecutorResult;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.appender.FileAppender;
+import org.apache.logging.log4j.core.config.LoggerConfig;
+import org.apache.logging.log4j.core.layout.PatternLayout;
+import org.junit.Assert;
+
+import org.apache.geode.distributed.Locator;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.InternalLocator;
+import org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLeave;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.test.dunit.DUnitEnv;
+import org.apache.geode.test.dunit.Host;
+import org.apache.geode.test.dunit.SerializableCallable;
+import org.apache.geode.test.dunit.VM;
/**
* A class to build a fake test configuration and launch some DUnit VMS.
@@ -73,6 +83,8 @@ public class DUnitLauncher {
private static final int LOCATOR_VM_NUM = -2;
static final long STARTUP_TIMEOUT = 120 * 1000;
+ private static final String STARTUP_TIMEOUT_MESSAGE = "VMs did not start up within " + (STARTUP_TIMEOUT/1000) + " seconds";
+
private static final String SUSPECT_FILENAME = "dunit_suspect.log";
private static File DUNIT_SUSPECT_FILE;
@@ -189,9 +201,9 @@ public class DUnitLauncher {
// Create a VM for the locator
processManager.launchVM(LOCATOR_VM_NUM);
- // wait for the VM to start up
- if (!processManager.waitForVMs(STARTUP_TIMEOUT)) {
- throw new RuntimeException("VMs did not start up with 30 seconds");
+ //wait for the VM to start up
+ if(!processManager.waitForVMs(STARTUP_TIMEOUT)) {
+ throw new RuntimeException("VMs did not start up within 30 seconds");
}
locatorPort = startLocator(registry);
@@ -204,9 +216,9 @@ public class DUnitLauncher {
processManager.launchVM(i);
}
- // wait for the VMS to start up
- if (!processManager.waitForVMs(STARTUP_TIMEOUT)) {
- throw new RuntimeException("VMs did not start up with 30 seconds");
+ //wait for the VMS to start up
+ if(!processManager.waitForVMs(STARTUP_TIMEOUT)) {
+ throw new RuntimeException("VMs did not start up within 30 seconds");
}
// populate the Host class with our stubs. The tests use this host class
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-junit/build.gradle
----------------------------------------------------------------------
diff --git a/geode-junit/build.gradle b/geode-junit/build.gradle
index f7e5e46..e47095f 100755
--- a/geode-junit/build.gradle
+++ b/geode-junit/build.gradle
@@ -16,6 +16,7 @@
*/
dependencies {
+ compile 'com.jayway.jsonpath:json-path:' + project.'json-path.version'
testCompile 'commons-lang:commons-lang:' + project.'commons-lang.version'
testCompile 'com.google.guava:guava:' + project.'guava.version'
testCompile 'org.assertj:assertj-core:' + project.'assertj-core.version'
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-junit/src/main/java/org/apache/geode/test/junit/rules/UseJacksonForJsonPathRule.java
----------------------------------------------------------------------
diff --git a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/UseJacksonForJsonPathRule.java b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/UseJacksonForJsonPathRule.java
new file mode 100644
index 0000000..03d5a60
--- /dev/null
+++ b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/UseJacksonForJsonPathRule.java
@@ -0,0 +1,128 @@
+/*
+ * 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.test.junit.rules;
+
+import java.util.EnumSet;
+import java.util.Set;
+
+import com.jayway.jsonpath.Configuration;
+import com.jayway.jsonpath.Configuration.Defaults;
+import com.jayway.jsonpath.Option;
+import com.jayway.jsonpath.spi.json.JacksonJsonProvider;
+import com.jayway.jsonpath.spi.json.JsonProvider;
+import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider;
+import com.jayway.jsonpath.spi.mapper.MappingProvider;
+
+import org.apache.geode.test.junit.rules.serializable.SerializableExternalResource;
+
+/**
+ * JUnit Rule that configures json-path to use the {@code JacksonJsonProvider}
+ *
+ * <p>UseJacksonForJsonPathRule can be used in tests that need to use json-path-assert:
+ * <pre>
+ * {@literal @}ClassRule
+ * public static UseJacksonForJsonPathRule useJacksonForJsonPathRule = new UseJacksonForJsonPathRule();
+ *
+ * {@literal @}Test
+ * public void hasAssertionsUsingJsonPathMatchers() {
+ * ...
+ * assertThat(json, isJson());
+ * assertThat(json, hasJsonPath("$.result"));
+ * }
+ * </pre>
+ */
+@SuppressWarnings({ "serial", "unused" })
+public class UseJacksonForJsonPathRule extends SerializableExternalResource {
+
+ private boolean hadDefaults;
+ private JsonProvider jsonProvider;
+ private MappingProvider mappingProvider;
+ private Set<Option> options;
+
+ /**
+ * Override to set up your specific external resource.
+ */
+ @Override
+ public void before() {
+ saveDefaults();
+ Configuration.setDefaults(new Defaults() {
+
+ private final JsonProvider jsonProvider = new JacksonJsonProvider();
+ private final MappingProvider mappingProvider = new JacksonMappingProvider();
+
+ @Override
+ public JsonProvider jsonProvider() {
+ return jsonProvider;
+ }
+
+ @Override
+ public MappingProvider mappingProvider() {
+ return mappingProvider;
+ }
+
+ @Override
+ public Set<Option> options() {
+ return EnumSet.noneOf(Option.class);
+ }
+
+ });
+ }
+
+ /**
+ * Override to tear down your specific external resource.
+ */
+ @Override
+ public void after() {
+ restoreDefaults();
+ }
+
+ private void saveDefaults() {
+ try {
+ Configuration defaultConfiguration = Configuration.defaultConfiguration();
+ this.jsonProvider = defaultConfiguration.jsonProvider();
+ this.mappingProvider = defaultConfiguration.mappingProvider();
+ this.options = defaultConfiguration.getOptions();
+ this.hadDefaults = true;
+ } catch (NoClassDefFoundError ignore) {
+ this.hadDefaults = false;
+ }
+ }
+
+ private void restoreDefaults() {
+ if (!this.hadDefaults) {
+ return;
+ }
+ Configuration.setDefaults(new Defaults() {
+
+ @Override
+ public JsonProvider jsonProvider() {
+ return jsonProvider;
+ }
+
+ @Override
+ public MappingProvider mappingProvider() {
+ return mappingProvider;
+ }
+
+ @Override
+ public Set<Option> options() {
+ return options;
+ }
+
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableExternalResource.java
----------------------------------------------------------------------
diff --git a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableExternalResource.java b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableExternalResource.java
index c76ed19..75f4575 100755
--- a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableExternalResource.java
+++ b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableExternalResource.java
@@ -14,11 +14,32 @@
*/
package org.apache.geode.test.junit.rules.serializable;
+import java.io.Serializable;
+
import org.junit.rules.ExternalResource;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
/**
* Serializable subclass of {@link org.junit.rules.ExternalResource ExternalResource}.
*/
-public abstract class SerializableExternalResource extends ExternalResource
- implements SerializableTestRule {
+public abstract class SerializableExternalResource extends ExternalResource implements SerializableTestRule {
+
+ public Statement apply(Statement base, Description description) {
+ return statement(base);
+ }
+
+ private Statement statement(final Statement base) {
+ return new SerializableStatement() {
+ @Override
+ public void evaluate() throws Throwable {
+ before();
+ try {
+ base.evaluate();
+ } finally {
+ after();
+ }
+ }
+ };
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableStatement.java
----------------------------------------------------------------------
diff --git a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableStatement.java b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableStatement.java
new file mode 100644
index 0000000..3f07421
--- /dev/null
+++ b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableStatement.java
@@ -0,0 +1,27 @@
+/*
+ * 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.test.junit.rules.serializable;
+
+import java.io.Serializable;
+
+import org.junit.runners.model.Statement;
+
+/**
+ * Serializable subclass of {@link Statement}.
+ */
+public abstract class SerializableStatement extends Statement implements Serializable {
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java
index 634ea2f..27582a7 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java
@@ -143,13 +143,12 @@ public class LuceneManagementDUnitTest extends ManagementTestBase {
}
}
- private static void verifyMBean() {
+ private void verifyMBean() {
getMBean();
}
- private static LuceneServiceMXBean getMBean() {
- ObjectName objectName =
- MBeanJMXAdapter.getCacheServiceMBeanName(ds.getDistributedMember(), "LuceneService");
+ private LuceneServiceMXBean getMBean() {
+ ObjectName objectName = MBeanJMXAdapter.getCacheServiceMBeanName(getSystem().getDistributedMember(), "LuceneService");
assertNotNull(getManagementService().getMBeanInstance(objectName, LuceneServiceMXBean.class));
return getManagementService().getMBeanInstance(objectName, LuceneServiceMXBean.class);
}
@@ -178,15 +177,14 @@ public class LuceneManagementDUnitTest extends ManagementTestBase {
createPartitionRegion(vm, regionName);
}
- private static void createIndexes(String regionName, int numIndexes) {
- LuceneService luceneService = LuceneServiceProvider.get(cache);
- for (int i = 0; i < numIndexes; i++) {
- luceneService.createIndex(INDEX_NAME + "_" + i, regionName, "field" + i);
+ private void createIndexes(String regionName, int numIndexes) {
+ LuceneService luceneService = LuceneServiceProvider.get(getCache());
+ for (int i=0; i<numIndexes; i++) {
+ luceneService.createIndex(INDEX_NAME+"_"+i, regionName, "field"+i);
}
}
- private static void verifyAllMBeanIndexMetrics(String regionName, int numRegionIndexes,
- int numTotalIndexes) {
+ private void verifyAllMBeanIndexMetrics(String regionName, int numRegionIndexes, int numTotalIndexes) {
LuceneServiceMXBean mbean = getMBean();
verifyMBeanIndexMetrics(mbean, regionName, numRegionIndexes, numTotalIndexes);
}
@@ -210,20 +208,18 @@ public class LuceneManagementDUnitTest extends ManagementTestBase {
}
}
- private static void putEntries(String regionName, int numEntries) {
- for (int i = 0; i < numEntries; i++) {
- Region region = cache.getRegion(regionName);
+ private void putEntries(String regionName, int numEntries) {
+ for (int i=0; i<numEntries; i++) {
+ Region region = getCache().getRegion(regionName);
String key = String.valueOf(i);
Object value = new TestObject(key);
region.put(key, value);
}
}
- private static void queryEntries(String regionName, String indexName)
- throws LuceneQueryException {
- LuceneService service = LuceneServiceProvider.get(cache);
- LuceneQuery query =
- service.createLuceneQueryFactory().create(indexName, regionName, "field0:0", null);
+ private void queryEntries(String regionName, String indexName) throws LuceneQueryException {
+ LuceneService service = LuceneServiceProvider.get(getCache());
+ LuceneQuery query = service.createLuceneQueryFactory().create(indexName, regionName, "field0:0", null);
query.findValues();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/gradle/dependency-versions.properties
----------------------------------------------------------------------
diff --git a/gradle/dependency-versions.properties b/gradle/dependency-versions.properties
index 828b088..05d7124 100644
--- a/gradle/dependency-versions.properties
+++ b/gradle/dependency-versions.properties
@@ -68,7 +68,8 @@ jline.version = 2.12
jmock.version = 2.8.2
jna.version = 4.0.0
jopt-simple.version = 5.0.1
-json-path.version = 1.2.0
+json-path.version = 2.2.0
+json-path-assert.version = 2.2.0
json4s.version = 3.2.4
jsr305.version = 3.0.1
junit.version = 4.12
[37/50] [abbrv] incubator-geode git commit: Remove unused imports
Posted by kl...@apache.org.
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 Lund <kl...@apache.org>
Authored: Mon Oct 31 14:07:47 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
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
[44/50] [abbrv] incubator-geode git commit: Convert from
ManagementTestCase to ManagementTestRule
Posted by kl...@apache.org.
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.
+ * <p>
+ * 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 REGION_NAME = "MANAGEMENT_TEST_REGION";
+ private static final String PARTITIONED_REGION_NAME = "MANAGEMENT_PAR_REGION";
+ private static final String FIXED_PR_NAME = "MANAGEMENT_FIXED_PR";
+ private static final String LOCAL_REGION_NAME = "TEST_LOCAL_REGION";
+ private static final String LOCAL_SUB_REGION_NAME = "TEST_LOCAL_SUB_REGION";
- private final String VERIFY_REMOTE_CONFIG_METHOD = "verifyConfigDataRemote";
+ 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;
- static final String REGION_NAME = "MANAGEMENT_TEST_REGION";
+ // field used in manager VM
+ private static Region fixedPartitionedRegion;
- static final String PARTITIONED_REGION_NAME = "MANAGEMENT_PAR_REGION";
+ private static final AtomicReference<List<Notification>> MEMBER_NOTIFICATIONS_REF = new AtomicReference<>();
+ private static final AtomicReference<List<Notification>> SYSTEM_NOTIFICATIONS_REF = new AtomicReference<>();
- static final String FIXED_PR_NAME = "MANAGEMENT_FIXED_PR";
+ @Manager
+ private VM managerVM;
- static final String REGION_PATH = "/MANAGEMENT_TEST_REGION";
+ @Member
+ private VM[] memberVMs;
- static final String PARTITIONED_REGION_PATH = "/MANAGEMENT_PAR_REGION";
+ @Before
+ public void before() throws Exception {
+ this.managerVM = getHost(0).getVM(0);
- static final String FIXED_PR_PATH = "/MANAGEMENT_FIXED_PR";
-
- static final String LOCAL_REGION_NAME = "TEST_LOCAL_REGION";
- static final String LOCAL_SUB_REGION_NAME = "TEST_LOCAL_SUB_REGION";
- static final String LOCAL_REGION_PATH = "/TEST_LOCAL_REGION";
- static final String LOCAL_SUB_REGION_PATH = "/TEST_LOCAL_REGION/TEST_LOCAL_SUB_REGION";
-
- private static final int MAX_WAIT = 70 * 1000;
-
- protected static final Region DiskRegion = null;
+ this.memberVMs = new VM[3];
+ this.memberVMs[0] = getHost(0).getVM(1);
+ this.memberVMs[1] = getHost(0).getVM(2);
+ this.memberVMs[2] = getHost(0).getVM(3);
+ }
- static List<FixedPartitionAttributes> fpaList = new ArrayList<FixedPartitionAttributes>();
+ @After
+ public void after() throws Exception {
+ invokeInEveryVM(() -> MEMBER_NOTIFICATIONS_REF.set(null));
+ invokeInEveryVM(() -> SYSTEM_NOTIFICATIONS_REF.set(null));
+ disconnectAllFromDS_tmp();
+ }
+ private void createMembersAndThenManagers_tmp() throws Exception {
+ initManagement(false);
+ }
- private static Region fixedPrRegion;
+ private void createManagersAndThenMembers_tmp() throws Exception {
+ initManagement(true);
+ }
+ private void disconnectAllFromDS_tmp() {
+ disconnectAllFromDS();
+ }
- public RegionManagementDUnitTest() {
- super();
+ private ManagementService getManagementService_tmp() {
+ return getManagementService();
+ }
+ private Cache getCache_tmp() {
+ return getCache();
}
/**
* Tests all Region MBean related Management APIs
- *
+ * <p>
* a) Notification propagated to member MBean while a region is created
- *
+ * <p>
* b) Creates and check a Distributed Region
- *
- *
- * @throws Exception
*/
-
- @Category(FlakyTest.class) // GEODE-1538
@Test
public void testDistributedRegion() throws Exception {
+ createMembersAndThenManagers_tmp();
- initManagement(false);
-
-
- VM[] managedNodes = new VM[getManagedNodeList().size()];
-
- getManagedNodeList().toArray(managedNodes);
- // Adding notif listener for remote cache members
- addMemberListener(managingNode);
-
- for (int j = 0; j < managedNodes.length; j++) {
-
- VM vm = managedNodes[j];
-
- createDistributedRegion(vm, REGION_NAME);
- validateReplicateRegionAfterCreate(vm);
+ // Adding notification listener for remote cache memberVMs
+ addMemberNotificationListener(this.managerVM, 3); // TODO: why?
+ for (VM memberVM : this.memberVMs) {
+ createDistributedRegion_tmp(memberVM, REGION_NAME);
+ verifyReplicateRegionAfterCreate(memberVM);
}
- verifyRemoteDistributedRegion(managingNode, 3);
+ verifyRemoteDistributedRegion(this.managerVM, 3);
-
- for (VM vm : getManagedNodeList()) {
- closeRegion(vm, REGION_PATH);
- validateReplicatedRegionAfterClose(vm);
+ for (VM memberVM : this.memberVMs) {
+ closeRegion(memberVM, REGION_PATH);
+ verifyReplicatedRegionAfterClose(memberVM);
}
- ensureProxyCleanup(managingNode);
+ verifyProxyCleanup(this.managerVM);
+
+ verifyMemberNotifications(this.managerVM, REGION_NAME, 3);
}
/**
* Tests all Region MBean related Management APIs
- *
+ * <p>
* a) Notification propagated to member MBean while a region is created
- *
+ * <p>
* b) Created and check a Partitioned Region
- *
- * @throws Exception
*/
@Test
public void testPartitionedRegion() throws Exception {
- initManagement(false);
-
- VM managingNode = getManagingNode();
+ createMembersAndThenManagers_tmp();
- VM[] managedNodes = new VM[getManagedNodeList().size()];
+ // Adding notification listener for remote cache memberVMs
+ addMemberNotificationListener(this.managerVM, 3); // TODO: why?
- getManagedNodeList().toArray(managedNodes);
- // Adding notif listener for remote cache members
-
- addMemberListener(managingNode);
-
- for (int j = 0; j < managedNodes.length; j++) {
-
- VM vm = managedNodes[j];
- createPartitionRegion(vm, PARTITIONED_REGION_NAME);
- validatePartitionRegionAfterCreate(vm);
+ for (VM memberVM : this.memberVMs) {
+ createPartitionRegion_tmp(memberVM, PARTITIONED_REGION_NAME);
+ verifyPartitionRegionAfterCreate(memberVM);
}
+ verifyRemotePartitionRegion(this.managerVM);
- validateRemotePartitionRegion(managingNode);
-
- for (VM vm : getManagedNodeList()) {
-
- closeRegion(vm, PARTITIONED_REGION_PATH);
- validatePartitionRegionAfterClose(vm);
+ for (VM memberVM : this.memberVMs) {
+ closeRegion(memberVM, PARTITIONED_REGION_PATH);
+ verifyPartitionRegionAfterClose(memberVM);
}
+
+ verifyMemberNotifications(this.managerVM, PARTITIONED_REGION_NAME, 3);
}
/**
* Tests all Region MBean related Management APIs
- *
+ * <p>
* a) Notification propagated to member MBean while a region is created
- *
+ * <p>
* b) Creates and check a Fixed Partitioned Region
- *
- * @throws Exception
*/
@Test
public void testFixedPRRegionMBean() throws Exception {
+ createMembersAndThenManagers_tmp();
- initManagement(false);
-
- VM managingNode = getManagingNode();
-
- VM[] managedNodes = new VM[getManagedNodeList().size()];
+ // Adding notification listener for remote cache memberVMs
+ addMemberNotificationListener(this.managerVM, 3); // TODO: why?
- getManagedNodeList().toArray(managedNodes);
- // Adding notif listener for remote cache members
- addMemberListener(managingNode);
-
- for (int j = 0; j < managedNodes.length; j++) {
-
- VM vm = managedNodes[j];
+ int primaryIndex = 0;
+ for (VM memberVM : this.memberVMs) {
+ List<FixedPartitionAttributes> fixedPartitionAttributesList = createFixedPartitionList(primaryIndex + 1);
+ memberVM.invoke(() -> createFixedPartitionRegion(fixedPartitionAttributesList));
+ primaryIndex++;
+ }
- createFixedPartitionList(j + 1);
- Object[] args = new Object[1];
- args[0] = fpaList;
- vm.invoke(RegionManagementDUnitTest.class, "createFixedPartitionRegion", args);
+// // TODO: Workaround for bug 46683. Reenable validation when bug is fixed.
+ verifyRemoteFixedPartitionRegion(this.managerVM);
+ for (VM memberVM : this.memberVMs) {
+ closeRegion(memberVM, FIXED_PR_PATH);
}
- // Workaround for bug 46683. Renable validation when bug is fixed.
- validateRemoteFixedPartitionRegion(managingNode);
- for (VM vm : getManagedNodeList()) {
- closeFixedPartitionRegion(vm);
- }
+ verifyMemberNotifications(this.managerVM, FIXED_PR_PATH, 3);
}
/**
- * Tests a Distributed Region at Managing Node side while region is created in a member node
- * asynchronously.
- *
- * @throws Exception
+ * Tests a Distributed Region at Managing Node side
+ * while region is created in a member node asynchronously.
*/
@Test
public void testRegionAggregate() throws Exception {
- initManagement(true);
-
- VM managingNode = getManagingNode();
-
- VM[] managedNodes = new VM[getManagedNodeList().size()];
-
- getManagedNodeList().toArray(managedNodes);
- // Adding notif listener for remote cache members
- addDistrListener(managingNode);
-
-
- for (int j = 0; j < managedNodes.length; j++) {
+ createManagersAndThenMembers_tmp();
- VM vm = managedNodes[j];
-
- createDistributedRegion(vm, REGION_NAME);
+ // Adding notification listener for remote cache memberVMs
+ addSystemNotificationListener(this.managerVM); // TODO: why?
+ for (VM memberVM : this.memberVMs) {
+ createDistributedRegion_tmp(memberVM, REGION_NAME);
}
+ verifyDistributedMBean(this.managerVM, 3);
+ createDistributedRegion_tmp(this.managerVM, REGION_NAME);
+ verifyDistributedMBean(this.managerVM, 4);
- validateDistributedMBean(managingNode, 3);
-
- createDistributedRegion(managingNode, REGION_NAME);
- validateDistributedMBean(managingNode, 4);
-
-
-
- for (int j = 0; j < managedNodes.length; j++) {
-
- VM vm = managedNodes[j];
-
- closeRegion(vm, REGION_PATH);
-
+ for (VM memberVM : this.memberVMs) {
+ closeRegion(memberVM, REGION_PATH);
}
- ensureProxyCleanup(managingNode);
-
- validateDistributedMBean(managingNode, 1);
- closeRegion(managingNode, REGION_PATH);
- validateDistributedMBean(managingNode, 0);
+ verifyProxyCleanup(this.managerVM);
+ verifyDistributedMBean(this.managerVM, 1);
+ closeRegion(this.managerVM, REGION_PATH);
+ verifyDistributedMBean(this.managerVM, 0);
+ verifySystemNotifications(this.managerVM, REGION_NAME, 3);
}
@Test
public void testNavigationAPIS() throws Exception {
- initManagement(true);
- for (VM vm : managedNodeList) {
- createDistributedRegion(vm, REGION_NAME);
- createPartitionRegion(vm, PARTITIONED_REGION_NAME);
- }
- createDistributedRegion(managingNode, REGION_NAME);
- createPartitionRegion(managingNode, PARTITIONED_REGION_NAME);
- List<String> memberIds = new ArrayList<String>();
+ createManagersAndThenMembers_tmp();
- for (VM vm : managedNodeList) {
- memberIds.add(getMemberId(vm));
+ for (VM memberVM : this.memberVMs) {
+ createDistributedRegion_tmp(memberVM, REGION_NAME);
+ createPartitionRegion_tmp(memberVM, PARTITIONED_REGION_NAME);
}
- checkNavigationAPIS(managingNode, memberIds);
-
+ createDistributedRegion_tmp(this.managerVM, REGION_NAME);
+ createPartitionRegion_tmp(this.managerVM, PARTITIONED_REGION_NAME);
+ List<String> memberIds = new ArrayList<>();
- for (VM vm : managedNodeList) {
- closeRegion(vm, REGION_PATH);
+ for (VM memberVM : this.memberVMs) {
+ memberIds.add(getDistributedMemberId_tmp(memberVM));
}
- closeRegion(managingNode, REGION_PATH);
+ verifyNavigationApis(this.managerVM, memberIds);
+ for (VM memberVM : this.memberVMs) {
+ closeRegion(memberVM, REGION_PATH);
+ }
+ closeRegion(this.managerVM, REGION_PATH);
}
-
-
@Test
public void testSubRegions() throws Exception {
- initManagement(false);
- for (VM vm : managedNodeList) {
- createLocalRegion(vm, LOCAL_REGION_NAME);
- createSubRegion(vm, LOCAL_REGION_NAME, LOCAL_SUB_REGION_NAME);
- }
+ createMembersAndThenManagers_tmp();
- for (VM vm : managedNodeList) {
- checkSubRegions(vm, LOCAL_SUB_REGION_PATH);
+ for (VM memberVM : this.memberVMs) {
+ createLocalRegion_tmp(memberVM, LOCAL_REGION_NAME);
+ createSubRegion_tmp(memberVM, LOCAL_REGION_NAME, LOCAL_SUB_REGION_NAME);
}
- for (VM vm : managedNodeList) {
- closeRegion(vm, LOCAL_REGION_NAME);
- checkNullRegions(vm, LOCAL_SUB_REGION_NAME);
+ for (VM memberVM : this.memberVMs) {
+ verifySubRegions(memberVM, LOCAL_SUB_REGION_PATH);
}
+ for (VM memberVM : this.memberVMs) {
+ closeRegion(memberVM, LOCAL_REGION_NAME);
+ verifyNullRegions(memberVM, LOCAL_SUB_REGION_NAME);
+ }
}
-
-
@Test
public void testSpecialRegions() throws Exception {
- initManagement(false);
- createSpecialRegion(managedNodeList.get(0));
- DistributedMember member = getMember(managedNodeList.get(0));
- checkSpecialRegion(managingNode, member);
- }
-
-
- public void createSpecialRegion(VM vm1) throws Exception {
- {
- vm1.invoke(new SerializableRunnable("Check Sub Regions") {
-
- public void run() {
- Cache cache = getCache();
- AttributesFactory attributesFactory = new AttributesFactory();
- attributesFactory.setValueConstraint(Portfolio.class);
- RegionAttributes regionAttributes = attributesFactory.create();
-
- cache.createRegion("p-os", regionAttributes);
- cache.createRegion("p_os", regionAttributes);
- }
- });
-
- }
- }
-
- public void checkSpecialRegion(VM vm1, final DistributedMember member) throws Exception {
- {
- vm1.invoke(new SerializableRunnable("Check Sub Regions") {
-
- public void run() {
-
- ManagementService service = getManagementService();
-
- try {
- MBeanUtil.getDistributedRegionMbean("/p-os", 1);
- MBeanUtil.getDistributedRegionMbean("/p_os", 1);
-
- } catch (Exception e) {
- InternalDistributedSystem.getLoggerI18n()
- .fine("Undesired Result , DistributedRegionMXBean Should not be null" + e);
- }
-
- }
- });
-
- }
-
+ createMembersAndThenManagers_tmp();
+ createSpecialRegion(this.memberVMs[0]);
+ verifySpecialRegion(this.managerVM);
}
@Test
public void testLruStats() throws Exception {
- initManagement(false);
- for (VM vm : managedNodeList) {
- createDiskRegion(vm);
-
+ createMembersAndThenManagers_tmp();
+ for (VM memberVM : this.memberVMs) {
+ createDiskRegion(memberVM);
}
- checkEntrySize(managingNode, 3);
+ verifyEntrySize(this.managerVM, 3);
}
- public void createDiskRegion(VM vm1) throws Exception {
- {
- vm1.invoke(new SerializableRunnable("Check Sub Regions") {
-
- public void run() {
- AttributesFactory factory = new AttributesFactory();
- factory.setScope(Scope.LOCAL);
- factory.setEvictionAttributes(EvictionAttributes.createLRUMemoryAttributes(20,
- new TestObjectSizerImpl(), EvictionAction.LOCAL_DESTROY));
- /*
- * File d = new File("DiskRegions" + OSProcess.getId()); d.mkdirs();
- *
- * DiskStoreFactory dsf = getCache().createDiskStoreFactory(); dsf.setDiskDirs(new
- * File[]{d}); factory.setDiskSynchronous(true); DiskStore ds = dsf.create(REGION_NAME);
- * factory.setDiskStoreName(ds.getName());
- */
- Region region = getCache().createRegion(REGION_NAME, factory.create());
-
- LRUStatistics lruStats = getLRUStats(region);
-
- assertNotNull(lruStats);
-
- RegionMXBean bean = managementService.getLocalRegionMBean(REGION_PATH);
-
- assertNotNull(bean);
-
- int total;
- for (total = 0; total < 10000; total++) {
- int[] array = new int[250];
- array[0] = total;
- region.put(new Integer(total), array);
- }
- assertTrue(bean.getEntrySize() > 0);
- LogWriterUtils.getLogWriter().info("DEBUG: EntrySize =" + bean.getEntrySize());
-
-
-
- }
- });
+ private void closeRegion(final VM anyVM, final String regionPath) {
+ anyVM.invoke("closeRegion", () -> getCache_tmp().getRegion(regionPath).close());
+ }
- }
+ private void createSpecialRegion(final VM memberVM) throws Exception {
+ memberVM.invoke("createSpecialRegion", () -> {
+ AttributesFactory attributesFactory = new AttributesFactory();
+ attributesFactory.setValueConstraint(Portfolio.class);
+ RegionAttributes regionAttributes = attributesFactory.create();
+ Cache cache = getCache_tmp();
+ cache.createRegion("p-os", regionAttributes);
+ cache.createRegion("p_os", regionAttributes);
+ });
}
- public void checkEntrySize(VM vm1, final int expectedMembers) throws Exception {
- {
- vm1.invoke(new SerializableRunnable("Check Sub Regions") {
-
- public void run() {
+ private void verifySpecialRegion(final VM managerVM) throws Exception {
+ managerVM.invoke("verifySpecialRegion", () -> {
+ awaitDistributedRegionMXBean("/p-os", 1); // TODO: why?
+ awaitDistributedRegionMXBean("/p_os", 1);
+ });
+ }
- DistributedRegionMXBean bean = null;
- try {
- bean = MBeanUtil.getDistributedRegionMbean(REGION_PATH, expectedMembers);
- } catch (Exception e) {
- InternalDistributedSystem.getLoggerI18n()
- .fine("Undesired Result , DistributedRegionMXBean Should not be null" + e);
- }
+ private void createDiskRegion(final VM memberVM) throws Exception {
+ memberVM.invoke("createDiskRegion", () -> {
+ AttributesFactory factory = new AttributesFactory();
+ factory.setScope(Scope.LOCAL);
+ factory.setEvictionAttributes(EvictionAttributes.createLRUMemoryAttributes(20, new TestObjectSizerImpl(), EvictionAction.LOCAL_DESTROY));
- assertNotNull(bean);
+ Region region = getCache_tmp().createRegion(REGION_NAME, factory.create());
- assertTrue(bean.getEntrySize() > 0);
- LogWriterUtils.getLogWriter().info("DEBUG: EntrySize =" + bean.getEntrySize());
- }
- });
+ LRUStatistics lruStats = ((AbstractRegion) region).getEvictionController().getLRUHelper().getStats();
+ assertThat(lruStats).isNotNull();
- }
+ RegionMXBean regionMXBean = getManagementService_tmp().getLocalRegionMBean(REGION_PATH);
+ assertThat(regionMXBean).isNotNull();
+ int total;
+ for (total = 0; total < 10000; total++) { // TODO: why so many?
+ int[] array = new int[250];
+ array[0] = total;
+ region.put(new Integer(total), array);
+ }
+ assertThat(regionMXBean.getEntrySize()).isGreaterThan(0);
+ });
}
- protected LRUStatistics getLRUStats(Region region) {
- final LocalRegion l = (LocalRegion) region;
- return l.getEvictionController().getLRUHelper().getStats();
+ private void verifyEntrySize(final VM managerVM, final int expectedMembers) throws Exception {
+ managerVM.invoke("verifyEntrySize", () -> {
+ DistributedRegionMXBean distributedRegionMXBean = awaitDistributedRegionMXBean(REGION_PATH, expectedMembers);
+ assertThat(distributedRegionMXBean).isNotNull();
+ assertThat(distributedRegionMXBean.getEntrySize()).isGreaterThan(0);
+ });
}
- @SuppressWarnings("serial")
- public void checkSubRegions(VM vm1, final String subRegionPath) throws Exception {
- {
- vm1.invoke(new SerializableRunnable("Check Sub Regions") {
-
- public void run() {
-
- RegionMXBean bean = managementService.getLocalRegionMBean(subRegionPath);
- assertNotNull(bean);
-
- }
- });
-
- }
+ private void verifySubRegions(final VM memberVM, final String subRegionPath) throws Exception {
+ memberVM.invoke("verifySubRegions", () -> {
+ RegionMXBean regionMXBean = getManagementService_tmp().getLocalRegionMBean(subRegionPath);
+ assertThat(regionMXBean).isNotNull();
+ });
}
- @SuppressWarnings("serial")
- public void checkNullRegions(VM vm1, final String subRegionPath) throws Exception {
- {
- vm1.invoke(new SerializableRunnable("Check Sub Regions") {
+ private void verifyNullRegions(final VM memberVM, final String subRegionPath) throws Exception {
+ memberVM.invoke("verifyNullRegions", () -> {
+ RegionMXBean regionMXBean = getManagementService_tmp().getLocalRegionMBean(subRegionPath);
+ assertThat(regionMXBean).isNull();
+ });
+ }
- public void run() {
+ private void verifyNavigationApis(final VM managerVM, final List<String> memberIds) {
+ managerVM.invoke("verifyNavigationApis", () -> {
+ ManagementService service = getManagementService_tmp();
+ assertThat(service.getDistributedSystemMXBean()).isNotNull();
- RegionMXBean bean = managementService.getLocalRegionMBean(subRegionPath);
- assertNull(bean);
+ awaitMemberCount(4);
- }
- });
+ DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
+ assertThat(distributedSystemMXBean.listDistributedRegionObjectNames()).hasSize(2);
- }
- }
+ assertThat(distributedSystemMXBean.fetchDistributedRegionObjectName(PARTITIONED_REGION_PATH)).isNotNull();
+ assertThat(distributedSystemMXBean.fetchDistributedRegionObjectName(REGION_PATH)).isNotNull();
+ ObjectName actualName = distributedSystemMXBean.fetchDistributedRegionObjectName(PARTITIONED_REGION_PATH);
+ ObjectName expectedName = MBeanJMXAdapter.getDistributedRegionMbeanName(PARTITIONED_REGION_PATH);
+ assertThat(actualName).isEqualTo(expectedName);
+ actualName = distributedSystemMXBean.fetchDistributedRegionObjectName(REGION_PATH);
+ expectedName = MBeanJMXAdapter.getDistributedRegionMbeanName(REGION_PATH);
+ assertThat(actualName).isEqualTo(expectedName);
- protected void checkNavigationAPIS(final VM vm, final List<String> managedNodeMemberIds) {
- SerializableRunnable checkNavigationAPIS = new SerializableRunnable("checkNavigationAPIS") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- ManagementService service = getManagementService();
- final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
+ for (String memberId : memberIds) {
+ ObjectName objectName = MBeanJMXAdapter.getMemberMBeanName(memberId);
+ awaitMemberMXBeanProxy(objectName);
- assertNotNull(service.getDistributedSystemMXBean());
+ ObjectName[] objectNames = distributedSystemMXBean.fetchRegionObjectNames(objectName);
+ assertThat(objectNames).isNotNull();
+ assertThat(objectNames).hasSize(2);
- waitForAllMembers(4);
- assertTrue(bean.listDistributedRegionObjectNames().length == 2);
- try {
- assertNotNull(bean.fetchDistributedRegionObjectName(PARTITIONED_REGION_PATH));
- assertNotNull(bean.fetchDistributedRegionObjectName(REGION_PATH));
- ObjectName actualName = bean.fetchDistributedRegionObjectName(PARTITIONED_REGION_PATH);
- ObjectName expectedName =
- MBeanJMXAdapter.getDistributedRegionMbeanName(PARTITIONED_REGION_PATH);
- assertEquals(expectedName, actualName);
+ List<ObjectName> listOfNames = Arrays.asList(objectNames);
- actualName = bean.fetchDistributedRegionObjectName(REGION_PATH);
- expectedName = MBeanJMXAdapter.getDistributedRegionMbeanName(REGION_PATH);
- assertEquals(expectedName, actualName);
+ expectedName = MBeanJMXAdapter.getRegionMBeanName(memberId, PARTITIONED_REGION_PATH);
+ assertThat(listOfNames).contains(expectedName);
- } catch (Exception e) {
- fail("fetchDistributedRegionObjectName () Unsuccessful " + e);
- }
-
- for (String memberId : managedNodeMemberIds) {
- ObjectName memberMBeanName = MBeanJMXAdapter.getMemberMBeanName(memberId);
- ObjectName expectedName;
- try {
- waitForProxy(memberMBeanName, MemberMXBean.class);
-
- ObjectName[] regionMBeanNames = bean.fetchRegionObjectNames(memberMBeanName);
- assertNotNull(regionMBeanNames);
- assertTrue(regionMBeanNames.length == 2);
- List<ObjectName> listOfNames = Arrays.asList(regionMBeanNames);
-
- expectedName = MBeanJMXAdapter.getRegionMBeanName(memberId, PARTITIONED_REGION_PATH);
- listOfNames.contains(expectedName);
- expectedName = MBeanJMXAdapter.getRegionMBeanName(memberId, REGION_PATH);
- listOfNames.contains(expectedName);
- } catch (Exception e) {
- fail("fetchRegionObjectNames () Unsuccessful " + e);
- }
- }
+ expectedName = MBeanJMXAdapter.getRegionMBeanName(memberId, REGION_PATH);
+ assertThat(listOfNames).contains(expectedName);
+ }
- for (String memberId : managedNodeMemberIds) {
- ObjectName expectedName;
- ObjectName actualName;
- ObjectName memberMBeanName = MBeanJMXAdapter.getMemberMBeanName(memberId);
- try {
- waitForProxy(memberMBeanName, MemberMXBean.class);
- expectedName = MBeanJMXAdapter.getRegionMBeanName(memberId, PARTITIONED_REGION_PATH);
- waitForProxy(expectedName, RegionMXBean.class);
- actualName = bean.fetchRegionObjectName(memberId, PARTITIONED_REGION_PATH);
-
- assertEquals(expectedName, actualName);
- expectedName = MBeanJMXAdapter.getRegionMBeanName(memberId, REGION_PATH);
- waitForProxy(expectedName, RegionMXBean.class);
- actualName = bean.fetchRegionObjectName(memberId, REGION_PATH);
-
- assertEquals(expectedName, actualName);
- } catch (Exception e) {
- fail("fetchRegionObjectName () Unsuccessful ");
- }
- }
+ for (String memberId : memberIds) {
+ ObjectName objectName = MBeanJMXAdapter.getMemberMBeanName(memberId);
+ awaitMemberMXBeanProxy(objectName);
- }
- };
- vm.invoke(checkNavigationAPIS);
- }
+ expectedName = MBeanJMXAdapter.getRegionMBeanName(memberId, PARTITIONED_REGION_PATH);
+ awaitRegionMXBeanProxy(expectedName);
+ actualName = distributedSystemMXBean.fetchRegionObjectName(memberId, PARTITIONED_REGION_PATH);
+ assertThat(actualName).isEqualTo(expectedName);
- protected void putBulkData(final VM vm, final int numKeys) {
- SerializableRunnable putBulkData = new SerializableRunnable("putBulkData") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Region region = cache.getRegion(REGION_PATH);
- for (int i = 0; i < numKeys; i++) {
- region.put(i, i * i);
- }
+ expectedName = MBeanJMXAdapter.getRegionMBeanName(memberId, REGION_PATH);
+ awaitRegionMXBeanProxy(expectedName);
+ actualName = distributedSystemMXBean.fetchRegionObjectName(memberId, REGION_PATH);
+ assertThat(actualName).isEqualTo(expectedName);
}
- };
- vm.invoke(putBulkData);
+ });
}
-
-
/**
- * creates a Fixed Partition List to be used for Fixed Partition Region
- *
- * @param primaryIndex index for each fixed partition
+ * Invoked in controller VM
*/
- private static void createFixedPartitionList(int primaryIndex) {
- fpaList.clear();
+ private List<FixedPartitionAttributes> createFixedPartitionList(final int primaryIndex) {
+ List<FixedPartitionAttributes> fixedPartitionAttributesList = new ArrayList<>();
if (primaryIndex == 1) {
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", true, 3));
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", 3));
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", 3));
+ fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q1", true, 3));
+ fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q2", 3));
+ fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q3", 3));
}
if (primaryIndex == 2) {
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", 3));
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", true, 3));
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", 3));
+ fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q1", 3));
+ fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q2", true, 3));
+ fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q3", 3));
}
if (primaryIndex == 3) {
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", 3));
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", 3));
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", true, 3));
+ fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q1", 3));
+ fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q2", 3));
+ fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q3", true, 3));
}
-
+ return fixedPartitionAttributesList;
}
-
-
/**
- * Creates a Fixed Partitioned Region
- *
- * @param fpaList partition list
+ * Invoked in member VMs
*/
- protected static void createFixedPartitionRegion(List<FixedPartitionAttributes> fpaList) {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- SystemManagementService service = (SystemManagementService) getManagementService();
+ private void createFixedPartitionRegion(final List<FixedPartitionAttributes> fixedPartitionAttributesList) {
+ SystemManagementService service = getSystemManagementService_tmp();
- PartitionAttributesFactory paf = new PartitionAttributesFactory();
+ PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
- paf.setRedundantCopies(2).setTotalNumBuckets(12);
- for (FixedPartitionAttributes fpa : fpaList) {
- paf.addFixedPartitionAttributes(fpa);
+ partitionAttributesFactory.setRedundantCopies(2).setTotalNumBuckets(12);
+ for (FixedPartitionAttributes fixedPartitionAttributes : fixedPartitionAttributesList) {
+ partitionAttributesFactory.addFixedPartitionAttributes(fixedPartitionAttributes);
}
- paf.setPartitionResolver(new SingleHopQuarterPartitionResolver());
+ partitionAttributesFactory.setPartitionResolver(new SingleHopQuarterPartitionResolver());
- AttributesFactory attr = new AttributesFactory();
- attr.setPartitionAttributes(paf.create());
- fixedPrRegion = cache.createRegion(FIXED_PR_NAME, attr.create());
- assertNotNull(fixedPrRegion);
- LogWriterUtils.getLogWriter().info("Partitioned Region " + FIXED_PR_NAME
- + " created Successfully :" + fixedPrRegion.toString());
+ AttributesFactory attributesFactory = new AttributesFactory();
+ attributesFactory.setPartitionAttributes(partitionAttributesFactory.create());
- RegionMXBean bean = service.getLocalRegionMBean(FIXED_PR_PATH);
- RegionAttributes regAttrs = fixedPrRegion.getAttributes();
+ fixedPartitionedRegion = getCache_tmp().createRegion(FIXED_PR_NAME, attributesFactory.create());
+ assertThat(fixedPartitionedRegion).isNotNull();
- LogWriterUtils.getLogWriter().info("FixedPartitionAttribute From GemFire :"
- + regAttrs.getPartitionAttributes().getFixedPartitionAttributes());
+ RegionMXBean regionMXBean = service.getLocalRegionMBean(FIXED_PR_PATH);
+ RegionAttributes regionAttributes = fixedPartitionedRegion.getAttributes();
- RegionAttributesData data = bean.listRegionAttributes();
+ PartitionAttributesData partitionAttributesData = regionMXBean.listPartitionAttributes();
+ verifyPartitionData(regionAttributes, partitionAttributesData);
- PartitionAttributesData parData = bean.listPartitionAttributes();
+ FixedPartitionAttributesData[] fixedPartitionAttributesData = regionMXBean.listFixedPartitionAttributes();
+ assertThat(fixedPartitionAttributesData).isNotNull();
+ assertThat(fixedPartitionAttributesData).hasSize(3);
- assertPartitionData(regAttrs, parData);
-
- FixedPartitionAttributesData[] fixedPrData = bean.listFixedPartitionAttributes();
-
- assertNotNull(fixedPrData);
-
- assertEquals(3, fixedPrData.length);
- for (int i = 0; i < fixedPrData.length; i++) {
- LogWriterUtils.getLogWriter()
- .info("<ExpectedString> Fixed PR Data is " + fixedPrData[i] + "</ExpectedString> ");
+ for (int i = 0; i < fixedPartitionAttributesData.length; i++) {
+ //LogWriterUtils.getLogWriter().info("<ExpectedString> Fixed PR Data is " + fixedPartitionAttributesData[i] + "</ExpectedString> ");
}
}
- /**
- * Verifies the Fixed Partition Region for partition related attributes
- *
- * @param vm
- */
- protected void validateRemoteFixedPartitionRegion(final VM vm) throws Exception {
- SerializableRunnable verifyFixedRegion = new SerializableRunnable("Verify Partition region") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Set<DistributedMember> otherMemberSet =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
-
- for (DistributedMember member : otherMemberSet) {
- RegionMXBean bean = null;
- try {
- bean = MBeanUtil.getRegionMbeanProxy(member, FIXED_PR_PATH);
- } catch (Exception e) {
- InternalDistributedSystem.getLoggerI18n()
- .fine("Undesired Result , RegionMBean Should not be null");
- }
- PartitionAttributesData data = bean.listPartitionAttributes();
- assertNotNull(data);
- FixedPartitionAttributesData[] fixedPrData = bean.listFixedPartitionAttributes();
- assertNotNull(fixedPrData);
- assertEquals(3, fixedPrData.length);
- for (int i = 0; i < fixedPrData.length; i++) {
- LogWriterUtils.getLogWriter().info(
- "<ExpectedString> Remote PR Data is " + fixedPrData[i] + "</ExpectedString> ");
- }
- }
-
+// /**
+// * Invoked in manager VM
+// */
+// private void verifyRemoteFixedPartitionRegion(final VM vm) throws Exception {
+// vm.invoke("Verify Partition region", () -> {
+// Set<DistributedMember> otherMemberSet = getDistributionManager_tmp().getOtherNormalDistributionManagerIds();
+//
+// for (DistributedMember member : otherMemberSet) {
+// RegionMXBean regionMXBean = awaitRegionMXBeanProxy(member, FIXED_PR_PATH);
+//
+// PartitionAttributesData partitionAttributesData = regionMXBean.listPartitionAttributes();
+// assertNotNull(partitionAttributesData);
+//
+// FixedPartitionAttributesData[] fixedPartitionAttributesData = regionMXBean.listFixedPartitionAttributes();
+// assertNotNull(fixedPartitionAttributesData);
+// assertEquals(3, fixedPartitionAttributesData.length);
+//
+// for (int i = 0; i < fixedPartitionAttributesData.length; i++) {
+// //LogWriterUtils.getLogWriter().info("<ExpectedString> Remote PR Data is " + fixedPartitionAttributesData[i] + "</ExpectedString> ");
+// }
+// }
+// });
+// }
+
+ private void addMemberNotificationListener(final VM managerVM, final int expectedMembers) {
+ managerVM.invoke("addMemberNotificationListener", () -> {
+ Set<DistributedMember> otherMemberSet = getOtherNormalMembers_tmp();
+ assertThat(otherMemberSet).hasSize(expectedMembers);
+
+ SystemManagementService service = getSystemManagementService_tmp();
+
+ List<Notification> notifications = new ArrayList<>();
+ MEMBER_NOTIFICATIONS_REF.set(notifications);
+
+ for (DistributedMember member : otherMemberSet) {
+ MemberNotificationListener listener = new MemberNotificationListener(notifications);
+ ObjectName objectName = service.getMemberMBeanName(member);
+ awaitMemberMXBeanProxy(objectName);
+
+ ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener, null, null);
}
-
- };
- vm.invoke(verifyFixedRegion);
+ });
}
/**
- * Add a Notification listener to MemberMBean
- *
- * @param vm
+ * Add a Notification listener to DistributedSystemMBean which should gather
+ * all the notifications which are propagated through all individual
+ * MemberMBeans Hence Region created/destroyed should be visible to this
+ * listener
*/
- protected void addMemberListener(final VM vm) {
- SerializableRunnable addMemberListener = new SerializableRunnable("addMemberListener") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-
- SystemManagementService service = (SystemManagementService) getManagementService();
-
- Set<DistributedMember> otherMemberSet =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
-
- for (DistributedMember member : otherMemberSet) {
-
- MBeanServer mbeanServer = MBeanJMXAdapter.mbeanServer;
-
- RegionNotif regionCreate = new RegionNotif();
-
- ObjectName memberMBeanName;
- try {
- memberMBeanName = service.getMemberMBeanName(member);
- Set<ObjectName> names = service.queryMBeanNames(member);
- if (names != null) {
- for (ObjectName name : names) {
- LogWriterUtils.getLogWriter()
- .info("<ExpectedString> ObjectNames arr" + name + "</ExpectedString> ");
- }
- }
- waitForProxy(memberMBeanName, MemberMXBean.class);
- mbeanServer.addNotificationListener(memberMBeanName, regionCreate, null, null);
- } catch (NullPointerException e) {
- Assert.fail("FAILED WITH EXCEPION", e);
- } catch (InstanceNotFoundException e) {
- Assert.fail("FAILED WITH EXCEPION", e);
- } catch (Exception e) {
- Assert.fail("FAILED WITH EXCEPION", e);
- }
-
- }
+ private void addSystemNotificationListener(final VM managerVM) {
+ managerVM.invoke("addSystemNotificationListener", () -> {
+ awaitDistributedSystemMXBean();
- }
- };
- vm.invoke(addMemberListener);
+ List<Notification> notifications = new ArrayList<>();
+ SYSTEM_NOTIFICATIONS_REF.set(notifications);
+ DistributedSystemNotificationListener listener = new DistributedSystemNotificationListener(notifications);
+ ObjectName objectName = MBeanJMXAdapter.getDistributedSystemName();
+ ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener, null, null);
+ });
}
- /**
- * Add a Notification listener to DistributedSystemMBean which should gather all the notifications
- * which are propagated through all individual MemberMBeans Hence Region created/destroyed should
- * be visible to this listener
- *
- * @param vm
- */
- protected void addDistrListener(final VM vm) {
- SerializableRunnable addDistrListener = new SerializableRunnable("addDistrListener") {
- public void run() {
- MBeanServer mbeanServer = MBeanJMXAdapter.mbeanServer;
-
- DistrNotif regionCreate = new DistrNotif();
-
- ObjectName systemMBeanName;
- try {
- systemMBeanName = MBeanJMXAdapter.getDistributedSystemName();
- mbeanServer.addNotificationListener(systemMBeanName, regionCreate, null, null);
-
- } catch (NullPointerException e) {
- Assert.fail("FAILED WITH EXCEPION", e);
- } catch (InstanceNotFoundException e) {
- Assert.fail("FAILED WITH EXCEPION", e);
-
+ private void verifyMemberNotifications(final VM managerVM, final String regionName, final int expectedMembers) {
+ managerVM.invoke("verifyMemberNotifications", () -> {
+ assertThat(MEMBER_NOTIFICATIONS_REF.get()).isNotNull();
+ assertThat(MEMBER_NOTIFICATIONS_REF.get()).hasSize(expectedMembers * 2);
+
+ int regionCreatedCount = 0;
+ int regionDestroyedCount = 0;
+ for (Notification notification : MEMBER_NOTIFICATIONS_REF.get()) {
+ if (JMXNotificationType.REGION_CREATED.equals(notification.getType())) {
+ regionCreatedCount++;
+ assertThat(notification.getMessage()).contains(regionName);
+ } else if (JMXNotificationType.REGION_CLOSED.equals(notification.getType())) {
+ regionDestroyedCount++;
+ assertThat(notification.getMessage()).contains(regionName);
+ } else {
+ fail("Unexpected notification type: " + notification.getType());
}
-
}
- };
- vm.invoke(addDistrListener);
+ assertThat(regionCreatedCount).isEqualTo(expectedMembers);
+ assertThat(regionDestroyedCount).isEqualTo(expectedMembers);
+ });
}
- public void ensureProxyCleanup(final VM vm) {
-
- SerializableRunnable ensureProxyCleanup = new SerializableRunnable("Ensure Proxy cleanup") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Set<DistributedMember> otherMemberSet =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
-
- final SystemManagementService service = (SystemManagementService) getManagementService();
-
- for (final DistributedMember member : otherMemberSet) {
- RegionMXBean bean = null;
- try {
-
- Wait.waitForCriterion(new WaitCriterion() {
-
- RegionMXBean bean = null;
-
- public String description() {
- return "Waiting for the proxy to get deleted at managing node";
- }
-
- public boolean done() {
- ObjectName objectName = service.getRegionMBeanName(member, REGION_PATH);
- bean = service.getMBeanProxy(objectName, RegionMXBean.class);
- boolean done = (bean == null);
- return done;
- }
-
- }, MAX_WAIT, 500, true);
-
- } catch (Exception e) {
- fail("could not remove proxies in required time");
-
- }
- assertNull(bean);
-
+ // <[javax.management.Notification[source=10.118.33.232(17632)<v1>-32770][type=gemfire.distributedsystem.cache.region.created][message=Region Created With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=10.118.33.232(17633)<v2>-32771][type=gemfire.distributedsystem.cache.region.created][message=Region Created With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=10.118.33.232(17634)<v3>-32772][type=gemfire.distributedsystem.cache.region.created][message=Region Created With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=10.118.33.232(17632)<v1>-32770][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=10.118.33.232(17633)<v2>-32771][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=10.118.33.232(17634)<v3>-32772][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION]]>
+
+ private void verifySystemNotifications(final VM managerVM, final String regionName, final int expectedMembers) {
+ managerVM.invoke("verifySystemNotifications", () -> {
+ assertThat(SYSTEM_NOTIFICATIONS_REF.get()).isNotNull();
+ assertThat(SYSTEM_NOTIFICATIONS_REF.get()).hasSize(expectedMembers + 2); // 2 for the manager
+
+
+ int regionCreatedCount = 0;
+ int regionDestroyedCount = 0;
+ for (Notification notification : SYSTEM_NOTIFICATIONS_REF.get()) {
+ if (JMXNotificationType.REGION_CREATED.equals(notification.getType())) {
+ regionCreatedCount++;
+ assertThat(notification.getMessage()).contains(regionName);
+ } else if (JMXNotificationType.REGION_CLOSED.equals(notification.getType())) {
+ regionDestroyedCount++;
+ assertThat(notification.getMessage()).contains(regionName);
+ } else {
+ fail("Unexpected notification type: " + notification.getType());
}
-
}
- };
- vm.invoke(ensureProxyCleanup);
- }
- /**
- * Verifies a Remote Distributed Region
- *
- * @param vm
- */
- protected void verifyRemoteDistributedRegion(final VM vm, final int expectedMembers)
- throws Exception {
- SerializableRunnable verifyRegion = new SerializableRunnable("Verify Distributed region") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Set<DistributedMember> otherMemberSet =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
-
- for (DistributedMember member : otherMemberSet) {
- RegionMXBean bean = null;
- try {
- bean = MBeanUtil.getRegionMbeanProxy(member, REGION_PATH);
- } catch (Exception e) {
- InternalDistributedSystem.getLoggerI18n()
- .fine("Undesired Result , RegionMBean Should not be null" + e);
-
- }
- assertNotNull(bean);
-
- RegionAttributesData data = bean.listRegionAttributes();
- assertNotNull(data);
- MembershipAttributesData membershipData = bean.listMembershipAttributes();
- EvictionAttributesData evictionData = bean.listEvictionAttributes();
- assertNotNull(membershipData);
- assertNotNull(evictionData);
- LogWriterUtils.getLogWriter().info("<ExpectedString> Membership Data is "
- + membershipData.toString() + "</ExpectedString> ");
- LogWriterUtils.getLogWriter().info("<ExpectedString> Eviction Data is "
- + membershipData.toString() + "</ExpectedString> ");
-
- }
- DistributedRegionMXBean bean = null;
- try {
- bean = MBeanUtil.getDistributedRegionMbean(REGION_PATH, expectedMembers);
- } catch (Exception e) {
- InternalDistributedSystem.getLoggerI18n()
- .fine("Undesired Result , DistributedRegionMXBean Should not be null" + e);
- }
+ assertThat(regionCreatedCount).isEqualTo(1); // just the manager
+ assertThat(regionDestroyedCount).isEqualTo(expectedMembers + 1); // all 3 members + manager
+ });
+ }
- assertNotNull(bean);
- assertEquals(REGION_PATH, bean.getFullPath());
+ // <[javax.management.Notification[source=192.168.1.72(18496)<v27>-32770][type=gemfire.distributedsystem.cache.region.created][message=Region Created With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=192.168.1.72(18497)<v28>-32771][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=192.168.1.72(18498)<v29>-32772][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=192.168.1.72(18499)<v30>-32773][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=192.168.1.72(18496)<v27>-32770][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION]]>
+ private void verifyProxyCleanup(final VM managerVM) {
+ managerVM.invoke("verifyProxyCleanup", () -> {
+ SystemManagementService service = getSystemManagementService_tmp();
+ Set<DistributedMember> otherMemberSet = getOtherNormalMembers_tmp();
+ for (final DistributedMember member : otherMemberSet) {
+ String alias = "Waiting for the proxy to get deleted at managing node";
+ await(alias).until(() -> assertThat(service.getMBeanProxy(service.getRegionMBeanName(member, REGION_PATH), RegionMXBean.class)).isNull());
}
- };
- vm.invoke(verifyRegion);
+ });
}
+ private void verifyRemoteDistributedRegion(final VM managerVM, final int expectedMembers) throws Exception {
+ managerVM.invoke("verifyRemoteDistributedRegion", () -> {
+ Set<DistributedMember> otherMemberSet = getOtherNormalMembers_tmp();
+ assertThat(otherMemberSet).hasSize(expectedMembers);
- protected void validateDistributedMBean(final VM vm, final int expectedMembers) {
- SerializableRunnable verifyRegion = new SerializableRunnable("Verify Distributed region") {
- public void run() {
- DistributedRegionMXBean bean = null;
- DistributedSystemMXBean sysMBean = null;
- final ManagementService service = getManagementService();
+ for (DistributedMember member : otherMemberSet) {
+ RegionMXBean regionMXBean = awaitRegionMXBeanProxy(member, REGION_PATH);
- if (expectedMembers == 0) {
- try {
- Wait.waitForCriterion(new WaitCriterion() {
+ RegionAttributesData regionAttributesData = regionMXBean.listRegionAttributes();
+ assertThat(regionAttributesData).isNotNull();
- RegionMXBean bean = null;
+ MembershipAttributesData membershipAttributesData = regionMXBean.listMembershipAttributes();
+ assertThat(membershipAttributesData).isNotNull();
- public String description() {
- return "Waiting for the proxy to get deleted at managing node";
- }
-
- public boolean done() {
- DistributedRegionMXBean bean = service.getDistributedRegionMXBean(REGION_PATH);
- boolean done = (bean == null);
- return done;
- }
-
- }, MAX_WAIT, 500, true);
-
- } catch (Exception e) {
- fail("could not remove Aggregate Bean in required time");
+ EvictionAttributesData evictionAttributesData = regionMXBean.listEvictionAttributes();
+ assertThat(evictionAttributesData).isNotNull();
+ }
- }
- return;
- }
+ DistributedRegionMXBean distributedRegionMXBean = awaitDistributedRegionMXBean(REGION_PATH, expectedMembers);
- try {
- bean = MBeanUtil.getDistributedRegionMbean(REGION_PATH, expectedMembers);
- sysMBean = service.getDistributedSystemMXBean();
- } catch (Exception e) {
- InternalDistributedSystem.getLoggerI18n()
- .fine("Undesired Result , DistributedRegionMXBean Should not be null" + e);
- }
+ assertThat(distributedRegionMXBean).isNotNull();
+ assertThat(distributedRegionMXBean.getFullPath()).isEqualTo(REGION_PATH);
+ });
+ }
- assertNotNull(bean);
- assertEquals(REGION_PATH, bean.getFullPath());
- assertEquals(expectedMembers, bean.getMemberCount());
- assertEquals(expectedMembers, bean.getMembers().length);
+ private void verifyDistributedMBean(final VM managerVM, final int expectedMembers) {
+ managerVM.invoke("verifyDistributedMBean", () -> {
+ if (expectedMembers == 0) {
+ ManagementService service = getManagementService_tmp();
+ String alias = "Waiting for the proxy to get deleted at managing node";
+ await(alias).until(() -> assertThat(service.getDistributedRegionMXBean(REGION_PATH)).isNull());
+ return;
+ }
- // Check Stats related Data
- // Add Mock testing
- LogWriterUtils.getLogWriter().info("<ExpectedString> CacheListenerCallsAvgLatency is "
- + bean.getCacheListenerCallsAvgLatency() + "</ExpectedString> ");
- LogWriterUtils.getLogWriter().info("<ExpectedString> CacheWriterCallsAvgLatency is "
- + bean.getCacheWriterCallsAvgLatency() + "</ExpectedString> ");
- LogWriterUtils.getLogWriter().info(
- "<ExpectedString> CreatesRate is " + bean.getCreatesRate() + "</ExpectedString> ");
+ DistributedRegionMXBean distributedRegionMXBean = awaitDistributedRegionMXBean(REGION_PATH, expectedMembers);
- }
- };
- // Test DistributedRegionMXBean
+ assertThat(distributedRegionMXBean.getFullPath()).isEqualTo(REGION_PATH);
+ assertThat(distributedRegionMXBean.getMemberCount()).isEqualTo(expectedMembers);
+ assertThat(distributedRegionMXBean.getMembers()).hasSize(expectedMembers);
- vm.invoke(verifyRegion);
+ // Check Stats related Data
+ //LogWriterUtils.getLogWriter().info("<ExpectedString> CacheListenerCallsAvgLatency is " + distributedRegionMXBean.getCacheListenerCallsAvgLatency() + "</ExpectedString> ");
+ //LogWriterUtils.getLogWriter().info("<ExpectedString> CacheWriterCallsAvgLatency is " + distributedRegionMXBean.getCacheWriterCallsAvgLatency() + "</ExpectedString> ");
+ //LogWriterUtils.getLogWriter().info("<ExpectedString> CreatesRate is " + distributedRegionMXBean.getCreatesRate() + "</ExpectedString> ");
+ });
}
- /**
- * Verifies a Remote Partition Region
- *
- * @param vm
- */
- protected void validateRemotePartitionRegion(final VM vm) throws Exception {
- SerializableRunnable verifyRegion = new SerializableRunnable("Verify Partition region") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Set<DistributedMember> otherMemberSet =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
-
- for (DistributedMember member : otherMemberSet) {
- RegionMXBean bean = null;
- try {
- bean = MBeanUtil.getRegionMbeanProxy(member, PARTITIONED_REGION_PATH);
- } catch (Exception e) {
- InternalDistributedSystem.getLoggerI18n()
- .fine("Undesired Result , RegionMBean Should not be null");
- }
- PartitionAttributesData data = bean.listPartitionAttributes();
- assertNotNull(data);
- }
-
- ManagementService service = getManagementService();
- DistributedRegionMXBean bean = service.getDistributedRegionMXBean(PARTITIONED_REGION_PATH);
- assertEquals(3, bean.getMembers().length);
+ private void verifyRemotePartitionRegion(final VM managerVM) throws Exception {
+ managerVM.invoke("verifyRemotePartitionRegion", () -> {
+ Set<DistributedMember> otherMemberSet = getOtherNormalMembers_tmp();
+ for (DistributedMember member : otherMemberSet) {
+ RegionMXBean regionMXBean = awaitRegionMXBeanProxy(member, PARTITIONED_REGION_PATH);
+ PartitionAttributesData partitionAttributesData = regionMXBean.listPartitionAttributes();
+ assertThat(partitionAttributesData).isNotNull();
}
- };
- vm.invoke(verifyRegion);
+ ManagementService service = getManagementService_tmp();
+ DistributedRegionMXBean distributedRegionMXBean = service.getDistributedRegionMXBean(PARTITIONED_REGION_PATH);
+ assertThat(distributedRegionMXBean.getMembers()).hasSize(3);
+ });
}
+ private void verifyReplicateRegionAfterCreate(final VM memberVM) {
+ memberVM.invoke("verifyReplicateRegionAfterCreate", () -> {
+ Cache cache = getCache_tmp();
+ String memberId = MBeanJMXAdapter.getMemberNameOrId(cache.getDistributedSystem().getDistributedMember());
+ ObjectName objectName = ObjectName.getInstance("GemFire:type=Member,member=" + memberId);
- /**
- * Creates a Distributed Region
- *
- * @param vm
- */
- protected void validateReplicateRegionAfterCreate(final VM vm) {
- SerializableRunnable checkDistributedRegion =
- new SerializableRunnable("Check Distributed region") {
- public void run() {
-
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- SystemManagementService service = (SystemManagementService) getManagementService();
-
- MBeanServer mbeanServer = MBeanJMXAdapter.mbeanServer;
- RegionNotif test = new RegionNotif();
-
- String memberId = MBeanJMXAdapter
- .getMemberNameOrId(cache.getDistributedSystem().getDistributedMember());
+// List<Notification> notifications = new ArrayList<>();
+// MEMBER_NOTIFICATIONS_REF.set(notifications);
+//
+// MemberNotificationListener listener = new MemberNotificationListener(notifications);
+// ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener, null, null);
- ObjectName memberMBeanName;
- try {
- memberMBeanName = ObjectName.getInstance("GemFire:type=Member,member=" + memberId);
- mbeanServer.addNotificationListener(memberMBeanName, test, null, null);
- } catch (MalformedObjectNameException e) {
+ SystemManagementService service = getSystemManagementService_tmp();
+ RegionMXBean regionMXBean = service.getLocalRegionMBean(REGION_PATH);
+ assertThat(regionMXBean).isNotNull();
- Assert.fail("FAILED WITH EXCEPION", e);
- } catch (NullPointerException e) {
- Assert.fail("FAILED WITH EXCEPION", e);
+ Region region = cache.getRegion(REGION_PATH);
+ RegionAttributes regionAttributes = region.getAttributes();
- } catch (InstanceNotFoundException e) {
- Assert.fail("FAILED WITH EXCEPION", e);
+ RegionAttributesData regionAttributesData = regionMXBean.listRegionAttributes();
+ verifyRegionAttributes(regionAttributes, regionAttributesData);
- }
+ MembershipAttributesData membershipData = regionMXBean.listMembershipAttributes();
+ assertThat(membershipData).isNotNull();
- assertNotNull(service.getLocalRegionMBean(REGION_PATH));
-
- RegionMXBean bean = service.getLocalRegionMBean(REGION_PATH);
- Region region = cache.getRegion(REGION_PATH);
+ EvictionAttributesData evictionData = regionMXBean.listEvictionAttributes();
+ assertThat(evictionData).isNotNull();
+ });
+ }
- RegionAttributes regAttrs = region.getAttributes();
+ private void verifyPartitionRegionAfterCreate(final VM memberVM) {
+ memberVM.invoke("verifyPartitionRegionAfterCreate", () -> {
+ Region region = getCache_tmp().getRegion(PARTITIONED_REGION_PATH);
- RegionAttributesData data = bean.listRegionAttributes();
+ SystemManagementService service = getSystemManagementService_tmp();
+ RegionMXBean regionMXBean = service.getLocalRegionMBean(PARTITIONED_REGION_PATH);
- assertRegionAttributes(regAttrs, data);
- MembershipAttributesData membershipData = bean.listMembershipAttributes();
- EvictionAttributesData evictionData = bean.listEvictionAttributes();
- assertNotNull(membershipData);
- assertNotNull(evictionData);
- LogWriterUtils.getLogWriter().info("<ExpectedString> Membership Data is "
- + membershipData.toString() + "</ExpectedString> ");
- LogWriterUtils.getLogWriter().info("<ExpectedString> Eviction Data is "
- + membershipData.toString() + "</ExpectedString> ");
- }
- };
- vm.invoke(checkDistributedRegion);
+ verifyPartitionData(region.getAttributes(), regionMXBean.listPartitionAttributes());
+ });
}
- /**
- * Creates a partition Region
- *
- * @param vm
- */
- protected void validatePartitionRegionAfterCreate(final VM vm) {
- SerializableRunnable createParRegion = new SerializableRunnable("Create Partitioned region") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- SystemManagementService service = (SystemManagementService) getManagementService();
- assertNotNull(service.getLocalRegionMBean(PARTITIONED_REGION_PATH));
- RegionMXBean bean = service.getLocalRegionMBean(PARTITIONED_REGION_PATH);
- Region partitionedRegion = cache.getRegion(PARTITIONED_REGION_PATH);
- RegionAttributes regAttrs = partitionedRegion.getAttributes();
- RegionAttributesData data = bean.listRegionAttributes();
- PartitionAttributesData parData = bean.listPartitionAttributes();
- assertPartitionData(regAttrs, parData);
+ private void verifyReplicatedRegionAfterClose(final VM memberVM) {
+ memberVM.invoke("verifyReplicatedRegionAfterClose", () -> {
+ SystemManagementService service = getSystemManagementService_tmp();
+ RegionMXBean regionMXBean = service.getLocalRegionMBean(REGION_PATH);
+ assertThat(regionMXBean).isNull();
- }
- };
- vm.invoke(createParRegion);
+ ObjectName objectName = service.getRegionMBeanName(getCache_tmp().getDistributedSystem().getDistributedMember(), REGION_PATH);
+ assertThat(service.getLocalManager().getManagementResourceRepo().getEntryFromLocalMonitoringRegion(objectName)).isNull();
+ });
}
- /**
- * closes a Distributed Region
- *
- * @param vm
- */
- protected void validateReplicatedRegionAfterClose(final VM vm) {
- SerializableRunnable closeRegion = new SerializableRunnable("Close Distributed region") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- SystemManagementService service = (SystemManagementService) getManagementService();
- RegionMXBean bean = null;
- try {
- bean = service.getLocalRegionMBean(REGION_PATH);
- } catch (ManagementException mgtEx) {
- LogWriterUtils.getLogWriter().info("<ExpectedString> Expected Exception "
- + mgtEx.getLocalizedMessage() + "</ExpectedString> ");
- }
- assertNull(bean);
- ObjectName regionObjectName = service
- .getRegionMBeanName(cache.getDistributedSystem().getDistributedMember(), REGION_PATH);
- assertNull(service.getLocalManager().getManagementResourceRepo()
- .getEntryFromLocalMonitoringRegion(regionObjectName));
- }
- };
- vm.invoke(closeRegion);
+ private void verifyPartitionRegionAfterClose(final VM memberVM) {
+ memberVM.invoke("verifyPartitionRegionAfterClose", () -> {
+ ManagementService service = getManagementService_tmp();
+ RegionMXBean regionMXBean = service.getLocalRegionMBean(PARTITIONED_REGION_PATH);
+ assertThat(regionMXBean).isNull();
+ });
}
/**
- * close a partition Region
- *
- * @param vm
+ * Invoked in member VMs
*/
- protected void validatePartitionRegionAfterClose(final VM vm) {
- SerializableRunnable closeParRegion = new SerializableRunnable("Close Partition region") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- ManagementService service = getManagementService();
- LogWriterUtils.getLogWriter().info("Closing Par Region");
- RegionMXBean bean = null;
- try {
- bean = service.getLocalRegionMBean(PARTITIONED_REGION_PATH);
- } catch (ManagementException mgtEx) {
- LogWriterUtils.getLogWriter().info("<ExpectedString> Expected Exception "
- + mgtEx.getLocalizedMessage() + "</ExpectedString> ");
- }
- assertNull(bean);
- }
- };
- vm.invoke(closeParRegion);
- }
+ private void verifyPartitionData(final RegionAttributes expectedRegionAttributes, final PartitionAttributesData partitionAttributesData) {
+ PartitionAttributes expectedPartitionAttributes = expectedRegionAttributes.getPartitionAttributes();
- /**
- * Closes Fixed Partition region
- *
- * @param vm
- */
- protected void closeFixedPartitionRegion(final VM vm) {
- SerializableRunnable closeParRegion = new SerializableRunnable("Close Fixed Partition region") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- ManagementService service = getManagementService();
- LogWriterUtils.getLogWriter().info("Closing Fixed Par Region");
- Region region = cache.getRegion(FIXED_PR_PATH);
- region.close();
- RegionMXBean bean = null;
- try {
- bean = service.getLocalRegionMBean(FIXED_PR_PATH);
- } catch (ManagementException mgtEx) {
- LogWriterUtils.getLogWriter().info("<ExpectedString> Expected Exception "
- + mgtEx.getLocalizedMessage() + "</ExpectedString> ");
- }
- assertNull(bean);
- }
- };
- vm.invoke(closeParRegion);
- }
+ assertThat(partitionAttributesData.getRedundantCopies()).isEqualTo(expectedPartitionAttributes.getRedundantCopies());
- /**
- * Asserts and verifies all the partition related data
- *
- * @param regAttrs
- * @param partitionAttributesData
- */
+ assertThat(partitionAttributesData.getTotalMaxMemory()).isEqualTo(expectedPartitionAttributes.getTotalMaxMemory());
- protected static void assertPartitionData(RegionAttributes regAttrs,
- PartitionAttributesData partitionAttributesData) {
- PartitionAttributesData data = partitionAttributesData;
-
- PartitionAttributes partAttrs = regAttrs.getPartitionAttributes();
-
- int redundantCopies = partAttrs.getRedundantCopies();
- assertEquals(redundantCopies, data.getRedundantCopies());
- long totalMaxMemory = partAttrs.getTotalMaxMemory();
- assertEquals(totalMaxMemory, data.getTotalMaxMemory());
// Total number of buckets for whole region
- int totalNumBuckets = partAttrs.getTotalNumBuckets();
- assertEquals(totalNumBuckets, data.getTotalNumBuckets());
+ assertThat(partitionAttributesData.getTotalNumBuckets()).isEqualTo(expectedPartitionAttributes.getTotalNumBuckets());
- int localMaxMemory = partAttrs.getLocalMaxMemory();
- assertEquals(localMaxMemory, data.getLocalMaxMemory());
+ assertThat(partitionAttributesData.getLocalMaxMemory()).isEqualTo(expectedPartitionAttributes.getLocalMaxMemory());
- String colocatedWith = partAttrs.getColocatedWith();
- assertEquals(colocatedWith, data.getColocatedWith());
+ assertThat(partitionAttributesData.getColocatedWith()).isEqualTo(expectedPartitionAttributes.getColocatedWith());
String partitionResolver = null;
- if (partAttrs.getPartitionResolver() != null) {
- partitionResolver = partAttrs.getPartitionResolver().getName();
+ if (expectedPartitionAttributes.getPartitionResolver() != null) { // TODO: these conditionals should be deterministic
+ partitionResolver = expectedPartitionAttributes.getPartitionResolver().getName();
}
+ assertThat(partitionAttributesData.getPartitionResolver()).isEqualTo(partitionResolver);
- assertEquals(partitionResolver, data.getPartitionResolver());
+ assertThat(partitionAttributesData.getRecoveryDelay()).isEqualTo(expectedPartitionAttributes.getRecoveryDelay());
- long recoveryDelay = partAttrs.getRecoveryDelay();
- assertEquals(recoveryDelay, data.getRecoveryDelay());
+ assertThat(partitionAttributesData.getStartupRecoveryDelay()).isEqualTo(expectedPartitionAttributes.getStartupRecoveryDelay());
- long startupRecoveryDelay = partAttrs.getStartupRecoveryDelay();
- assertEquals(startupRecoveryDelay, data.getStartupRecoveryDelay());
+ if (expectedPartitionAttributes.getPartitionListeners() != null) {
+ for (int i = 0; i < expectedPartitionAttributes.getPartitionListeners().length; i++) {
+ //assertEquals((expectedPartitionAttributes.getPartitionListeners())[i].getClass().getCanonicalName(), partitionAttributesData.getPartitionListeners()[i]);
+ assertThat(partitionAttributesData.getPartitionListeners()[i])
+ .isEqualTo(expectedPartitionAttributes.getPartitionListeners()[i].getClass().getCanonicalName());
- if (partAttrs.getPartitionListeners() != null) {
- for (int i = 0; i < partAttrs.getPartitionListeners().length; i++) {
- assertEquals((partAttrs.getPartitionListeners())[i].getClass().getCanonicalName(),
- data.getPartitionListeners()[i]);
}
-
}
-
}
/**
- * Checks all Region Attributes
- *
- * @param regAttrs
- * @param data
+ * Invoked in member VMs
*/
- protected static void assertRegionAttributes(RegionAttributes regAttrs,
- RegionAttributesData data) {
-
+ private void verifyRegionAttributes(final RegionAttributes regionAttributes, final RegionAttributesData regionAttributesData) {
String compressorClassName = null;
- if (regAttrs.getCompressor() != null) {
- compressorClassName = regAttrs.getCompressor().getClass().getCanonicalName();
+ if (regionAttributes.getCompressor() != null) { // TODO: these conditionals should be deterministic
+ compressorClassName = regionAttributes.getCompressor().getClass().getCanonicalName();
}
- assertEquals(compressorClassName, data.getCompressorClassName());
+ assertThat(regionAttributesData.getCompressorClassName()).isEqualTo(compressorClassName);
+
String cacheLoaderClassName = null;
- if (regAttrs.getCacheLoader() != null) {
- cacheLoaderClassName = regAttrs.getCacheLoader().getClass().getCanonicalName();
+ if (regionAttributes.getCacheLoader() != null) {
+ cacheLoaderClassName = regionAttributes.getCacheLoader().getClass().getCanonicalName();
}
- assertEquals(cacheLoaderClassName, data.getCacheLoaderClassName());
+ assertThat(regionAttributesData.getCacheLoaderClassName()).isEqualTo(cacheLoaderClassName);
+
String cacheWriteClassName = null;
- if (regAttrs.getCacheWriter() != null) {
- cacheWriteClassName = regAttrs.getCacheWriter().getClass().getCanonicalName();
+ if (regionAttributes.getCacheWriter() != null) {
+ cacheWriteClassName = regionAttributes.getCacheWriter().getClass().getCanonicalName();
}
- assertEquals(cacheWriteClassName, data.getCacheWriterClassName());
+ assertThat(regionAttributesData.getCacheWriterClassName()).isEqualTo(cacheWriteClassName);
+
String keyConstraintClassName = null;
- if (regAttrs.getKeyConstraint() != null) {
- keyConstraintClassName = regAttrs.getKeyConstraint().getName();
+ if (regionAttributes.getKeyConstraint() != null) {
+ keyConstraintClassName = regionAttributes.getKeyConstraint().getName();
}
- assertEquals(keyConstraintClassName, data.getKeyConstraintClassName());
+ assertThat(regionAttributesData.getKeyConstraintClassName()).isEqualTo(keyConstraintClassName);
+
String valueContstaintClassName = null;
- if (regAttrs.getValueConstraint() != null) {
- valueContstaintClassName = regAttrs.getValueConstraint().getName();
+ if (regionAttributes.getValueConstraint() != null) {
+ valueContstaintClassName = regionAttributes.getValueConstraint().getName();
}
- assertEquals(valueContstaintClassName, data.getValueConstraintClassName());
- CacheListener[] listeners = regAttrs.getCacheListeners();
-
+ assertThat(regionAttributesData.getValueConstraintClassName()).isEqualTo(valueContstaintClassName);
+ CacheListener[] listeners = regionAttributes.getCacheListeners();
if (listeners != null) {
- String[] value = data.getCacheListeners();
+ String[] value = regionAttributesData.getCacheListeners();
for (int i = 0; i < listeners.length; i++) {
- assertEquals(value[i], listeners[i].getClass().getName());
+ assertThat(listeners[i].getClass().getName()).isEqualTo(value[i]);
}
-
}
+ assertThat(regionAttributesData.getRegionTimeToLive()).isEqualTo(regionAttributes.getRegionTimeToLive().getTimeout());
+ assertThat(regionAttributesData.getRegionIdleTimeout()).isEqualTo(regionAttributes.getRegionIdleTimeout().getTimeout());
- int regionTimeToLive = regAttrs.getRegionTimeToLive().getTimeout();
-
- assertEquals(regionTimeToLive, data.getRegionTimeToLive());
-
- int regionIdleTimeout = regAttrs.getRegionIdleTimeout().getTimeout();
-
- assertEquals(regionIdleTimeout, data.getRegionIdleTimeout());
+ assertThat(regionAttributesData.getEntryTimeToLive()).isEqualTo(regionAttributes.getEntryTimeToLive().getTimeout());
- int entryTimeToLive = regAttrs.getEntryTimeToLive().getTimeout();
+ assertThat(regionAttributesData.getEntryIdleTimeout()).isEqualTo(regionAttributes.getEntryIdleTimeout().getTimeout());
- assertEquals(entryTimeToLive, data.getEntryTimeToLive());
-
- int entryIdleTimeout = regAttrs.getEntryIdleTimeout().getTimeout();
-
- assertEquals(entryIdleTimeout, data.getEntryIdleTimeout());
String customEntryTimeToLive = null;
- Object o1 = regAttrs.getCustomEntryTimeToLive();
+ Object o1 = regionAttributes.getCustomEntryTimeToLive();
if (o1 != null) {
customEntryTimeToLive = o1.toString();
}
- assertEquals(customEntryTimeToLive, data.getCustomEntryTimeToLive());
+ assertThat(regionAttributesData.getCustomEntryTimeToLive()).isEqualTo(customEntryTimeToLive);
String customEntryIdleTimeout = null;
- Object o2 = regAttrs.getCustomEntryIdleTimeout();
+ Object o2 = regionAttributes.getCustomEntryIdleTimeout();
if (o2 != null) {
customEntryIdleTimeout = o2.toString();
}
- assertEquals(customEntryIdleTimeout, data.getCustomEntryIdleTimeout());
+ assertThat(regionAttributesData.getCustomEntryIdleTimeout()).isEqualTo(customEntryIdleTimeout);
- boolean ignoreJTA = regAttrs.getIgnoreJTA();
- assertEquals(ignoreJTA, data.isIgnoreJTA());
+ assertThat(regionAttributesData.isIgnoreJTA()).isEqualTo(regionAttributes.getIgnoreJTA());
- String dataPolicy = regAttrs.getDataPolicy().toString();
- assertEquals(dataPolicy, data.getDataPolicy());
+ assertThat(regionAttributesData.getDataPolicy()).isEqualTo(regionAttributes.getDataPolicy().toString());
- String scope = regAttrs.getScope().toString();
- assertEquals(scope, data.getScope());
+ assertThat(regionAttributesData.getScope()).isEqualTo(regionAttributes.getScope().toString());
- int initialCapacity = regAttrs.getInitialCapacity();
- assertEquals(initialCapacity, data.getInitialCapacity());
- float loadFactor = regAttrs.getLoadFactor();
- assertEquals(loadFactor, data.getLoadFactor(), 0);
+ assertThat(regionAttributesData.getInitialCapacity()).isEqualTo(regionAttributes.getInitialCapacity());
- boolean lockGrantor = regAttrs.isLockGrantor();
- assertEquals(lockGrantor, data.isLockGrantor());
+ assertThat(regionAttributesData.getLoadFactor()).isEqualTo(regionAttributes.getLoadFactor());
- boolean multicastEnabled = regAttrs.getMulticastEnabled();
- assertEquals(multicastEnabled, data.isMulticastEnabled());
+ assertThat(regionAttributesData.isLockGrantor()).isEqualTo(regionAttributes.isLockGrantor());
- int concurrencyLevel = regAttrs.getConcurrencyLevel();
- assertEquals(concurrencyLevel, data.getConcurrencyLevel());
+ assertThat(regionAttributesData.isMulticastEnabled()).isEqualTo(regionAttributes.getMulticastEnabled());
- boolean indexMaintenanceSynchronous = regAttrs.getIndexMaintenanceSynchronous();
- assertEquals(indexMaintenanceSynchronous, data.isIndexMaintenanceSynchronous());
+ assertThat(regionAttributesData.getConcurrencyLevel()).isEqualTo(regionAttributes.getConcurrencyLevel());
- boolean statisticsEnabled = regAttrs.getStatisticsEnabled();
+ assertThat(regionAttributesData.isIndexMaintenanceSynchronous()).isEqualTo(regionAttributes.getIndexMaintenanceSynchronous());
- assertEquals(statisticsEnabled, data.isStatisticsEnabled());
+ assertThat(regionAttributesData.isStatisticsEnabled()).isEqualTo(regionAttributes.getStatisticsEnabled());
- boolean subsciptionConflationEnabled = regAttrs.getEnableSubscriptionConflation();
- assertEquals(subsciptionConflationEnabled, data.isSubscriptionConflationEnabled());
+ assertThat(regionAttributesData.isSubscriptionConflationEnabled()).isEqualTo(regionAttributes.getEnableSubscriptionConflation());
- boolean asyncConflationEnabled = regAttrs.getEnableAsyncConflation();
- assertEquals(asyncConflationEnabled, data.isAsyncConflationEnabled());
+ assertThat(regionAttributesData.isAsyncConflationEnabled()).isEqualTo(regionAttributes.getEnableAsyncConflation());
- String poolName = regAttrs.getPoolName();
- assertEquals(poolName, data.getPoolName());
+ assertThat(regionAttributesData.getPoolName()).isEqualTo(regionAttributes.getPoolName());
- boolean isCloningEnabled = regAttrs.getCloningEnabled();
- assertEquals(isCloningEnabled, data.isCloningEnabled());
+ assertThat(regionAttributesData.isCloningEnabled()).isEqualTo(regionAttributes.getCloningEnabled());
- String diskStoreName = regAttrs.getDiskStoreName();
- assertEquals(diskStoreName, data.getDiskStoreName());
+ assertThat(regionAttributesData.getDiskStoreName()).isEqualTo(regionAttributes.getDiskStoreName());
String interestPolicy = null;
- if (regAttrs.getSubscriptionAttributes() != null) {
- interestPolicy = regAttrs.getSubscriptionAttributes().getInterestPolicy().toString();
+ if (regionAttributes.getSubscriptionAttributes() != null) {
+ interestPolicy = regionAttributes.getSubscriptionAttributes().getInterestPolicy().toString();
}
- assertEquals(interestPolicy, data.getInterestPolicy());
- boolean diskSynchronus = regAttrs.isDiskSynchronous();
- assertEquals(diskSynchronus, data.isDiskSynchronous());
+ assertThat(regionAttributesData.getInterestPolicy()).isEqualTo(interestPolicy);
+
+ assertThat(regionAttributesData.isDiskSynchronous()).isEqualTo(regionAttributes.isDiskSynchronous());
}
- /**
- * Verifies Region related Statistics
- */
- public void verifyStatistics() {
+ private void verifyRemoteFixedPartitionRegion(final VM managerVM) throws Exception {
+ managerVM.invoke("Verify Partition region", () -> {
+ Set<DistributedMember> otherMemberSet = getOtherNormalMembers_tmp();
+
+ for (DistributedMember member : otherMemberSet) {
+ RegionMXBean bean = awaitRegionMXBeanProxy(member, FIXED_PR_PATH);
+
+ PartitionAttributesData data = bean.listPartitionAttributes();
+ assertThat(data).isNotNull();
+
+ FixedPartitionAttributesData[] fixedPrData = bean.listFixedPartitionAttributes();
+ assertThat(fixedPrData).isNotNull();
+ assertThat(fixedPrData).hasSize(3);
+
+ for (int i = 0; i < fixedPrData.length; i++) {
+ //LogWriterUtils.getLogWriter().info("<ExpectedString> Remote PR Data is " + fixedPrData[i] + "</ExpectedString> ");
+ }
+ }
+ });
+ }
+
+ private void createDistributedRegion_tmp(final VM vm, final String regionName) {
+ vm.invoke(() -> createDistributedRegion_tmp(regionName));
+ }
+ private void createDistributedRegion_tmp(final String regionName) {
+ getCache_tmp().createRegionFactory(RegionShortcut.REPLICATE).create(regionName);
}
+ private void createPartitionRegion_tmp(final VM vm, final String partitionRegionName) {
+ vm.invoke("Create Partitioned region", () -> {
+ SystemManagementService service = getSystemManagementService_tmp();
+ RegionFactory regionFactory = getCache_tmp().createRegionFactory(RegionShortcut.PARTITION_REDUNDANT);
+ regionFactory.create(partitionRegionName);
+ });
+ }
+
+ private void createLocalRegion_tmp(final VM vm, final String localRegionName) {
+ vm.invoke("Create Local region", () -> {
+ SystemManagementService service = getSystemManagementService_tmp();
+ RegionFactory regionFactory = getCache_tmp().createRegionFactory(RegionShortcut.LOCAL);
+ regionFactory.create(localRegionName);
+ });
+ }
+
+ private void createSubRegion_tmp(final VM vm, final String parentRegionPath, final String subregionName) {
+ vm.invoke("Create Sub region", () -> {
+ SystemManagementService service = getSystemManagementService_tmp();
+ Region region = getCache_tmp().getRegion(parentRegionPath);
+ region.createSubregion(subregionName, region.getAttributes());
+ });
+ }
+
+ private String getDistributedMemberId_tmp(final VM vm) {
+ return vm.invoke("getMemberId", () -> getCache_tmp().getDistributedSystem().getDistributedMember().getId());
+ }
+
+ private DistributedMember getDistributedMember_tmp(final VM anyVM) {
+ return anyVM.invoke("getDistributedMember_tmp", () -> getCache_tmp().getDistributedSystem().getDistributedMember());
+ }
+
+ private SystemManagementService getSystemManagementService_tmp() {
+ return (SystemManagementService) getManagementService_tmp();
+ }
+
+ private DM getDistributionManager_tmp() {
+ return ((GemFireCacheImpl)getCache_tmp()).getDistributionManager();
+ }
+
+ private DistributedMember getDistributedMember_tmp() {
+ return getCache_tmp().getDistributedSystem().getDistributedMember();
+ }
+
+ private Set<DistributedMember> getOtherNormalMembers_tmp() {
+ Set<DistributedMember> allMembers = new HashSet<>(getDistributionManager_tmp().getNormalDistributionManagerIds());
+ allMembers.remove(getDistributedMember_tmp());
+ return allMembers;
+ }
+
+ private void awaitMemberCount(final int expectedCount) {
+ DistributedSystemMXBean distributedSystemMXBean = awaitDistributedSystemMXBean();
+ await().until(() -> assertThat(distributedSystemMXBean.getMemberCount()).isEqualTo(expectedCount));
+ }
+
+ private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name) {
+ SystemManagementService service = getSystemManagementService_tmp();
+
+ await().until(() -> assertThat(service.getDistributedRegionMXBean(name)).isNotNull());
+
+ return service.getDistributedRegionMXBean(name);
+ }
+
+ private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name, final int memberCount) {
+ SystemManagementService service = getSystemManagementService_tmp();
+
+ await().until(() -> assertThat(service.getDistributedRegionMXBean(name)).isNotNull());
+ await().until(() -> assertThat(service.getDistributedRegionMXBean(name).getMemberCount()).isEqualTo(memberCount));
+
+ return service.getDistributedRegionMXBean(name);
+ }
+
+ private RegionMXBean awaitRegionMXBeanProxy(final DistributedMember member, final String name) {
+ SystemManagementService service = getSystemManagementService_tmp();
+ ObjectName objectName = service.getRegionMBeanName(member, name);
+ String alias = "awaiting RegionMXBean proxy for " + member;
+
+ await(alias).until(() -> assertThat(service.getMBeanProxy(objectName, RegionMXBean.class)).isNotNull());
+
+ return service.getMBeanProxy(objectName, RegionMXBean.class);
+ }
+
+ private RegionMXBean awaitRegionMXBeanProxy(final ObjectName objectName) {
+ SystemManagementService service = getSystemManagementService_tmp();
+
+ await().until(() -> assertThat(service.getMBeanProxy(objectName, RegionMXBean.class)).isNotNull());
+
+ return service.getMBeanProxy(objectName, RegionMXBean.class);
+ }
+
+ private MemberMXBean awaitMemberMXBeanProxy(final DistributedMember member) {
+ SystemManagementService service = getSystemManagementService_tmp();
+ ObjectName objectName = service.getMemberMBeanName(member);
+ String alias = "awaiting MemberMXBean proxy for " + member;
+
+ await(alias).until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
+
+ return service.getMBeanProxy(objectName, MemberMXBean.class);
+ }
+
+ private MemberMXBean awaitMemberMXBeanProxy(final ObjectName objectName) {
+ SystemManagementService service = getSystemManagementService_tmp();
+ await().until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
+ return service.getMBeanProxy(objectName, MemberMXBean.class);
+ }
+
+ private DistributedSystemMXBean awaitDistributedSystemMXBean() {
+ ManagementService service = getSystemManagementService_tmp();
+
+ await().until(() -> assertThat(service.getDistributedSystemMXBean()).isNotNull());
+
+ return service.getDistributedSystemMXBean();
+ }
+
+ private ConditionFactor
<TRUNCATED>
[25/50] [abbrv] incubator-geode git commit: Addressing Review
comments.
Posted by kl...@apache.org.
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: adongre <av...@ampool.io>
Authored: Sun Nov 6 17:27:55 2016 +0530
Committer: Anthony Baker <ab...@apache.org>
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<PartitionResolver> resolverClass = (Class<PartitionResolver>) 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 = forName(regionCreateArgs.getPartitionResolver(),
- CliStrings.CREATE_REGION__PARTITION_RESOLVER);
+ Class<PartitionResolver> partitionResolverClass = forName(
+ regionCreateArgs.getPartitionResolver(), CliStrings.CREATE_REGION__PARTITION_RESOLVER);
prAttrFactory
.setPartitionResolver((PartitionResolver<K, V>) newInstance(partitionResolverClass,
CliStrings.CREATE_REGION__PARTITION_RESOLVER));
@@ -419,12 +419,14 @@ public class RegionCreateFunction extends FunctionAdapter implements InternalEnt
}
- private static Class<?> forName(String className, String neededFor) {
- if (Strings.isNullOrEmpty(className)) {
- return null;
+ private static Class<PartitionResolver> forName(String className, String neededFor) {
+ if (StringUtils.isBlank(className)) {
+ throw new IllegalArgumentException(
+ CliStrings.format(CliStrings.CREATE_REGION__MSG__INVALID_PARTITION_RESOLVER,
+ new Object[] {className, neededFor}));
}
try {
- return ClassPathLoader.getLatest().forName(className);
+ return (Class<PartitionResolver>) ClassPathLoader.getLatest().forName(className);
} catch (ClassNotFoundException e) {
throw new RuntimeException(CliStrings.format(
CliStrings.CREATE_REGION_PARTITION_RESOLVER__MSG__COULDNOT_FIND_CLASS_0_SPECIFIED_FOR_1,
@@ -436,7 +438,7 @@ public class RegionCreateFunction extends FunctionAdapter implements InternalEnt
}
}
- private static Object newInstance(Class<?> klass, String neededFor) {
+ private static PartitionResolver newInstance(Class<PartitionResolver> klass, String neededFor) {
try {
return klass.newInstance();
} catch (InstantiationException e) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e9c57169/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommandsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommandsDUnitTest.java
index 4896ead..7a75cfa 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommandsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommandsDUnitTest.java
@@ -1112,13 +1112,14 @@ public class CreateAlterDestroyRegionCommandsDUnitTest extends CliCommandTestBas
ClassBuilder classBuilder = new ClassBuilder();
// classBuilder.addToClassPath(".");
- final File prJarFile = new File(new File(".").getAbsolutePath(), "myPartitionResolver.jar");
+ final File prJarFile = new File(temporaryFolder.getRoot().getCanonicalPath() + File.separator,
+ "myPartitionResolver.jar");
this.filesToBeDeleted.add(prJarFile.getAbsolutePath());
byte[] jarBytes =
classBuilder.createJarFromClassContent("com/cadrdunit/TestPartitionResolver", PR_STRING);
writeJarBytesToFile(prJarFile, jarBytes);
- CommandResult cmdResult = executeCommand("deploy --jar=myPartitionResolver.jar");
+ CommandResult cmdResult = executeCommand("deploy --jar=" + prJarFile.getAbsolutePath());
assertEquals(Result.Status.OK, cmdResult.getStatus());
@@ -1194,7 +1195,6 @@ public class CreateAlterDestroyRegionCommandsDUnitTest extends CliCommandTestBas
commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGIONSHORTCUT, "REPLICATE");
commandStringBuilder.addOption(CliStrings.CREATE_REGION__PARTITION_RESOLVER, "a.b.c.d");
CommandResult cmdResult = executeCommand(commandStringBuilder.toString());
- System.out.println("Result --> " + cmdResult);
assertEquals(Result.Status.ERROR, cmdResult.getStatus());
// Assert that our region was not created
[38/50] [abbrv] incubator-geode git commit: Fix formatting
Posted by kl...@apache.org.
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 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.tests;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
index 5c0bbdb..11f572b 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
@@ -83,7 +83,8 @@ public class DUnitLauncher {
private static final int LOCATOR_VM_NUM = -2;
static final long STARTUP_TIMEOUT = 120 * 1000;
- private static final String STARTUP_TIMEOUT_MESSAGE = "VMs did not start up within " + (STARTUP_TIMEOUT/1000) + " seconds";
+ private static final String STARTUP_TIMEOUT_MESSAGE =
+ "VMs did not start up within " + (STARTUP_TIMEOUT / 1000) + " seconds";
private static final String SUSPECT_FILENAME = "dunit_suspect.log";
private static File DUNIT_SUSPECT_FILE;
@@ -201,8 +202,8 @@ public class DUnitLauncher {
// Create a VM for the locator
processManager.launchVM(LOCATOR_VM_NUM);
- //wait for the VM to start up
- if(!processManager.waitForVMs(STARTUP_TIMEOUT)) {
+ // wait for the VM to start up
+ if (!processManager.waitForVMs(STARTUP_TIMEOUT)) {
throw new RuntimeException("VMs did not start up within 30 seconds");
}
@@ -216,8 +217,8 @@ public class DUnitLauncher {
processManager.launchVM(i);
}
- //wait for the VMS to start up
- if(!processManager.waitForVMs(STARTUP_TIMEOUT)) {
+ // wait for the VMS to start up
+ if (!processManager.waitForVMs(STARTUP_TIMEOUT)) {
throw new RuntimeException("VMs did not start up within 30 seconds");
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-junit/src/main/java/org/apache/geode/test/junit/rules/UseJacksonForJsonPathRule.java
----------------------------------------------------------------------
diff --git a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/UseJacksonForJsonPathRule.java b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/UseJacksonForJsonPathRule.java
index 03d5a60..c7c326a 100644
--- a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/UseJacksonForJsonPathRule.java
+++ b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/UseJacksonForJsonPathRule.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.junit.rules;
@@ -32,7 +30,9 @@ import org.apache.geode.test.junit.rules.serializable.SerializableExternalResour
/**
* JUnit Rule that configures json-path to use the {@code JacksonJsonProvider}
*
- * <p>UseJacksonForJsonPathRule can be used in tests that need to use json-path-assert:
+ * <p>
+ * UseJacksonForJsonPathRule can be used in tests that need to use json-path-assert:
+ *
* <pre>
* {@literal @}ClassRule
* public static UseJacksonForJsonPathRule useJacksonForJsonPathRule = new UseJacksonForJsonPathRule();
@@ -45,7 +45,7 @@ import org.apache.geode.test.junit.rules.serializable.SerializableExternalResour
* }
* </pre>
*/
-@SuppressWarnings({ "serial", "unused" })
+@SuppressWarnings({"serial", "unused"})
public class UseJacksonForJsonPathRule extends SerializableExternalResource {
private boolean hadDefaults;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableExternalResource.java
----------------------------------------------------------------------
diff --git a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableExternalResource.java b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableExternalResource.java
index 75f4575..be561df 100755
--- a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableExternalResource.java
+++ b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableExternalResource.java
@@ -23,7 +23,8 @@ import org.junit.runners.model.Statement;
/**
* Serializable subclass of {@link org.junit.rules.ExternalResource ExternalResource}.
*/
-public abstract class SerializableExternalResource extends ExternalResource implements SerializableTestRule {
+public abstract class SerializableExternalResource extends ExternalResource
+ implements SerializableTestRule {
public Statement apply(Statement base, Description description) {
return statement(base);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableStatement.java
----------------------------------------------------------------------
diff --git a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableStatement.java b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableStatement.java
index 3f07421..9251e83 100644
--- a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableStatement.java
+++ b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/serializable/SerializableStatement.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.junit.rules.serializable;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java
index 27582a7..478fe67 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java
@@ -148,7 +148,8 @@ public class LuceneManagementDUnitTest extends ManagementTestBase {
}
private LuceneServiceMXBean getMBean() {
- ObjectName objectName = MBeanJMXAdapter.getCacheServiceMBeanName(getSystem().getDistributedMember(), "LuceneService");
+ ObjectName objectName = MBeanJMXAdapter
+ .getCacheServiceMBeanName(getSystem().getDistributedMember(), "LuceneService");
assertNotNull(getManagementService().getMBeanInstance(objectName, LuceneServiceMXBean.class));
return getManagementService().getMBeanInstance(objectName, LuceneServiceMXBean.class);
}
@@ -179,12 +180,13 @@ public class LuceneManagementDUnitTest extends ManagementTestBase {
private void createIndexes(String regionName, int numIndexes) {
LuceneService luceneService = LuceneServiceProvider.get(getCache());
- for (int i=0; i<numIndexes; i++) {
- luceneService.createIndex(INDEX_NAME+"_"+i, regionName, "field"+i);
+ for (int i = 0; i < numIndexes; i++) {
+ luceneService.createIndex(INDEX_NAME + "_" + i, regionName, "field" + i);
}
}
- private void verifyAllMBeanIndexMetrics(String regionName, int numRegionIndexes, int numTotalIndexes) {
+ private void verifyAllMBeanIndexMetrics(String regionName, int numRegionIndexes,
+ int numTotalIndexes) {
LuceneServiceMXBean mbean = getMBean();
verifyMBeanIndexMetrics(mbean, regionName, numRegionIndexes, numTotalIndexes);
}
@@ -209,7 +211,7 @@ public class LuceneManagementDUnitTest extends ManagementTestBase {
}
private void putEntries(String regionName, int numEntries) {
- for (int i=0; i<numEntries; i++) {
+ for (int i = 0; i < numEntries; i++) {
Region region = getCache().getRegion(regionName);
String key = String.valueOf(i);
Object value = new TestObject(key);
@@ -219,7 +221,8 @@ public class LuceneManagementDUnitTest extends ManagementTestBase {
private void queryEntries(String regionName, String indexName) throws LuceneQueryException {
LuceneService service = LuceneServiceProvider.get(getCache());
- LuceneQuery query = service.createLuceneQueryFactory().create(indexName, regionName, "field0:0", null);
+ LuceneQuery query =
+ service.createLuceneQueryFactory().create(indexName, regionName, "field0:0", null);
query.findValues();
}
[13/50] [abbrv] incubator-geode git commit: GEODE-1785: add script to
generate region entry source
Posted by kl...@apache.org.
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 Schneider <ds...@pivotal.io>
Authored: Wed Nov 9 14:34:33 2016 -0800
Committer: Darrel Schneider <ds...@pivotal.io>
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 | 2 +-
.../VMThinDiskRegionEntryOffHeapLongKey.java | 2 +-
.../VMThinDiskRegionEntryOffHeapObjectKey.java | 2 +-
.../VMThinDiskRegionEntryOffHeapStringKey1.java | 2 +-
.../VMThinDiskRegionEntryOffHeapStringKey2.java | 2 +-
.../VMThinDiskRegionEntryOffHeapUUIDKey.java | 2 +-
.../cache/VMThinLRURegionEntryHeapIntKey.java | 2 +-
.../cache/VMThinLRURegionEntryHeapLongKey.java | 2 +-
.../VMThinLRURegionEntryHeapObjectKey.java | 2 +-
.../VMThinLRURegionEntryHeapStringKey1.java | 2 +-
.../VMThinLRURegionEntryHeapStringKey2.java | 2 +-
.../cache/VMThinLRURegionEntryHeapUUIDKey.java | 2 +-
.../VMThinLRURegionEntryOffHeapIntKey.java | 2 +-
.../VMThinLRURegionEntryOffHeapLongKey.java | 2 +-
.../VMThinLRURegionEntryOffHeapObjectKey.java | 2 +-
.../VMThinLRURegionEntryOffHeapStringKey1.java | 2 +-
.../VMThinLRURegionEntryOffHeapStringKey2.java | 2 +-
.../VMThinLRURegionEntryOffHeapUUIDKey.java | 2 +-
.../cache/VMThinRegionEntryHeapIntKey.java | 2 +-
.../cache/VMThinRegionEntryHeapLongKey.java | 2 +-
.../cache/VMThinRegionEntryHeapObjectKey.java | 2 +-
.../cache/VMThinRegionEntryHeapStringKey1.java | 2 +-
.../cache/VMThinRegionEntryHeapStringKey2.java | 2 +-
.../cache/VMThinRegionEntryHeapUUIDKey.java | 2 +-
.../cache/VMThinRegionEntryOffHeapIntKey.java | 2 +-
.../cache/VMThinRegionEntryOffHeapLongKey.java | 2 +-
.../VMThinRegionEntryOffHeapObjectKey.java | 2 +-
.../VMThinRegionEntryOffHeapStringKey1.java | 2 +-
.../VMThinRegionEntryOffHeapStringKey2.java | 2 +-
.../cache/VMThinRegionEntryOffHeapUUIDKey.java | 2 +-
...sionedStatsDiskLRURegionEntryHeapIntKey.java | 2 +-
...ionedStatsDiskLRURegionEntryHeapLongKey.java | 2 +-
...nedStatsDiskLRURegionEntryHeapObjectKey.java | 2 +-
...edStatsDiskLRURegionEntryHeapStringKey1.java | 2 +-
...edStatsDiskLRURegionEntryHeapStringKey2.java | 2 +-
...ionedStatsDiskLRURegionEntryHeapUUIDKey.java | 2 +-
...nedStatsDiskLRURegionEntryOffHeapIntKey.java | 2 +-
...edStatsDiskLRURegionEntryOffHeapLongKey.java | 2 +-
...StatsDiskLRURegionEntryOffHeapObjectKey.java | 2 +-
...tatsDiskLRURegionEntryOffHeapStringKey1.java | 2 +-
...tatsDiskLRURegionEntryOffHeapStringKey2.java | 2 +-
...edStatsDiskLRURegionEntryOffHeapUUIDKey.java | 2 +-
...VersionedStatsDiskRegionEntryHeapIntKey.java | 2 +-
...ersionedStatsDiskRegionEntryHeapLongKey.java | 2 +-
...sionedStatsDiskRegionEntryHeapObjectKey.java | 2 +-
...ionedStatsDiskRegionEntryHeapStringKey1.java | 2 +-
...ionedStatsDiskRegionEntryHeapStringKey2.java | 2 +-
...ersionedStatsDiskRegionEntryHeapUUIDKey.java | 2 +-
...sionedStatsDiskRegionEntryOffHeapIntKey.java | 2 +-
...ionedStatsDiskRegionEntryOffHeapLongKey.java | 2 +-
...nedStatsDiskRegionEntryOffHeapObjectKey.java | 2 +-
...edStatsDiskRegionEntryOffHeapStringKey1.java | 2 +-
...edStatsDiskRegionEntryOffHeapStringKey2.java | 2 +-
...ionedStatsDiskRegionEntryOffHeapUUIDKey.java | 2 +-
.../VersionedStatsLRURegionEntryHeapIntKey.java | 2 +-
...VersionedStatsLRURegionEntryHeapLongKey.java | 2 +-
...rsionedStatsLRURegionEntryHeapObjectKey.java | 2 +-
...sionedStatsLRURegionEntryHeapStringKey1.java | 2 +-
...sionedStatsLRURegionEntryHeapStringKey2.java | 2 +-
...VersionedStatsLRURegionEntryHeapUUIDKey.java | 2 +-
...rsionedStatsLRURegionEntryOffHeapIntKey.java | 2 +-
...sionedStatsLRURegionEntryOffHeapLongKey.java | 2 +-
...onedStatsLRURegionEntryOffHeapObjectKey.java | 2 +-
...nedStatsLRURegionEntryOffHeapStringKey1.java | 2 +-
...nedStatsLRURegionEntryOffHeapStringKey2.java | 2 +-
...sionedStatsLRURegionEntryOffHeapUUIDKey.java | 2 +-
.../VersionedStatsRegionEntryHeapIntKey.java | 2 +-
.../VersionedStatsRegionEntryHeapLongKey.java | 2 +-
.../VersionedStatsRegionEntryHeapObjectKey.java | 2 +-
...VersionedStatsRegionEntryHeapStringKey1.java | 2 +-
...VersionedStatsRegionEntryHeapStringKey2.java | 2 +-
.../VersionedStatsRegionEntryHeapUUIDKey.java | 2 +-
.../VersionedStatsRegionEntryOffHeapIntKey.java | 2 +-
...VersionedStatsRegionEntryOffHeapLongKey.java | 2 +-
...rsionedStatsRegionEntryOffHeapObjectKey.java | 2 +-
...sionedStatsRegionEntryOffHeapStringKey1.java | 2 +-
...sionedStatsRegionEntryOffHeapStringKey2.java | 2 +-
...VersionedStatsRegionEntryOffHeapUUIDKey.java | 2 +-
...rsionedThinDiskLRURegionEntryHeapIntKey.java | 2 +-
...sionedThinDiskLRURegionEntryHeapLongKey.java | 2 +-
...onedThinDiskLRURegionEntryHeapObjectKey.java | 2 +-
...nedThinDiskLRURegionEntryHeapStringKey1.java | 2 +-
...nedThinDiskLRURegionEntryHeapStringKey2.java | 2 +-
...sionedThinDiskLRURegionEntryHeapUUIDKey.java | 2 +-
...onedThinDiskLRURegionEntryOffHeapIntKey.java | 2 +-
...nedThinDiskLRURegionEntryOffHeapLongKey.java | 2 +-
...dThinDiskLRURegionEntryOffHeapObjectKey.java | 2 +-
...ThinDiskLRURegionEntryOffHeapStringKey1.java | 2 +-
...ThinDiskLRURegionEntryOffHeapStringKey2.java | 2 +-
...nedThinDiskLRURegionEntryOffHeapUUIDKey.java | 2 +-
.../VersionedThinDiskRegionEntryHeapIntKey.java | 2 +-
...VersionedThinDiskRegionEntryHeapLongKey.java | 2 +-
...rsionedThinDiskRegionEntryHeapObjectKey.java | 2 +-
...sionedThinDiskRegionEntryHeapStringKey1.java | 2 +-
...sionedThinDiskRegionEntryHeapStringKey2.java | 2 +-
...VersionedThinDiskRegionEntryHeapUUIDKey.java | 2 +-
...rsionedThinDiskRegionEntryOffHeapIntKey.java | 2 +-
...sionedThinDiskRegionEntryOffHeapLongKey.java | 2 +-
...onedThinDiskRegionEntryOffHeapObjectKey.java | 2 +-
...nedThinDiskRegionEntryOffHeapStringKey1.java | 2 +-
...nedThinDiskRegionEntryOffHeapStringKey2.java | 2 +-
...sionedThinDiskRegionEntryOffHeapUUIDKey.java | 2 +-
.../VersionedThinLRURegionEntryHeapIntKey.java | 2 +-
.../VersionedThinLRURegionEntryHeapLongKey.java | 2 +-
...ersionedThinLRURegionEntryHeapObjectKey.java | 2 +-
...rsionedThinLRURegionEntryHeapStringKey1.java | 2 +-
...rsionedThinLRURegionEntryHeapStringKey2.java | 2 +-
.../VersionedThinLRURegionEntryHeapUUIDKey.java | 2 +-
...ersionedThinLRURegionEntryOffHeapIntKey.java | 2 +-
...rsionedThinLRURegionEntryOffHeapLongKey.java | 2 +-
...ionedThinLRURegionEntryOffHeapObjectKey.java | 2 +-
...onedThinLRURegionEntryOffHeapStringKey1.java | 2 +-
...onedThinLRURegionEntryOffHeapStringKey2.java | 2 +-
...rsionedThinLRURegionEntryOffHeapUUIDKey.java | 2 +-
.../VersionedThinRegionEntryHeapIntKey.java | 2 +-
.../VersionedThinRegionEntryHeapLongKey.java | 2 +-
.../VersionedThinRegionEntryHeapObjectKey.java | 2 +-
.../VersionedThinRegionEntryHeapStringKey1.java | 2 +-
.../VersionedThinRegionEntryHeapStringKey2.java | 2 +-
.../VersionedThinRegionEntryHeapUUIDKey.java | 2 +-
.../VersionedThinRegionEntryOffHeapIntKey.java | 2 +-
.../VersionedThinRegionEntryOffHeapLongKey.java | 2 +-
...ersionedThinRegionEntryOffHeapObjectKey.java | 2 +-
...rsionedThinRegionEntryOffHeapStringKey1.java | 2 +-
...rsionedThinRegionEntryOffHeapStringKey2.java | 2 +-
.../VersionedThinRegionEntryOffHeapUUIDKey.java | 2 +-
194 files changed, 1122 insertions(+), 192 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/dev-tools/generateRegionEntryClasses.sh
----------------------------------------------------------------------
diff --git a/dev-tools/generateRegionEntryClasses.sh b/dev-tools/generateRegionEntryClasses.sh
new file mode 100755
index 0000000..23a8a02
--- /dev/null
+++ b/dev-tools/generateRegionEntryClasses.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+# 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.
+#
+# This script should only be run from the top level build directory
+# (the one that contains the "dev-tools" subdirectory).
+# It reads LeafRegionEntry.cpp, preprocesses it and generates all the leaf
+# class source files that subclass AbstractRegionEntry.
+# It executes cpp. It has been tested with gnu's cpp on linux.
+# After using it to generate new java files, make sure and
+# run './gradlew spotlessApply' to format these generated files.
+# Then use 'git diff' to validate the changes you made to the
+# generated java files before committing them.
+
+SRCDIR=geode-core/src/main/java/org/apache/geode/internal/cache
+SRCFILE=$SRCDIR/LeafRegionEntry.cpp
+
+for VERTYPE in VM Versioned
+do
+ for RETYPE in Thin Stats ThinLRU StatsLRU ThinDisk StatsDisk ThinDiskLRU StatsDiskLRU
+ do
+ for KEY_INFO in 'ObjectKey KEY_OBJECT' 'IntKey KEY_INT' 'LongKey KEY_LONG' 'UUIDKey KEY_UUID' 'StringKey1 KEY_STRING1' 'StringKey2 KEY_STRING2'
+ do
+ for MEMTYPE in Heap OffHeap
+ do
+ declare -a KEY_ARRAY=($KEY_INFO)
+ KEY_CLASS=${KEY_ARRAY[0]}
+ KEY_TYPE=${KEY_ARRAY[1]}
+ BASE=${VERTYPE}${RETYPE}RegionEntry${MEMTYPE}
+ OUT=${BASE}${KEY_CLASS}
+ WP_ARGS=-Wp,-C,-P,-D${KEY_TYPE},-DPARENT_CLASS=$BASE,-DLEAF_CLASS=$OUT
+ if [ "$VERTYPE" = "Versioned" ]; then
+ WP_ARGS=${WP_ARGS},-DVERSIONED
+ fi
+ if [[ "$RETYPE" = *Stats* ]]; then
+ WP_ARGS=${WP_ARGS},-DSTATS
+ fi
+ if [[ "$RETYPE" = *Disk* ]]; then
+ WP_ARGS=${WP_ARGS},-DDISK
+ fi
+ if [[ "$RETYPE" = *LRU* ]]; then
+ WP_ARGS=${WP_ARGS},-DLRU
+ fi
+ if [[ "$MEMTYPE" = "OffHeap" ]]; then
+ WP_ARGS=${WP_ARGS},-DOFFHEAP
+ fi
+ echo generating $SRCDIR/$OUT.java
+ cpp -E $WP_ARGS $SRCFILE >$SRCDIR/$OUT.java
+ #echo VERTYPE=$VERTYPE RETYPE=$RETYPE $KEY_INFO KEY_CLASS=$KEY_CLASS KEY_TYPE=$KEY_TYPE args=$WP_ARGS
+ done
+ done
+ done
+done
+echo now run \'./gradlew spotlessApply\' to format the generated files
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/LeafRegionEntry.cpp
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LeafRegionEntry.cpp b/geode-core/src/main/java/org/apache/geode/internal/cache/LeafRegionEntry.cpp
new file mode 100644
index 0000000..b8122c3
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LeafRegionEntry.cpp
@@ -0,0 +1,866 @@
+/*
+ * 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.cache;
+
+// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+#if defined(KEY_OBJECT)
+#define KEY_TYPE Object
+#elif defined(KEY_INT)
+#define KEY_TYPE int
+#elif defined(KEY_LONG)
+#define KEY_TYPE long
+#elif defined(KEY_UUID)
+#define KEY_TYPE UUID
+#elif defined(KEY_STRING1) || defined(KEY_STRING2)
+#define KEY_TYPE String
+#else
+#error the KEY_TYPE macro must be defined
+#endif
+
+#ifdef KEY_UUID
+import java.util.UUID;
+#endif
+#if defined(STATS) || defined(LRU)
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
+#endif
+import java.util.concurrent.atomic.AtomicLongFieldUpdater;
+#if defined(VERSIONED)
+import org.apache.geode.cache.EntryEvent;
+#endif
+#if defined(DISK) || defined(LRU)
+import org.apache.geode.internal.cache.lru.EnableLRU;
+#endif
+#ifdef DISK
+import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
+#endif
+#ifdef STATS
+import org.apache.geode.internal.InternalStatisticsDisabledException;
+#endif
+#ifdef LRU
+import org.apache.geode.internal.cache.lru.LRUClockNode;
+import org.apache.geode.internal.cache.lru.NewLRUClockHand;
+#endif
+#ifdef VERSIONED
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.cache.versions.VersionSource;
+import org.apache.geode.internal.cache.versions.VersionStamp;
+import org.apache.geode.internal.cache.versions.VersionTag;
+#endif
+#ifdef OFFHEAP
+import org.apache.geode.internal.offheap.OffHeapRegionEntryHelper;
+import org.apache.geode.internal.offheap.annotations.Released;
+import org.apache.geode.internal.offheap.annotations.Retained;
+import org.apache.geode.internal.offheap.annotations.Unretained;
+#endif
+import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
+
+// macros whose definition changes this class:
+// disk: DISK
+// lru: LRU
+// stats: STATS
+// versioned: VERSIONED
+// offheap: OFFHEAP
+// One of the following key macros must be defined:
+// key object: KEY_OBJECT
+// key int: KEY_INT
+// key long: KEY_LONG
+// key uuid: KEY_UUID
+// key string1: KEY_STRING1
+// key string2: KEY_STRING2
+
+/**
+ * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run
+ * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
+ */
+public class LEAF_CLASS extends PARENT_CLASS {
+ public LEAF_CLASS (RegionEntryContext context, KEY_TYPE key,
+#ifdef OFFHEAP
+ @Retained
+#endif
+ Object value
+#if defined(KEY_STRING1) || defined(KEY_STRING2)
+ , boolean byteEncode
+#endif
+ ) {
+ super(context,
+#ifdef DISK
+ (value instanceof RecoveredEntry ? null : value)
+#else
+ value
+#endif
+ );
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+#ifdef DISK
+ initialize(context, value);
+#endif
+#if defined(KEY_OBJECT)
+ this.key = key;
+#elif defined(KEY_INT)
+ this.key = key;
+#elif defined(KEY_LONG)
+ this.key = key;
+#elif defined(KEY_UUID)
+ this.keyMostSigBits = key.getMostSignificantBits();
+ this.keyLeastSigBits = key.getLeastSignificantBits();
+#elif defined(KEY_STRING1)
+ // caller has already confirmed that key.length <= MAX_INLINE_STRING_KEY
+ long tmpBits1 = 0L;
+ if (byteEncode) {
+ for (int i=key.length()-1; i >= 0; i--) {
+ // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to keep findbugs happy.
+ tmpBits1 |= (byte)key.charAt(i) & 0xff;
+ tmpBits1 <<= 8;
+ }
+ tmpBits1 |= 1<<6;
+ } else {
+ for (int i=key.length()-1; i >= 0; i--) {
+ tmpBits1 |= key.charAt(i);
+ tmpBits1 <<= 16;
+ }
+ }
+ tmpBits1 |= key.length();
+ this.bits1 = tmpBits1;
+#elif defined(KEY_STRING2)
+ // caller has already confirmed that key.length <= MAX_INLINE_STRING_KEY
+ long tmpBits1 = 0L;
+ long tmpBits2 = 0L;
+ if (byteEncode) {
+ for (int i=key.length()-1; i >= 0; i--) {
+ // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to keep findbugs happy.
+ if (i < 7) {
+ tmpBits1 |= (byte)key.charAt(i) & 0xff;
+ tmpBits1 <<= 8;
+ } else {
+ tmpBits2 <<= 8;
+ tmpBits2 |= (byte)key.charAt(i) & 0xff;
+ }
+ }
+ tmpBits1 |= 1<<6;
+ } else {
+ for (int i=key.length()-1; i >= 0; i--) {
+ if (i < 3) {
+ tmpBits1 |= key.charAt(i);
+ tmpBits1 <<= 16;
+ } else {
+ tmpBits2 <<= 16;
+ tmpBits2 |= key.charAt(i);
+ }
+ }
+ }
+ tmpBits1 |= key.length();
+ this.bits1 = tmpBits1;
+ this.bits2 = tmpBits2;
+#endif
+ }
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ // common code
+ protected int hash;
+ private HashEntry<Object, Object> next;
+ @SuppressWarnings("unused")
+ private volatile long lastModified;
+ private static final AtomicLongFieldUpdater<LEAF_CLASS> lastModifiedUpdater
+ = AtomicLongFieldUpdater.newUpdater(LEAF_CLASS.class, "lastModified");
+#ifdef OFFHEAP
+ /**
+ * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is.
+ */
+ @SuppressWarnings("unused")
+ @Retained @Released private volatile long ohAddress;
+ /**
+ * I needed to add this because I wanted clear to call setValue which normally can only be called while the re is synced.
+ * But if I sync in that code it causes a lock ordering deadlock with the disk regions because they also get a rw lock in clear.
+ * Some hardware platforms do not support CAS on a long. If gemfire is run on one of those the AtomicLongFieldUpdater does a sync
+ * on the re and we will once again be deadlocked.
+ * I don't know if we support any of the hardware platforms that do not have a 64bit CAS. If we do then we can expect deadlocks
+ * on disk regions.
+ */
+ private final static AtomicLongFieldUpdater<LEAF_CLASS> ohAddrUpdater = AtomicLongFieldUpdater.newUpdater(LEAF_CLASS.class, "ohAddress");
+
+ @Override
+ public Token getValueAsToken() {
+ return OffHeapRegionEntryHelper.getValueAsToken(this);
+ }
+
+ @Override
+ protected Object getValueField() {
+ return OffHeapRegionEntryHelper._getValue(this);
+ }
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+ @Override
+#ifdef OFFHEAP
+ @Unretained
+ protected void setValueField(@Unretained Object v) {
+#else
+ protected void setValueField(Object v) {
+#endif
+ OffHeapRegionEntryHelper.setValue(this, v);
+ }
+ @Override
+#ifdef OFFHEAP
+ @Retained
+#endif
+ public Object _getValueRetain(RegionEntryContext context, boolean decompress) {
+ return OffHeapRegionEntryHelper._getValueRetain(this, decompress, context);
+ }
+
+ @Override
+ public long getAddress() {
+ return ohAddrUpdater.get(this);
+ }
+
+ @Override
+ public boolean setAddress(long expectedAddr, long newAddr) {
+ return ohAddrUpdater.compareAndSet(this, expectedAddr, newAddr);
+ }
+
+ @Override
+#ifdef OFFHEAP
+ @Released
+#endif
+ public void release() {
+ OffHeapRegionEntryHelper.releaseEntry(this);
+ }
+
+ @Override
+ public void returnToPool() {
+ // Deadcoded for now; never was working
+// if (this instanceof VMThinRegionEntryLongKey) {
+// factory.returnToPool((VMThinRegionEntryLongKey)this);
+// }
+ }
+#else
+ private volatile Object value;
+ @Override
+ protected final Object getValueField() {
+ return this.value;
+ }
+ @Override
+ protected void setValueField(Object v) {
+ this.value = v;
+ }
+#endif
+ protected long getlastModifiedField() {
+ return lastModifiedUpdater.get(this);
+ }
+ protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
+ return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
+ }
+ /**
+ * @see HashEntry#getEntryHash()
+ */
+ public final int getEntryHash() {
+ return this.hash;
+ }
+ protected void setEntryHash(int v) {
+ this.hash = v;
+ }
+ /**
+ * @see HashEntry#getNextEntry()
+ */
+ public final HashEntry<Object, Object> getNextEntry() {
+ return this.next;
+ }
+ /**
+ * @see HashEntry#setNextEntry
+ */
+ public final void setNextEntry(final HashEntry<Object, Object> n) {
+ this.next = n;
+ }
+#ifdef DISK
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ // disk code
+#ifdef LRU
+ protected void initialize(RegionEntryContext drs, Object value) {
+ boolean isBackup;
+ if (drs instanceof LocalRegion) {
+ isBackup = ((LocalRegion)drs).getDiskRegion().isBackup();
+ } else if (drs instanceof PlaceHolderDiskRegion) {
+ isBackup = true;
+ } else {
+ throw new IllegalArgumentException("expected a LocalRegion or PlaceHolderDiskRegion");
+ }
+ // Delay the initialization of DiskID if overflow only
+ if (isBackup) {
+ diskInitialize(drs, value);
+ }
+ }
+ @Override
+ public final synchronized int updateAsyncEntrySize(EnableLRU capacityController) {
+ int oldSize = getEntrySize();
+ int newSize = capacityController.entrySize( getKeyForSizing(), null);
+ setEntrySize(newSize);
+ int delta = newSize - oldSize;
+ return delta;
+ }
+#else
+ protected void initialize(RegionEntryContext context, Object value) {
+ diskInitialize(context, value);
+ }
+ @Override
+ public int updateAsyncEntrySize(EnableLRU capacityController) {
+ throw new IllegalStateException("should never be called");
+ }
+#endif
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ private void diskInitialize(RegionEntryContext context, Object value) {
+ DiskRecoveryStore drs = (DiskRecoveryStore)context;
+ DiskStoreImpl ds = drs.getDiskStore();
+ long maxOplogSize = ds.getMaxOplogSize();
+ //get appropriate instance of DiskId implementation based on maxOplogSize
+ this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
+ Helper.initialize(this, drs, value);
+ }
+
+ /**
+ * DiskId
+ *
+ * @since GemFire 5.1
+ */
+ protected DiskId id;//= new DiskId();
+ public DiskId getDiskId() {
+ return this.id;
+ }
+ @Override
+ void setDiskId(RegionEntry old) {
+ this.id = ((AbstractDiskRegionEntry)old).getDiskId();
+ }
+// // inlining DiskId
+// // always have these fields
+// /**
+// * id consists of
+// * most significant
+// * 1 byte = users bits
+// * 2-8 bytes = oplog id
+// * least significant.
+// *
+// * The highest bit in the oplog id part is set to 1 if the oplog id
+// * is negative.
+// * @todo this field could be an int for an overflow only region
+// */
+// private long id;
+// /**
+// * Length of the bytes on disk.
+// * This is always set. If the value is invalid then it will be set to 0.
+// * The most significant bit is used by overflow to mark it as needing to be written.
+// */
+// protected int valueLength = 0;
+// // have intOffset or longOffset
+// // intOffset
+// /**
+// * The position in the oplog (the oplog offset) where this entry's value is
+// * stored
+// */
+// private volatile int offsetInOplog;
+// // longOffset
+// /**
+// * The position in the oplog (the oplog offset) where this entry's value is
+// * stored
+// */
+// private volatile long offsetInOplog;
+// // have overflowOnly or persistence
+// // overflowOnly
+// // no fields
+// // persistent
+// /** unique entry identifier * */
+// private long keyId;
+#endif
+
+#ifdef LRU
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ // lru code
+ @Override
+ public void setDelayedDiskId(LocalRegion r) {
+#ifdef DISK
+ DiskStoreImpl ds = r.getDiskStore();
+ long maxOplogSize = ds.getMaxOplogSize();
+ this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList());
+#else
+ // nothing needed for LRUs with no disk
+#endif
+ }
+ public final synchronized int updateEntrySize(EnableLRU capacityController) {
+ return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing refcount because we are synced and only getting the size
+ }
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ public final synchronized int updateEntrySize(EnableLRU capacityController,
+ Object value) {
+ int oldSize = getEntrySize();
+ int newSize = capacityController.entrySize( getKeyForSizing(), value);
+ setEntrySize(newSize);
+ int delta = newSize - oldSize;
+ // if ( debug ) log( "updateEntrySize key=" + getKey()
+ // + (_getValue() == Token.INVALID ? " invalid" :
+ // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" :
+ // (_getValue()==null ? " evicted" : " valid")))
+ // + " oldSize=" + oldSize
+ // + " newSize=" + this.size );
+ return delta;
+ }
+ public final boolean testRecentlyUsed() {
+ return areAnyBitsSet(RECENTLY_USED);
+ }
+ @Override
+ public final void setRecentlyUsed() {
+ setBits(RECENTLY_USED);
+ }
+ public final void unsetRecentlyUsed() {
+ clearBits(~RECENTLY_USED);
+ }
+ public final boolean testEvicted() {
+ return areAnyBitsSet(EVICTED);
+ }
+ public final void setEvicted() {
+ setBits(EVICTED);
+ }
+ public final void unsetEvicted() {
+ clearBits(~EVICTED);
+ }
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ private LRUClockNode nextLRU;
+ private LRUClockNode prevLRU;
+ private int size;
+ public final void setNextLRUNode( LRUClockNode next ) {
+ this.nextLRU = next;
+ }
+ public final LRUClockNode nextLRUNode() {
+ return this.nextLRU;
+ }
+ public final void setPrevLRUNode( LRUClockNode prev ) {
+ this.prevLRU = prev;
+ }
+ public final LRUClockNode prevLRUNode() {
+ return this.prevLRU;
+ }
+ public final int getEntrySize() {
+ return this.size;
+ }
+ protected final void setEntrySize(int size) {
+ this.size = size;
+ }
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+//@Override
+//public StringBuilder appendFieldsToString(final StringBuilder sb) {
+// StringBuilder result = super.appendFieldsToString(sb);
+// result.append("; prev=").append(this.prevLRU==null?"null":"not null");
+// result.append("; next=").append(this.nextLRU==null?"null":"not null");
+// return result;
+//}
+
+ @Override
+ public Object getKeyForSizing() {
+#ifdef KEY_OBJECT
+ // default implementation.
+ return getKey();
+#else
+ // inline keys always report null for sizing since the size comes from the entry size
+ return null;
+#endif
+ }
+#endif
+
+#ifdef STATS
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ // stats code
+ @Override
+ public final void updateStatsForGet(boolean hit, long time)
+ {
+ setLastAccessed(time);
+ if (hit) {
+ incrementHitCount();
+ } else {
+ incrementMissCount();
+ }
+ }
+ @Override
+ protected final void setLastModified(long lastModified) {
+ _setLastModified(lastModified);
+ if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
+ setLastAccessed(lastModified);
+ }
+ }
+ private volatile long lastAccessed;
+ private volatile int hitCount;
+ private volatile int missCount;
+
+ private static final AtomicIntegerFieldUpdater<LEAF_CLASS> hitCountUpdater
+ = AtomicIntegerFieldUpdater.newUpdater(LEAF_CLASS.class, "hitCount");
+ private static final AtomicIntegerFieldUpdater<LEAF_CLASS> missCountUpdater
+ = AtomicIntegerFieldUpdater.newUpdater(LEAF_CLASS.class, "missCount");
+
+ @Override
+ public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ return this.lastAccessed;
+ }
+ private void setLastAccessed(long lastAccessed) {
+ this.lastAccessed = lastAccessed;
+ }
+ @Override
+ public final long getHitCount() throws InternalStatisticsDisabledException {
+ return this.hitCount & 0xFFFFFFFFL;
+ }
+ @Override
+ public final long getMissCount() throws InternalStatisticsDisabledException {
+ return this.missCount & 0xFFFFFFFFL;
+ }
+ private void incrementHitCount() {
+ hitCountUpdater.incrementAndGet(this);
+ }
+ private void incrementMissCount() {
+ missCountUpdater.incrementAndGet(this);
+ }
+ @Override
+ public final void resetCounts() throws InternalStatisticsDisabledException {
+ hitCountUpdater.set(this,0);
+ missCountUpdater.set(this,0);
+ }
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ @Override
+ public final void txDidDestroy(long currTime) {
+ setLastModified(currTime);
+ setLastAccessed(currTime);
+ this.hitCount = 0;
+ this.missCount = 0;
+ }
+ @Override
+ public boolean hasStats() {
+ return true;
+ }
+#endif
+
+#ifdef VERSIONED
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ // versioned code
+ private VersionSource memberID;
+ private short entryVersionLowBytes;
+ private short regionVersionHighBytes;
+ private int regionVersionLowBytes;
+ private byte entryVersionHighByte;
+ private byte distributedSystemId;
+
+ public int getEntryVersion() {
+ return ((entryVersionHighByte << 16) & 0xFF0000) | (entryVersionLowBytes & 0xFFFF);
+ }
+
+ public long getRegionVersion() {
+ return (((long)regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
+ }
+
+
+ public long getVersionTimeStamp() {
+ return getLastModified();
+ }
+
+ public void setVersionTimeStamp(long time) {
+ setLastModified(time);
+ }
+
+ public VersionSource getMemberID() {
+ return this.memberID;
+ }
+ public int getDistributedSystemId() {
+ return this.distributedSystemId;
+ }
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ public void setVersions(VersionTag tag) {
+ this.memberID = tag.getMemberID();
+ int eVersion = tag.getEntryVersion();
+ this.entryVersionLowBytes = (short)(eVersion & 0xffff);
+ this.entryVersionHighByte = (byte)((eVersion & 0xff0000) >> 16);
+ this.regionVersionHighBytes = tag.getRegionVersionHighBytes();
+ this.regionVersionLowBytes = tag.getRegionVersionLowBytes();
+ if (!(tag.isGatewayTag()) && this.distributedSystemId == tag.getDistributedSystemId()) {
+ if (getVersionTimeStamp() <= tag.getVersionTimeStamp()) {
+ setVersionTimeStamp(tag.getVersionTimeStamp());
+ } else {
+ tag.setVersionTimeStamp(getVersionTimeStamp());
+ }
+ } else {
+ setVersionTimeStamp(tag.getVersionTimeStamp());
+ }
+ this.distributedSystemId = (byte)(tag.getDistributedSystemId() & 0xff);
+ }
+
+ public void setMemberID(VersionSource memberID) {
+ this.memberID = memberID;
+ }
+
+ @Override
+ public VersionStamp getVersionStamp() {
+ return this;
+ }
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ public VersionTag asVersionTag() {
+ VersionTag tag = VersionTag.create(memberID);
+ tag.setEntryVersion(getEntryVersion());
+ tag.setRegionVersion(this.regionVersionHighBytes, this.regionVersionLowBytes);
+ tag.setVersionTimeStamp(getVersionTimeStamp());
+ tag.setDistributedSystemId(this.distributedSystemId);
+ return tag;
+ }
+
+ public void processVersionTag(LocalRegion r, VersionTag tag,
+ boolean isTombstoneFromGII, boolean hasDelta,
+ VersionSource thisVM, InternalDistributedMember sender, boolean checkForConflicts) {
+ basicProcessVersionTag(r, tag, isTombstoneFromGII, hasDelta, thisVM, sender, checkForConflicts);
+ }
+
+ @Override
+ public void processVersionTag(EntryEvent cacheEvent) {
+ // this keeps Eclipse happy. without it the sender chain becomes confused
+ // while browsing this code
+ super.processVersionTag(cacheEvent);
+ }
+
+ /** get rvv internal high byte. Used by region entries for transferring to storage */
+ public short getRegionVersionHighBytes() {
+ return this.regionVersionHighBytes;
+ }
+
+ /** get rvv internal low bytes. Used by region entries for transferring to storage */
+ public int getRegionVersionLowBytes() {
+ return this.regionVersionLowBytes;
+ }
+#endif
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ // key code
+#ifdef KEY_OBJECT
+ private final Object key;
+ @Override
+ public final Object getKey() {
+ return this.key;
+ }
+
+#elif defined(KEY_INT)
+ private final int key;
+ @Override
+ public final Object getKey() {
+ return this.key;
+ }
+ @Override
+ public boolean isKeyEqual(Object k) {
+ if (k instanceof Integer) {
+ return ((Integer) k).intValue() == this.key;
+ }
+ return false;
+ }
+
+#elif defined(KEY_LONG)
+ private final long key;
+ @Override
+ public final Object getKey() {
+ return this.key;
+ }
+ @Override
+ public boolean isKeyEqual(Object k) {
+ if (k instanceof Long) {
+ return ((Long) k).longValue() == this.key;
+ }
+ return false;
+ }
+
+#elif defined(KEY_UUID)
+ private final long keyMostSigBits;
+ private final long keyLeastSigBits;
+ @Override
+ public final Object getKey() {
+ return new UUID(this.keyMostSigBits, this.keyLeastSigBits);
+ }
+ @Override
+ public boolean isKeyEqual(Object k) {
+ if (k instanceof UUID) {
+ UUID uuid = (UUID) k;
+ return uuid.getLeastSignificantBits() == this.keyLeastSigBits
+ && uuid.getMostSignificantBits() == this.keyMostSigBits;
+ }
+ return false;
+ }
+
+#elif defined(KEY_STRING1)
+ private final long bits1;
+ private int getKeyLength() {
+ return (int) (this.bits1 & 0x003fL);
+ }
+ private int getEncoding() {
+ // 0 means encoded as char
+ // 1 means encoded as bytes that are all <= 0x7f;
+ return (int) (this.bits1 >> 6) & 0x03;
+ }
+ @Override
+ public final Object getKey() {
+ int keylen = getKeyLength();
+ char[] chars = new char[keylen];
+ long tmpBits1 = this.bits1;
+ if (getEncoding() == 1) {
+ for (int i=0; i < keylen; i++) {
+ tmpBits1 >>= 8;
+ chars[i] = (char) (tmpBits1 & 0x00ff);
+ }
+ } else {
+ for (int i=0; i < keylen; i++) {
+ tmpBits1 >>= 16;
+ chars[i] = (char) (tmpBits1 & 0x00FFff);
+ }
+ }
+ return new String(chars);
+ }
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ @Override
+ public boolean isKeyEqual(Object k) {
+ if (k instanceof String) {
+ String str = (String)k;
+ int keylen = getKeyLength();
+ if (str.length() == keylen) {
+ long tmpBits1 = this.bits1;
+ if (getEncoding() == 1) {
+ for (int i=0; i < keylen; i++) {
+ tmpBits1 >>= 8;
+ char c = (char) (tmpBits1 & 0x00ff);
+ if (str.charAt(i) != c) {
+ return false;
+ }
+ }
+ } else {
+ for (int i=0; i < keylen; i++) {
+ tmpBits1 >>= 16;
+ char c = (char) (tmpBits1 & 0x00FFff);
+ if (str.charAt(i) != c) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+#elif defined(KEY_STRING2)
+ // strlen is encoded in lowest 6 bits (max strlen is 63)
+ // character encoding info is in bits 7 and 8
+ // The other bits are used to encoded character data.
+ private final long bits1;
+ // bits2 encodes character data
+ private final long bits2;
+ private int getKeyLength() {
+ return (int) (this.bits1 & 0x003fL);
+ }
+ private int getEncoding() {
+ // 0 means encoded as char
+ // 1 means encoded as bytes that are all <= 0x7f;
+ return (int) (this.bits1 >> 6) & 0x03;
+ }
+ @Override
+ public final Object getKey() {
+ int keylen = getKeyLength();
+ char[] chars = new char[keylen];
+ long tmpBits1 = this.bits1;
+ long tmpBits2 = this.bits2;
+ if (getEncoding() == 1) {
+ for (int i=0; i < keylen; i++) {
+ if (i < 7) {
+ tmpBits1 >>= 8;
+ chars[i] = (char) (tmpBits1 & 0x00ff);
+ } else {
+ chars[i] = (char) (tmpBits2 & 0x00ff);
+ tmpBits2 >>= 8;
+ }
+ }
+ } else {
+ for (int i=0; i < keylen; i++) {
+ if (i < 3) {
+ tmpBits1 >>= 16;
+ chars[i] = (char) (tmpBits1 & 0x00FFff);
+ } else {
+ chars[i] = (char) (tmpBits2 & 0x00FFff);
+ tmpBits2 >>= 16;
+ }
+ }
+ }
+ return new String(chars);
+ }
+
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+ @Override
+ public boolean isKeyEqual(Object k) {
+ if (k instanceof String) {
+ String str = (String)k;
+ int keylen = getKeyLength();
+ if (str.length() == keylen) {
+ long tmpBits1 = this.bits1;
+ long tmpBits2 = this.bits2;
+ if (getEncoding() == 1) {
+ for (int i=0; i < keylen; i++) {
+ char c;
+ if (i < 7) {
+ tmpBits1 >>= 8;
+ c = (char) (tmpBits1 & 0x00ff);
+ } else {
+ c = (char) (tmpBits2 & 0x00ff);
+ tmpBits2 >>= 8;
+ }
+ if (str.charAt(i) != c) {
+ return false;
+ }
+ }
+ } else {
+ for (int i=0; i < keylen; i++) {
+ char c;
+ if (i < 3) {
+ tmpBits1 >>= 16;
+ c = (char) (tmpBits1 & 0x00FFff);
+ } else {
+ c = (char) (tmpBits2 & 0x00FFff);
+ tmpBits2 >>= 16;
+ }
+ if (str.charAt(i) != c) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+#endif
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java
index 41bd334..aa1b513 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java
@@ -39,7 +39,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 VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEntryHeap {
public VMStatsDiskLRURegionEntryHeapIntKey(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/VMStatsDiskLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java
index 1ae6628..ce659c0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java
@@ -39,7 +39,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 VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEntryHeap {
public VMStatsDiskLRURegionEntryHeapLongKey(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/VMStatsDiskLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java
index e046d65..5ea08a9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java
@@ -39,7 +39,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 VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegionEntryHeap {
public VMStatsDiskLRURegionEntryHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java
index 57cab2d..0f92cb8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java
@@ -39,7 +39,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 VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegionEntryHeap {
public VMStatsDiskLRURegionEntryHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java
index 6f06653..b601648 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java
@@ -39,7 +39,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 VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegionEntryHeap {
public VMStatsDiskLRURegionEntryHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapUUIDKey.java
index 1dd4428..92ad469 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapUUIDKey.java
@@ -40,7 +40,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 VMStatsDiskLRURegionEntryHeapUUIDKey extends VMStatsDiskLRURegionEntryHeap {
public VMStatsDiskLRURegionEntryHeapUUIDKey(RegionEntryContext context, UUID 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/VMStatsDiskLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapIntKey.java
index 421477d..abba32a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapIntKey.java
@@ -43,7 +43,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 VMStatsDiskLRURegionEntryOffHeapIntKey extends VMStatsDiskLRURegionEntryOffHeap {
public VMStatsDiskLRURegionEntryOffHeapIntKey(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/VMStatsDiskLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapLongKey.java
index 76bf1e2..a721a52 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapLongKey.java
@@ -43,7 +43,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 VMStatsDiskLRURegionEntryOffHeapLongKey extends VMStatsDiskLRURegionEntryOffHeap {
public VMStatsDiskLRURegionEntryOffHeapLongKey(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/VMStatsDiskLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapObjectKey.java
index a6186a5..4d6bfa7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapObjectKey.java
@@ -43,7 +43,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 VMStatsDiskLRURegionEntryOffHeapObjectKey extends VMStatsDiskLRURegionEntryOffHeap {
public VMStatsDiskLRURegionEntryOffHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey1.java
index eac0af5..0fbd39c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey1.java
@@ -43,7 +43,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 VMStatsDiskLRURegionEntryOffHeapStringKey1 extends VMStatsDiskLRURegionEntryOffHeap {
public VMStatsDiskLRURegionEntryOffHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey2.java
index bba9ef3..eccc55c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapStringKey2.java
@@ -43,7 +43,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 VMStatsDiskLRURegionEntryOffHeapStringKey2 extends VMStatsDiskLRURegionEntryOffHeap {
public VMStatsDiskLRURegionEntryOffHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java
index 5ab2d0b..0593dc7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java
@@ -44,7 +44,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 VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegionEntryOffHeap {
public VMStatsDiskLRURegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java
index d50319a..b09136a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java
@@ -37,7 +37,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 VMStatsDiskRegionEntryHeapIntKey extends VMStatsDiskRegionEntryHeap {
public VMStatsDiskRegionEntryHeapIntKey(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/VMStatsDiskRegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java
index de829cb..0c8fe86 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java
@@ -37,7 +37,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 VMStatsDiskRegionEntryHeapLongKey extends VMStatsDiskRegionEntryHeap {
public VMStatsDiskRegionEntryHeapLongKey(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/VMStatsDiskRegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java
index b73bb52..b004295 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java
@@ -37,7 +37,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 VMStatsDiskRegionEntryHeapObjectKey extends VMStatsDiskRegionEntryHeap {
public VMStatsDiskRegionEntryHeapObjectKey(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/VMStatsDiskRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java
index 33ece05..d12f2d5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java
@@ -37,7 +37,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 VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntryHeap {
public VMStatsDiskRegionEntryHeapStringKey1(RegionEntryContext context, String 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/VMStatsDiskRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java
index 894ac55..189d41d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java
@@ -37,7 +37,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 VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntryHeap {
public VMStatsDiskRegionEntryHeapStringKey2(RegionEntryContext context, String 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/VMStatsDiskRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapUUIDKey.java
index a283733..7646f45 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapUUIDKey.java
@@ -38,7 +38,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 VMStatsDiskRegionEntryHeapUUIDKey extends VMStatsDiskRegionEntryHeap {
public VMStatsDiskRegionEntryHeapUUIDKey(RegionEntryContext context, UUID 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/VMStatsDiskRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapIntKey.java
index f45f772..71c67fb 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapIntKey.java
@@ -41,7 +41,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 VMStatsDiskRegionEntryOffHeapIntKey extends VMStatsDiskRegionEntryOffHeap {
public VMStatsDiskRegionEntryOffHeapIntKey(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/VMStatsDiskRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapLongKey.java
index c588595..41bb469 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapLongKey.java
@@ -41,7 +41,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 VMStatsDiskRegionEntryOffHeapLongKey extends VMStatsDiskRegionEntryOffHeap {
public VMStatsDiskRegionEntryOffHeapLongKey(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/VMStatsDiskRegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapObjectKey.java
index b66d160..85f0e13 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapObjectKey.java
@@ -41,7 +41,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 VMStatsDiskRegionEntryOffHeapObjectKey extends VMStatsDiskRegionEntryOffHeap {
public VMStatsDiskRegionEntryOffHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey1.java
index 92cef48..824aabb 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey1.java
@@ -41,7 +41,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 VMStatsDiskRegionEntryOffHeapStringKey1 extends VMStatsDiskRegionEntryOffHeap {
public VMStatsDiskRegionEntryOffHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey2.java
index c9a9904..10c31ca 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapStringKey2.java
@@ -41,7 +41,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 VMStatsDiskRegionEntryOffHeapStringKey2 extends VMStatsDiskRegionEntryOffHeap {
public VMStatsDiskRegionEntryOffHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapUUIDKey.java
index 2e8f033..0e899fc 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryOffHeapUUIDKey.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 VMStatsDiskRegionEntryOffHeapUUIDKey extends VMStatsDiskRegionEntryOffHeap {
public VMStatsDiskRegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapIntKey.java
index 66b34d6..707adb9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapIntKey.java
@@ -38,7 +38,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 VMStatsLRURegionEntryHeapIntKey extends VMStatsLRURegionEntryHeap {
public VMStatsLRURegionEntryHeapIntKey(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/VMStatsLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapLongKey.java
index 442736e..3524bbe 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapLongKey.java
@@ -38,7 +38,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 VMStatsLRURegionEntryHeapLongKey extends VMStatsLRURegionEntryHeap {
public VMStatsLRURegionEntryHeapLongKey(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/VMStatsLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapObjectKey.java
index d12066a..a5a0dc0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapObjectKey.java
@@ -38,7 +38,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 VMStatsLRURegionEntryHeapObjectKey extends VMStatsLRURegionEntryHeap {
public VMStatsLRURegionEntryHeapObjectKey(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/VMStatsLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey1.java
index 1de7a21..04ea3d7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey1.java
@@ -38,7 +38,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 VMStatsLRURegionEntryHeapStringKey1 extends VMStatsLRURegionEntryHeap {
public VMStatsLRURegionEntryHeapStringKey1(RegionEntryContext context, String 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/VMStatsLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java
index e1b58eb..2ca6440 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java
@@ -38,7 +38,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 VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHeap {
public VMStatsLRURegionEntryHeapStringKey2(RegionEntryContext context, String 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/VMStatsLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapUUIDKey.java
index a5c327b..d1d539e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapUUIDKey.java
@@ -39,7 +39,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 VMStatsLRURegionEntryHeapUUIDKey extends VMStatsLRURegionEntryHeap {
public VMStatsLRURegionEntryHeapUUIDKey(RegionEntryContext context, UUID 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/VMStatsLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapIntKey.java
index 2d39ac5..dbb6e7b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapIntKey.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 VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOffHeap {
public VMStatsLRURegionEntryOffHeapIntKey(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/VMStatsLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapLongKey.java
index 0ffaddf..9bf356c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapLongKey.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 VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOffHeap {
public VMStatsLRURegionEntryOffHeapLongKey(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/VMStatsLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapObjectKey.java
index f990481..486cbca 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapObjectKey.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 VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntryOffHeap {
public VMStatsLRURegionEntryOffHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.java
index 2e55620..b4ab253 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.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 VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntryOffHeap {
public VMStatsLRURegionEntryOffHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.java
index 6a7c0ae..fc72ec8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.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 VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntryOffHeap {
public VMStatsLRURegionEntryOffHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapUUIDKey.java
index 7d1c8c7..8a4f04b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapUUIDKey.java
@@ -43,7 +43,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 VMStatsLRURegionEntryOffHeapUUIDKey extends VMStatsLRURegionEntryOffHeap {
public VMStatsLRURegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
[11/50] [abbrv] incubator-geode git commit: GEODE-1785: add script to
generate region entry source
Posted by kl...@apache.org.
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 from the top level directory).
*/
public class VersionedStatsDiskRegionEntryHeapLongKey extends VersionedStatsDiskRegionEntryHeap {
public VersionedStatsDiskRegionEntryHeapLongKey(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/VersionedStatsDiskRegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapObjectKey.java
index fbe2816..6d5f898 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapObjectKey.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 VersionedStatsDiskRegionEntryHeapObjectKey extends VersionedStatsDiskRegionEntryHeap {
public VersionedStatsDiskRegionEntryHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey1.java
index 9d2c8bc..e9705af 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey1.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 VersionedStatsDiskRegionEntryHeapStringKey1 extends VersionedStatsDiskRegionEntryHeap {
public VersionedStatsDiskRegionEntryHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey2.java
index c3af973..4452a05 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey2.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 VersionedStatsDiskRegionEntryHeapStringKey2 extends VersionedStatsDiskRegionEntryHeap {
public VersionedStatsDiskRegionEntryHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapUUIDKey.java
index 6b235ec..0b5b8be 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapUUIDKey.java
@@ -43,7 +43,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 VersionedStatsDiskRegionEntryHeapUUIDKey extends VersionedStatsDiskRegionEntryHeap {
public VersionedStatsDiskRegionEntryHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapIntKey.java
index 11d854b..87589d2 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapIntKey.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 VersionedStatsDiskRegionEntryOffHeapIntKey
extends VersionedStatsDiskRegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapLongKey.java
index 6b3816e..ac5dca2 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapLongKey.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 VersionedStatsDiskRegionEntryOffHeapLongKey
extends VersionedStatsDiskRegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapObjectKey.java
index 40c8e4c..7140a0c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapObjectKey.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 VersionedStatsDiskRegionEntryOffHeapObjectKey
extends VersionedStatsDiskRegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey1.java
index 335dff8..e235c9b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey1.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 VersionedStatsDiskRegionEntryOffHeapStringKey1
extends VersionedStatsDiskRegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey2.java
index 7b20bf2..16ed0f6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey2.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 VersionedStatsDiskRegionEntryOffHeapStringKey2
extends VersionedStatsDiskRegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapUUIDKey.java
index 2ab6401..be089c6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapUUIDKey.java
@@ -47,7 +47,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 VersionedStatsDiskRegionEntryOffHeapUUIDKey
extends VersionedStatsDiskRegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapIntKey.java
index e00966b..70e1a38 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapIntKey.java
@@ -43,7 +43,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 VersionedStatsLRURegionEntryHeapIntKey extends VersionedStatsLRURegionEntryHeap {
public VersionedStatsLRURegionEntryHeapIntKey(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/VersionedStatsLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapLongKey.java
index 5c5c8c5..03e8e97 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapLongKey.java
@@ -43,7 +43,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 VersionedStatsLRURegionEntryHeapLongKey extends VersionedStatsLRURegionEntryHeap {
public VersionedStatsLRURegionEntryHeapLongKey(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/VersionedStatsLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapObjectKey.java
index 59b9fe4..c329e03 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapObjectKey.java
@@ -43,7 +43,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 VersionedStatsLRURegionEntryHeapObjectKey extends VersionedStatsLRURegionEntryHeap {
public VersionedStatsLRURegionEntryHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey1.java
index c13af73..a22d88d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey1.java
@@ -43,7 +43,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 VersionedStatsLRURegionEntryHeapStringKey1 extends VersionedStatsLRURegionEntryHeap {
public VersionedStatsLRURegionEntryHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey2.java
index 2c7ce6a..2b92b49 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey2.java
@@ -43,7 +43,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 VersionedStatsLRURegionEntryHeapStringKey2 extends VersionedStatsLRURegionEntryHeap {
public VersionedStatsLRURegionEntryHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapUUIDKey.java
index 02571a9..cd0cb14 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapUUIDKey.java
@@ -44,7 +44,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 VersionedStatsLRURegionEntryHeapUUIDKey extends VersionedStatsLRURegionEntryHeap {
public VersionedStatsLRURegionEntryHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapIntKey.java
index 98a70a0..de9b8a2 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapIntKey.java
@@ -47,7 +47,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 VersionedStatsLRURegionEntryOffHeapIntKey extends VersionedStatsLRURegionEntryOffHeap {
public VersionedStatsLRURegionEntryOffHeapIntKey(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/VersionedStatsLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapLongKey.java
index 5677dc6..9f2c2bb 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapLongKey.java
@@ -47,7 +47,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 VersionedStatsLRURegionEntryOffHeapLongKey
extends VersionedStatsLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java
index c4ac504..d521590 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java
@@ -47,7 +47,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 VersionedStatsLRURegionEntryOffHeapObjectKey
extends VersionedStatsLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java
index 020df97..6195cb6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java
@@ -47,7 +47,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 VersionedStatsLRURegionEntryOffHeapStringKey1
extends VersionedStatsLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java
index 0805648..860d117 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java
@@ -47,7 +47,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 VersionedStatsLRURegionEntryOffHeapStringKey2
extends VersionedStatsLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java
index d0d6b0b..cef686e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.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 VersionedStatsLRURegionEntryOffHeapUUIDKey
extends VersionedStatsLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java
index 55acb79..ba2fcbf 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java
@@ -40,7 +40,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 VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEntryHeap {
public VersionedStatsRegionEntryHeapIntKey(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/VersionedStatsRegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java
index b7d90f3..3e92a43 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java
@@ -40,7 +40,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 VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEntryHeap {
public VersionedStatsRegionEntryHeapLongKey(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/VersionedStatsRegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java
index 4047e70..3a13e7f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java
@@ -40,7 +40,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 VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegionEntryHeap {
public VersionedStatsRegionEntryHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java
index b0d7e29..48365c5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java
@@ -40,7 +40,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 VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegionEntryHeap {
public VersionedStatsRegionEntryHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java
index 1225b550..5fb13cb 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java
@@ -40,7 +40,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 VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegionEntryHeap {
public VersionedStatsRegionEntryHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java
index 56663e8..5f6a634 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java
@@ -41,7 +41,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 VersionedStatsRegionEntryHeapUUIDKey extends VersionedStatsRegionEntryHeap {
public VersionedStatsRegionEntryHeapUUIDKey(RegionEntryContext context, UUID 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/VersionedStatsRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapIntKey.java
index a9b2168..ac6cfc1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapIntKey.java
@@ -44,7 +44,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 VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegionEntryOffHeap {
public VersionedStatsRegionEntryOffHeapIntKey(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/VersionedStatsRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapLongKey.java
index 7bf5fb6..9707df1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapLongKey.java
@@ -44,7 +44,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 VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegionEntryOffHeap {
public VersionedStatsRegionEntryOffHeapLongKey(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/VersionedStatsRegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapObjectKey.java
index 6be3ee9..0a57429 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapObjectKey.java
@@ -44,7 +44,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 VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsRegionEntryOffHeap {
public VersionedStatsRegionEntryOffHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java
index a158f75..f03a1cc 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java
@@ -44,7 +44,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 VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRegionEntryOffHeap {
public VersionedStatsRegionEntryOffHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java
index 8f7eb32..60b6e02 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java
@@ -44,7 +44,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 VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRegionEntryOffHeap {
public VersionedStatsRegionEntryOffHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java
index 7cc0e3a..aa50d1c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java
@@ -45,7 +45,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 VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegionEntryOffHeap {
public VersionedStatsRegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java
index 3d5ec14..b23fec5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java
@@ -43,7 +43,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 VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDiskLRURegionEntryHeap {
public VersionedThinDiskLRURegionEntryHeapIntKey(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/VersionedThinDiskLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapLongKey.java
index 27eccc7..58617ac 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapLongKey.java
@@ -43,7 +43,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 VersionedThinDiskLRURegionEntryHeapLongKey
extends VersionedThinDiskLRURegionEntryHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapObjectKey.java
index c427ffd..add80be 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapObjectKey.java
@@ -43,7 +43,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 VersionedThinDiskLRURegionEntryHeapObjectKey
extends VersionedThinDiskLRURegionEntryHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey1.java
index 3305b98..f1f5345 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey1.java
@@ -43,7 +43,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 VersionedThinDiskLRURegionEntryHeapStringKey1
extends VersionedThinDiskLRURegionEntryHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey2.java
index e02c51b..4ba22bd 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey2.java
@@ -43,7 +43,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 VersionedThinDiskLRURegionEntryHeapStringKey2
extends VersionedThinDiskLRURegionEntryHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapUUIDKey.java
index 0818dbc..ff71e93 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapUUIDKey.java
@@ -44,7 +44,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 VersionedThinDiskLRURegionEntryHeapUUIDKey
extends VersionedThinDiskLRURegionEntryHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapIntKey.java
index 0705e71..220b096 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapIntKey.java
@@ -47,7 +47,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 VersionedThinDiskLRURegionEntryOffHeapIntKey
extends VersionedThinDiskLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapLongKey.java
index 3f059ca..0ca005d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapLongKey.java
@@ -47,7 +47,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 VersionedThinDiskLRURegionEntryOffHeapLongKey
extends VersionedThinDiskLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java
index b1dfc09..3903e13 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java
@@ -47,7 +47,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 VersionedThinDiskLRURegionEntryOffHeapObjectKey
extends VersionedThinDiskLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java
index 69fdb69..5cf2769 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java
@@ -47,7 +47,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 VersionedThinDiskLRURegionEntryOffHeapStringKey1
extends VersionedThinDiskLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java
index 2d3382d..6405a29 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java
@@ -47,7 +47,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 VersionedThinDiskLRURegionEntryOffHeapStringKey2
extends VersionedThinDiskLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java
index d21ffce..e917996 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.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 VersionedThinDiskLRURegionEntryOffHeapUUIDKey
extends VersionedThinDiskLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapIntKey.java
index 962c402..bda1c73 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapIntKey.java
@@ -40,7 +40,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 VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskRegionEntryHeap {
public VersionedThinDiskRegionEntryHeapIntKey(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/VersionedThinDiskRegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapLongKey.java
index a759b93..52a6d43 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapLongKey.java
@@ -40,7 +40,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 VersionedThinDiskRegionEntryHeapLongKey extends VersionedThinDiskRegionEntryHeap {
public VersionedThinDiskRegionEntryHeapLongKey(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/VersionedThinDiskRegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapObjectKey.java
index 4fda44c..43399da 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapObjectKey.java
@@ -40,7 +40,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 VersionedThinDiskRegionEntryHeapObjectKey extends VersionedThinDiskRegionEntryHeap {
public VersionedThinDiskRegionEntryHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey1.java
index c16f23b..e9c626f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey1.java
@@ -40,7 +40,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 VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDiskRegionEntryHeap {
public VersionedThinDiskRegionEntryHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey2.java
index 7568636..954f0ee 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey2.java
@@ -40,7 +40,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 VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDiskRegionEntryHeap {
public VersionedThinDiskRegionEntryHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapUUIDKey.java
index bef8158..6af09ee 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapUUIDKey.java
@@ -41,7 +41,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 VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRegionEntryHeap {
public VersionedThinDiskRegionEntryHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapIntKey.java
index 99587ad..97b8f15 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapIntKey.java
@@ -44,7 +44,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 VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDiskRegionEntryOffHeap {
public VersionedThinDiskRegionEntryOffHeapIntKey(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/VersionedThinDiskRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapLongKey.java
index 8214cc7..7591113 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapLongKey.java
@@ -44,7 +44,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 VersionedThinDiskRegionEntryOffHeapLongKey
extends VersionedThinDiskRegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapObjectKey.java
index aa8c9f2..9b4f75c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapObjectKey.java
@@ -44,7 +44,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 VersionedThinDiskRegionEntryOffHeapObjectKey
extends VersionedThinDiskRegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey1.java
index 804f7bc..3e83564 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey1.java
@@ -44,7 +44,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 VersionedThinDiskRegionEntryOffHeapStringKey1
extends VersionedThinDiskRegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey2.java
index a385962..99d45b8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey2.java
@@ -44,7 +44,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 VersionedThinDiskRegionEntryOffHeapStringKey2
extends VersionedThinDiskRegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapUUIDKey.java
index 3c1d088..fb8ea46 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapUUIDKey.java
@@ -45,7 +45,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 VersionedThinDiskRegionEntryOffHeapUUIDKey
extends VersionedThinDiskRegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.java
index 0ba441d..eafdcd0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.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 VersionedThinLRURegionEntryHeapIntKey extends VersionedThinLRURegionEntryHeap {
public VersionedThinLRURegionEntryHeapIntKey(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/VersionedThinLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapLongKey.java
index c523783..95f27c8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapLongKey.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 VersionedThinLRURegionEntryHeapLongKey extends VersionedThinLRURegionEntryHeap {
public VersionedThinLRURegionEntryHeapLongKey(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/VersionedThinLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapObjectKey.java
index a53adeb..12dc438 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapObjectKey.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 VersionedThinLRURegionEntryHeapObjectKey extends VersionedThinLRURegionEntryHeap {
public VersionedThinLRURegionEntryHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey1.java
index 44c7ef7..8f9438b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey1.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 VersionedThinLRURegionEntryHeapStringKey1 extends VersionedThinLRURegionEntryHeap {
public VersionedThinLRURegionEntryHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey2.java
index 91ecc63..5ee384b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey2.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 VersionedThinLRURegionEntryHeapStringKey2 extends VersionedThinLRURegionEntryHeap {
public VersionedThinLRURegionEntryHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapUUIDKey.java
index 4ace7b0..977cd75 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapUUIDKey.java
@@ -43,7 +43,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 VersionedThinLRURegionEntryHeapUUIDKey extends VersionedThinLRURegionEntryHeap {
public VersionedThinLRURegionEntryHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapIntKey.java
index ae00c22..848cb1d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapIntKey.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 VersionedThinLRURegionEntryOffHeapIntKey extends VersionedThinLRURegionEntryOffHeap {
public VersionedThinLRURegionEntryOffHeapIntKey(RegionEntryContext context, int key,
[27/50] [abbrv] incubator-geode git commit: GEODE-2074
GMSJoinLeaveJUnitTest.testDuplicateJoinRequestDoesNotCauseNewView
Posted by kl...@apache.org.
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 Schuchardt <bs...@pivotal.io>
Authored: Mon Nov 14 10:06:42 2016 -0800
Committer: Bruce Schuchardt <bs...@pivotal.io>
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 {
[40/50] [abbrv] incubator-geode git commit: Fix formatting
Posted by kl...@apache.org.
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 {
}
protected <T> T getMBeanProxy(final ObjectName objectName, Class<T> interfaceClass) {
- SystemManagementService service = (SystemManagementService)ManagementService.getManagementService(getCache());
+ SystemManagementService service =
+ (SystemManagementService) ManagementService.getManagementService(getCache());
return service.getMBeanProxy(objectName, interfaceClass);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/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 ac60d0c..e97a652 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
@@ -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.management;
@@ -69,8 +67,7 @@ public class ManagementTestRule implements MethodRule, Serializable {
private VM[] members;
protected ManagementTestRule(final Builder builder) {
- this.helper = new JUnit4CacheTestCase() {
- };
+ this.helper = new JUnit4CacheTestCase() {};
this.managersCount = builder.managersCount;
this.membersCount = builder.membersCount;
this.start = builder.start;
@@ -166,10 +163,10 @@ public class ManagementTestRule implements MethodRule, Serializable {
}
public Cache getCache() {
-// Cache cache = GemFireCacheImpl.getInstance();
-// if (cache != null && !cache.isClosed()) {
-// return cache;
-// }
+ // Cache cache = GemFireCacheImpl.getInstance();
+ // if (cache != null && !cache.isClosed()) {
+ // return cache;
+ // }
return this.helper.getCache();
}
@@ -178,18 +175,18 @@ public class ManagementTestRule implements MethodRule, Serializable {
}
public boolean hasCache() {
-// Cache cache = GemFireCacheImpl.getInstance();
-// if (cache != null && !cache.isClosed()) {
-// return true;
-// }
+ // Cache cache = GemFireCacheImpl.getInstance();
+ // if (cache != null && !cache.isClosed()) {
+ // return true;
+ // }
return this.helper.hasCache();
}
public Cache basicGetCache() {
-// Cache cache = GemFireCacheImpl.getInstance();
-// if (cache != null && !cache.isClosed()) {
-// return cache;
-// }
+ // Cache cache = GemFireCacheImpl.getInstance();
+ // if (cache != null && !cache.isClosed()) {
+ // return cache;
+ // }
return this.helper.basicGetCache();
}
@@ -239,7 +236,7 @@ public class ManagementTestRule implements MethodRule, Serializable {
}
private DM getDistributionManager() {
- return ((GemFireCacheImpl)getCache()).getDistributionManager();
+ return ((GemFireCacheImpl) getCache()).getDistributionManager();
}
public void disconnectAllFromDS() {
@@ -249,7 +246,8 @@ public class ManagementTestRule implements MethodRule, Serializable {
Invoke.invokeInEveryVM("disconnectFromDS", () -> JUnit4DistributedTestCase.disconnectFromDS());
}
- private void setPropertyIfNotSet(final Properties properties, final String key, final String value) {
+ private void setPropertyIfNotSet(final Properties properties, final String key,
+ final String value) {
if (!properties.containsKey(key)) {
properties.setProperty(key, value);
}
@@ -349,11 +347,13 @@ public class ManagementTestRule implements MethodRule, Serializable {
private void throwIfAlreadyAssigned(final Field field, final boolean alreadyAssigned) {
if (alreadyAssigned) {
- throw new IllegalStateException("Field " + field.getName() + " is already annotated with " + field.getAnnotations());
+ throw new IllegalStateException(
+ "Field " + field.getName() + " is already annotated with " + field.getAnnotations());
}
}
- private void assignManagerField(final Object target, final Field field) throws IllegalAccessException {
+ private void assignManagerField(final Object target, final Field field)
+ throws IllegalAccessException {
throwIfNotSameType(field, VM.class);
field.setAccessible(true);
@@ -364,7 +364,8 @@ public class ManagementTestRule implements MethodRule, Serializable {
}
}
- private void assignMemberField(final Object target, final Field field) throws IllegalAccessException {
+ private void assignMemberField(final Object target, final Field field)
+ throws IllegalAccessException {
throwIfNotSameType(field, VM.class);
field.setAccessible(true);
@@ -378,7 +379,8 @@ public class ManagementTestRule implements MethodRule, Serializable {
private void throwIfNotSameType(final Field field, final Class clazz) {
if (!field.getType().equals(clazz) && // non-array
!field.getType().getComponentType().equals(clazz)) { // array
- throw new IllegalArgumentException("Field " + field.getName() + " is not same type as " + clazz.getName());
+ throw new IllegalArgumentException(
+ "Field " + field.getName() + " is not same type as " + clazz.getName());
}
}
@@ -396,8 +398,7 @@ public class ManagementTestRule implements MethodRule, Serializable {
private boolean managersFirst = true;
- protected Builder() {
- }
+ protected Builder() {}
public Builder createManagers(final boolean value) {
this.createManagers = value;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/Manager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/Manager.java b/geode-core/src/test/java/org/apache/geode/management/Manager.java
index 0de158e..ce6c6a6 100644
--- a/geode-core/src/test/java/org/apache/geode/management/Manager.java
+++ b/geode-core/src/test/java/org/apache/geode/management/Manager.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.management;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/Member.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/Member.java b/geode-core/src/test/java/org/apache/geode/management/Member.java
index e90d278..84a80e5 100644
--- a/geode-core/src/test/java/org/apache/geode/management/Member.java
+++ b/geode-core/src/test/java/org/apache/geode/management/Member.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.management;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java
index a38dd48..97fdab1 100644
--- a/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java
@@ -61,10 +61,7 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
* Specified assertion operations.
*/
private enum ASSERT_OP {
- EQUAL,
- GREATER_THAN,
- GREATER_THAN_OR_EQUAL,
- LESS_THAN
+ EQUAL, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN
}
/**
@@ -120,8 +117,9 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* A region entry value.
*/
- private static final byte[] VALUE = "Proin lobortis enim vel sem congue ut condimentum leo rhoncus. In turpis lorem, rhoncus nec rutrum vel, sodales vitae lacus. Etiam nunc ligula, scelerisque id egestas vitae, gravida non enim. Donec ac ligula purus. Mauris gravida ligula sit amet mi ornare blandit. Aliquam at velit ac enim varius malesuada ut eu tortor. Quisque diam nisi, fermentum vel accumsan at, commodo et velit."
- .getBytes();
+ private static final byte[] VALUE =
+ "Proin lobortis enim vel sem congue ut condimentum leo rhoncus. In turpis lorem, rhoncus nec rutrum vel, sodales vitae lacus. Etiam nunc ligula, scelerisque id egestas vitae, gravida non enim. Donec ac ligula purus. Mauris gravida ligula sit amet mi ornare blandit. Aliquam at velit ac enim varius malesuada ut eu tortor. Quisque diam nisi, fermentum vel accumsan at, commodo et velit."
+ .getBytes();
/**
* The expected size of the region entry value in off-heap memory.
@@ -131,7 +129,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Listens for off-heap JMX notifications.
*/
- private static final OffHeapNotificationListener notificationListener = new OffHeapNotificationListener();
+ private static final OffHeapNotificationListener notificationListener =
+ new OffHeapNotificationListener();
/**
* Local MBeanServer.
@@ -227,7 +226,7 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
// Make sure our starting off heap stats are correct
assertOffHeapMetricsOnVm(vm, TOTAL_MEMORY, 0, 0, 0);
- // After allocating large chunk (equal to total memory)
+ // After allocating large chunk (equal to total memory)
// we should still have no fragmentation
int largeChunk = (int) TOTAL_MEMORY - OffHeapStoredObject.HEADER_SIZE;
doPutOnVm(vm, KEY, new byte[largeChunk], OFF_HEAP_REGION_NAME, false);
@@ -249,7 +248,7 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
doPutOnVm(vm, KEY + "1", new byte[halfChunk], OFF_HEAP_REGION_NAME, false);
doDestroyOnVm(vm, KEY + "0", OFF_HEAP_REGION_NAME);
- // Allocate largeChunk to trigger compaction and fragmentation should be zero
+ // Allocate largeChunk to trigger compaction and fragmentation should be zero
// as all free memory is available as one fragment
doPutOnVm(vm, KEY + "1", new byte[largeChunk], OFF_HEAP_REGION_NAME, true);
assertFragmentationStatOnVm(vm, 0, ASSERT_OP.EQUAL);
@@ -470,7 +469,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
* @param numAllocations the number of previous off-heap allocations
* @param numDestroys the number of destroys to perform
*/
- private void doFreeOffHeapMemoryOnVm(final VM vm, final int numAllocations, final int numDestroys) {
+ private void doFreeOffHeapMemoryOnVm(final VM vm, final int numAllocations,
+ final int numDestroys) {
vm.invoke(new SerializableRunnable() {
@Override
public void run() {
@@ -547,7 +547,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
* @param compactionTime total off heap compaction time.
* @param op an assert operation.
*/
- private void assertCompactionTimeStatOnVm(final VM vm, final long compactionTime, final ASSERT_OP op) {
+ private void assertCompactionTimeStatOnVm(final VM vm, final long compactionTime,
+ final ASSERT_OP op) {
vm.invoke(() -> assertCompactionTimeStat(compactionTime, op));
}
@@ -589,7 +590,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
* @param fragmentation a fragmentation percentage
* @param op an assertion operation
*/
- private void assertFragmentationStatOnVm(final VM vm, final int fragmentation, final ASSERT_OP op) {
+ private void assertFragmentationStatOnVm(final VM vm, final int fragmentation,
+ final ASSERT_OP op) {
vm.invoke(() -> assertFragmentationStat(fragmentation, op));
}
@@ -695,11 +697,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
* @param objects number of objects stored in off-heap memory.
* @param fragmentation the fragmentation percentage.
*/
- private void assertOffHeapMetricsOnVm(final VM vm,
- final long freeMemory,
- final long allocatedMemory,
- final long objects,
- final int fragmentation) {
+ private void assertOffHeapMetricsOnVm(final VM vm, final long freeMemory,
+ final long allocatedMemory, final long objects, final int fragmentation) {
vm.invoke(() -> assertOffHeapMetrics(freeMemory, allocatedMemory, objects, fragmentation));
}
@@ -711,7 +710,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
* @param objects number of objects stored in off-heap memory.
* @param fragmentation the fragmentation percentage.
*/
- private void assertOffHeapMetrics(final long freeMemory, final long allocatedMemory, final long objects, final int fragmentation) {
+ private void assertOffHeapMetrics(final long freeMemory, final long allocatedMemory,
+ final long objects, final int fragmentation) {
ManagementService service = ManagementService.getExistingManagementService(getCache());
assertNotNull(service);
@@ -735,7 +735,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
*
* @return true if successful.
*/
- private boolean createOffHeapRegionOnVm(final VM vm, final String name, final DataPolicy dataPolicy) {
+ private boolean createOffHeapRegionOnVm(final VM vm, final String name,
+ final DataPolicy dataPolicy) {
return vm.invoke(() -> null != createOffHeapRegion(name, dataPolicy));
}
@@ -758,7 +759,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
* @param management starts the ManagementService when true.
* @param props distributed system properties.
*/
- private void setSystemPropertiesOnVm(final VM vm, final boolean management, final Properties props) {
+ private void setSystemPropertiesOnVm(final VM vm, final boolean management,
+ final Properties props) {
vm.invoke(() -> setSystemProperties(management, props));
}
@@ -811,11 +813,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
* @param value region entry value.
* @param regionName a region name.
*/
- private void doPutOnVm(final VM vm,
- final Object key,
- final Object value,
- final String regionName,
- final boolean expectException) {
+ private void doPutOnVm(final VM vm, final Object key, final Object value, final String regionName,
+ final boolean expectException) {
vm.invoke(() -> doPut(key, value, regionName, expectException));
}
@@ -826,7 +825,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
* @param value region entry value.
* @param regionName a region name.
*/
- private void doPut(final Object key, final Object value, final String regionName, final boolean expectException) {
+ private void doPut(final Object key, final Object value, final String regionName,
+ final boolean expectException) {
Region region = getCache().getRegion(regionName);
assertNotNull(region);
@@ -876,10 +876,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
* @param highThreshold the high threshold trigger.
* @param lowThreshold the low threshold trigger.
*/
- private void setupOffHeapMonitorOnVm(final VM vm,
- final String attribute,
- final long highThreshold,
- final long lowThreshold) {
+ private void setupOffHeapMonitorOnVm(final VM vm, final String attribute,
+ final long highThreshold, final long lowThreshold) {
vm.invoke(() -> setupOffHeapMonitor(attribute, highThreshold, lowThreshold));
}
@@ -890,8 +888,10 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
* @param highThreshold the high threshold trigger.
* @param lowThreshold the low threshold trigger.
*/
- private void setupOffHeapMonitor(final String attribute, final long highThreshold, final long lowThreshold) throws JMException {
- ObjectName memberMBeanObjectName = MBeanJMXAdapter.getMemberMBeanName(InternalDistributedSystem.getConnectedInstance().getDistributedMember());
+ private void setupOffHeapMonitor(final String attribute, final long highThreshold,
+ final long lowThreshold) throws JMException {
+ ObjectName memberMBeanObjectName = MBeanJMXAdapter.getMemberMBeanName(
+ InternalDistributedSystem.getConnectedInstance().getDistributedMember());
assertNotNull(memberMBeanObjectName);
ObjectName offHeapMonitorName = new ObjectName("monitors:type=Gauge,attr=" + attribute);
@@ -920,11 +920,10 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
* @param interval the polling interval to check for notifications.
* @param throwOnTimeout throws an exception on timeout if true.
*/
- private void waitForNotificationListenerOnVm(final VM vm,
- final long wait,
- final long interval,
- final boolean throwOnTimeout) {
- vm.invoke(() -> await("Awaiting Notification Listener").atMost(wait, TimeUnit.MILLISECONDS).until(() -> assertTrue(notificationListener.getNotificationSize() > 0)));
+ private void waitForNotificationListenerOnVm(final VM vm, final long wait, final long interval,
+ final boolean throwOnTimeout) {
+ vm.invoke(() -> await("Awaiting Notification Listener").atMost(wait, TimeUnit.MILLISECONDS)
+ .until(() -> assertTrue(notificationListener.getNotificationSize() > 0)));
}
/**
@@ -941,7 +940,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
*/
private static class OffHeapNotificationListener implements NotificationListener {
- List<Notification> notificationList = Collections.synchronizedList(new ArrayList<Notification>());
+ List<Notification> notificationList =
+ Collections.synchronizedList(new ArrayList<Notification>());
@Override
public void handleNotification(final Notification notification, final Object handback) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/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 e6f6361..6fd7b98 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
@@ -75,6 +75,7 @@ import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
/**
* Distributed tests for {@link DistributedSystemMXBean#queryData(String, String, int)}.
* <p>
+ *
* <pre>
* Test Basic Json Strings for Partitioned Regions
* Test Basic Json Strings for Replicated Regions
@@ -93,7 +94,7 @@ import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
* </pre>
*/
@Category(DistributedTest.class)
-@SuppressWarnings({ "serial", "unused" })
+@SuppressWarnings({"serial", "unused"})
public class QueryDataDUnitTest implements Serializable {
private static final int NUM_OF_BUCKETS = 20;
@@ -115,24 +116,28 @@ public class QueryDataDUnitTest implements Serializable {
private static final String BIG_COLLECTION_ELEMENT_ = "BIG_COLLECTION_ELEMENT_";
private static final String BIG_COLLECTION_ = "BIG_COLLECTION_";
- private static final String[] QUERIES = new String[] {
- "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " WHERE ID >= 0",
- "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2 + " r2 WHERE r1.ID = r2.ID",
- "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2 + " r2 WHERE r1.ID = r2.ID AND r1.status = r2.status",
- "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2 + " r2, /" + PARTITIONED_REGION_NAME3 + " r3 WHERE r1.ID = r2.ID AND r2.ID = r3.ID",
- "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2 + " r2, /" + PARTITIONED_REGION_NAME3 + " r3, /" + REPLICATE_REGION_NAME1 + " r4 WHERE r1.ID = r2.ID AND r2.ID = r3.ID AND r3.ID = r4.ID",
- "SELECT * FROM /" + PARTITIONED_REGION_NAME4 + " r4, /" + PARTITIONED_REGION_NAME5 + " r5 WHERE r4.ID = r5.ID"
- };
-
- private static final String[] QUERIES_FOR_REPLICATED = new String[] {
- "<TRACE> SELECT * FROM /" + REPLICATE_REGION_NAME1 + " WHERE ID >= 0",
- "SELECT * FROM /" + REPLICATE_REGION_NAME1 + " r1, /" + REPLICATE_REGION_NAME2 + " r2 WHERE r1.ID = r2.ID",
- "SELECT * FROM /" + REPLICATE_REGION_NAME3 + " WHERE ID >= 0"
- };
-
- private static final String[] QUERIES_FOR_LIMIT = new String[] {
- "SELECT * FROM /" + REPLICATE_REGION_NAME4
- };
+ private static final String[] QUERIES =
+ new String[] {"SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " WHERE ID >= 0",
+ "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2
+ + " r2 WHERE r1.ID = r2.ID",
+ "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2
+ + " r2 WHERE r1.ID = r2.ID AND r1.status = r2.status",
+ "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2
+ + " r2, /" + PARTITIONED_REGION_NAME3 + " r3 WHERE r1.ID = r2.ID AND r2.ID = r3.ID",
+ "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2
+ + " r2, /" + PARTITIONED_REGION_NAME3 + " r3, /" + REPLICATE_REGION_NAME1
+ + " r4 WHERE r1.ID = r2.ID AND r2.ID = r3.ID AND r3.ID = r4.ID",
+ "SELECT * FROM /" + PARTITIONED_REGION_NAME4 + " r4, /" + PARTITIONED_REGION_NAME5
+ + " r5 WHERE r4.ID = r5.ID"};
+
+ private static final String[] QUERIES_FOR_REPLICATED =
+ new String[] {"<TRACE> SELECT * FROM /" + REPLICATE_REGION_NAME1 + " WHERE ID >= 0",
+ "SELECT * FROM /" + REPLICATE_REGION_NAME1 + " r1, /" + REPLICATE_REGION_NAME2
+ + " r2 WHERE r1.ID = r2.ID",
+ "SELECT * FROM /" + REPLICATE_REGION_NAME3 + " WHERE ID >= 0"};
+
+ private static final String[] QUERIES_FOR_LIMIT =
+ new String[] {"SELECT * FROM /" + REPLICATE_REGION_NAME4};
private DistributedMember member1;
private DistributedMember member2;
@@ -145,10 +150,12 @@ public class QueryDataDUnitTest implements Serializable {
private VM[] memberVMs;
@Rule
- public DistributedUseJacksonForJsonPathRule useJacksonForJsonPathRule = new DistributedUseJacksonForJsonPathRule();
+ public DistributedUseJacksonForJsonPathRule useJacksonForJsonPathRule =
+ new DistributedUseJacksonForJsonPathRule();
@Rule
- public ManagementTestRule managementTestRule = ManagementTestRule.builder().managersFirst(false).start(true).build();
+ public ManagementTestRule managementTestRule =
+ ManagementTestRule.builder().managersFirst(false).start(true).build();
@Rule
public SerializableTestName testName = new SerializableTestName();
@@ -166,7 +173,8 @@ public class QueryDataDUnitTest implements Serializable {
@Test
public void testQueryOnPartitionedRegion() throws Exception {
this.managerVM.invoke(this.testName.getMethodName(), () -> {
- DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+ DistributedSystemMXBean distributedSystemMXBean =
+ this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
String jsonString = distributedSystemMXBean.queryData(QUERIES[0], null, 10);
assertThat(jsonString).contains("result").doesNotContain("No Data Found");
@@ -179,11 +187,11 @@ public class QueryDataDUnitTest implements Serializable {
// TODO: better assertions
// assertThat("QUERIES[" + i + "]", result,
- // isJson(withJsonPath("$..member",
- // equalTo(JsonPath.compile(result)))));
- // //equalTo(new JSONObject().put(String.class.getName(), member1.getId())))));
- //System.out.println(JsonPath.read(jsonString, "$.result.*"));
- //System.out.println(JsonPath.read(jsonString, "$['result']['member']"));
+ // isJson(withJsonPath("$..member",
+ // equalTo(JsonPath.compile(result)))));
+ // //equalTo(new JSONObject().put(String.class.getName(), member1.getId())))));
+ // System.out.println(JsonPath.read(jsonString, "$.result.*"));
+ // System.out.println(JsonPath.read(jsonString, "$['result']['member']"));
verifyJsonIsValid(jsonString);
}
@@ -193,7 +201,8 @@ public class QueryDataDUnitTest implements Serializable {
@Test
public void testQueryOnReplicatedRegion() throws Exception {
this.managerVM.invoke(this.testName.getMethodName(), () -> {
- DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+ DistributedSystemMXBean distributedSystemMXBean =
+ this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
String jsonString = distributedSystemMXBean.queryData(QUERIES_FOR_REPLICATED[0], null, 10);
assertThat(jsonString).contains("result").doesNotContain("No Data Found");
@@ -208,9 +217,11 @@ public class QueryDataDUnitTest implements Serializable {
@Test
public void testMemberWise() throws Exception {
this.managerVM.invoke(this.testName.getMethodName(), () -> {
- DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+ DistributedSystemMXBean distributedSystemMXBean =
+ this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
- byte[] bytes = distributedSystemMXBean.queryDataForCompressedResult(QUERIES_FOR_REPLICATED[0], member1.getId() + "," + member2.getId(), 2);
+ byte[] bytes = distributedSystemMXBean.queryDataForCompressedResult(QUERIES_FOR_REPLICATED[0],
+ member1.getId() + "," + member2.getId(), 2);
String jsonString = BeanUtilFuncs.decompress(bytes);
verifyJsonIsValid(jsonString);
@@ -222,10 +233,12 @@ public class QueryDataDUnitTest implements Serializable {
this.memberVMs[0].invoke("putBigInstances", () -> putBigInstances(REPLICATE_REGION_NAME4));
this.managerVM.invoke(this.testName.getMethodName(), () -> {
- DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+ DistributedSystemMXBean distributedSystemMXBean =
+ this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
// Query With Default values
- assertThat(distributedSystemMXBean.getQueryCollectionsDepth()).isEqualTo(TypedJson.DEFAULT_COLLECTION_ELEMENT_LIMIT);
+ assertThat(distributedSystemMXBean.getQueryCollectionsDepth())
+ .isEqualTo(TypedJson.DEFAULT_COLLECTION_ELEMENT_LIMIT);
assertThat(distributedSystemMXBean.getQueryResultSetLimit()).isEqualTo(DEFAULT_QUERY_LIMIT);
String jsonString = distributedSystemMXBean.queryData(QUERIES_FOR_LIMIT[0], null, 0);
@@ -252,8 +265,10 @@ public class QueryDataDUnitTest implements Serializable {
distributedSystemMXBean.setQueryCollectionsDepth(newQueryCollectionDepth);
distributedSystemMXBean.setQueryResultSetLimit(newQueryResultSetLimit);
- assertThat(distributedSystemMXBean.getQueryCollectionsDepth()).isEqualTo(newQueryCollectionDepth);
- assertThat(distributedSystemMXBean.getQueryResultSetLimit()).isEqualTo(newQueryResultSetLimit);
+ assertThat(distributedSystemMXBean.getQueryCollectionsDepth())
+ .isEqualTo(newQueryCollectionDepth);
+ assertThat(distributedSystemMXBean.getQueryResultSetLimit())
+ .isEqualTo(newQueryResultSetLimit);
jsonString = distributedSystemMXBean.queryData(QUERIES_FOR_LIMIT[0], null, 0);
@@ -278,41 +293,61 @@ public class QueryDataDUnitTest implements Serializable {
@Test
public void testErrors() throws Exception {
this.managerVM.invoke(this.testName.getMethodName(), () -> {
- DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+ DistributedSystemMXBean distributedSystemMXBean =
+ this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
String invalidQuery = "SELECT * FROM " + PARTITIONED_REGION_NAME1;
String invalidQueryResult = distributedSystemMXBean.queryData(invalidQuery, null, 2);
- assertThat(invalidQueryResult, isJson(withJsonPath("$.message", equalTo(QUERY__MSG__INVALID_QUERY.toLocalizedString("Region mentioned in query probably missing /")))));
+ assertThat(invalidQueryResult,
+ isJson(withJsonPath("$.message", equalTo(QUERY__MSG__INVALID_QUERY
+ .toLocalizedString("Region mentioned in query probably missing /")))));
String nonexistentRegionName = this.testName.getMethodName() + "_NONEXISTENT_REGION";
- String regionsNotFoundQuery = "SELECT * FROM /" + nonexistentRegionName + " r1, PARTITIONED_REGION_NAME2 r2 WHERE r1.ID = r2.ID";
- String regionsNotFoundResult = distributedSystemMXBean.queryData(regionsNotFoundQuery, null, 2);
- assertThat(regionsNotFoundResult, isJson(withJsonPath("$.message", equalTo(QUERY__MSG__REGIONS_NOT_FOUND.toLocalizedString("/" + nonexistentRegionName)))));
+ String regionsNotFoundQuery = "SELECT * FROM /" + nonexistentRegionName
+ + " r1, PARTITIONED_REGION_NAME2 r2 WHERE r1.ID = r2.ID";
+ String regionsNotFoundResult =
+ distributedSystemMXBean.queryData(regionsNotFoundQuery, null, 2);
+ assertThat(regionsNotFoundResult, isJson(withJsonPath("$.message",
+ equalTo(QUERY__MSG__REGIONS_NOT_FOUND.toLocalizedString("/" + nonexistentRegionName)))));
String regionName = this.testName.getMethodName() + "_REGION";
String regionsNotFoundOnMembersQuery = "SELECT * FROM /" + regionName;
- RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE);
+ RegionFactory regionFactory =
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE);
regionFactory.create(regionName);
- String regionsNotFoundOnMembersResult = distributedSystemMXBean.queryData(regionsNotFoundOnMembersQuery, member1.getId(), 2);
- assertThat(regionsNotFoundOnMembersResult, isJson(withJsonPath("$.message", equalTo(QUERY__MSG__REGIONS_NOT_FOUND_ON_MEMBERS.toLocalizedString("/" + regionName)))));
+ String regionsNotFoundOnMembersResult =
+ distributedSystemMXBean.queryData(regionsNotFoundOnMembersQuery, member1.getId(), 2);
+ assertThat(regionsNotFoundOnMembersResult, isJson(withJsonPath("$.message",
+ equalTo(QUERY__MSG__REGIONS_NOT_FOUND_ON_MEMBERS.toLocalizedString("/" + regionName)))));
String joinMissingMembersQuery = QUERIES[1];
- String joinMissingMembersResult = distributedSystemMXBean.queryData(joinMissingMembersQuery, null, 2);
- assertThat(joinMissingMembersResult, isJson(withJsonPath("$.message", equalTo(QUERY__MSG__JOIN_OP_EX.toLocalizedString()))));
+ String joinMissingMembersResult =
+ distributedSystemMXBean.queryData(joinMissingMembersQuery, null, 2);
+ assertThat(joinMissingMembersResult,
+ isJson(withJsonPath("$.message", equalTo(QUERY__MSG__JOIN_OP_EX.toLocalizedString()))));
});
}
@Test
public void testNormalRegions() throws Exception {
this.managerVM.invoke(this.testName.getMethodName(), () -> {
- DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+ DistributedSystemMXBean distributedSystemMXBean =
+ this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
String normalRegionName1 = this.testName.getMethodName() + "_NORMAL_REGION_1";
String tempRegionName1 = this.testName.getMethodName() + "_TEMP_REGION_1";
- String normalRegionName2 = this.testName.getMethodName() + "_NORMAL_REGION_2"; // to Reverse order of regions while getting Random region in QueryDataFunction [?]
+ String normalRegionName2 = this.testName.getMethodName() + "_NORMAL_REGION_2"; // to Reverse
+ // order of
+ // regions
+ // while
+ // getting
+ // Random
+ // region in
+ // QueryDataFunction
+ // [?]
String tempRegionName2 = this.testName.getMethodName() + "_TEMP_REGION_2";
Cache cache = this.managementTestRule.getCache();
@@ -328,8 +363,10 @@ public class QueryDataDUnitTest implements Serializable {
regionFactory1.create(tempRegionName1);
regionFactory1.create(tempRegionName2);
- String query1 = "SELECT * FROM /" + tempRegionName1 + " r1, /" + normalRegionName1 + " r2 WHERE r1.ID = r2.ID";
- String query2 = "SELECT * FROM /" + normalRegionName2 + " r1, /" + tempRegionName2 + " r2 WHERE r1.ID = r2.ID";
+ String query1 = "SELECT * FROM /" + tempRegionName1 + " r1, /" + normalRegionName1
+ + " r2 WHERE r1.ID = r2.ID";
+ String query2 = "SELECT * FROM /" + normalRegionName2 + " r1, /" + tempRegionName2
+ + " r2 WHERE r1.ID = r2.ID";
String query3 = "SELECT * FROM /" + normalRegionName2;
distributedSystemMXBean.queryDataForCompressedResult(query1, null, 2);
@@ -344,8 +381,8 @@ public class QueryDataDUnitTest implements Serializable {
public void testRegionsLocalDataSet() throws Exception {
String partitionedRegionName = this.testName.getMethodName() + "_PARTITIONED_REGION";
- String[] values1 = new String[] { "val1", "val2", "val3" };
- String[] values2 = new String[] { "val4", "val5", "val6" };
+ String[] values1 = new String[] {"val1", "val2", "val3"};
+ String[] values2 = new String[] {"val4", "val5", "val6"};
this.memberVMs[0].invoke(this.testName.getMethodName() + " Create Region", () -> {
PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
@@ -357,7 +394,9 @@ public class QueryDataDUnitTest implements Serializable {
}
partitionAttributesFactory.setPartitionResolver(new SingleHopQuarterPartitionResolver());
- RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(partitionAttributesFactory.create());
+ RegionFactory regionFactory =
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+ .setPartitionAttributes(partitionAttributesFactory.create());
Region region = regionFactory.create(partitionedRegionName);
for (int i = 0; i < values1.length; i++) {
@@ -375,7 +414,9 @@ public class QueryDataDUnitTest implements Serializable {
}
partitionAttributesFactory.setPartitionResolver(new SingleHopQuarterPartitionResolver());
- RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(partitionAttributesFactory.create());
+ RegionFactory regionFactory =
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+ .setPartitionAttributes(partitionAttributesFactory.create());
Region region = regionFactory.create(partitionedRegionName);
for (int i = 0; i < values2.length; i++) {
@@ -393,21 +434,29 @@ public class QueryDataDUnitTest implements Serializable {
}
partitionAttributesFactory.setPartitionResolver(new SingleHopQuarterPartitionResolver());
- RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(partitionAttributesFactory.create());
+ RegionFactory regionFactory =
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+ .setPartitionAttributes(partitionAttributesFactory.create());
regionFactory.create(partitionedRegionName);
});
- final List<String> member1RealData = this.memberVMs[0].invoke(() -> getLocalDataSet(partitionedRegionName));
- final List<String> member2RealData = this.memberVMs[1].invoke(() -> getLocalDataSet(partitionedRegionName));
- final List<String> member3RealData = this.memberVMs[2].invoke(() -> getLocalDataSet(partitionedRegionName));
+ final List<String> member1RealData =
+ this.memberVMs[0].invoke(() -> getLocalDataSet(partitionedRegionName));
+ final List<String> member2RealData =
+ this.memberVMs[1].invoke(() -> getLocalDataSet(partitionedRegionName));
+ final List<String> member3RealData =
+ this.memberVMs[2].invoke(() -> getLocalDataSet(partitionedRegionName));
this.managerVM.invoke(this.testName.getMethodName(), () -> {
- DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
- DistributedRegionMXBean distributedRegionMXBean = awaitDistributedRegionMXBean("/" + partitionedRegionName, 3);
+ DistributedSystemMXBean distributedSystemMXBean =
+ this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+ DistributedRegionMXBean distributedRegionMXBean =
+ awaitDistributedRegionMXBean("/" + partitionedRegionName, 3);
String alias = "Waiting for all entries to get reflected at managing node";
int expectedEntryCount = values1.length + values2.length;
- await(alias).until(() -> assertThat(distributedRegionMXBean.getSystemRegionEntryCount()).isEqualTo(expectedEntryCount));
+ await(alias).until(() -> assertThat(distributedRegionMXBean.getSystemRegionEntryCount())
+ .isEqualTo(expectedEntryCount));
String query = "Select * from /" + partitionedRegionName;
@@ -444,7 +493,8 @@ public class QueryDataDUnitTest implements Serializable {
assertThat(new JSONObject(jsonString)).isNotNull();
}
- private void putDataInRegion(final String regionName, final Object[] portfolio, final int from, final int to) {
+ private void putDataInRegion(final String regionName, final Object[] portfolio, final int from,
+ final int to) {
Region region = this.managementTestRule.getCache().getRegion(regionName);
for (int i = from; i < to; i++) {
region.put(new Integer(i), portfolio[i]);
@@ -459,18 +509,26 @@ public class QueryDataDUnitTest implements Serializable {
final Portfolio[] portfolio = createPortfoliosAndPositions(COUNT_DESTINATION);
// Fill local region
- this.memberVMs[0].invoke(() -> putDataInRegion(LOCAL_REGION_NAME, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[0]
+ .invoke(() -> putDataInRegion(LOCAL_REGION_NAME, portfolio, COUNT_FROM, COUNT_DESTINATION));
// Fill replicated region
- this.memberVMs[0].invoke(() -> putDataInRegion(REPLICATE_REGION_NAME1, portfolio, COUNT_FROM, COUNT_DESTINATION));
- this.memberVMs[1].invoke(() -> putDataInRegion(REPLICATE_REGION_NAME2, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[0].invoke(
+ () -> putDataInRegion(REPLICATE_REGION_NAME1, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[1].invoke(
+ () -> putDataInRegion(REPLICATE_REGION_NAME2, portfolio, COUNT_FROM, COUNT_DESTINATION));
// Fill Partition Region
- this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME1, portfolio, COUNT_FROM, COUNT_DESTINATION));
- this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME2, portfolio, COUNT_FROM, COUNT_DESTINATION));
- this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME3, portfolio, COUNT_FROM, COUNT_DESTINATION));
- this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME4, portfolio, COUNT_FROM, COUNT_DESTINATION));
- this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME5, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[0].invoke(
+ () -> putDataInRegion(PARTITIONED_REGION_NAME1, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[0].invoke(
+ () -> putDataInRegion(PARTITIONED_REGION_NAME2, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[0].invoke(
+ () -> putDataInRegion(PARTITIONED_REGION_NAME3, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[0].invoke(
+ () -> putDataInRegion(PARTITIONED_REGION_NAME4, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[0].invoke(
+ () -> putDataInRegion(PARTITIONED_REGION_NAME5, portfolio, COUNT_FROM, COUNT_DESTINATION));
this.memberVMs[0].invoke(() -> putPdxInstances(REPLICATE_REGION_NAME3));
}
@@ -520,27 +578,49 @@ public class QueryDataDUnitTest implements Serializable {
}
private void createLocalRegion() {
- this.managementTestRule.getCache().createRegionFactory(RegionShortcut.LOCAL).create(LOCAL_REGION_NAME);
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.LOCAL)
+ .create(LOCAL_REGION_NAME);
}
private void createReplicatedRegion() {
- this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE).create(REPLICATE_REGION_NAME1);
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE)
+ .create(REPLICATE_REGION_NAME1);
}
private void createColocatedPR() {
PartitionResolver testKeyBasedResolver = new TestPartitionResolver();
- this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).create()).create(PARTITIONED_REGION_NAME1);
- this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME1).create()).create(PARTITIONED_REGION_NAME2);
- this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME2).create()).create(PARTITIONED_REGION_NAME3);
- this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).create()).create(PARTITIONED_REGION_NAME4); // not collocated
- this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME4).create()).create(PARTITIONED_REGION_NAME5); // collocated with 4
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+ .setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS)
+ .setPartitionResolver(testKeyBasedResolver).create())
+ .create(PARTITIONED_REGION_NAME1);
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+ .setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS)
+ .setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME1)
+ .create())
+ .create(PARTITIONED_REGION_NAME2);
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+ .setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS)
+ .setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME2)
+ .create())
+ .create(PARTITIONED_REGION_NAME3);
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+ .setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS)
+ .setPartitionResolver(testKeyBasedResolver).create())
+ .create(PARTITIONED_REGION_NAME4); // not collocated
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+ .setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS)
+ .setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME4)
+ .create())
+ .create(PARTITIONED_REGION_NAME5); // collocated with 4
}
private void createDistributedRegion(final String regionName) {
- this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE).create(regionName);
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE)
+ .create(regionName);
}
- private void createRegionsInNodes() throws InterruptedException, TimeoutException, ExecutionException {
+ private void createRegionsInNodes()
+ throws InterruptedException, TimeoutException, ExecutionException {
// Create local Region on servers
this.memberVMs[0].invoke(() -> createLocalRegion());
@@ -572,8 +652,10 @@ public class QueryDataDUnitTest implements Serializable {
}
private List<String> getLocalDataSet(final String region) {
- PartitionedRegion partitionedRegion = PartitionedRegionHelper.getPartitionedRegion(region, this.managementTestRule.getCache());
- Set<BucketRegion> localPrimaryBucketRegions = partitionedRegion.getDataStore().getAllLocalPrimaryBucketRegions();
+ PartitionedRegion partitionedRegion =
+ PartitionedRegionHelper.getPartitionedRegion(region, this.managementTestRule.getCache());
+ Set<BucketRegion> localPrimaryBucketRegions =
+ partitionedRegion.getDataStore().getAllLocalPrimaryBucketRegions();
List<String> allPrimaryValues = new ArrayList<>();
@@ -611,7 +693,8 @@ public class QueryDataDUnitTest implements Serializable {
ObjectName objectName = service.getMemberMBeanName(member);
String alias = "awaiting MemberMXBean proxy for " + member;
- await(alias).until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
+ await(alias)
+ .until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
return service.getMBeanProxy(objectName, MemberMXBean.class);
}
@@ -632,11 +715,13 @@ public class QueryDataDUnitTest implements Serializable {
return service.getDistributedRegionMXBean(name);
}
- private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name, final int memberCount) {
+ private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name,
+ final int memberCount) {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
await().until(() -> assertThat(service.getDistributedRegionMXBean(name)).isNotNull());
- await().until(() -> assertThat(service.getDistributedRegionMXBean(name).getMemberCount()).isEqualTo(memberCount));
+ await().until(() -> assertThat(service.getDistributedRegionMXBean(name).getMemberCount())
+ .isEqualTo(memberCount));
return service.getDistributedRegionMXBean(name);
}
@@ -652,12 +737,11 @@ public class QueryDataDUnitTest implements Serializable {
private static class TestPartitionResolver implements PartitionResolver {
@Override
- public void close() {
- }
+ public void close() {}
@Override
public Serializable getRoutingObject(EntryOperation opDetails) {
- return (((Integer)opDetails.getKey()).intValue() % NUM_OF_BUCKETS);
+ return (((Integer) opDetails.getKey()).intValue() % NUM_OF_BUCKETS);
}
@Override
[19/50] [abbrv] incubator-geode git commit: GEODE-2091: Do not return
false when containsValueForKey call failed in a transaction
Posted by kl...@apache.org.
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: eshu <es...@pivotal.io>
Authored: Thu Nov 10 14:57:48 2016 -0800
Committer: eshu <es...@pivotal.io>
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<Region<?, ?>, TXRegionStub> 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<Integer, Boolean> 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(
LocalizedStrings.PartitionedRegion_KEY_0_NOT_COLOCATED_WITH_TRANSACTION
.toLocalizedString(keyInfo.getKey()));
}
ex = cause;
while (ex != null) {
- if (ex instanceof PrimaryBucketException) {
+ if (ex instanceof PrimaryBucketException || ex instanceof BucketNotFoundException) {
return new TransactionDataRebalancedException(
LocalizedStrings.PartitionedRegion_TRANSACTIONAL_DATA_MOVED_DUE_TO_REBALANCING
.toLocalizedString());
@@ -126,6 +131,23 @@ public class PartitionedTXRegionStub extends AbstractPeerTXRegionStub {
return new TransactionDataNodeHasDepartedException(cause.getLocalizedMessage());
}
+ // is this key in a different bucket from all the existing buckets
+ // of the underlying PR or its colocated PRs touched by the transaction.
+ private boolean isKeyInNonColocatedBucket(KeyInfo keyInfo) {
+ Map<Region<?, ?>, TXRegionStub> regionStubs = this.state.getRegionStubs();
+ Collection<PartitionedRegion> colcatedRegions = (Collection<PartitionedRegion>) ColocationHelper
+ .getAllColocationRegions((PartitionedRegion) this.region).values();
+ // get all colocated region buckets touched in the transaction
+ for (PartitionedRegion colcatedRegion : colcatedRegions) {
+ PartitionedTXRegionStub regionStub =
+ (PartitionedTXRegionStub) regionStubs.get(colcatedRegion);
+ if (regionStub != null) {
+ buckets.putAll(regionStub.getBuckets());
+ }
+ }
+ return keyInfo != null && !buckets.isEmpty() && !buckets.containsKey(keyInfo.getBucketId());
+ }
+
/**
* wait to retry after getting a ForceReattemptException
@@ -232,7 +254,9 @@ public class PartitionedTXRegionStub extends AbstractPeerTXRegionStub {
throw re;
} catch (ForceReattemptException e) {
if (isBucketNotFoundException(e)) {
- return false;
+ RuntimeException re = getTransactionException(keyInfo, e);
+ re.initCause(e);
+ throw re;
}
waitToRetry();
RuntimeException re = new TransactionDataNodeHasDepartedException(
@@ -274,7 +298,9 @@ public class PartitionedTXRegionStub extends AbstractPeerTXRegionStub {
throw re;
} catch (ForceReattemptException e) {
if (isBucketNotFoundException(e)) {
- return false;
+ RuntimeException re = getTransactionException(keyInfo, e);
+ re.initCause(e);
+ throw re;
}
waitToRetry();
RuntimeException re = new TransactionDataNodeHasDepartedException(
@@ -306,7 +332,9 @@ public class PartitionedTXRegionStub extends AbstractPeerTXRegionStub {
throw re;
} catch (ForceReattemptException e) {
if (isBucketNotFoundException(e)) {
- return null;
+ RuntimeException re = getTransactionException(keyInfo, e);
+ re.initCause(e);
+ throw re;
}
waitToRetry();
RuntimeException re = getTransactionException(keyInfo, e);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e01dbe6f/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 150fe33..ed8d3c6 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
@@ -43,6 +43,14 @@ public class PRDistTXDUnitTest extends PRTransactionDUnitTest {
@Test
public void testTxWithGetOnMovedBucket() {}
+ @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.")
+ @Test
+ public void testTxWithContainsKeyOnMovedBucket() {}
+
@Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
@Test
public void testBasicPRTransactionRedundancy0() {}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e01dbe6f/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 8ff1d94..4e6f846 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
@@ -43,6 +43,14 @@ public class PRDistTXWithVersionsDUnitTest extends PRTransactionWithVersionsDUni
@Test
public void testTxWithGetOnMovedBucket() {}
+ @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.")
+ @Test
+ public void testTxWithContainsKeyOnMovedBucket() {}
+
@Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
@Override
@Test
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e01dbe6f/geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java
index 2122960..e2ba2b3 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java
@@ -336,7 +336,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
*
* @param bucketRedundancy redundancy for the colocated PRs
*/
- protected void baiscPRTXWithNonColocatedGet(int bucketRedundancy) {
+ protected void basicPRTXWithNonColocatedGet(int bucketRedundancy) {
dataStore1.invoke(runGetCache);
dataStore2.invoke(runGetCache);
redundancy = new Integer(bucketRedundancy);
@@ -454,45 +454,26 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
}
/**
- * This method executes a transaction with get on a key in a moved bucket, and expects transaction
- * to fail with TransactionDataRebalancedException.
+ * This method executes a transaction with operation on a key in a moved bucket, and expects
+ * transaction to fail with TransactionDataRebalancedException.
*
+ * @param op which entry op to be executed
* @param bucketRedundancy redundancy for the colocated PRs
*/
@SuppressWarnings("unchecked")
- protected void baiscPRTXWithGetOnMovedBucket(int bucketRedundancy) {
- dataStore1.invoke(runGetCache);
- dataStore2.invoke(runGetCache);
- redundancy = new Integer(bucketRedundancy);
- localMaxmemory = new Integer(50);
- totalNumBuckets = new Integer(1);
-
- setAttributes(CustomerPartitionedRegionName, null);
-
- createPRInTwoNodes();
-
- setAttributes(OrderPartitionedRegionName, CustomerPartitionedRegionName);
-
- createPRInTwoNodes();
-
- // Put the customer 1 in CustomerPartitionedRegion
- dataStore1.invoke(
- () -> PRColocationDUnitTest.putCustomerPartitionedRegion(CustomerPartitionedRegionName, 1));
-
- // Put the associated order in colocated OrderPartitionedRegion
- dataStore1.invoke(
- () -> PRColocationDUnitTest.putOrderPartitionedRegion(OrderPartitionedRegionName, 1));
+ protected void basicPRTXWithOpOnMovedBucket(Op op, int bucketRedundancy) {
+ setupMoveBucket(bucketRedundancy);
DistributedMember dm1 = (DistributedMember) dataStore1.invoke(getDM());
DistributedMember dm2 = (DistributedMember) dataStore2.invoke(getDM());
// First get transaction.
TransactionId txId = (TransactionId) dataStore1.invoke(beginTx());
- dataStore1.invoke(resumeTx(txId, dm1, dm2));
+ dataStore1.invoke(resumeTx(op, txId, dm1, dm2));
// Second one. Will go through different path (using TXState or TXStateStub)
txId = (TransactionId) dataStore1.invoke(beginTx());
- dataStore1.invoke(resumeTx(txId, dm1, dm2));
+ dataStore1.invoke(resumeTx(op, txId, dm1, dm2));
}
@SuppressWarnings({"rawtypes", "serial"})
@@ -523,7 +504,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
}
@SuppressWarnings("serial")
- private SerializableRunnable resumeTx(TransactionId txId, DistributedMember dm1,
+ private SerializableRunnable resumeTx(Op op, TransactionId txId, DistributedMember dm1,
DistributedMember dm2) {
return new SerializableRunnable("resume tx") {
@Override
@@ -532,57 +513,96 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
.getRegion(Region.SEPARATOR + OrderPartitionedRegionName);
CacheTransactionManager mgr = basicGetCache().getCacheTransactionManager();
- moveBucket(dm1, dm2);
+ moveBucket(op, dm1, dm2);
- Assertions.assertThatThrownBy(() -> _resumeTx(txId, pr, mgr))
+ Assertions.assertThatThrownBy(() -> _resumeTx(op, txId, pr, mgr))
.isInstanceOf(TransactionDataRebalancedException.class);
}
+ };
+ }
- private void _resumeTx(TransactionId txId, PartitionedRegion pr,
- CacheTransactionManager mgr) {
- CustId cust1 = new CustId(1);
- OrderId order1 = new OrderId(11, cust1);
- mgr.resume(txId);
- try {
+ enum Op {
+ GET, CONTAINSVALUEFORKEY, CONTAINSKEY;
+ }
+
+ private void _resumeTx(Op op, TransactionId txId, PartitionedRegion pr,
+ CacheTransactionManager mgr) {
+ CustId cust1 = new CustId(1);
+ OrderId order1 = new OrderId(11, cust1);
+ mgr.resume(txId);
+ try {
+ switch (op) {
+ case GET:
pr.get(order1);
- } finally {
- mgr.rollback();
- }
+ break;
+ case CONTAINSVALUEFORKEY:
+ pr.containsValueForKey(order1);
+ break;
+ case CONTAINSKEY:
+ pr.containsKey(order1);
+ break;
+ default:
+ throw new AssertionError("Unknown operations " + op);
}
- @SuppressWarnings("unchecked")
- private void moveBucket(DistributedMember dm1, DistributedMember dm2) {
- PartitionedRegion pr = (PartitionedRegion) basicGetCache()
- .getRegion(Region.SEPARATOR + CustomerPartitionedRegionName);
- CustId cust1 = new CustId(1);
- OrderId order1 = new OrderId(11, cust1);
- boolean isCust1Local = isCust1LocalSingleBucket(pr, cust1);
- DistributedMember source = isCust1Local ? dm1 : dm2;
- DistributedMember destination = isCust1Local ? dm2 : dm1;
- PartitionedRegion prOrder = (PartitionedRegion) basicGetCache()
- .getRegion(Region.SEPARATOR + OrderPartitionedRegionName);
+ } finally {
+ mgr.rollback();
+ }
+ }
- LogService.getLogger().info("source ={}, destination ={}", source, destination);
- if (isCust1Local) {
- // Use TXState
- setBucketReadHook(order1, source, destination, prOrder);
- } else {
- // Use TXStateStub -- transaction data on remote node
- PartitionRegionHelper.moveBucketByKey(prOrder, source, destination, order1);
- }
- }
+ @SuppressWarnings("unchecked")
+ private void moveBucket(Op op, DistributedMember dm1, DistributedMember dm2) {
+ PartitionedRegion pr = (PartitionedRegion) basicGetCache()
+ .getRegion(Region.SEPARATOR + CustomerPartitionedRegionName);
+ CustId cust1 = new CustId(1);
+ OrderId order1 = new OrderId(11, cust1);
+ boolean isCust1Local = isCust1LocalSingleBucket(pr, cust1);
+ DistributedMember source = isCust1Local ? dm1 : dm2;
+ DistributedMember destination = isCust1Local ? dm2 : dm1;
+ PartitionedRegion prOrder = (PartitionedRegion) basicGetCache()
+ .getRegion(Region.SEPARATOR + OrderPartitionedRegionName);
+
+ LogService.getLogger().info("source ={}, destination ={}", source, destination);
+
+ switch (op) {
+ case GET:
+ moveBucketForGet(order1, isCust1Local, source, destination, prOrder);
+ break;
+ case CONTAINSVALUEFORKEY:
+ case CONTAINSKEY:
+ PartitionRegionHelper.moveBucketByKey(prOrder, source, destination, order1);
+ break;
+ default:
+ throw new AssertionError("Unknown operations " + op);
+ }
+ }
- private void setBucketReadHook(OrderId order1, DistributedMember source,
- DistributedMember destination, PartitionedRegion prOrder) {
- prOrder.getDataStore().setBucketReadHook(new Runnable() {
- @SuppressWarnings("unchecked")
- public void run() {
- LogService.getLogger().info("In bucketReadHook");
- PartitionRegionHelper.moveBucketByKey(prOrder, source, destination, order1);
- }
- });
+ @SuppressWarnings("unchecked")
+ private void moveBucketForGet(OrderId order1, boolean isCust1Local, DistributedMember source,
+ DistributedMember destination, PartitionedRegion prOrder) {
+ if (isCust1Local) {
+ // Use TXState
+ setBucketReadHook(order1, source, destination, prOrder);
+ } else {
+ // Use TXStateStub -- transaction data on remote node
+ PartitionRegionHelper.moveBucketByKey(prOrder, source, destination, order1);
+ }
+ }
+
+ private void setBucketReadHook(OrderId order1, DistributedMember source,
+ DistributedMember destination, PartitionedRegion prOrder) {
+ prOrder.getDataStore().setBucketReadHook(new Runnable() {
+ @SuppressWarnings("unchecked")
+ public void run() {
+ LogService.getLogger().info("In bucketReadHook");
+ PartitionRegionHelper.moveBucketByKey(prOrder, source, destination, order1);
}
- };
+ });
+ }
+
+ private void createPRInTwoNodes() {
+ dataStore1.invoke(PRColocationDUnitTest.class, "createPR", this.attributeObjects);
+ dataStore2.invoke(PRColocationDUnitTest.class, "createPR", this.attributeObjects);
}
@SuppressWarnings("unchecked")
@@ -591,20 +611,52 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
return (Integer) localPrimaryBucketList.size() == 1;
}
+ @SuppressWarnings("unchecked")
+ private void setupMoveBucket(int bucketRedundancy) {
+ dataStore1.invoke(runGetCache);
+ dataStore2.invoke(runGetCache);
+ redundancy = new Integer(bucketRedundancy);
+ localMaxmemory = new Integer(50);
+ totalNumBuckets = new Integer(1);
- private void createPRInTwoNodes() {
- dataStore1.invoke(PRColocationDUnitTest.class, "createPR", this.attributeObjects);
- dataStore2.invoke(PRColocationDUnitTest.class, "createPR", this.attributeObjects);
+ setAttributes(CustomerPartitionedRegionName, null);
+
+ createPRInTwoNodes();
+
+ setAttributes(OrderPartitionedRegionName, CustomerPartitionedRegionName);
+
+ createPRInTwoNodes();
+
+ // Put the customer 1 in CustomerPartitionedRegion
+ dataStore1.invoke(
+ () -> PRColocationDUnitTest.putCustomerPartitionedRegion(CustomerPartitionedRegionName, 1));
+
+ // Put the associated order in colocated OrderPartitionedRegion
+ dataStore1.invoke(
+ () -> PRColocationDUnitTest.putOrderPartitionedRegion(OrderPartitionedRegionName, 1));
}
@Test
public void testTxWithNonColocatedGet() {
- baiscPRTXWithNonColocatedGet(0);
+ basicPRTXWithNonColocatedGet(0);
}
@Test
public void testTxWithGetOnMovedBucket() {
- baiscPRTXWithGetOnMovedBucket(0);
+ Op op = Op.GET;
+ basicPRTXWithOpOnMovedBucket(op, 0);
+ }
+
+ @Test
+ public void testTxWithContainsValueForKeyOnMovedBucket() {
+ Op op = Op.CONTAINSVALUEFORKEY;
+ basicPRTXWithOpOnMovedBucket(op, 0);
+ }
+
+ @Test
+ public void testTxWithContainsKeyOnMovedBucket() {
+ Op op = Op.CONTAINSKEY;
+ basicPRTXWithOpOnMovedBucket(op, 0);
}
@Test
[21/50] [abbrv] incubator-geode git commit: Fix documentation typo.
Region attribute compressor uses lower case 'c',
and the example used upper case 'C'.
Posted by kl...@apache.org.
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 Miller <km...@pivotal.io>
Authored: Fri Nov 11 10:05:22 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
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\u201d lock-lease="120" lock-timeout= "60" search-timeout= "300" is-server= "true" copy-on-read= "false" >
<region name="compressedRegion" >
<region-attributes data-policy="replicate" ... />
- <Compressor>
+ <compressor>
<class-name>org.apache.geode.compression.SnappyCompressor</class-name>
- </Compressor>
+ </compressor>
...
</region-attributes>
</region>
[46/50] [abbrv] incubator-geode git commit: Convert from
ManagementTestCase to ManagementTestRule
Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java
index 289d6d7..a38dd48 100644
--- a/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java
@@ -14,6 +14,7 @@
*/
package org.apache.geode.management;
+import static com.jayway.awaitility.Awaitility.*;
import static org.apache.geode.distributed.ConfigurationProperties.*;
import static org.junit.Assert.*;
@@ -21,8 +22,11 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
import javax.management.Attribute;
import javax.management.AttributeList;
+import javax.management.JMException;
import javax.management.MBeanServer;
import javax.management.Notification;
import javax.management.NotificationListener;
@@ -36,32 +40,31 @@ import org.apache.geode.cache.Cache;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.Region;
import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.offheap.OffHeapMemoryStats;
import org.apache.geode.internal.offheap.OffHeapStorage;
import org.apache.geode.internal.offheap.OffHeapStoredObject;
import org.apache.geode.management.internal.MBeanJMXAdapter;
import org.apache.geode.management.internal.beans.MemberMBean;
import org.apache.geode.test.dunit.Host;
-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.dunit.cache.internal.JUnit4CacheTestCase;
import org.apache.geode.test.junit.categories.DistributedTest;
/**
* Tests the off-heap additions to the RegionMXBean and MemberMXBean JMX interfaces.
*/
-@SuppressWarnings("serial")
@Category(DistributedTest.class)
+@SuppressWarnings("serial")
public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
+
/**
* Specified assertion operations.
*/
- private static enum ASSERT_OP {
- EQUAL, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN
+ private enum ASSERT_OP {
+ EQUAL,
+ GREATER_THAN,
+ GREATER_THAN_OR_EQUAL,
+ LESS_THAN
}
/**
@@ -117,9 +120,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* A region entry value.
*/
- private static final byte[] VALUE =
- "Proin lobortis enim vel sem congue ut condimentum leo rhoncus. In turpis lorem, rhoncus nec rutrum vel, sodales vitae lacus. Etiam nunc ligula, scelerisque id egestas vitae, gravida non enim. Donec ac ligula purus. Mauris gravida ligula sit amet mi ornare blandit. Aliquam at velit ac enim varius malesuada ut eu tortor. Quisque diam nisi, fermentum vel accumsan at, commodo et velit."
- .getBytes();
+ private static final byte[] VALUE = "Proin lobortis enim vel sem congue ut condimentum leo rhoncus. In turpis lorem, rhoncus nec rutrum vel, sodales vitae lacus. Etiam nunc ligula, scelerisque id egestas vitae, gravida non enim. Donec ac ligula purus. Mauris gravida ligula sit amet mi ornare blandit. Aliquam at velit ac enim varius malesuada ut eu tortor. Quisque diam nisi, fermentum vel accumsan at, commodo et velit."
+ .getBytes();
/**
* The expected size of the region entry value in off-heap memory.
@@ -129,8 +131,7 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Listens for off-heap JMX notifications.
*/
- private static final OffHeapNotificationListener notificationListener =
- new OffHeapNotificationListener();
+ private static final OffHeapNotificationListener notificationListener = new OffHeapNotificationListener();
/**
* Local MBeanServer.
@@ -139,28 +140,20 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
@Override
public final void postSetUp() throws Exception {
- Host.getHost(0).getVM(0).invoke(new SerializableRunnable() {
- @Override
- public void run() {
- System.setProperty(OffHeapStorage.STAY_CONNECTED_ON_OUTOFOFFHEAPMEMORY_PROPERTY, "true");
- }
+ Host.getHost(0).getVM(0).invoke(() -> {
+ System.setProperty(OffHeapStorage.STAY_CONNECTED_ON_OUTOFOFFHEAPMEMORY_PROPERTY, "true");
});
}
@Override
public final void preTearDownCacheTestCase() throws Exception {
- Host.getHost(0).getVM(0).invoke(new SerializableRunnable() {
- @Override
- public void run() {
- System.clearProperty(OffHeapStorage.STAY_CONNECTED_ON_OUTOFOFFHEAPMEMORY_PROPERTY);
- }
+ Host.getHost(0).getVM(0).invoke(() -> {
+ System.clearProperty(OffHeapStorage.STAY_CONNECTED_ON_OUTOFOFFHEAPMEMORY_PROPERTY);
});
}
/**
* Tests off-heap additions to the RegionMXBean and MemberMXBean interfaces.
- *
- * @throws Exception
*/
@Test
public void testOffHeapMBeanAttributesAndStats() throws Exception {
@@ -209,8 +202,6 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Tests the fragmentation statistic for off-heap memory.
- *
- * @throws Exception
*/
@Test
public void testFragmentationStat() throws Exception {
@@ -236,7 +227,7 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
// Make sure our starting off heap stats are correct
assertOffHeapMetricsOnVm(vm, TOTAL_MEMORY, 0, 0, 0);
- // After allocating large chunk (equal to total memory)
+ // After allocating large chunk (equal to total memory)
// we should still have no fragmentation
int largeChunk = (int) TOTAL_MEMORY - OffHeapStoredObject.HEADER_SIZE;
doPutOnVm(vm, KEY, new byte[largeChunk], OFF_HEAP_REGION_NAME, false);
@@ -258,7 +249,7 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
doPutOnVm(vm, KEY + "1", new byte[halfChunk], OFF_HEAP_REGION_NAME, false);
doDestroyOnVm(vm, KEY + "0", OFF_HEAP_REGION_NAME);
- // Allocate largeChunk to trigger compaction and fragmentation should be zero
+ // Allocate largeChunk to trigger compaction and fragmentation should be zero
// as all free memory is available as one fragment
doPutOnVm(vm, KEY + "1", new byte[largeChunk], OFF_HEAP_REGION_NAME, true);
assertFragmentationStatOnVm(vm, 0, ASSERT_OP.EQUAL);
@@ -300,9 +291,7 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
}
/**
- * Tests the compation time statistic for off-heap memory.
- *
- * @throws Exception
+ * Tests the compaction time statistic for off-heap memory.
*/
@Test
public void testCompactionTimeStat() throws Exception {
@@ -476,12 +465,12 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Destroys a number of entries previously allocated.
- *
+ *
* @param vm a virtual machine
* @param numAllocations the number of previous off-heap allocations
* @param numDestroys the number of destroys to perform
*/
- protected void doFreeOffHeapMemoryOnVm(VM vm, final int numAllocations, final int numDestroys) {
+ private void doFreeOffHeapMemoryOnVm(final VM vm, final int numAllocations, final int numDestroys) {
vm.invoke(new SerializableRunnable() {
@Override
public void run() {
@@ -492,11 +481,11 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Performs some destroys to free off-heap allocations.
- *
+ *
* @param numAllocations the number of previous off-heap allocations
* @param numDestroys the number of destroys to perform
*/
- protected void doFreeOffHeapMemory(int numAllocations, int numDestroys) {
+ private void doFreeOffHeapMemory(final int numAllocations, final int numDestroys) {
assertTrue(numDestroys <= numAllocations);
Region region = getCache().getRegion(OFF_HEAP_REGION_NAME);
@@ -520,34 +509,29 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Consumes off off-heap memory until the allocation size cannot be satisfied.
- *
+ *
* @param vm a virtual machine
* @param allocationSize the number of bytes for each allocation
+ *
* @return the number of successful puts
*/
- protected int doConsumeOffHeapMemoryOnVm(VM vm, final int allocationSize) {
- return (Integer) vm.invoke(new SerializableCallable() {
- @Override
- public Object call() {
- return doConsumeOffHeapMemory(allocationSize);
- }
- });
+ private int doConsumeOffHeapMemoryOnVm(final VM vm, final int allocationSize) {
+ return vm.invoke(() -> doConsumeOffHeapMemory(allocationSize));
}
/**
* Consumes off off-heap memory until the allocation size cannot be satisfied.
- *
+ *
* @param allocationSize the number of bytes for each allocation
+ *
* @return the number of successful puts
*/
- protected int doConsumeOffHeapMemory(int allocationSize) { // TODO:KIRK: change this to handle new
- // OutOfOffHeapMemoryException
- OffHeapMemoryStats stats = ((GemFireCacheImpl) getCache()).getOffHeapStore().getStats();
+ private int doConsumeOffHeapMemory(final int allocationSize) {
int i = 0;
// Loop until we fail
try {
- while (true) {
+ while (true) { // TODO: put a time limit on this just in case
doPut("KEY" + (i++), new byte[allocationSize], OFF_HEAP_REGION_NAME, false);
}
} catch (OutOfOffHeapMemoryException e) {
@@ -558,28 +542,22 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Asserts that the compactionTime stat is available and satisfies an assert operation.
- *
+ *
* @param vm a virtual machine.
* @param compactionTime total off heap compaction time.
* @param op an assert operation.
*/
- protected void assertCompactionTimeStatOnVm(VM vm, final long compactionTime,
- final ASSERT_OP op) {
- vm.invoke(new SerializableRunnable() {
- @Override
- public void run() {
- assertCompactionTimeStat(compactionTime, op);
- }
- });
+ private void assertCompactionTimeStatOnVm(final VM vm, final long compactionTime, final ASSERT_OP op) {
+ vm.invoke(() -> assertCompactionTimeStat(compactionTime, op));
}
/**
* Asserts that the compactionTime stat is available and satisfies an assert operation.
- *
+ *
* @param compactionTime total off heap compaction time.
* @param op an assert operation.
*/
- protected void assertCompactionTimeStat(long compactionTime, ASSERT_OP op) {
+ private void assertCompactionTimeStat(final long compactionTime, final ASSERT_OP op) {
ManagementService service = ManagementService.getExistingManagementService(getCache());
assertNotNull(service);
@@ -606,27 +584,22 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Asserts that the fragmentation stat is available and satisfies an assert operation.
- *
+ *
* @param vm a virtual machine
* @param fragmentation a fragmentation percentage
* @param op an assertion operation
*/
- protected void assertFragmentationStatOnVm(VM vm, final int fragmentation, final ASSERT_OP op) {
- vm.invoke(new SerializableRunnable() {
- @Override
- public void run() {
- assertFragmentationStat(fragmentation, op);
- }
- });
+ private void assertFragmentationStatOnVm(final VM vm, final int fragmentation, final ASSERT_OP op) {
+ vm.invoke(() -> assertFragmentationStat(fragmentation, op));
}
/**
* Asserts that the fragmentation stat is available and satisfies an assert operation.
- *
+ *
* @param fragmentation a fragmentation percentage
* @param op an assertion operation
*/
- protected void assertFragmentationStat(int fragmentation, ASSERT_OP op) {
+ private void assertFragmentationStat(final int fragmentation, final ASSERT_OP op) {
ManagementService service = ManagementService.getExistingManagementService(getCache());
assertNotNull(service);
@@ -651,7 +624,7 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Returns off-heap system properties for enabling off-heap and the JMX system.
*/
- protected Properties getSystemProperties() {
+ private Properties getSystemProperties() {
Properties props = getDistributedSystemProperties();
props.setProperty(OFF_HEAP_MEMORY_SIZE, "1m");
@@ -664,16 +637,11 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Removes off heap region on vm and disconnects.
- *
- * @param vm a virutal machine.
+ *
+ * @param vm a virtual machine.
*/
- protected void doCleanupOnVm(VM vm) {
- vm.invoke(new SerializableRunnable() {
- @Override
- public void run() {
- cleanup();
- }
- });
+ private void doCleanupOnVm(final VM vm) {
+ vm.invoke(() -> cleanup());
}
/**
@@ -696,20 +664,14 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Asserts that the off heap region data is available and enabled for a VM.
*/
- @SuppressWarnings("serial")
- protected void assertOffHeapRegionAttributesOnVm(VM vm) {
- vm.invoke(new SerializableRunnable() {
- @Override
- public void run() {
- assertOffHeapRegionAttributes();
- }
- });
+ private void assertOffHeapRegionAttributesOnVm(final VM vm) {
+ vm.invoke(() -> assertOffHeapRegionAttributes());
}
/**
* Asserts that the off heap region data is available and enabled.
*/
- protected void assertOffHeapRegionAttributes() {
+ private void assertOffHeapRegionAttributes() {
ManagementService service = ManagementService.getExistingManagementService(getCache());
assertNotNull(service);
@@ -726,33 +688,30 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Asserts that OffHeapMetrics match input parameters for a VM.
- *
+ *
* @param vm a virtual machine.
* @param freeMemory total off-heap free memory in bytes.
* @param allocatedMemory allocated (or used) off-heap memory in bytes.
* @param objects number of objects stored in off-heap memory.
* @param fragmentation the fragmentation percentage.
*/
- protected void assertOffHeapMetricsOnVm(VM vm, final long freeMemory, final long allocatedMemory,
- final long objects, final int fragmentation) {
- vm.invoke(new SerializableRunnable() {
- @Override
- public void run() {
- assertOffHeapMetrics(freeMemory, allocatedMemory, objects, fragmentation);
- }
- });
+ private void assertOffHeapMetricsOnVm(final VM vm,
+ final long freeMemory,
+ final long allocatedMemory,
+ final long objects,
+ final int fragmentation) {
+ vm.invoke(() -> assertOffHeapMetrics(freeMemory, allocatedMemory, objects, fragmentation));
}
/**
* Asserts that OffHeapMetrics match input parameters.
- *
+ *
* @param freeMemory total off-heap free memory in bytes.
* @param allocatedMemory allocated (or used) off-heap memory in bytes.
* @param objects number of objects stored in off-heap memory.
* @param fragmentation the fragmentation percentage.
*/
- protected void assertOffHeapMetrics(long freeMemory, long allocatedMemory, long objects,
- int fragmentation) {
+ private void assertOffHeapMetrics(final long freeMemory, final long allocatedMemory, final long objects, final int fragmentation) {
ManagementService service = ManagementService.getExistingManagementService(getCache());
assertNotNull(service);
@@ -769,57 +728,47 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Creates an off-heap region on a vm.
- *
+ *
* @param vm a virtual machine.
* @param name a region name.
* @param dataPolicy a data policy.
+ *
* @return true if successful.
*/
- protected boolean createOffHeapRegionOnVm(final VM vm, final String name,
- final DataPolicy dataPolicy) {
- return (Boolean) vm.invoke(new SerializableCallable() {
- @Override
- public Object call() throws Exception {
- return (null != createOffHeapRegion(name, dataPolicy));
- }
- });
+ private boolean createOffHeapRegionOnVm(final VM vm, final String name, final DataPolicy dataPolicy) {
+ return vm.invoke(() -> null != createOffHeapRegion(name, dataPolicy));
}
/**
* Creates an off-heap region.
- *
+ *
* @param name a region name.
* @param dataPolicy a data policy.
+ *
* @return the newly created region.
*/
- protected Region createOffHeapRegion(String name, DataPolicy dataPolicy) {
+ private Region createOffHeapRegion(final String name, final DataPolicy dataPolicy) {
return getCache().createRegionFactory().setOffHeap(true).setDataPolicy(dataPolicy).create(name);
}
/**
* Sets the distributed system properties for a vm.
- *
+ *
* @param vm a virtual machine.
* @param management starts the ManagementService when true.
* @param props distributed system properties.
*/
- @SuppressWarnings("serial")
- protected void setSystemPropertiesOnVm(VM vm, final boolean management, final Properties props) {
- vm.invoke(new SerializableRunnable() {
- @Override
- public void run() {
- setSystemProperties(management, props);
- }
- });
+ private void setSystemPropertiesOnVm(final VM vm, final boolean management, final Properties props) {
+ vm.invoke(() -> setSystemProperties(management, props));
}
/**
* Sets the distributed system properties.
- *
+ *
* @param management starts the ManagementService when true.
* @param props distributed system properties.
*/
- protected void setSystemProperties(boolean management, Properties props) {
+ private void setSystemProperties(final boolean management, final Properties props) {
getSystem(props);
if (management) {
@@ -832,27 +781,22 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Performs a destroy operation on a vm.
- *
+ *
* @param vm a virtual machine.
* @param key the region entry to destroy.
* @param regionName a region name.
*/
- protected void doDestroyOnVm(final VM vm, final Object key, final String regionName) {
- vm.invoke(new SerializableRunnable() {
- @Override
- public void run() {
- doDestroy(key, regionName);
- }
- });
+ private void doDestroyOnVm(final VM vm, final Object key, final String regionName) {
+ vm.invoke(() -> doDestroy(key, regionName));
}
/**
* Performs a destroy operation.
- *
+ *
* @param key the region entry to destroy.
* @param regionName a region name.
*/
- protected void doDestroy(Object key, String regionName) {
+ private void doDestroy(final Object key, final String regionName) {
Region region = getCache().getRegion(regionName);
assertNotNull(region);
@@ -861,59 +805,56 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Performs a put operation on a vm.
- *
+ *
* @param vm a virtual machine.
* @param key region entry key.
* @param value region entry value.
* @param regionName a region name.
*/
- protected void doPutOnVm(final VM vm, final Object key, final Object value,
- final String regionName, final boolean expectException) {
- vm.invoke(new SerializableRunnable() {
- @Override
- public void run() {
- doPut(key, value, regionName, expectException);
- }
- });
+ private void doPutOnVm(final VM vm,
+ final Object key,
+ final Object value,
+ final String regionName,
+ final boolean expectException) {
+ vm.invoke(() -> doPut(key, value, regionName, expectException));
}
/**
* Performs a put operation.
- *
+ *
* @param key region entry key.
* @param value region entry value.
* @param regionName a region name.
*/
- protected void doPut(Object key, Object value, String regionName, boolean expectException) {
+ private void doPut(final Object key, final Object value, final String regionName, final boolean expectException) {
Region region = getCache().getRegion(regionName);
assertNotNull(region);
try {
region.put(key, value);
+ if (expectException) {
+ fail("Expected OutOfOffHeapMemoryException");
+ }
} catch (OutOfOffHeapMemoryException e) {
- if (!expectException)
+ if (!expectException) {
throw e;
+ }
}
}
/**
* Adds an off-heap notification listener to the MemberMXBean for a vm.
- *
+ *
* @param vm a virtual machine.
*/
- protected void addOffHeapNotificationListenerOnVm(VM vm) {
- vm.invoke(new SerializableRunnable() {
- @Override
- public void run() {
- addOffHeapNotificationListener();
- }
- });
+ private void addOffHeapNotificationListenerOnVm(final VM vm) {
+ vm.invoke(() -> addOffHeapNotificationListener());
}
/**
* Adds an off-heap notification listener to the MemberMXBean.
*/
- protected void addOffHeapNotificationListener() {
+ private void addOffHeapNotificationListener() {
ManagementService service = ManagementService.getExistingManagementService(getCache());
assertNotNull(service);
@@ -929,116 +870,90 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
/**
* Creates and adds a generic GaugeMonitor for an attribute of the MemberMXBean on a VM.
- *
+ *
* @param vm a virtual machine.
* @param attribute the attribute to monitor.
* @param highThreshold the high threshold trigger.
* @param lowThreshold the low threshold trigger.
*/
- protected void setupOffHeapMonitorOnVm(VM vm, final String attribute, final long highThreshold,
- final long lowThreshold) {
- vm.invoke(new SerializableRunnable() {
- @Override
- public void run() {
- setupOffHeapMonitor(attribute, highThreshold, lowThreshold);
- }
- });
+ private void setupOffHeapMonitorOnVm(final VM vm,
+ final String attribute,
+ final long highThreshold,
+ final long lowThreshold) {
+ vm.invoke(() -> setupOffHeapMonitor(attribute, highThreshold, lowThreshold));
}
/**
* Creates and adds a generic GaugeMonitor for an attribute of the MemberMXBean.
- *
+ *
* @param attribute the attribute to monitor.
* @param highThreshold the high threshold trigger.
* @param lowThreshold the low threshold trigger.
*/
- protected void setupOffHeapMonitor(String attribute, long highThreshold, long lowThreshold) {
- ObjectName memberMBeanObjectName = MBeanJMXAdapter.getMemberMBeanName(
- InternalDistributedSystem.getConnectedInstance().getDistributedMember());
+ private void setupOffHeapMonitor(final String attribute, final long highThreshold, final long lowThreshold) throws JMException {
+ ObjectName memberMBeanObjectName = MBeanJMXAdapter.getMemberMBeanName(InternalDistributedSystem.getConnectedInstance().getDistributedMember());
assertNotNull(memberMBeanObjectName);
- try {
- ObjectName offHeapMonitorName = new ObjectName("monitors:type=Gauge,attr=" + attribute);
- mbeanServer.createMBean("javax.management.monitor.GaugeMonitor", offHeapMonitorName);
-
- AttributeList al = new AttributeList();
- al.add(new Attribute("ObservedObject", memberMBeanObjectName));
- al.add(new Attribute("GranularityPeriod", 500));
- al.add(new Attribute("ObservedAttribute", attribute));
- al.add(new Attribute("Notify", true));
- al.add(new Attribute("NotifyHigh", true));
- al.add(new Attribute("NotifyLow", true));
- al.add(new Attribute("HighTheshold", highThreshold));
- al.add(new Attribute("LowThreshold", lowThreshold));
-
- mbeanServer.setAttributes(offHeapMonitorName, al);
- mbeanServer.addNotificationListener(offHeapMonitorName, notificationListener, null, null);
- mbeanServer.invoke(offHeapMonitorName, "start", new Object[] {}, new String[] {});
- } catch (Exception e) {
- fail(e.getMessage());
- }
+ ObjectName offHeapMonitorName = new ObjectName("monitors:type=Gauge,attr=" + attribute);
+ mbeanServer.createMBean("javax.management.monitor.GaugeMonitor", offHeapMonitorName);
+
+ AttributeList al = new AttributeList();
+ al.add(new Attribute("ObservedObject", memberMBeanObjectName));
+ al.add(new Attribute("GranularityPeriod", 500));
+ al.add(new Attribute("ObservedAttribute", attribute));
+ al.add(new Attribute("Notify", true));
+ al.add(new Attribute("NotifyHigh", true));
+ al.add(new Attribute("NotifyLow", true));
+ al.add(new Attribute("HighTheshold", highThreshold));
+ al.add(new Attribute("LowThreshold", lowThreshold));
+
+ mbeanServer.setAttributes(offHeapMonitorName, al);
+ mbeanServer.addNotificationListener(offHeapMonitorName, notificationListener, null, null);
+ mbeanServer.invoke(offHeapMonitorName, "start", new Object[] {}, new String[] {});
}
/**
* Waits to receive MBean notifications.
- *
+ *
* @param vm a virtual machine.
* @param wait how long to wait for in millis.
* @param interval the polling interval to check for notifications.
* @param throwOnTimeout throws an exception on timeout if true.
*/
- protected void waitForNotificationListenerOnVm(VM vm, final long wait, final long interval,
- final boolean throwOnTimeout) {
- vm.invoke(new SerializableRunnable() {
- @Override
- public void run() {
- Wait.waitForCriterion(new WaitCriterion() {
- @Override
- public boolean done() {
- return (notificationListener.getNotificationSize() > 0);
- }
-
- @Override
- public String description() {
- return "Awaiting Notification Listener";
- }
- }, wait, interval, throwOnTimeout);
- }
- });
+ private void waitForNotificationListenerOnVm(final VM vm,
+ final long wait,
+ final long interval,
+ final boolean throwOnTimeout) {
+ vm.invoke(() -> await("Awaiting Notification Listener").atMost(wait, TimeUnit.MILLISECONDS).until(() -> assertTrue(notificationListener.getNotificationSize() > 0)));
}
/**
* Clears received notifications.
- *
+ *
* @param vm a virtual machine.
*/
- protected void clearNotificationListenerOnVm(VM vm) {
- vm.invoke(new SerializableRunnable() {
- @Override
- public void run() {
- notificationListener.clear();
- }
- });
+ private void clearNotificationListenerOnVm(final VM vm) {
+ vm.invoke(() -> notificationListener.clear());
}
-}
+ /**
+ * Collects MBean Notifications.
+ */
+ private static class OffHeapNotificationListener implements NotificationListener {
-/**
- * Collects MBean Notifications.
- */
-class OffHeapNotificationListener implements NotificationListener {
- List<Notification> notificationList = Collections.synchronizedList(new ArrayList<Notification>());
+ List<Notification> notificationList = Collections.synchronizedList(new ArrayList<Notification>());
- @Override
- public void handleNotification(Notification notification, Object handback) {
- this.notificationList.add(notification);
- }
+ @Override
+ public void handleNotification(final Notification notification, final Object handback) {
+ this.notificationList.add(notification);
+ }
- public void clear() {
- this.notificationList.clear();
- }
+ public void clear() {
+ this.notificationList.clear();
+ }
- public int getNotificationSize() {
- return this.notificationList.size();
+ public int getNotificationSize() {
+ return this.notificationList.size();
+ }
}
}
[10/50] [abbrv] incubator-geode git commit: GEODE-1785: add script to
generate region entry source
Posted by kl...@apache.org.
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 directory).
*/
public class VersionedThinLRURegionEntryOffHeapStringKey2
extends VersionedThinLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java
index 24fb7f5..e9d3d9e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java
@@ -47,7 +47,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 VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRURegionEntryOffHeap {
public VersionedThinLRURegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapIntKey.java
index 7339070..f3330ac 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapIntKey.java
@@ -38,7 +38,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 VersionedThinRegionEntryHeapIntKey extends VersionedThinRegionEntryHeap {
public VersionedThinRegionEntryHeapIntKey(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/VersionedThinRegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapLongKey.java
index 0078d88..20dd863 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapLongKey.java
@@ -38,7 +38,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 VersionedThinRegionEntryHeapLongKey extends VersionedThinRegionEntryHeap {
public VersionedThinRegionEntryHeapLongKey(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/VersionedThinRegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapObjectKey.java
index dc4b28d..665fa49 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapObjectKey.java
@@ -38,7 +38,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 VersionedThinRegionEntryHeapObjectKey extends VersionedThinRegionEntryHeap {
public VersionedThinRegionEntryHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey1.java
index 44d2ab4..6b5783e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey1.java
@@ -38,7 +38,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 VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionEntryHeap {
public VersionedThinRegionEntryHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey2.java
index 220515f..5cdf57d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey2.java
@@ -38,7 +38,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 VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionEntryHeap {
public VersionedThinRegionEntryHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapUUIDKey.java
index a347211..1900435 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapUUIDKey.java
@@ -39,7 +39,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 VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntryHeap {
public VersionedThinRegionEntryHeapUUIDKey(RegionEntryContext context, UUID 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/VersionedThinRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapIntKey.java
index 89747ad..e920222 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapIntKey.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 VersionedThinRegionEntryOffHeapIntKey extends VersionedThinRegionEntryOffHeap {
public VersionedThinRegionEntryOffHeapIntKey(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/VersionedThinRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapLongKey.java
index f1059d1..8b3de9d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapLongKey.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 VersionedThinRegionEntryOffHeapLongKey extends VersionedThinRegionEntryOffHeap {
public VersionedThinRegionEntryOffHeapLongKey(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/VersionedThinRegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapObjectKey.java
index 11e8166..90ac91a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapObjectKey.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 VersionedThinRegionEntryOffHeapObjectKey extends VersionedThinRegionEntryOffHeap {
public VersionedThinRegionEntryOffHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapStringKey1.java
index 1f133ec..80b4237 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapStringKey1.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 VersionedThinRegionEntryOffHeapStringKey1 extends VersionedThinRegionEntryOffHeap {
public VersionedThinRegionEntryOffHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapStringKey2.java
index 9e61638..f1dd95e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapStringKey2.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 VersionedThinRegionEntryOffHeapStringKey2 extends VersionedThinRegionEntryOffHeap {
public VersionedThinRegionEntryOffHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapUUIDKey.java
index 5cb31ce..cd9c4c3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryOffHeapUUIDKey.java
@@ -43,7 +43,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 VersionedThinRegionEntryOffHeapUUIDKey extends VersionedThinRegionEntryOffHeap {
public VersionedThinRegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
[18/50] [abbrv] incubator-geode git commit: GEODE-1993: postprocess
region/key in developer rest api
Posted by kl...@apache.org.
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 Duling <kd...@pivotal.io>
Authored: Fri Oct 28 13:27:56 2016 -0700
Committer: Jinmei Liao <ji...@pivotal.io>
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 0000000..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 org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+ static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+ static Properties properties = new Properties() {
+ {
+ setProperty(SampleSecurityManager.SECURITY_JSON,
+ "org/apache/geode/management/internal/security/clientServer.json");
+ setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+ setProperty(START_DEV_REST_API, "true");
+ setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+ setProperty(HTTP_SERVICE_PORT, restPort + "");
+ setProperty(SECURITY_POST_PROCESSOR, RedactingPostProcessor.class.getName());
+ }
+ };
+
+ @ClassRule
+ public static ServerStarterRule serverStarter = new ServerStarterRule(properties);
+ private final GeodeRestClient restClient = new GeodeRestClient("localhost", restPort);
+
+ @BeforeClass
+ public static void before() throws Exception {
+ Region region =
+ serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create("customers");
+ region.put("1", new Customer(1L, "John", "Doe", "555555555"));
+ region.put("2", new Customer(2L, "Richard", "Roe", "222533554"));
+ region.put("3", new Customer(3L, "Jane", "Doe", "555223333"));
+ region.put("4", new Customer(4L, "Jane", "Roe", "555443333"));
+ }
+
+ /**
+ * Test post-processing of a retrieved key from the server.
+ */
+ @Test
+ public void getRegionKey() throws Exception {
+ // Test a single key
+ HttpResponse response = restClient.doGet("/customers/1", "dataReader", "1234567");
+ assertEquals(200, getCode(response));
+ assertEquals(MediaType.APPLICATION_JSON_UTF8_VALUE, getContentType(response));
+
+ // Ensure SSN is hidden
+ JSONObject jsonObject = getJsonObject(response);
+ assertEquals("*********", jsonObject.getString("socialSecurityNumber"));
+ assertEquals(1L, jsonObject.getLong("customerId"));
+
+ // Try with super-user
+ response = restClient.doGet("/customers/1", "super-user", "1234567");
+ assertEquals(200, getCode(response));
+ assertEquals(MediaType.APPLICATION_JSON_UTF8_VALUE, getContentType(response));
+
+ // ensure SSN is readable
+ jsonObject = getJsonObject(response);
+ assertEquals("555555555", jsonObject.getString("socialSecurityNumber"));
+ assertEquals(1L, jsonObject.getLong("customerId"));
+ }
+
+ // Test multiple keys
+ @Test
+ public void getMultipleRegionKeys() throws Exception {
+ HttpResponse response = restClient.doGet("/customers/1,3", "dataReader", "1234567");
+ assertEquals(200, getCode(response));
+ assertEquals(MediaType.APPLICATION_JSON_UTF8_VALUE, getContentType(response));
+
+ JSONObject jsonObject = getJsonObject(response);
+ JSONArray jsonArray = jsonObject.getJSONArray("customers");
+ final int length = jsonArray.length();
+ assertEquals(2, length);
+ JSONObject customer = jsonArray.getJSONObject(0);
+ assertEquals("*********", customer.getString("socialSecurityNumber"));
+ assertEquals(1, customer.getLong("customerId"));
+ customer = jsonArray.getJSONObject(1);
+ assertEquals("*********", customer.getString("socialSecurityNumber"));
+ assertEquals(3, customer.getLong("customerId"));
+ }
+
+ @Test
+ public void getRegion() throws Exception {
+ HttpResponse response = restClient.doGet("/customers", "dataReader", "1234567");
+ assertEquals(200, getCode(response));
+ assertEquals(MediaType.APPLICATION_JSON_UTF8_VALUE, getContentType(response));
+
+ JSONObject jsonObject = getJsonObject(response);
+ JSONArray jsonArray = jsonObject.getJSONArray("customers");
+ final int length = jsonArray.length();
+ for (int index = 0; index < length; ++index) {
+ JSONObject customer = jsonArray.getJSONObject(index);
+ assertEquals("*********", customer.getString("socialSecurityNumber"));
+ assertEquals((long) index + 1, customer.getLong("customerId"));
+ }
+ }
+
+ @Test
+ public void adhocQuery() throws Exception {
+ String query = "/queries/adhoc?q="
+ + URLEncoder.encode("SELECT * FROM /customers order by customerId", "UTF-8");
+ HttpResponse response = restClient.doGet(query, "dataReader", "1234567");
+ assertEquals(200, getCode(response));
+ assertEquals(MediaType.APPLICATION_JSON_UTF8_VALUE, getContentType(response));
+
+ JSONArray jsonArray = getJsonArray(response);
+ final int length = jsonArray.length();
+ for (int index = 0; index < length; ++index) {
+ JSONObject customer = jsonArray.getJSONObject(index);
+ assertEquals("*********", customer.getString("socialSecurityNumber"));
+ assertEquals((long) index + 1, customer.getLong("customerId"));
+ }
+ }
+
+ @Test
+ public void namedQuery() throws Exception {
+ // Declare the named query
+ String namedQuery = "SELECT c FROM /customers c WHERE c.customerId = $1";
+
+ // Install the named query
+ HttpResponse response =
+ restClient.doPost("/queries?id=selectCustomer&q=" + URLEncoder.encode(namedQuery, "UTF-8"),
+ "dataReader", "1234567", "");
+ assertEquals(201, getCode(response));
+
+ // Verify the query has been installed
+ String query = "/queries";
+ response = restClient.doGet(query, "dataReader", "1234567");
+ assertEquals(200, getCode(response));
+ assertEquals(MediaType.APPLICATION_JSON_UTF8_VALUE, getContentType(response));
+
+ // Execute the query
+ response = restClient.doPost("/queries/selectCustomer", "dataReader", "1234567",
+ "{" + "\"@type\": \"int\"," + "\"@value\": 1" + "}");
+ assertEquals(200, getCode(response));
+
+ // Validate the result
+ JSONArray jsonArray = getJsonArray(response);
+ assertTrue(jsonArray.length() == 1);
+ JSONObject customer = jsonArray.getJSONObject(0);
+ assertEquals("*********", customer.getString("socialSecurityNumber"));
+ assertEquals(1L, customer.getLong("customerId"));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/Customer.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/Customer.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/Customer.java
index 263e6c7..9732aa0 100644
--- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/Customer.java
+++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/Customer.java
@@ -14,21 +14,28 @@
*/
package org.apache.geode.rest.internal.web.controllers;
-import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.geode.internal.lang.ObjectUtils;
+import java.io.Serializable;
+
/**
* The Customer class models a customer entity.
* <p/>
*
* @since GemFire 8.0
*/
-
+@JsonInclude(Include.NON_NULL)
public class Customer implements Serializable {
+ @JsonProperty("id")
private Long customerId;
private String firstName;
private String lastName;
+ @JsonProperty("ssn")
+ private String socialSecurityNumber;
public Customer() {}
@@ -36,10 +43,11 @@ public class Customer implements Serializable {
this.customerId = custId;
}
- public Customer(final Long custId, final String fname, final String lname) {
+ public Customer(final Long custId, final String fname, final String lname, final String ssn) {
this.customerId = custId;
this.firstName = fname;
this.lastName = lname;
+ this.socialSecurityNumber = ssn;
}
public Long getCustomerId() {
@@ -80,7 +88,16 @@ public class Customer implements Serializable {
return (ObjectUtils.equals(this.getCustomerId(), that.getCustomerId())
&& ObjectUtils.equals(this.getLastName(), that.getLastName())
- && ObjectUtils.equals(this.getFirstName(), that.getFirstName()));
+ && ObjectUtils.equals(this.getFirstName(), that.getFirstName())
+ && ObjectUtils.equals(this.getSocialSecurityNumber(), that.getSocialSecurityNumber()));
+ }
+
+ public String getSocialSecurityNumber() {
+ return socialSecurityNumber;
+ }
+
+ public void setSocialSecurityNumber(final String ssn) {
+ this.socialSecurityNumber = ssn;
}
@Override
@@ -99,6 +116,7 @@ public class Customer implements Serializable {
buffer.append(", customerId = ").append(getCustomerId());
buffer.append(", firstName = ").append(getFirstName());
buffer.append(", lastName = ").append(getLastName());
+ buffer.append(", ssn = ").append(getSocialSecurityNumber());
buffer.append(" }");
return buffer.toString();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RedactingPostProcessor.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RedactingPostProcessor.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RedactingPostProcessor.java
new file mode 100644
index 0000000..7ec14bf
--- /dev/null
+++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RedactingPostProcessor.java
@@ -0,0 +1,67 @@
+/*
+ * 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.controllers;
+
+import org.apache.geode.security.PostProcessor;
+
+import java.security.Principal;
+import java.util.Properties;
+
+/**
+ * This is example that implements PostProcessor that will redact Social Security Numbers from
+ * Customer objects
+ */
+public class RedactingPostProcessor implements PostProcessor {
+
+ @Override
+ public void init(final Properties securityProps) {}
+
+ /**
+ * Protect the Customer's Social Security Number from unauthorized users
+ *
+ * @param principal The principal that's accessing the value
+ * @param regionName The region that's been accessed. This could be null.
+ * @param id the customer id the lookup was done with. This could be null.
+ * @param customer a @Customer object, this could be null.
+ * @return the processed value
+ */
+ @Override
+ public Object processRegionValue(Object principal, String regionName, Object id,
+ Object customer) {
+ if (customer == null)
+ return null;
+ if (customer instanceof Customer) {
+ String username = getUsername(principal);
+ // Unable to retrieve the role at this point, so for this demo we'll just work with the
+ // username
+ if (username.equals("super-user"))
+ return customer;
+ Customer cust = (Customer) customer;
+ return new Customer(cust.getCustomerId(), cust.getFirstName(), cust.getLastName(),
+ "*********");
+ } else
+ return customer;
+ }
+
+ private String getUsername(final Object principal) {
+ String name = null;
+ if (principal instanceof Principal) {
+ name = ((Principal) principal).getName();
+ } else {
+ name = principal.toString();
+ }
+ return name;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
index 5397b95..f054110 100644
--- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
+++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
@@ -14,34 +14,13 @@
*/
package org.apache.geode.rest.internal.web.controllers;
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.util.StringUtils;
-import org.springframework.web.client.HttpClientErrorException;
-import org.springframework.web.client.HttpServerErrorException;
+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.MCAST_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import org.apache.geode.cache.AttributesFactory;
import org.apache.geode.cache.Cache;
@@ -67,6 +46,31 @@ import org.apache.geode.internal.net.SocketCreator;
import org.apache.geode.management.internal.AgentUtil;
import org.apache.geode.management.internal.ManagementConstants;
import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.StringUtils;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.HttpServerErrorException;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
@Category(IntegrationTest.class)
public class RestAPIsQueryAndFEJUnitTest {
@@ -761,7 +765,6 @@ public class RestAPIsQueryAndFEJUnitTest {
entity = new HttpEntity<>(TEST_DATA[index][REQUEST_BODY_INDEX], headers);
ResponseEntity<String> result = RestTestUtils.getRestTemplate().exchange(restRequestUrl,
(HttpMethod) TEST_DATA[index][METHOD_INDEX], entity, String.class);
-
validateGetAllResult(index, result);
validateQueryResult(index, result);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledValue.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledValue.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledValue.java
index a2844fd..9da575d 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledValue.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledValue.java
@@ -14,7 +14,12 @@
*/
package org.apache.geode.cache.query.internal;
-import org.apache.geode.cache.query.*;
+import org.apache.geode.cache.query.AmbiguousNameException;
+import org.apache.geode.cache.query.FunctionDomainException;
+import org.apache.geode.cache.query.NameResolutionException;
+import org.apache.geode.cache.query.QueryInvalidException;
+import org.apache.geode.cache.query.QueryInvocationTargetException;
+import org.apache.geode.cache.query.TypeMismatchException;
import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
import org.apache.geode.cache.query.types.ObjectType;
import org.apache.geode.distributed.internal.DistributionConfig;
@@ -120,7 +125,7 @@ public interface CompiledValue {
/**
* Populates the Set passed with the name of the Region which, if any , will be the bottommost
- * object (CompiledRegion). The default implemenation is provided in the AbstractCompiledValue &
+ * object (CompiledRegion). The default implementation is provided in the AbstractCompiledValue &
* overridden in the CompiledSelect as it can contain multiple iterators
*/
public void getRegionsInQuery(Set regionNames, Object[] parameters);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-core/src/main/java/org/apache/geode/cache/query/internal/DefaultQuery.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/DefaultQuery.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/DefaultQuery.java
index 78054ad..068f1d1 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/DefaultQuery.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/DefaultQuery.java
@@ -26,16 +26,39 @@ import org.apache.geode.cache.execute.Function;
import org.apache.geode.cache.execute.RegionFunctionContext;
import org.apache.geode.cache.partition.PartitionRegionHelper;
import org.apache.geode.cache.persistence.PartitionOfflineException;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.cache.query.*;
+import org.apache.geode.cache.query.FunctionDomainException;
+import org.apache.geode.cache.query.NameResolutionException;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryException;
+import org.apache.geode.cache.query.QueryInvalidException;
+import org.apache.geode.cache.query.QueryInvocationTargetException;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.QueryStatistics;
+import org.apache.geode.cache.query.RegionNotFoundException;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.TypeMismatchException;
import org.apache.geode.cache.query.internal.cq.InternalCqQuery;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.internal.NanoTimer;
-import org.apache.geode.internal.cache.*;
-import org.apache.geode.internal.cache.partitioned.RegionAdvisor;
+import org.apache.geode.internal.cache.BucketRegion;
+import org.apache.geode.internal.cache.CachePerfStats;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.LocalDataSet;
+import org.apache.geode.internal.cache.PRQueryProcessor;
+import org.apache.geode.internal.cache.PartitionedRegion;
+import org.apache.geode.internal.cache.TXManagerImpl;
+import org.apache.geode.internal.cache.TXStateProxy;
import org.apache.geode.internal.i18n.LocalizedStrings;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
@@ -771,9 +794,9 @@ public class DefaultQuery implements Query {
/**
* Returns an unmodifiable Set containing the Region names which are present in the Query. A
- * region which is assosciated with the query as a bind parameter will not be included in the
- * list. The Region names returned by the query do not indicate anything about the state of the
- * region or whether the region actually exists in the GemfireCache etc.
+ * region which is associated with the query as a bind parameter will not be included in the list.
+ * The Region names returned by the query do not indicate anything about the state of the region
+ * or whether the region actually exists in the GemfireCache etc.
*
* @param parameters the parameters to be passed in to the query when executed
* @return Unmodifiable List containing the region names.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/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 57cb2db..73d051f 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
@@ -440,7 +440,9 @@ public class IntegratedSecurityService implements SecurityService {
}
/**
- * If Shiro's security manager is configured, then return true, otherwise, return false;
+ * check if Shiro's security manager is configured
+ *
+ * @return true if configured, false if not
*/
public boolean isIntegratedSecurity() {
if (isIntegratedSecurity != null) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-core/src/main/java/org/apache/geode/security/PostProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/security/PostProcessor.java b/geode-core/src/main/java/org/apache/geode/security/PostProcessor.java
index 3cfcace..707e3cf 100644
--- a/geode-core/src/main/java/org/apache/geode/security/PostProcessor.java
+++ b/geode-core/src/main/java/org/apache/geode/security/PostProcessor.java
@@ -39,7 +39,7 @@ public interface PostProcessor {
* depend on how you implemented your SecurityManager
* @param regionName The region that's been accessed. This could be null.
* @param key the key of the value that's been accessed. This could be null.
- * @param value the original value. The orginal value could be null as well.
+ * @param value the original value. The original value could be null as well.
* @return the value that will be returned to the requester
*/
Object processRegionValue(Object principal, String regionName, Object key, Object value);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java
index 2a8a64c..fda6cf4 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java
@@ -14,9 +14,6 @@
*/
package org.apache.geode.cache.query.dunit;
-import org.apache.geode.test.junit.categories.DistributedTest;
-import org.junit.Test;
-
import org.apache.geode.cache.Region;
import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.client.ClientCache;
@@ -36,6 +33,8 @@ import org.apache.geode.test.dunit.NetworkUtils;
import org.apache.geode.test.dunit.SerializableCallable;
import org.apache.geode.test.dunit.ThreadUtils;
import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.junit.categories.DistributedTest;
+import org.junit.Test;
import org.junit.experimental.categories.Category;
@Category(DistributedTest.class)
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
index 07f6537..ce4df64 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
@@ -14,15 +14,12 @@
*/
package org.apache.geode.internal.cache.execute;
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
-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 org.apache.geode.test.junit.categories.FlakyTest;
import org.apache.geode.cache.AttributesFactory;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.Region;
@@ -41,20 +38,20 @@ import org.apache.geode.distributed.DistributedSystem;
import org.apache.geode.internal.cache.functions.TestFunction;
import org.apache.geode.internal.cache.tier.sockets.CacheServerTestUtil;
import org.apache.geode.test.dunit.Assert;
-import org.apache.geode.test.dunit.AsyncInvocation;
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.LogWriterUtils;
import org.apache.geode.test.dunit.NetworkUtils;
import org.apache.geode.test.dunit.Wait;
import org.apache.geode.test.dunit.WaitCriterion;
+import org.apache.geode.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
-import java.util.Set;
-import java.util.concurrent.Callable;
@Category(DistributedTest.class)
public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBase {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java b/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
index 4182bf9..2a5f51f 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
@@ -34,7 +34,6 @@ import org.apache.geode.internal.Assert;
import org.apache.geode.internal.cache.CacheServerImpl;
import org.apache.geode.internal.cache.GemFireCacheImpl;
import org.apache.geode.internal.cache.PartitionedRegion;
-import org.apache.geode.internal.cache.PartitionedRegionDataStore;
import org.apache.geode.internal.cache.execute.InternalFunctionInvocationTargetException;
import org.apache.geode.internal.cache.execute.MyFunctionExecutionException;
import org.apache.geode.internal.cache.execute.RegionFunctionContextImpl;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-core/src/test/java/org/apache/geode/security/NoShowValue1PostProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/NoShowValue1PostProcessor.java b/geode-core/src/test/java/org/apache/geode/security/NoShowValue1PostProcessor.java
index 8aeecae..078448c 100644
--- a/geode-core/src/test/java/org/apache/geode/security/NoShowValue1PostProcessor.java
+++ b/geode-core/src/test/java/org/apache/geode/security/NoShowValue1PostProcessor.java
@@ -14,10 +14,6 @@
*/
package org.apache.geode.security;
-import java.io.Serializable;
-
-import org.apache.geode.security.PostProcessor;
-
public class NoShowValue1PostProcessor implements PostProcessor {
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-core/src/test/java/org/apache/geode/security/PDXPostProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/PDXPostProcessor.java b/geode-core/src/test/java/org/apache/geode/security/PDXPostProcessor.java
index aeebd15..2b84246 100644
--- a/geode-core/src/test/java/org/apache/geode/security/PDXPostProcessor.java
+++ b/geode-core/src/test/java/org/apache/geode/security/PDXPostProcessor.java
@@ -14,16 +14,14 @@
*/
package org.apache.geode.security;
-import static org.junit.Assert.*;
-
-import java.util.Arrays;
-import java.util.Properties;
-
-import org.apache.geode.security.PostProcessor;
+import static org.junit.Assert.assertTrue;
import org.apache.geode.pdx.SimpleClass;
import org.apache.geode.pdx.internal.PdxInstanceImpl;
+import java.util.Arrays;
+import java.util.Properties;
+
public class PDXPostProcessor implements PostProcessor {
public static byte[] BYTES = {1, 0};
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/AbstractBaseController.java
----------------------------------------------------------------------
diff --git a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/AbstractBaseController.java b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/AbstractBaseController.java
index 80297b5..b9d2bf4 100644
--- a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/AbstractBaseController.java
+++ b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/AbstractBaseController.java
@@ -27,6 +27,7 @@ import org.apache.geode.cache.LowMemoryException;
import org.apache.geode.cache.PartitionedRegionStorageException;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.TimeoutException;
+import org.apache.geode.cache.query.Query;
import org.apache.geode.cache.query.QueryService;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.LeaseExpiredException;
@@ -44,6 +45,7 @@ import org.apache.geode.rest.internal.web.exception.GemfireRestException;
import org.apache.geode.rest.internal.web.exception.MalformedJsonException;
import org.apache.geode.rest.internal.web.exception.RegionNotFoundException;
import org.apache.geode.rest.internal.web.exception.ResourceNotFoundException;
+import org.apache.geode.rest.internal.web.security.RestSecurityService;
import org.apache.geode.rest.internal.web.util.ArrayUtils;
import org.apache.geode.rest.internal.web.util.IdentifiableUtils;
import org.apache.geode.rest.internal.web.util.JSONUtils;
@@ -91,18 +93,17 @@ import javax.annotation.PostConstruct;
@SuppressWarnings("unused")
public abstract class AbstractBaseController {
- private static final Logger logger = LogService.getLogger();
-
protected static final String NEW_META_DATA_PROPERTY = "@new";
protected static final String OLD_META_DATA_PROPERTY = "@old";
protected static final String TYPE_META_DATA_PROPERTY = "@type";
-
protected static final String UTF_8 = "UTF-8";
protected static final String DEFAULT_ENCODING = UTF_8;
+ private static final Logger logger = LogService.getLogger();
private static final AtomicLong ID_SEQUENCE = new AtomicLong(0l);
// private Cache cache = GemFireCacheImpl.getExisting(null);
-
+ @Autowired
+ protected RestSecurityService securityService;
@Autowired
private ObjectMapper objectMapper;
@@ -190,15 +191,18 @@ public abstract class AbstractBaseController {
}
}
- public ResponseEntity<String> processQueryResponse(Object queryResult, String queryId)
+ public ResponseEntity<String> processQueryResponse(Query query, Object args[], Object queryResult)
throws JSONException {
if (queryResult instanceof Collection<?>) {
- Collection<Object> result = (Collection<Object>) queryResult;
- String queryResultAsJson = JSONUtils.convertCollectionToJson(result);
+ Collection processedResults = new ArrayList(((Collection) queryResult).size());
+ for (Object result : (Collection) queryResult) {
+ processedResults.add(securityService.postProcess(null, null, result, false));
+ }
+ String queryResultAsJson = JSONUtils.convertCollectionToJson(processedResults);
final HttpHeaders headers = new HttpHeaders();
- headers.setLocation(toUri("queries", queryId));
- return new ResponseEntity<String>(queryResultAsJson, headers, HttpStatus.OK);
+ headers.setLocation(toUri("queries", query.getQueryString()));
+ return new ResponseEntity<>(queryResultAsJson, headers, HttpStatus.OK);
} else {
throw new GemfireRestException(
"Server has encountered error while generating query result into restful format(JSON)!");
@@ -211,7 +215,6 @@ public abstract class AbstractBaseController {
jsonArr = new JSONArray(jsonArray);
Collection<PdxInstance> pdxInstances = new ArrayList<PdxInstance>();
-
for (int index = 0; index < jsonArr.length(); index++) {
// String element = jsonArr.getJSONObject(i).toString();
// String element = jsonArr.getString(i);
@@ -639,6 +642,10 @@ public abstract class AbstractBaseController {
try {
final Region<Object, T> region = getRegion(regionNamePath);
final Map<Object, T> entries = region.getAll(Arrays.asList(getKeys(regionNamePath, keys)));
+ for (Object key : entries.keySet()) {
+ entries.put(key,
+ (T) securityService.postProcess(regionNamePath, key, entries.get(key), false));
+ }
return entries;
} catch (SerializationException se) {
throw new DataTypeNotSupportedException(
@@ -881,12 +888,20 @@ public abstract class AbstractBaseController {
@SuppressWarnings("unchecked")
protected <T> T getValue(final String regionNamePath, final Object key) {
+ return getValue(regionNamePath, key, true);
+ }
+
+ protected <T> T getValue(final String regionNamePath, final Object key, boolean postProcess) {
Assert.notNull(key, "The Cache Region key to read the value for cannot be null!");
Region r = getRegion(regionNamePath);
try {
Object value = r.get(key);
- return (T) value;
+ if (postProcess) {
+ return (T) securityService.postProcess(regionNamePath, key, value, false);
+ } else {
+ return (T) value;
+ }
} catch (SerializationException se) {
throw new DataTypeNotSupportedException(
"The resource identified could not convert into the supported content characteristics (JSON)!",
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/FunctionAccessController.java
----------------------------------------------------------------------
diff --git a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/FunctionAccessController.java b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/FunctionAccessController.java
index ec05ec7..08ec9a1 100644
--- a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/FunctionAccessController.java
+++ b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/FunctionAccessController.java
@@ -63,15 +63,14 @@ import java.util.Set;
@RequestMapping(FunctionAccessController.REST_API_VERSION + "/functions")
@SuppressWarnings("unused")
public class FunctionAccessController extends AbstractBaseController {
- private static final Logger logger = LogService.getLogger();
-
// Constant String value indicating the version of the REST API.
protected static final String REST_API_VERSION = "/v1";
+ private static final Logger logger = LogService.getLogger();
/**
* Gets the version of the REST API implemented by this @Controller.
* <p>
- *
+ *
* @return a String indicating the REST API version.
*/
@Override
@@ -81,7 +80,7 @@ public class FunctionAccessController extends AbstractBaseController {
/**
* list all registered functions in Gemfire data node
- *
+ *
* @return result as a JSON document.
*/
@RequestMapping(method = RequestMethod.GET, produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
@@ -102,13 +101,13 @@ public class FunctionAccessController extends AbstractBaseController {
JSONUtils.formulateJsonForListFunctionsCall(registeredFunctions.keySet());
final HttpHeaders headers = new HttpHeaders();
headers.setLocation(toUri("functions"));
- return new ResponseEntity<String>(listFunctionsAsJson, headers, HttpStatus.OK);
+ return new ResponseEntity<>(listFunctionsAsJson, headers, HttpStatus.OK);
}
/**
* Execute a function on Gemfire data node using REST API call. Arguments to the function are
* passed as JSON string in the request body.
- *
+ *
* @param functionId represents function to be executed
* @param region list of regions on which function to be executed.
* @param members list of nodes on which function to be executed.
@@ -116,6 +115,7 @@ public class FunctionAccessController extends AbstractBaseController {
* @param filter list of keys which the function will use to determine on which node to execute
* the function.
* @param argsInBody function argument as a JSON document
+ *
* @return result as a JSON document
*/
@RequestMapping(method = RequestMethod.POST, value = "/{functionId}",
@@ -145,7 +145,6 @@ public class FunctionAccessController extends AbstractBaseController {
logger.debug("Executing Function ({}) with arguments ({}) on Region ({})...", functionId,
ArrayUtils.toString(argsInBody), region);
-
region = decode(region);
try {
function = FunctionService.onRegion(getRegion(region));
@@ -236,7 +235,7 @@ public class FunctionAccessController extends AbstractBaseController {
@SuppressWarnings("unchecked")
String functionResultAsJson =
JSONUtils.convertCollectionToJson((ArrayList<Object>) functionResult);
- return new ResponseEntity<String>(functionResultAsJson, headers, HttpStatus.OK);
+ return new ResponseEntity<>(functionResultAsJson, headers, HttpStatus.OK);
} catch (JSONException e) {
throw new GemfireRestException(
"Could not convert function results into Restful (JSON) format!", e);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/PdxBasedCrudController.java
----------------------------------------------------------------------
diff --git a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/PdxBasedCrudController.java b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/PdxBasedCrudController.java
index 2b44e54..3b08c5f 100644
--- a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/PdxBasedCrudController.java
+++ b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/PdxBasedCrudController.java
@@ -113,7 +113,7 @@ public class PdxBasedCrudController extends CommonCrudController {
headers.setLocation(toUri(region, key));
if (existingPdxObj != null) {
- final RegionEntryData<Object> data = new RegionEntryData<Object>(region);
+ final RegionEntryData<Object> data = new RegionEntryData<>(region);
data.add(existingPdxObj);
headers.setContentType(MediaType.APPLICATION_JSON);
return new ResponseEntity<RegionEntryData<?>>(data, headers, HttpStatus.CONFLICT);
@@ -149,13 +149,13 @@ public class PdxBasedCrudController extends CommonCrudController {
region = decode(region);
Map<Object, Object> valueObjs = null;
- final RegionData<Object> data = new RegionData<Object>(region);
+ final RegionData<Object> data = new RegionData<>(region);
final HttpHeaders headers = new HttpHeaders();
String keyList = null;
int regionSize = getRegion(region).size();
- List<Object> keys = new ArrayList<Object>(regionSize);
- List<Object> values = new ArrayList<Object>(regionSize);
+ List<Object> keys = new ArrayList<>(regionSize);
+ List<Object> values = new ArrayList<>(regionSize);
for (Map.Entry<Object, Object> entry : getValues(region).entrySet()) {
Object value = entry.getValue();
@@ -174,8 +174,7 @@ public class PdxBasedCrudController extends CommonCrudController {
if (maxLimit < 0) {
String errorMessage =
String.format("Negative limit param (%1$s) is not valid!", maxLimit);
- return new ResponseEntity<String>(convertErrorAsJson(errorMessage),
- HttpStatus.BAD_REQUEST);
+ return new ResponseEntity<>(convertErrorAsJson(errorMessage), HttpStatus.BAD_REQUEST);
}
int mapSize = keys.size();
@@ -190,7 +189,7 @@ public class PdxBasedCrudController extends CommonCrudController {
// limit param is not specified in proper format. set the HTTPHeader
// for BAD_REQUEST
String errorMessage = String.format("limit param (%1$s) is not valid!", limit);
- return new ResponseEntity<String>(convertErrorAsJson(errorMessage), HttpStatus.BAD_REQUEST);
+ return new ResponseEntity<>(convertErrorAsJson(errorMessage), HttpStatus.BAD_REQUEST);
}
}
@@ -233,7 +232,7 @@ public class PdxBasedCrudController extends CommonCrudController {
.format("Key (%1$s) does not exist for region (%2$s) in cache!", keys[0], region));
}
- final RegionEntryData<Object> data = new RegionEntryData<Object>(region);
+ final RegionEntryData<Object> data = new RegionEntryData<>(region);
headers.set("Content-Location", toUri(region, keys[0]).toASCIIString());
data.add(value);
return new ResponseEntity<RegionData<?>>(data, headers, HttpStatus.OK);
@@ -245,7 +244,7 @@ public class PdxBasedCrudController extends CommonCrudController {
String errorMessage = String.format(
"ignoreMissingKey param (%1$s) is not valid. valid usage is ignoreMissingKey=true!",
ignoreMissingKey);
- return new ResponseEntity<String>(convertErrorAsJson(errorMessage), HttpStatus.BAD_REQUEST);
+ return new ResponseEntity<>(convertErrorAsJson(errorMessage), HttpStatus.BAD_REQUEST);
}
if (!("true".equalsIgnoreCase(ignoreMissingKey))) {
@@ -254,7 +253,7 @@ public class PdxBasedCrudController extends CommonCrudController {
String unknownKeysAsStr = StringUtils.collectionToDelimitedString(unknownKeys, ",");
String erroString = String.format("Requested keys (%1$s) not exist in region (%2$s)",
StringUtils.collectionToDelimitedString(unknownKeys, ","), region);
- return new ResponseEntity<String>(convertErrorAsJson(erroString), headers,
+ return new ResponseEntity<>(convertErrorAsJson(erroString), headers,
HttpStatus.BAD_REQUEST);
}
}
@@ -268,7 +267,7 @@ public class PdxBasedCrudController extends CommonCrudController {
// currently we are not removing keys having value null from the result.
String keyList = StringUtils.collectionToDelimitedString(valueObjs.keySet(), ",");
headers.set("Content-Location", toUri(region, keyList).toASCIIString());
- final RegionData<Object> data = new RegionData<Object>(region);
+ final RegionData<Object> data = new RegionData<>(region);
data.add(valueObjs.values());
return new ResponseEntity<RegionData<?>>(data, headers, HttpStatus.OK);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/QueryAccessController.java
----------------------------------------------------------------------
diff --git a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/QueryAccessController.java b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/QueryAccessController.java
index 4a7dfde..b00a7aa 100644
--- a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/QueryAccessController.java
+++ b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/QueryAccessController.java
@@ -71,8 +71,7 @@ public class QueryAccessController extends AbstractBaseController {
protected static final String PARAMETERIZED_QUERIES_REGION = "__ParameterizedQueries__";
- private final ConcurrentHashMap<String, DefaultQuery> compiledQueries =
- new ConcurrentHashMap<String, DefaultQuery>();
+ private final ConcurrentHashMap<String, DefaultQuery> compiledQueries = new ConcurrentHashMap<>();
// Constant String value indicating the version of the REST API.
protected static final String REST_API_VERSION = "/v1";
@@ -112,7 +111,7 @@ public class QueryAccessController extends AbstractBaseController {
String queryListAsJson = JSONUtils.formulateJsonForListQueriesCall(parametrizedQueryRegion);
final HttpHeaders headers = new HttpHeaders();
headers.setLocation(toUri("queries"));
- return new ResponseEntity<String>(queryListAsJson, headers, HttpStatus.OK);
+ return new ResponseEntity<>(queryListAsJson, headers, HttpStatus.OK);
}
/**
@@ -142,7 +141,7 @@ public class QueryAccessController extends AbstractBaseController {
// store the compiled OQL statement with 'queryId' as the Key into the hidden,
- // ParameterizedQueries Region...
+ // Parametrized Queries Region...
final String existingOql =
createNamedQuery(PARAMETERIZED_QUERIES_REGION, queryId, oqlStatement);
@@ -151,9 +150,8 @@ public class QueryAccessController extends AbstractBaseController {
if (existingOql != null) {
headers.setContentType(MediaType.APPLICATION_JSON);
- return new ResponseEntity<String>(
- JSONUtils.formulateJsonForExistingQuery(queryId, existingOql), headers,
- HttpStatus.CONFLICT);
+ return new ResponseEntity<>(JSONUtils.formulateJsonForExistingQuery(queryId, existingOql),
+ headers, HttpStatus.CONFLICT);
} else {
return new ResponseEntity<String>(headers, HttpStatus.CREATED);
}
@@ -188,7 +186,7 @@ public class QueryAccessController extends AbstractBaseController {
// and handle the Exceptions appropriately (500 Server Error)!
try {
Object queryResult = query.execute();
- return processQueryResponse(queryResult, "adhoc?q=" + oql);
+ return processQueryResponse(query, null, queryResult);
} catch (FunctionDomainException fde) {
throw new GemfireRestException(
"A function was applied to a parameter that is improper for that function!", fde);
@@ -253,7 +251,7 @@ public class QueryAccessController extends AbstractBaseController {
Query compiledQuery = compiledQueries.get(queryId);
if (compiledQuery == null) {
// This is first time the query is seen by this server.
- final String oql = getValue(PARAMETERIZED_QUERIES_REGION, queryId);
+ final String oql = getValue(PARAMETERIZED_QUERIES_REGION, queryId, false);
ValidationUtils.returnValueThrowOnNull(oql, new ResourceNotFoundException(
String.format("No Query with ID (%1$s) was found!", queryId)));
@@ -269,7 +267,7 @@ public class QueryAccessController extends AbstractBaseController {
// and handle the Exceptions appropriately (500 Server Error)!
try {
Object queryResult = compiledQuery.execute(args);
- return processQueryResponse(queryResult, queryId);
+ return processQueryResponse(compiledQuery, args, queryResult);
} catch (FunctionDomainException fde) {
throw new GemfireRestException(
"A function was applied to a parameter that is improper for that function!", fde);
@@ -327,13 +325,13 @@ public class QueryAccessController extends AbstractBaseController {
queryId);
- // update the OQL statement with 'queryId' as the Key into the hidden, ParameterizedQueries
+ // update the OQL statement with 'queryId' as the Key into the hidden, Parametrized Queries
// Region...
checkForQueryIdExist(PARAMETERIZED_QUERIES_REGION, queryId);
updateNamedQuery(PARAMETERIZED_QUERIES_REGION, queryId, oqlStatement);
compiledQueries.remove(queryId);
- return new ResponseEntity<Object>(HttpStatus.OK);
+ return new ResponseEntity<>(HttpStatus.OK);
}
// delete named, parametrized query
@@ -358,7 +356,7 @@ public class QueryAccessController extends AbstractBaseController {
// ParameterizedQueries Region...
deleteNamedQuery(PARAMETERIZED_QUERIES_REGION, queryId);
compiledQueries.remove(queryId);
- return new ResponseEntity<Object>(HttpStatus.OK);
+ return new ResponseEntity<>(HttpStatus.OK);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/security/RestSecurityService.java
----------------------------------------------------------------------
diff --git a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/security/RestSecurityService.java b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/security/RestSecurityService.java
index 9004936..80ff719 100644
--- a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/security/RestSecurityService.java
+++ b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/security/RestSecurityService.java
@@ -15,10 +15,9 @@
package org.apache.geode.rest.internal.web.security;
-import org.springframework.stereotype.Component;
-
import org.apache.geode.internal.security.SecurityService;
import org.apache.geode.security.GemFireSecurityException;
+import org.springframework.stereotype.Component;
@Component("securityService")
public class RestSecurityService {
@@ -50,4 +49,9 @@ public class RestSecurityService {
}
return true;
}
+
+ public Object postProcess(String regionPath, Object key, Object value,
+ boolean valueIsSerialized) {
+ return securityService.postProcess(regionPath, key, value, valueIsSerialized);
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd229d76/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/util/JsonWriter.java
----------------------------------------------------------------------
diff --git a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/util/JsonWriter.java b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/util/JsonWriter.java
index cc6a424..68a9c3e 100644
--- a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/util/JsonWriter.java
+++ b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/util/JsonWriter.java
@@ -15,37 +15,34 @@
package org.apache.geode.rest.internal.web.util;
+import com.fasterxml.jackson.core.JsonGenerationException;
+import com.fasterxml.jackson.core.JsonGenerator;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.query.Struct;
+import org.apache.geode.cache.query.internal.StructImpl;
+import org.apache.geode.pdx.PdxInstance;
+import org.apache.geode.pdx.internal.EnumInfo;
+import org.apache.geode.pdx.internal.EnumInfo.PdxInstanceEnumInfo;
+import org.springframework.hateoas.Link;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.util.CollectionUtils;
+
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.springframework.hateoas.Link;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.util.CollectionUtils;
-
-import com.fasterxml.jackson.core.JsonGenerationException;
-import com.fasterxml.jackson.core.JsonGenerator;
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.query.Struct;
-import org.apache.geode.cache.query.internal.StructImpl;
-import org.apache.geode.pdx.PdxInstance;
-import org.apache.geode.pdx.internal.EnumInfo;
-import org.apache.geode.pdx.internal.EnumInfo.PdxInstanceEnumInfo;
-import org.apache.geode.rest.internal.web.exception.GemfireRestException;
-
/**
* The JsonWriter class is an utility to write various java types as a JSON string.
* <p/>
- *
+ *
* @since GemFire 8.0
*/
public class JsonWriter {
@@ -490,8 +487,8 @@ public class JsonWriter {
writeArrayAsJson(generator, value, pdxField);
} else if (value.getClass().equals(Link.class)) {
writeLinkAsJson(generator, (Link) value, pdxField);
- } else if (value.getClass().equals(Date.class)) {
- generator.writeObject((Date) value);
+ // } else if (value.getClass().equals(Date.class)) {
+ // generator.writeObject((Date) value);
} else if (value.getClass().equals(EnumInfo.class)) {
/*
* try { generator.writeString(((EnumInfo)value).getEnum().name()); } catch
@@ -512,21 +509,7 @@ public class JsonWriter {
} else if (value instanceof Map) {
writeMapAsJson(generator, (Map) value, pdxField);
} else {
- // TODO:: can value be a domain object...? As we have configured PdxInstance based storage,
- // Throw GemfireRestException for value of type domain objects.
-
- // TODO:Do we need to convert domain objects into the JSON using ObjectMapper. There is no
- // gurantee that domain class is in classpath.
- /*
- * ObjectMapper mapper = new ObjectMapper(); mapper.setDateFormat(new
- * SimpleDateFormat("MM/dd/yyyy"));
- * mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- * mapper.configure(com.fasterxml.jackson.core.JsonParser.Feature.
- * ALLOW_UNQUOTED_FIELD_NAMES, true); mapper.writeValueAsString(value)
- *
- * Object classInstance = mapper.readValue(JSON, Class.forName(className));
- */
- throw new GemfireRestException("Requested data could not convert into REST format[JSON] ");
+ generator.writeObject(value);
}
}
}
[30/50] [abbrv] incubator-geode git commit: GEODE-2105 Remove docs
about log collection utility
Posted by kl...@apache.org.
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 Miller <km...@pivotal.io>
Authored: Mon Nov 14 14:52:20 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
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.
<li>
<a href="/docs/guide/managing/logging/configuring_log4j2.html">Advanced Users\u2014Configuring Log4j 2 for Geode</a>
</li>
- <li>
- <a href="/docs/guide/managing/logging/log_collection_utility.html">Log Collection Utility</a>
- </li>
</ul>
</li>
<li class="has_submenu">
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..0000000
--- a/geode-docs/managing/logging/log_collection_utility.html.md.erb
+++ /dev/null
@@ -1,71 +0,0 @@
----
-title: Log Collection Utility
----
-
-<!--
-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.
--->
-
-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 <company> -o <output dir> [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 <file> Use a file with log locations instead of scanning for logs.
- Entries should be in the format hostname:/log/location
-```
-
-## Known Limitations
-
-The following are known limitations with the tool:
-
-1. Only supports Linux hosts.
-2. Requires SSH access between machines.
-3. Requires that the username be the same for each host that this app scans. For example, you can't specify user@host1, anotherUser@host2, etc.
-4. Requires that SSH access is available across all hosts using either the same password or the same public key.
-5. In order to get stacks using jstack, this process must be ran as the same user who owns the Geode process.
-6. Requires 'jps' (typically in $JAVA\_HOME/bin) to be in the user's PATH on each machine.
-
-
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ddc4819b/geode-docs/managing/logging/logging.html.md.erb
----------------------------------------------------------------------
diff --git a/geode-docs/managing/logging/logging.html.md.erb b/geode-docs/managing/logging/logging.html.md.erb
index db4de7e..c4fbaf6 100644
--- a/geode-docs/managing/logging/logging.html.md.erb
+++ b/geode-docs/managing/logging/logging.html.md.erb
@@ -41,8 +41,4 @@ Comprehensive logging messages help you confirm system configuration and debug p
Basic Geode logging configuration is configured via the gemfire.properties file. This topic is intended for advanced users who need increased control over logging due to integration with third-party libraries.
-- **[Log Collection Utility](../../managing/logging/log_collection_utility.html)**
-
- 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.
-
[49/50] [abbrv] incubator-geode git commit: Convert from
ManagementTestCase to ManagementTestRule
Posted by kl...@apache.org.
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);
- client = host.getVM(2);
- client2 = host.getVM(3);
+ @Rule
+ public ManagementTestRule managementTestRule = ManagementTestRule.builder().build();
- IgnoredException.addIgnoredException("Connection reset");
- }
+ @Before
+ public void before() throws Exception {
+ this.hostName = getServerHostName(getHost(0));
- @Override
- public final void preTearDown() throws Exception {
- reset();
- helper.closeCache(managingNode);
- helper.closeCache(client);
- helper.closeCache(client2);
- helper.closeCache(server);
+ this.managerVM = getHost(0).getVM(0);
+ this.serverVM = getHost(0).getVM(1);
+ this.client1VM = getHost(0).getVM(2);
+ this.client2VM = getHost(0).getVM(3);
- disconnectAllFromDS();
+ addIgnoredException("Connection reset");
}
- private static void reset() throws Exception {
- lastKeyReceived = false;
- numOfCreates = 0;
- numOfUpdates = 0;
- numOfInvalidates = 0;
+ @After
+ public void after() throws Exception {
+ invokeInEveryVM(() -> {
+ lastKeyReceived = false;
+ numOfCreates = 0;
+ numOfUpdates = 0;
+ numOfInvalidates = 0;
+ clientCache = null;
+ });
}
@Test
public void testClientHealthStats_SubscriptionEnabled() throws Exception {
- helper.createManagementCache(managingNode);
- helper.startManagingNode(managingNode);
+ this.managementTestRule.createManager(this.managerVM, false);
+ this.managementTestRule.startManager(this.managerVM);
- int port = (Integer) server.invoke(() -> ClientHealthStatsDUnitTest.createServerCache());
+ int port = this.serverVM.invoke(() -> createServerCache());
- DistributedMember serverMember = helper.getMember(server);
+ this.client1VM.invoke(() -> createClientCache(this.hostName, port, 1, true));
+ this.client2VM.invoke(() -> createClientCache(this.hostName, port, 2, true));
- client.invoke(
- () -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 1, true, false));
+ this.client1VM.invoke(() -> put());
+ this.client2VM.invoke(() -> put());
- client2.invoke(
- () -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 2, true, false));
+ DistributedMember serverMember = this.managementTestRule.getDistributedMember(this.serverVM);
+ this.managerVM.invoke(() -> verifyClientStats(serverMember, port, 2));
- client.invoke(() -> ClientHealthStatsDUnitTest.put());
- client2.invoke(() -> ClientHealthStatsDUnitTest.put());
-
- managingNode.invoke(() -> ClientHealthStatsDUnitTest.verifyClientStats(serverMember, port, 2));
- helper.stopManagingNode(managingNode);
+ this.managementTestRule.stopManager(this.managerVM);
}
@Test
public void testClientHealthStats_SubscriptionDisabled() throws Exception {
- helper.createManagementCache(managingNode);
- helper.startManagingNode(managingNode);
-
- int port = (Integer) server.invoke(() -> ClientHealthStatsDUnitTest.createServerCache());
-
- DistributedMember serverMember = helper.getMember(server);
+ this.managementTestRule.createManager(this.managerVM, false);
+ this.managementTestRule.startManager(this.managerVM);
- client.invoke(() -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 1,
- false, false));
+ int port = this.serverVM.invoke(() -> createServerCache());
- client2.invoke(() -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 2,
- false, false));
+ this.client1VM.invoke(() -> createClientCache(this.hostName, port, 1, false));
+ this.client2VM.invoke(() -> createClientCache(this.hostName, port, 2, false));
- client.invoke(() -> ClientHealthStatsDUnitTest.put());
- client2.invoke(() -> ClientHealthStatsDUnitTest.put());
+ this.client1VM.invoke(() -> put());
+ this.client2VM.invoke(() -> put());
- managingNode.invoke(() -> ClientHealthStatsDUnitTest.verifyClientStats(serverMember, port, 0));
- helper.stopManagingNode(managingNode);
+ DistributedMember serverMember = this.managementTestRule.getDistributedMember(this.serverVM);
+ this.managerVM.invoke(() -> verifyClientStats(serverMember, port, 0));
+ this.managementTestRule.stopManager(this.managerVM);
}
@Test
public void testClientHealthStats_DurableClient() throws Exception {
- helper.createManagementCache(managingNode);
- helper.startManagingNode(managingNode);
+ this.managementTestRule.createManager(this.managerVM, false);
+ this.managementTestRule.startManager(this.managerVM);
- int port = (Integer) server.invoke(() -> ClientHealthStatsDUnitTest.createServerCache());
+ int port = this.serverVM.invoke(() -> createServerCache());
- DistributedMember serverMember = helper.getMember(server);
+ this.client1VM.invoke(() -> createClientCache(this.hostName, port, 1, true));
+ this.client2VM.invoke(() -> createClientCache(this.hostName, port, 2, true));
- client.invoke(
- () -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 1, true, true));
+ this.client1VM.invoke(() -> put());
+ this.client2VM.invoke(() -> put());
- client2.invoke(
- () -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 2, true, true));
+ this.client1VM.invoke(() -> clientCache.close(true));
+ this.client2VM.invoke(() -> clientCache.close(true));
- client.invoke(() -> ClientHealthStatsDUnitTest.put());
- client2.invoke(() -> ClientHealthStatsDUnitTest.put());
-
- client.invoke(() -> ClientHealthStatsDUnitTest.closeClientCache());
-
- client2.invoke(() -> ClientHealthStatsDUnitTest.closeClientCache());
-
- managingNode.invoke(() -> ClientHealthStatsDUnitTest.verifyClientStats(serverMember, port, 2));
- helper.stopManagingNode(managingNode);
+ DistributedMember serverMember = this.managementTestRule.getDistributedMember(this.serverVM);
+ this.managerVM.invoke(() -> verifyClientStats(serverMember, port, 2));
+ this.managementTestRule.stopManager(this.managerVM);
}
- @Category(FlakyTest.class) // GEODE-337
@Test
public void testStatsMatchWithSize() throws Exception {
- // start a server
- int port = (Integer) server.invoke(() -> ClientHealthStatsDUnitTest.createServerCache());
- // create durable client, with durable RI
- client.invoke(
- () -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 1, true, false));
- // do puts on server from three different threads, pause after 500 puts each.
- server.invoke(() -> ClientHealthStatsDUnitTest.doPuts());
- // close durable client
- client.invoke(() -> ClientHealthStatsDUnitTest.closeClientCache());
-
- server.invoke("verifyProxyHasBeenPaused", () -> verifyProxyHasBeenPaused());
- // resume puts on server, add another 100.
- server.invokeAsync(() -> ClientHealthStatsDUnitTest.resumePuts());
- // start durable client
- client.invoke(
- () -> ClientHealthStatsDUnitTest.createClientCache(server.getHost(), port, 1, true, false));
- // wait for full queue dispatch
- client.invoke(() -> ClientHealthStatsDUnitTest.waitForLastKey());
- // verify the stats
- server.invoke(() -> ClientHealthStatsDUnitTest.verifyStats(port));
- }
+ int port = this.serverVM.invoke(() -> createServerCache()); // start a serverVM
- private static void verifyProxyHasBeenPaused() {
+ this.client1VM.invoke(() -> createClientCache(this.hostName, port, 1, true)); // create durable client1VM, with durable RI
- WaitCriterion criterion = new WaitCriterion() {
+ this.serverVM.invoke(() -> doPuts()); // do puts on serverVM from three different threads, pause after 500 puts each.
- @Override
- public boolean done() {
- CacheClientNotifier ccn = CacheClientNotifier.getInstance();
- Collection<CacheClientProxy> ccProxies = ccn.getClientProxies();
+ this.client1VM.invoke(() -> clientCache.close(true)); // close durable client1VM
- Iterator<CacheClientProxy> itr = ccProxies.iterator();
+ this.serverVM.invoke(() -> await().atMost(2, MINUTES).until(() -> cacheClientProxyHasBeenPause()));
- while (itr.hasNext()) {
- CacheClientProxy ccp = itr.next();
- System.out.println("proxy status " + ccp.getState());
- if (ccp.isPaused())
- return true;
- }
- return false;
- }
+ this.serverVM.invoke(() -> resumePuts()); // resume puts on serverVM, add another 100.
- @Override
- public String description() {
- return "Proxy has not paused yet";
- }
- };
+ this.client1VM.invoke(() -> createClientCache(this.hostName, port, 1, true)); // start durable client1VM
- Wait.waitForCriterion(criterion, 15 * 1000, 200, true);
+ this.client1VM.invoke(() -> await().atMost(1, MINUTES).until(() -> lastKeyReceived)); // wait for full queue dispatch
+
+ this.serverVM.invoke(() -> verifyStats(port)); // verify the stats
}
- private static int createServerCache() throws Exception {
- Cache cache = helper.createCache(false);
+ /**
+ * Invoked in serverVM
+ */
+ private boolean cacheClientProxyHasBeenPause() {
+ CacheClientNotifier clientNotifier = CacheClientNotifier.getInstance(); // TODO
+ //CacheClientNotifier clientNotifier = ((CacheServerImpl)this.managementTestRule.getCache().getCacheServers().get(0)).getAcceptor().getCacheClientNotifier();
- RegionFactory<String, String> rf = cache.createRegionFactory(RegionShortcut.REPLICATE);
- rf.setConcurrencyChecksEnabled(false);
- rf.create(REGION_NAME);
+ Collection<CacheClientProxy> clientProxies = clientNotifier.getClientProxies();
- CacheServer server1 = cache.addCacheServer();
- server1.setPort(0);
- server1.start();
- return server1.getPort();
+ for (CacheClientProxy clientProxy: clientProxies) {
+ if (clientProxy.isPaused()) {
+ return true;
+ }
+ }
+ return false;
}
- private static void closeClientCache() throws Exception {
- cache.close(true);
+ /**
+ * Invoked in serverVM
+ */
+ private int createServerCache() throws Exception {
+ Cache cache = this.managementTestRule.getCache();
+
+ RegionFactory<String, String> regionFactory = cache.createRegionFactory(RegionShortcut.REPLICATE);
+ regionFactory.setConcurrencyChecksEnabled(false);
+ regionFactory.create(REGION_NAME);
+
+ CacheServer cacheServer = cache.addCacheServer();
+ cacheServer.setPort(0);
+ cacheServer.start();
+ return cacheServer.getPort();
}
- private static void createClientCache(Host host, Integer port, int clientNum,
- boolean subscriptionEnabled, boolean durable) throws Exception {
+ /**
+ * Invoked in client1VM and client2VM
+ */
+ private void createClientCache(final String hostName,
+ final Integer port,
+ final int clientNum,
+ final boolean subscriptionEnabled) throws Exception {
Properties props = new Properties();
- props.setProperty(DURABLE_CLIENT_ID, "durable-" + clientNum);
- props.setProperty(DURABLE_CLIENT_TIMEOUT, "300000");
- props.setProperty(LOG_LEVEL, "info");
- props.setProperty(STATISTIC_ARCHIVE_FILE,
- getTestMethodName() + "_client_" + clientNum + ".gfs");
props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
- ClientCacheFactory ccf = new ClientCacheFactory(props);
+ ClientCacheFactory cacheFactory = new ClientCacheFactory(props);
if (subscriptionEnabled) {
- ccf.setPoolSubscriptionEnabled(true);
- ccf.setPoolSubscriptionAckInterval(50);
- ccf.setPoolSubscriptionRedundancy(0);
+ cacheFactory.setPoolSubscriptionEnabled(true);
+ cacheFactory.setPoolSubscriptionAckInterval(50);
+ cacheFactory.setPoolSubscriptionRedundancy(0);
}
- if (durable) {
- ccf.set(DURABLE_CLIENT_ID, "DurableClientId_" + clientNum);
- ccf.set(DURABLE_CLIENT_TIMEOUT, "" + 300);
- }
+ cacheFactory.set(DURABLE_CLIENT_ID, "DurableClientId_" + clientNum);
+ cacheFactory.set(DURABLE_CLIENT_TIMEOUT, "" + 30000);
- ccf.addPoolServer(host.getHostName(), port);
- cache = (GemFireCacheImpl) ccf.create();
+ cacheFactory.addPoolServer(hostName, port);
+ clientCache = cacheFactory.create();
- ClientRegionFactory<String, String> crf =
- cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY);
- crf.setConcurrencyChecksEnabled(false);
+ ClientRegionFactory<String, String> regionFactory = clientCache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY);
+ regionFactory.setConcurrencyChecksEnabled(false);
- crf.addCacheListener(new CacheListenerAdapter<String, String>() {
- public void afterInvalidate(EntryEvent<String, String> event) {
- cache.getLoggerI18n()
- .fine("Invalidate Event: " + event.getKey() + ", " + event.getNewValue());
+ regionFactory.addCacheListener(new CacheListenerAdapter<String, String>() {
+ @Override
+ public void afterInvalidate(final EntryEvent<String, String> event) {
numOfInvalidates++;
}
- public void afterCreate(EntryEvent<String, String> event) {
- if (((String) event.getKey()).equals("last_key")) {
+ @Override
+ public void afterCreate(final EntryEvent<String, String> event) {
+ if ("last_key".equals(event.getKey())) {
lastKeyReceived = true;
}
- cache.getLoggerI18n().fine("Create Event: " + event.getKey() + ", " + event.getNewValue());
numOfCreates++;
}
- public void afterUpdate(EntryEvent<String, String> event) {
- cache.getLoggerI18n().fine("Update Event: " + event.getKey() + ", " + event.getNewValue());
+ @Override
+ public void afterUpdate(final EntryEvent<String, String> event) {
numOfUpdates++;
}
});
- Region<String, String> r = crf.create(REGION_NAME);
+ Region<String, String> region = regionFactory.create(REGION_NAME);
if (subscriptionEnabled) {
- r.registerInterest("ALL_KEYS", true);
- cache.readyForEvents();
+ region.registerInterest("ALL_KEYS", true);
+ clientCache.readyForEvents();
}
}
- private static void doPuts() throws Exception {
- Cache cache = GemFireCacheImpl.getInstance();
- final Region<String, String> r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
- Thread t1 = new Thread(new Runnable() {
- public void run() {
- for (int i = 0; i < 500; i++) {
- r.put("T1_KEY_" + i, "VALUE_" + i);
- }
+ /**
+ * Invoked in serverVM
+ */
+ private void doPuts() throws Exception {
+ Cache cache = this.managementTestRule.getCache();
+ Region<String, String> region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
+
+ Thread thread1 = new Thread(() -> {
+ for (int i = 0; i < NUMBER_PUTS; i++) {
+ region.put("T1_KEY_" + i, "VALUE_" + i);
}
});
- Thread t2 = new Thread(new Runnable() {
- public void run() {
- for (int i = 0; i < 500; i++) {
- r.put("T2_KEY_" + i, "VALUE_" + i);
- }
+ Thread thread2 = new Thread(() -> {
+ for (int i = 0; i < NUMBER_PUTS; i++) {
+ region.put("T2_KEY_" + i, "VALUE_" + i);
}
});
- Thread t3 = new Thread(new Runnable() {
- public void run() {
- for (int i = 0; i < 500; i++) {
- r.put("T3_KEY_" + i, "VALUE_" + i);
- }
+ Thread thread3 = new Thread(() -> {
+ for (int i = 0; i < NUMBER_PUTS; i++) {
+ region.put("T3_KEY_" + i, "VALUE_" + i);
}
});
- t1.start();
- t2.start();
- t3.start();
+ thread1.start();
+ thread2.start();
+ thread3.start();
- t1.join();
- t2.join();
- t3.join();
+ thread1.join();
+ thread2.join();
+ thread3.join();
}
- private static void resumePuts() {
- Cache cache = GemFireCacheImpl.getInstance();
- Region<String, String> r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
- for (int i = 0; i < 100; i++) {
- r.put("NEWKEY_" + i, "NEWVALUE_" + i);
+ /**
+ * Invoked in serverVM
+ */
+ private void resumePuts() {
+ Cache cache = this.managementTestRule.getCache();
+ Region<String, String> region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
+
+ for (int i = 0; i < NUMBER_PUTS; i++) {
+ region.put("NEWKEY_" + i, "NEWVALUE_" + i);
}
- r.put("last_key", "last_value");
+ region.put("last_key", "last_value");
}
- private static void waitForLastKey() {
- WaitCriterion wc = new WaitCriterion() {
- @Override
- public boolean done() {
- return lastKeyReceived;
- }
+ /**
+ * Invoked in managerVM
+ */
+ private void verifyClientStats(final DistributedMember serverMember, final int serverPort, final int numSubscriptions) throws Exception {
+ ManagementService service = this.managementTestRule.getManagementService();
+ CacheServerMXBean cacheServerMXBean = awaitCacheServerMXBean(serverMember, serverPort);
- @Override
- public String description() {
- return "Did not receive last key.";
- }
- };
- Wait.waitForCriterion(wc, 60 * 1000, 500, true);
- }
+ String[] clientIds = cacheServerMXBean.getClientIds();
+ assertThat(clientIds).hasSize(2);
- private static DistributedMember getMember() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- return cache.getDistributedSystem().getDistributedMember();
- }
+ ClientHealthStatus[] clientStatuses = cacheServerMXBean.showAllClientStats();
- private static void verifyClientStats(DistributedMember serverMember, int serverPort,
- int numSubscriptions) {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- try {
- ManagementService service = ManagementService.getExistingManagementService(cache);
- CacheServerMXBean bean = MBeanUtil.getCacheServerMbeanProxy(serverMember, serverPort);
-
- String[] clientIds = bean.getClientIds();
- assertTrue(clientIds.length == 2);
- System.out.println(
- "<ExpectedString> ClientId-1 of the Server is " + clientIds[0] + "</ExpectedString> ");
- System.out.println(
- "<ExpectedString> ClientId-2 of the Server is " + clientIds[1] + "</ExpectedString> ");
-
- ClientHealthStatus[] clientStatuses = bean.showAllClientStats();
-
- ClientHealthStatus clientStatus1 = bean.showClientStats(clientIds[0]);
- ClientHealthStatus clientStatus2 = bean.showClientStats(clientIds[1]);
- assertNotNull(clientStatus1);
- assertNotNull(clientStatus2);
- System.out.println("<ExpectedString> ClientStats-1 of the Server is " + clientStatus1
- + "</ExpectedString> ");
- System.out.println("<ExpectedString> ClientStats-2 of the Server is " + clientStatus2
- + "</ExpectedString> ");
-
- System.out
- .println("<ExpectedString> clientStatuses " + clientStatuses + "</ExpectedString> ");
- assertNotNull(clientStatuses);
-
- assertTrue(clientStatuses.length == 2);
- for (ClientHealthStatus status : clientStatuses) {
- System.out.println(
- "<ExpectedString> ClientStats of the Server is " + status + "</ExpectedString> ");
- }
+ ClientHealthStatus clientStatus1 = cacheServerMXBean.showClientStats(clientIds[0]);
+ ClientHealthStatus clientStatus2 = cacheServerMXBean.showClientStats(clientIds[1]);
+ assertThat(clientStatus1).isNotNull();
+ assertThat(clientStatus2).isNotNull();
- DistributedSystemMXBean dsBean = service.getDistributedSystemMXBean();
- assertEquals(2, dsBean.getNumClients());
- assertEquals(numSubscriptions, dsBean.getNumSubscriptions());
+ assertThat(clientStatuses).isNotNull().hasSize(2);
- } catch (Exception e) {
- fail("Error while verifying cache server from remote member", e);
- }
+ DistributedSystemMXBean dsBean = service.getDistributedSystemMXBean();
+ assertThat(dsBean.getNumClients()).isEqualTo(2);
+ assertThat(dsBean.getNumSubscriptions()).isEqualTo(numSubscriptions);
}
- private static void put() {
- Cache cache = GemFireCacheImpl.getInstance();
- Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME);
- assertNotNull(r1);
-
- r1.put(k1, client_k1);
- assertEquals(r1.getEntry(k1).getValue(), client_k1);
- r1.put(k2, client_k2);
- assertEquals(r1.getEntry(k2).getValue(), client_k2);
- try {
- Thread.sleep(10000);
- } catch (Exception e) {
- // sleep
- }
- r1.clear();
-
- r1.put(k1, client_k1);
- assertEquals(r1.getEntry(k1).getValue(), client_k1);
- r1.put(k2, client_k2);
- assertEquals(r1.getEntry(k2).getValue(), client_k2);
- r1.clear();
- try {
- Thread.sleep(10000);
- } catch (Exception e) {
- // sleep
- }
+ /**
+ * Invoked in client1VM and client2VM
+ */
+ private void put() throws Exception {
+ Cache cache = (Cache)clientCache;
+ Region<String, String> region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
+
+ region.put(KEY1, VALUE1);
+ assertThat(region.getEntry(KEY1).getValue()).isEqualTo(VALUE1);
+
+ region.put(KEY2, VALUE2);
+ assertThat(region.getEntry(KEY2).getValue()).isEqualTo(VALUE2);
+
+ region.clear();
+
+ region.put(KEY1, VALUE1);
+ assertThat(region.getEntry(KEY1).getValue()).isEqualTo(VALUE1);
+
+ region.put(KEY2, VALUE2);
+ assertThat(region.getEntry(KEY2).getValue()).isEqualTo(VALUE2);
+
+ region.clear();
}
- private static void verifyStats(int serverPort) throws Exception {
- Cache cache = GemFireCacheImpl.getInstance();
- ManagementService service = ManagementService.getExistingManagementService(cache);
+ /**
+ * Invoked in serverVM
+ */
+ private void verifyStats(final int serverPort) throws Exception {
+ ManagementService service = this.managementTestRule.getManagementService();
CacheServerMXBean serverBean = service.getLocalCacheServerMXBean(serverPort);
- CacheClientNotifier ccn = CacheClientNotifier.getInstance();
- CacheClientProxy ccp = ccn.getClientProxies().iterator().next();
- cache.getLoggerI18n().info(LocalizedStrings.DEBUG, "getQueueSize() " + ccp.getQueueSize());
- cache.getLoggerI18n().info(LocalizedStrings.DEBUG,
- "getQueueSizeStat() " + ccp.getQueueSizeStat());
- cache.getLoggerI18n().info(LocalizedStrings.DEBUG,
- "getEventsEnqued() " + ccp.getHARegionQueue().getStatistics().getEventsEnqued());
- cache.getLoggerI18n().info(LocalizedStrings.DEBUG,
- "getEventsDispatched() " + ccp.getHARegionQueue().getStatistics().getEventsDispatched());
- cache.getLoggerI18n().info(LocalizedStrings.DEBUG,
- "getEventsRemoved() " + ccp.getHARegionQueue().getStatistics().getEventsRemoved());
- cache.getLoggerI18n().info(LocalizedStrings.DEBUG,
- "getNumVoidRemovals() " + ccp.getHARegionQueue().getStatistics().getNumVoidRemovals());
- assertEquals(ccp.getQueueSize(), ccp.getQueueSizeStat());
+
+ CacheClientNotifier clientNotifier = CacheClientNotifier.getInstance();
+ CacheClientProxy clientProxy = clientNotifier.getClientProxies().iterator().next();
+ assertThat(clientProxy.getQueueSizeStat()).isEqualTo(clientProxy.getQueueSize());
+
ClientQueueDetail queueDetails = serverBean.showClientQueueDetails()[0];
- assertEquals(queueDetails.getQueueSize(), ccp.getQueueSizeStat());
+ assertThat(clientProxy.getQueueSizeStat()).isEqualTo((int)queueDetails.getQueueSize());
+ }
+
+ private CacheServerMXBean awaitCacheServerMXBean(final DistributedMember serverMember, final int port) {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ ObjectName objectName = service.getCacheServerMBeanName(port, serverMember);
+
+ await().until(() -> assertThat(service.getMBeanProxy(objectName, CacheServerMXBean.class)).isNotNull());
+
+ return service.getMBeanProxy(objectName, CacheServerMXBean.class);
+ }
+
+ private ConditionFactory await() {
+ return Awaitility.await().atMost(2, MINUTES);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/CompositeTypeTestDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/CompositeTypeTestDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/CompositeTypeTestDUnitTest.java
index 9c33003..3176bda 100644
--- a/geode-core/src/test/java/org/apache/geode/management/CompositeTypeTestDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/CompositeTypeTestDUnitTest.java
@@ -14,163 +14,86 @@
*/
package org.apache.geode.management;
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
+import static java.util.concurrent.TimeUnit.*;
+import static org.assertj.core.api.Assertions.*;
-import static org.junit.Assert.*;
+import java.io.Serializable;
-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 org.apache.geode.test.junit.categories.FlakyTest;
-
-import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import com.jayway.awaitility.Awaitility;
+import com.jayway.awaitility.core.ConditionFactory;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import org.apache.geode.management.internal.MBeanJMXAdapter;
-import org.apache.geode.management.internal.ManagementConstants;
import org.apache.geode.management.internal.SystemManagementService;
-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;
@Category(DistributedTest.class)
-public class CompositeTypeTestDUnitTest extends ManagementTestBase {
+@SuppressWarnings({ "serial", "unused" })
+public class CompositeTypeTestDUnitTest implements Serializable {
- public CompositeTypeTestDUnitTest() {
- super();
- // TODO Auto-generated constructor stub
- }
+ @Manager
+ private VM managerVM;
- /**
- *
- */
- private static final long serialVersionUID = 1L;
+ @Member
+ private VM memberVM;
- private static ObjectName objectName;
+ @Rule
+ public ManagementTestRule managementTestRule = ManagementTestRule.builder().start(true).build();
- @Category(FlakyTest.class) // GEODE-1492
@Test
- public void testCompositeTypeGetters() throws Exception {
+ public void testCompositeTypeGetters() throws Exception{
+ registerMBeanWithCompositeTypeGetters(this.memberVM);
- initManagement(false);
- String member = getMemberId(managedNode1);
- member = MBeanJMXAdapter.makeCompliantName(member);
-
- registerMBeanWithCompositeTypeGetters(managedNode1, member);
+ String memberName = MBeanJMXAdapter.makeCompliantName(getMemberId(this.memberVM));
+ verifyMBeanWithCompositeTypeGetters(this.managerVM, memberName);
+ }
+ private void registerMBeanWithCompositeTypeGetters(final VM memberVM) throws Exception {
+ memberVM.invoke("registerMBeanWithCompositeTypeGetters", () -> {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
- checkMBeanWithCompositeTypeGetters(managingNode, member);
+ ObjectName objectName = new ObjectName("GemFire:service=custom,type=composite");
+ CompositeTestMXBean compositeTestMXBean = new CompositeTestMBean();
+ objectName = service.registerMBean(compositeTestMXBean, objectName);
+ service.federate(objectName, CompositeTestMXBean.class, false);
+ });
}
+ private void verifyMBeanWithCompositeTypeGetters(final VM managerVM, final String memberId) throws Exception {
+ managerVM.invoke("verifyMBeanWithCompositeTypeGetters", () -> {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ ObjectName objectName = new ObjectName("GemFire:service=custom,type=composite,member=" + memberId);
- /**
- * Creates a Local region
- *
- * @param vm reference to VM
- */
- protected void registerMBeanWithCompositeTypeGetters(VM vm, final String memberID)
- throws Exception {
- SerializableRunnable regMBean =
- new SerializableRunnable("Register CustomMBean with composite Type") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- SystemManagementService service = (SystemManagementService) getManagementService();
-
- try {
- ObjectName objectName = new ObjectName("GemFire:service=custom,type=composite");
- CompositeTestMXBean mbean = new CompositeTestMBean();
- objectName = service.registerMBean(mbean, objectName);
- service.federate(objectName, CompositeTestMXBean.class, false);
- } catch (MalformedObjectNameException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NullPointerException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
-
- }
- };
- vm.invoke(regMBean);
- }
+ await().until(() -> service.getMBeanInstance(objectName, CompositeTestMXBean.class) != null);
+
+ CompositeTestMXBean compositeTestMXBean = service.getMBeanInstance(objectName, CompositeTestMXBean.class);
+ assertThat(compositeTestMXBean).isNotNull();
+ CompositeStats listCompositeStatsData = compositeTestMXBean.listCompositeStats();
+ assertThat(listCompositeStatsData).isNotNull();
- /**
- * Creates a Local region
- *
- * @param vm reference to VM
- */
- protected void checkMBeanWithCompositeTypeGetters(VM vm, final String memberID) throws Exception {
- SerializableRunnable checkMBean =
- new SerializableRunnable("Check CustomMBean with composite Type") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- final SystemManagementService service =
- (SystemManagementService) getManagementService();
-
- try {
- final ObjectName objectName =
- new ObjectName("GemFire:service=custom,type=composite,member=" + memberID);
-
- Wait.waitForCriterion(new WaitCriterion() {
- public String description() {
- return "Waiting for Composite Type MBean";
- }
-
- public boolean done() {
- CompositeTestMXBean bean =
- service.getMBeanInstance(objectName, CompositeTestMXBean.class);
- boolean done = (bean != null);
- return done;
- }
-
- }, ManagementConstants.REFRESH_TIME * 4, 500, true);
-
-
- CompositeTestMXBean bean =
- service.getMBeanInstance(objectName, CompositeTestMXBean.class);
-
- CompositeStats listData = bean.listCompositeStats();
-
- System.out.println("connectionStatsType = " + listData.getConnectionStatsType());
- System.out.println("connectionsOpened = " + listData.getConnectionsOpened());
- System.out.println("connectionsClosed = " + listData.getConnectionsClosed());
- System.out.println("connectionsAttempted = " + listData.getConnectionsAttempted());
- System.out.println("connectionsFailed = " + listData.getConnectionsFailed());
-
- CompositeStats getsData = bean.getCompositeStats();
- System.out.println("connectionStatsType = " + getsData.getConnectionStatsType());
- System.out.println("connectionsOpened = " + getsData.getConnectionsOpened());
- System.out.println("connectionsClosed = " + getsData.getConnectionsClosed());
- System.out.println("connectionsAttempted = " + getsData.getConnectionsAttempted());
- System.out.println("connectionsFailed = " + getsData.getConnectionsFailed());
-
- CompositeStats[] arrayData = bean.getCompositeArray();
- Integer[] intArrayData = bean.getIntegerArray();
- Thread.sleep(2 * 60 * 1000);
- } catch (MalformedObjectNameException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NullPointerException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
-
- }
- };
- vm.invoke(checkMBean);
+ CompositeStats getCompositeStatsData = compositeTestMXBean.getCompositeStats();
+ assertThat(getCompositeStatsData).isNotNull();
+
+ CompositeStats[] getCompositeArrayData = compositeTestMXBean.getCompositeArray();
+ assertThat(getCompositeArrayData).isNotNull().isNotEmpty();
+
+ Integer[] getIntegerArrayData = compositeTestMXBean.getIntegerArray();
+ assertThat(getIntegerArrayData).isNotNull().isNotEmpty();
+ });
}
+ private String getMemberId(final VM memberVM) {
+ return memberVM.invoke("getMemberId", () -> this.managementTestRule.getDistributedMember().getId());
+ }
+ private ConditionFactory await() {
+ return Awaitility.await().atMost(2, MINUTES);
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/DLockManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/DLockManagementDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/DLockManagementDUnitTest.java
index 86501c3..9c8e5c9 100644
--- a/geode-core/src/test/java/org/apache/geode/management/DLockManagementDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/DLockManagementDUnitTest.java
@@ -14,452 +14,272 @@
*/
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.apache.geode.internal.process.ProcessUtils.*;
+import static org.assertj.core.api.Assertions.*;
+import java.io.Serializable;
import java.util.Map;
import java.util.Set;
import javax.management.ObjectName;
+import com.jayway.awaitility.Awaitility;
+import com.jayway.awaitility.core.ConditionFactory;
+import org.junit.Rule;
+import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.apache.geode.distributed.DistributedLockService;
import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
import org.apache.geode.distributed.internal.locks.DLockService;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
import org.apache.geode.internal.cache.GemFireCacheImpl;
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.FlakyTest;
+import org.apache.geode.test.junit.categories.DistributedTest;
@Category(DistributedTest.class)
-public class DLockManagementDUnitTest extends ManagementTestBase {
+@SuppressWarnings({ "serial", "unused" })
+public class DLockManagementDUnitTest implements Serializable {
- private static final long serialVersionUID = 1L;
+ private static final int MAX_WAIT_MILLIS = 120 * 1000; // 2 MINUTES
- private static final String LOCK_SERVICE_NAME = "testLockService";
+ private static final String LOCK_SERVICE_NAME = DLockManagementDUnitTest.class.getSimpleName() + "_testLockService";
- // 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;
+ @Manager
+ private VM managerVM;
- public DLockManagementDUnitTest() {
- super();
+ @Member
+ private VM[] memberVMs;
- }
+ @Rule
+ public ManagementTestRule managementTestRule = ManagementTestRule.builder().managersFirst(false).start(true).build();
- /**
- * Distributed Lock Service test
- *
- * @throws Exception
- */
- @Category(FlakyTest.class) // GEODE-173: eats exceptions, HeadlessGFSH, time sensitive,
- // waitForCriterions
@Test
- public void testDLockMBean() throws Throwable {
+ public void testLockServiceMXBean() throws Throwable {
+ createLockServiceGrantor(this.memberVMs[0]);
+ createLockService(this.memberVMs[1]);
+ createLockService(this.memberVMs[2]);
- initManagement(false);
-
- VM[] managedNodes = new VM[getManagedNodeList().size()];
- VM managingNode = getManagingNode();
-
- getManagedNodeList().toArray(managedNodes);
-
- createGrantorLockService(managedNodes[0]);
-
- createLockService(managedNodes[1]);
-
- createLockService(managedNodes[2]);
-
- for (VM vm : getManagedNodeList()) {
- verifyLockData(vm);
+ for (VM memberVM : this.memberVMs) {
+ verifyLockServiceMXBeanInMember(memberVM);
}
- verifyLockDataRemote(managingNode);
+ verifyLockServiceMXBeanInManager(this.managerVM);
- for (VM vm : getManagedNodeList()) {
- closeLockService(vm);
+ for (VM memberVM : this.memberVMs) {
+ closeLockService(memberVM);
}
}
- /**
- * Distributed Lock Service test
- *
- * @throws Exception
- */
- @Category(FlakyTest.class) // GEODE-553: waitForCriterion, eats exceptions, HeadlessGFSH
@Test
- public void testDLockAggregate() throws Throwable {
- initManagement(false);
- VM[] managedNodes = new VM[getManagedNodeList().size()];
- VM managingNode = getManagingNode();
-
- getManagedNodeList().toArray(managedNodes);
-
- createGrantorLockService(managedNodes[0]);
+ public void testDistributedLockServiceMXBean() throws Throwable {
+ createLockServiceGrantor(this.memberVMs[0]);
+ createLockService(this.memberVMs[1]);
+ createLockService(this.memberVMs[2]);
- createLockService(managedNodes[1]);
+ verifyDistributedLockServiceMXBean(this.managerVM, 3);
- createLockService(managedNodes[2]);
+ DistributedMember member = this.managementTestRule.getDistributedMember(this.memberVMs[2]);
+ verifyFetchOperations(this.managerVM, member);
- checkAggregate(managingNode, 3);
- DistributedMember member = getMember(managedNodes[2]);
- checkNavigation(managingNode, member);
+ createLockService(this.managerVM);
+ verifyDistributedLockServiceMXBean(this.managerVM, 4);
- createLockService(managingNode);
- checkAggregate(managingNode, 4);
-
-
- for (VM vm : getManagedNodeList()) {
- closeLockService(vm);
+ for (VM memberVM : this.memberVMs) {
+ closeLockService(memberVM);
}
- ensureProxyCleanup(managingNode);
- checkAggregate(managingNode, 1);
- closeLockService(managingNode);
- checkAggregate(managingNode, 0);
+ verifyProxyCleanupInManager(this.managerVM);
+ verifyDistributedLockServiceMXBean(this.managerVM, 1);
+ closeLockService(this.managerVM);
+ verifyDistributedLockServiceMXBean(this.managerVM, 0);
}
- public void ensureProxyCleanup(final VM vm) {
-
- SerializableRunnable ensureProxyCleanup = new SerializableRunnable("Ensure Proxy cleanup") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Set<DistributedMember> otherMemberSet =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
- final SystemManagementService service = (SystemManagementService) getManagementService();
-
-
- for (final DistributedMember member : otherMemberSet) {
- RegionMXBean bean = null;
- try {
-
- Wait.waitForCriterion(new WaitCriterion() {
-
- LockServiceMXBean bean = null;
-
- public String description() {
- return "Waiting for the proxy to get deleted at managing node";
- }
-
- public boolean done() {
- ObjectName objectName = service.getRegionMBeanName(member, LOCK_SERVICE_NAME);
- bean = service.getMBeanProxy(objectName, LockServiceMXBean.class);
- boolean done = (bean == null);
- return done;
- }
-
- }, MAX_WAIT, 500, true);
-
- } catch (Exception e) {
- throw new AssertionError("could not remove proxies in required time", e);
-
- }
- assertNull(bean);
-
- }
+ private void verifyProxyCleanupInManager(final VM managerVM) {
+ managerVM.invoke("verifyProxyCleanupInManager", () -> {
+ Set<DistributedMember> otherMembers = this.managementTestRule.getOtherNormalMembers();
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ for (final DistributedMember member : otherMembers) {
+ ObjectName objectName = service.getRegionMBeanName(member, LOCK_SERVICE_NAME);
+ await().until(() -> assertThat(service.getMBeanProxy(objectName, LockServiceMXBean.class)).isNull());
}
- };
- vm.invoke(ensureProxyCleanup);
+ });
}
- /**
- * Creates a grantor lock service
- *
- * @param vm
- */
- @SuppressWarnings("serial")
- protected void createGrantorLockService(final VM vm) {
- SerializableRunnable createGrantorLockService =
- new SerializableRunnable("Create Grantor LockService") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- assertNull(DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME));
-
- DLockService service = (DLockService) DistributedLockService.create(LOCK_SERVICE_NAME,
- cache.getDistributedSystem());
+ private void createLockServiceGrantor(final VM memberVM) {
+ memberVM.invoke("createLockServiceGrantor", () -> {
+ assertThat(DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME)).isNull();
- assertSame(service, DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME));
+ DLockService lockService = (DLockService) DistributedLockService.create(LOCK_SERVICE_NAME, this.managementTestRule.getCache().getDistributedSystem());
+ DistributedMember grantor = lockService.getLockGrantorId().getLockGrantorMember();
+ assertThat(grantor).isNotNull();
- InternalDistributedMember grantor = service.getLockGrantorId().getLockGrantorMember();
+ LockServiceMXBean lockServiceMXBean = awaitLockServiceMXBean(LOCK_SERVICE_NAME);
- assertNotNull(grantor);
+ assertThat(lockServiceMXBean).isNotNull();
+ assertThat(lockServiceMXBean.isDistributed()).isTrue();
+ assertThat(lockServiceMXBean.getName()).isEqualTo(LOCK_SERVICE_NAME);
+ assertThat(lockServiceMXBean.isLockGrantor()).isTrue();
+ assertThat(lockServiceMXBean.fetchGrantorMember()).isEqualTo(this.managementTestRule.getDistributedMember().getId());
+ });
+ }
- LogWriterUtils.getLogWriter().info("In identifyLockGrantor - grantor is " + grantor);
+ private void createLockService(final VM anyVM) {
+ anyVM.invoke("createLockService", () -> {
+ assertThat(DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME)).isNull();
+ DistributedLockService.create(LOCK_SERVICE_NAME, this.managementTestRule.getCache().getDistributedSystem());
+ LockServiceMXBean lockServiceMXBean = awaitLockServiceMXBean(LOCK_SERVICE_NAME);
- ManagementService mgmtService = getManagementService();
+ assertThat(lockServiceMXBean).isNotNull();
+ assertThat(lockServiceMXBean.isDistributed()).isTrue();
+ assertThat(lockServiceMXBean.isLockGrantor()).isFalse();
+ });
+ }
- LockServiceMXBean bean = mgmtService.getLocalLockServiceMBean(LOCK_SERVICE_NAME);
+ private void closeLockService(final VM anyVM) {
+ anyVM.invoke("closeLockService", () -> {
+ assertThat(DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME)).isNotNull();
+ DistributedLockService.destroy(LOCK_SERVICE_NAME);
- assertNotNull(bean);
+ awaitLockServiceMXBeanIsNull(LOCK_SERVICE_NAME);
- assertTrue(bean.isDistributed());
+ ManagementService service = this.managementTestRule.getManagementService();
+ LockServiceMXBean lockServiceMXBean = service.getLocalLockServiceMBean(LOCK_SERVICE_NAME);
+ assertThat(lockServiceMXBean).isNull();
+ });
+ }
- assertEquals(bean.getName(), LOCK_SERVICE_NAME);
+ private void verifyLockServiceMXBeanInMember(final VM memberVM) {
+ memberVM.invoke("verifyLockServiceMXBeanInManager", () -> {
+ DistributedLockService lockService = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
+ lockService.lock("lockObject_" + identifyPid(), MAX_WAIT_MILLIS, -1);
- assertTrue(bean.isLockGrantor());
+ ManagementService service = this.managementTestRule.getManagementService();
+ LockServiceMXBean lockServiceMXBean = service.getLocalLockServiceMBean(LOCK_SERVICE_NAME);
+ assertThat(lockServiceMXBean).isNotNull();
- assertEquals(cache.getDistributedSystem().getMemberId(), bean.fetchGrantorMember());
+ String[] listHeldLock = lockServiceMXBean.listHeldLocks();
+ assertThat(listHeldLock).hasSize(1);
- }
- };
- vm.invoke(createGrantorLockService);
+ Map<String, String> lockThreadMap = lockServiceMXBean.listThreadsHoldingLock();
+ assertThat(lockThreadMap).hasSize(1);
+ });
}
/**
- * Creates a named lock service
- *
- * @param vm
+ * Verify lock data from remote Managing node
*/
- @SuppressWarnings("serial")
- protected void createLockService(final VM vm) {
- SerializableRunnable createLockService = new SerializableRunnable("Create LockService") {
- public void run() {
- assertNull(DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME));
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- DistributedLockService service =
- DistributedLockService.create(LOCK_SERVICE_NAME, cache.getDistributedSystem());
+ private void verifyLockServiceMXBeanInManager(final VM managerVM) throws Exception {
+ managerVM.invoke("verifyLockServiceMXBeanInManager", () -> {
+ Set<DistributedMember> otherMembers = this.managementTestRule.getOtherNormalMembers();
- assertSame(service, DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME));
+ for (DistributedMember member : otherMembers) {
+ LockServiceMXBean lockServiceMXBean = awaitLockServiceMXBeanProxy(member, LOCK_SERVICE_NAME);
+ assertThat(lockServiceMXBean).isNotNull();
+ String[] listHeldLock = lockServiceMXBean.listHeldLocks();
+ assertThat(listHeldLock).hasSize(1);
+ Map<String, String> lockThreadMap = lockServiceMXBean.listThreadsHoldingLock();
+ assertThat(lockThreadMap).hasSize(1);
+ }
+ });
+ }
- ManagementService mgmtService = getManagementService();
-
- LockServiceMXBean bean = mgmtService.getLocalLockServiceMBean(LOCK_SERVICE_NAME);
-
- assertNotNull(bean);
+ private void verifyFetchOperations(final VM memberVM, final DistributedMember member) {
+ memberVM.invoke("verifyFetchOperations", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
- assertTrue(bean.isDistributed());
+ DistributedSystemMXBean distributedSystemMXBean = awaitDistributedSystemMXBean();
+ ObjectName distributedLockServiceMXBeanName = MBeanJMXAdapter.getDistributedLockServiceName(LOCK_SERVICE_NAME);
+ assertThat(distributedSystemMXBean.fetchDistributedLockServiceObjectName(LOCK_SERVICE_NAME)).isEqualTo(distributedLockServiceMXBeanName);
- assertFalse(bean.isLockGrantor());
- }
- };
- vm.invoke(createLockService);
+ ObjectName lockServiceMXBeanName = MBeanJMXAdapter.getLockServiceMBeanName(member.getId(), LOCK_SERVICE_NAME);
+ assertThat(distributedSystemMXBean.fetchLockServiceObjectName(member.getId(), LOCK_SERVICE_NAME)).isEqualTo(lockServiceMXBeanName);
+ });
}
/**
- * Closes a named lock service
- *
- * @param vm
+ * Verify Aggregate MBean
*/
- @SuppressWarnings("serial")
- protected void closeLockService(final VM vm) {
- SerializableRunnable closeLockService = new SerializableRunnable("Close LockService") {
- public void run() {
-
- DistributedLockService service = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
-
- DistributedLockService.destroy(LOCK_SERVICE_NAME);
+ private void verifyDistributedLockServiceMXBean(final VM managerVM, final int memberCount) {
+ managerVM.invoke("verifyDistributedLockServiceMXBean", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
- ManagementService mgmtService = getManagementService();
-
- LockServiceMXBean bean = null;
- try {
+ if (memberCount == 0) {
+ await().until(() -> assertThat(service.getDistributedLockServiceMXBean(LOCK_SERVICE_NAME)).isNull());
+ return;
+ }
- bean = mgmtService.getLocalLockServiceMBean(LOCK_SERVICE_NAME);
+ DistributedLockServiceMXBean distributedLockServiceMXBean = awaitDistributedLockServiceMXBean(LOCK_SERVICE_NAME, memberCount);
+ assertThat(distributedLockServiceMXBean).isNotNull();
+ assertThat(distributedLockServiceMXBean.getName()).isEqualTo(LOCK_SERVICE_NAME);
+ });
+ }
- } catch (ManagementException mgs) {
+ private DistributedSystemMXBean awaitDistributedSystemMXBean() {
+ ManagementService service = this.managementTestRule.getManagementService();
- }
- assertNull(bean);
+ await().until(() -> assertThat(service.getDistributedSystemMXBean()).isNotNull());
- }
- };
- vm.invoke(closeLockService);
+ return service.getDistributedSystemMXBean();
}
/**
- * Lock data related verifications
- *
- * @param vm
+ * Await and return a DistributedRegionMXBean proxy with specified member
+ * count.
*/
- @SuppressWarnings("serial")
- protected void verifyLockData(final VM vm) {
- SerializableRunnable verifyLockData = new SerializableRunnable("Verify LockService") {
- public void run() {
-
- DistributedLockService service = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
-
- final String LOCK_OBJECT = "lockObject_" + vm.getPid();
-
- Wait.waitForCriterion(new WaitCriterion() {
- DistributedLockService service = null;
-
- public String description() {
- return "Waiting for the lock service to be initialised";
- }
-
- public boolean done() {
- DistributedLockService service =
- DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
- boolean done = service != null;
- return done;
- }
-
- }, MAX_WAIT, 500, true);
-
- service.lock(LOCK_OBJECT, 1000, -1);
-
+ private DistributedLockServiceMXBean awaitDistributedLockServiceMXBean(final String lockServiceName, final int memberCount) {
+ ManagementService service = this.managementTestRule.getManagementService();
- ManagementService mgmtService = getManagementService();
+ await().until(() -> {
+ assertThat(service.getDistributedLockServiceMXBean(lockServiceName)).isNotNull();
+ assertThat(service.getDistributedLockServiceMXBean(lockServiceName).getMemberCount()).isEqualTo(memberCount);
+ });
- LockServiceMXBean bean = null;
- try {
-
- bean = mgmtService.getLocalLockServiceMBean(LOCK_SERVICE_NAME);
-
- } catch (ManagementException mgs) {
-
- }
- assertNotNull(bean);
- String[] listHeldLock = bean.listHeldLocks();
- assertEquals(listHeldLock.length, 1);
- LogWriterUtils.getLogWriter().info("List Of Lock Object is " + listHeldLock[0]);
- Map<String, String> lockThreadMap = bean.listThreadsHoldingLock();
- assertEquals(lockThreadMap.size(), 1);
- LogWriterUtils.getLogWriter().info("List Of Lock Thread is " + lockThreadMap.toString());
- }
- };
- vm.invoke(verifyLockData);
+ return service.getDistributedLockServiceMXBean(lockServiceName);
}
/**
- * Verify lock data from remote Managing node
- *
- * @param vm
+ * Await and return a LockServiceMXBean proxy for a specific member and
+ * lockServiceName.
*/
- @SuppressWarnings("serial")
- protected void verifyLockDataRemote(final VM vm) {
- SerializableRunnable verifyLockDataRemote =
- new SerializableRunnable("Verify LockService Remote") {
- public void run() {
-
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Set<DistributedMember> otherMemberSet =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
-
- for (DistributedMember member : otherMemberSet) {
- LockServiceMXBean bean = null;
- try {
- bean = MBeanUtil.getLockServiceMbeanProxy(member, LOCK_SERVICE_NAME);
- } catch (Exception e) {
- InternalDistributedSystem.getLoggerI18n()
- .fine("Undesired Result , LockServiceMBean Should not be null", e);
-
- }
- assertNotNull(bean);
- String[] listHeldLock = bean.listHeldLocks();
- assertEquals(listHeldLock.length, 1);
- LogWriterUtils.getLogWriter().info("List Of Lock Object is " + listHeldLock[0]);
- Map<String, String> lockThreadMap = bean.listThreadsHoldingLock();
- assertEquals(lockThreadMap.size(), 1);
- LogWriterUtils.getLogWriter()
- .info("List Of Lock Thread is " + lockThreadMap.toString());
- }
-
- }
- };
- vm.invoke(verifyLockDataRemote);
- }
+ private LockServiceMXBean awaitLockServiceMXBeanProxy(final DistributedMember member, final String lockServiceName) {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ ObjectName lockServiceMXBeanName = service.getLockServiceMBeanName(member, lockServiceName);
- protected void checkNavigation(final VM vm, final DistributedMember lockServiceMember) {
- SerializableRunnable checkNavigation = new SerializableRunnable("Check Navigation") {
- public void run() {
-
- final ManagementService service = getManagementService();
-
- DistributedSystemMXBean disMBean = service.getDistributedSystemMXBean();
- try {
- ObjectName expected = MBeanJMXAdapter.getDistributedLockServiceName(LOCK_SERVICE_NAME);
- ObjectName actual = disMBean.fetchDistributedLockServiceObjectName(LOCK_SERVICE_NAME);
- assertEquals(expected, actual);
- } catch (Exception e) {
- throw new AssertionError("Lock Service Navigation Failed ", e);
- }
-
- try {
- ObjectName expected =
- MBeanJMXAdapter.getLockServiceMBeanName(lockServiceMember.getId(), LOCK_SERVICE_NAME);
- ObjectName actual =
- disMBean.fetchLockServiceObjectName(lockServiceMember.getId(), LOCK_SERVICE_NAME);
- assertEquals(expected, actual);
- } catch (Exception e) {
- throw new AssertionError("Lock Service Navigation Failed ", e);
- }
+ await().until(() -> assertThat(service.getMBeanProxy(lockServiceMXBeanName, LockServiceMXBean.class)).isNotNull());
- }
- };
- vm.invoke(checkNavigation);
+ return service.getMBeanProxy(lockServiceMXBeanName, LockServiceMXBean.class);
}
/**
- * Verify Aggregate MBean
- *
- * @param vm
+ * Await creation of local LockServiceMXBean for specified lockServiceName.
*/
- @SuppressWarnings("serial")
- protected void checkAggregate(final VM vm, final int expectedMembers) {
- SerializableRunnable checkAggregate = new SerializableRunnable("Verify Aggregate MBean") {
- public void run() {
-
- final ManagementService service = getManagementService();
- if (expectedMembers == 0) {
- try {
- Wait.waitForCriterion(new WaitCriterion() {
-
- DistributedLockServiceMXBean bean = null;
+ private LockServiceMXBean awaitLockServiceMXBean(final String lockServiceName) {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
- public String description() {
- return "Waiting for the proxy to get deleted at managing node";
- }
+ await().until(() -> assertThat(service.getLocalLockServiceMBean(lockServiceName)).isNotNull());
- public boolean done() {
- bean = service.getDistributedLockServiceMXBean(LOCK_SERVICE_NAME);
-
- boolean done = (bean == null);
- return done;
- }
-
- }, MAX_WAIT, 500, true);
-
- } catch (Exception e) {
- throw new AssertionError("could not remove Aggregate Bean in required time", e);
-
- }
- return;
- }
+ return service.getLocalLockServiceMBean(lockServiceName);
+ }
- DistributedLockServiceMXBean bean = null;
- try {
- bean = MBeanUtil.getDistributedLockMbean(LOCK_SERVICE_NAME, expectedMembers);
- } catch (Exception e) {
- InternalDistributedSystem.getLoggerI18n()
- .fine("Undesired Result , LockServiceMBean Should not be null", e);
+ /**
+ * Await destruction of local LockServiceMXBean for specified
+ * lockServiceName.
+ */
+ private void awaitLockServiceMXBeanIsNull(final String lockServiceName) {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
- }
- assertNotNull(bean);
- assertEquals(bean.getName(), LOCK_SERVICE_NAME);
+ await().until(() -> assertThat(service.getLocalLockServiceMBean(lockServiceName)).isNull());
+ }
- }
- };
- vm.invoke(checkAggregate);
+ private ConditionFactory await() {
+ return Awaitility.await().atMost(MAX_WAIT_MILLIS, MILLISECONDS);
}
}
+
[42/50] [abbrv] incubator-geode git commit: Fix TestClientIdsDUnitTest
Posted by kl...@apache.org.
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 Lund <kl...@apache.org>
Authored: Mon Nov 7 11:50:39 2016 -0800
Committer: Kirk Lund <kl...@apache.org>
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 org.apache.geode.test.dunit.LogWriterUtils;
-import org.apache.geode.test.dunit.NetworkUtils;
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.dunit.internal.JUnit4DistributedTestCase;
import org.apache.geode.test.junit.categories.DistributedTest;
/**
* This is for testing client IDs
*/
@Category(DistributedTest.class)
-@SuppressWarnings("serial")
-public class TestClientIdsDUnitTest extends ManagementTestBase {
-
- 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";
- private static final String REGION_NAME = "ClientHealthStatsDUnitTest_Region";
-
- private static VM server = null;
- private static VM client = null;
- private static VM client2 = null;
-
- @Override
- public final void postSetUpManagementTestBase() throws Exception {
- server = Host.getHost(0).getVM(1);
- client = Host.getHost(0).getVM(2);
- client2 = Host.getHost(0).getVM(3);
- }
-
- @Override
- public final void postTearDownManagementTestBase() throws Exception {
- closeCache(server);
- closeCache(client);
- closeCache(client2);
-
- disconnectFromDS();
+@SuppressWarnings({ "serial", "unused" })
+public class TestClientIdsDUnitTest implements Serializable {
+
+ private static final String KEY1 = "KEY1";
+ private static final String KEY2 = "KEY2";
+ private static final String VALUE1 = "client-KEY1";
+ private static final String VALUE2 = "client-KEY2";
+ private static final String REGION_NAME = TestClientIdsDUnitTest.class.getSimpleName() + "_Region";
+
+ @Manager
+ private VM managerVM;
+
+ private VM serverVM;
+ private VM client1VM;
+ private VM client2VM;
+
+ @Rule
+ public ManagementTestRule managementTestRule = ManagementTestRule.builder().start(false).build();
+
+ @Before
+ public void before() throws Exception {
+ serverVM = Host.getHost(0).getVM(1);
+ client1VM = Host.getHost(0).getVM(2);
+ client2VM = Host.getHost(0).getVM(3);
}
@Test
public void testClientIds() throws Exception {
- createManagementCache(managingNode);
- startManagingNode(managingNode);
- int port = (Integer) createServerCache(server);
- DistributedMember serverMember = getMember(server);
- createClientCache(client, NetworkUtils.getServerHostName(server.getHost()), port);
- createClientCache(client2, NetworkUtils.getServerHostName(server.getHost()), port);
- put(client);
- put(client2);
- verifyClientIds(managingNode, serverMember, port);
- stopManagingNode(managingNode);
- }
+ this.managementTestRule.createManagers();
- private Object createServerCache(VM vm) {
- return vm.invoke(new SerializableCallable("Create Server Cache") {
- public Object call() {
- try {
- return createServerCache();
- } catch (Exception e) {
- fail("Error while createServerCache " + e);
- }
- return null;
- }
- });
- }
+ int port = this.serverVM.invoke(() -> createServerCache());
- private void createClientCache(VM vm, final String host, final Integer port1) {
- vm.invoke(new SerializableCallable("Create Client Cache") {
+ this.client1VM.invoke(() -> createClientCache(getServerHostName(this.serverVM.getHost()), port));
+ this.client2VM.invoke(() -> createClientCache(getServerHostName(this.serverVM.getHost()), port));
- public Object call() {
+ DistributedMember serverMember = this.managementTestRule.getDistributedMember(this.serverVM);
+ DistributedMember client1Member = this.managementTestRule.getDistributedMember(this.client1VM);
+ DistributedMember client2Member = this.managementTestRule.getDistributedMember(this.client2VM);
+
+// this.managerVM.invoke(() -> verifyClientIds(serverMember, port));
+ this.managerVM.invoke(() -> {
+ CacheServerMXBean cacheServerMXBean = awaitCacheServerMXBean(serverMember, port);
+ await().until(() -> {
try {
- createClientCache(host, port1);
+ assertThat(cacheServerMXBean.getClientIds()).hasSize(2);
} catch (Exception e) {
- fail("Error while createClientCache " + e);
+ throw new Error(e);
}
- return null;
- }
+ });
+ assertThat(cacheServerMXBean.getClientIds()).hasSize(2); // TODO
});
}
- private Cache createCache(Properties props) throws Exception {
- DistributedSystem ds = getSystem(props);
- ds.disconnect();
- ds = getSystem(props);
- assertNotNull(ds);
- Cache cache = (GemFireCacheImpl) CacheFactory.create(ds);
- assertNotNull(cache);
- return cache;
- }
+ private int createServerCache() throws IOException {
+ Cache cache = this.managementTestRule.getCache();
- private Integer createServerCache(DataPolicy dataPolicy) throws Exception {
- Cache cache = createCache(false);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
- factory.setDataPolicy(dataPolicy);
+ factory.setDataPolicy(DataPolicy.REPLICATE);
+
RegionAttributes attrs = factory.create();
cache.createRegion(REGION_NAME, attrs);
- int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- CacheServer server1 = cache.addCacheServer();
- server1.setPort(port);
- server1.setNotifyBySubscription(true);
- server1.start();
- return new Integer(server1.getPort());
- }
- public Integer createServerCache() throws Exception {
- return createServerCache(DataPolicy.REPLICATE);
+ CacheServer cacheServer = cache.addCacheServer();
+ cacheServer.setPort(0);
+ cacheServer.setNotifyBySubscription(true);
+ cacheServer.start();
+ return cacheServer.getPort();
}
- public Cache createClientCache(String host, Integer port1) throws Exception {
-
- Properties props = new Properties();
- props.setProperty(MCAST_PORT, "0");
- props.setProperty(LOCATORS, "");
- Cache cache = createCache(props);
- PoolImpl p = (PoolImpl) PoolManager.createFactory().addServer(host, port1.intValue())
- .setSubscriptionEnabled(false).setThreadLocalConnections(true).setMinConnections(1)
- .setReadTimeout(20000).setPingInterval(10000).setRetryAttempts(1)
- .setSubscriptionEnabled(true).setStatisticInterval(1000)
- .create("CacheServerManagementDUnitTest");
-
- AttributesFactory factory = new AttributesFactory();
- factory.setScope(Scope.DISTRIBUTED_ACK);
- factory.setPoolName(p.getName());
-
- RegionAttributes attrs = factory.create();
- Region region = cache.createRegion(REGION_NAME, attrs);
- return cache;
-
+ private void createClientCache(final String host, final int serverPort) {
+ ClientCache cache = this.managementTestRule.getClientCache();
+
+ PoolImpl pool = (PoolImpl) PoolManager.createFactory()
+ .addServer(host, serverPort)
+ .setSubscriptionEnabled(false)
+ .setThreadLocalConnections(true)
+ .setMinConnections(1)
+ .setReadTimeout(20000)
+ .setPingInterval(10000)
+ .setRetryAttempts(1)
+ .setSubscriptionEnabled(true)
+ .setStatisticInterval(1000)
+ .create(getClass().getSimpleName());
+
+ ClientRegionFactory factory = cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY);
+ factory.setPoolName(pool.getName());
+ factory.create(REGION_NAME);
}
- /**
- * get member id
- */
- protected static DistributedMember getMember() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- return cache.getDistributedSystem().getDistributedMember();
+ private void verifyClientIds(final DistributedMember serverMember, final int serverPort) throws Exception {
+ CacheServerMXBean cacheServerMXBean = awaitCacheServerMXBean(serverMember, serverPort);
+ await().until(() -> {
+ try {
+ assertThat(cacheServerMXBean.getClientIds()).hasSize(2);
+ } catch (Exception e) {
+ throw new Error(e);
+ }
+ });
+ assertThat(cacheServerMXBean.getClientIds()).hasSize(2); // TODO
}
- /**
- * Verify the Cache Server details
- *
- * @param vm
- */
- protected void verifyClientIds(final VM vm,
- final DistributedMember serverMember, final int serverPort) {
- SerializableRunnable verifyCacheServerRemote = new SerializableRunnable(
- "Verify Cache Server Remote") {
- public void run() {
- try {
- final WaitCriterion waitCriteria = new WaitCriterion() {
- @Override
- public boolean done() {
- CacheServerMXBean bean = null;
- try {
- bean = MBeanUtil.getCacheServerMbeanProxy(
- serverMember, serverPort);
- if (bean != null) {
- if( bean.getClientIds().length > 0){
- return true;
- }
- return false;
- }
+ private CacheServerMXBean awaitCacheServerMXBean(final DistributedMember serverMember, final int port) {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ ObjectName objectName = service.getCacheServerMBeanName(port, serverMember);
- @Override
- public String description() {
- return "wait for getNumOfClients bean to complete and get results";
- }
- };
- Wait.waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);
+ await().until(() -> assertThat(service.getMBeanProxy(objectName, CacheServerMXBean.class)).isNotNull());
- // Now it is sure that bean would be available
- CacheServerMXBean bean = MBeanUtil.getCacheServerMbeanProxy(serverMember, serverPort);
- LogWriterUtils.getLogWriter().info("verifyClientIds = " + bean.getClientIds().length);
- assertEquals(true, bean.getClientIds().length > 0 ? true : false);
- } catch (Exception e) {
- fail("Error while verifying cache server from remote member " + e);
- }
- }
- };
- vm.invoke(verifyCacheServerRemote);
+ return service.getMBeanProxy(objectName, CacheServerMXBean.class);
}
- /**
- * Verify the Cache Server details
- *
- * @param vm
- */
- protected void put(final VM vm) {
- SerializableRunnable put = new SerializableRunnable("put") {
- public void run() {
- try {
- Cache cache = GemFireCacheImpl.getInstance();
- Region<Object, Object> r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME);
- assertNotNull(r1);
-
- r1.put(k1, client_k1);
- assertEquals(r1.getEntry(k1).getValue(), client_k1);
- r1.put(k2, client_k2);
- assertEquals(r1.getEntry(k2).getValue(), client_k2);
- try {
- Thread.sleep(10000);
- } catch (Exception e) {
- // sleep
- }
- r1.clear();
-
- r1.put(k1, client_k1);
- assertEquals(r1.getEntry(k1).getValue(), client_k1);
- r1.put(k2, client_k2);
- assertEquals(r1.getEntry(k2).getValue(), client_k2);
- try {
- Thread.sleep(10000);
- } catch (Exception e) {
- // sleep
- }
- r1.clear();
- } catch (Exception ex) {
- Assert.fail("failed while put", ex);
- }
- }
-
- };
- vm.invoke(put);
+ private ConditionFactory await() {
+ return Awaitility.await().atMost(2, MINUTES);
}
-
}
[24/50] [abbrv] incubator-geode git commit: Fixing test
org.apache.geode.codeAnalysis.AnalyzeSerializablesJUnitTest testSerializables
Posted by kl...@apache.org.
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: adongre <av...@ampool.io>
Authored: Sat Oct 29 08:35:39 2016 +0530
Committer: Anthony Baker <ab...@apache.org>
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:
boolean,isSetMcastEnabled:boolean,isSetOffHeap:boolean,isSetStatisticsEnabled:boolean,keyConstraint:java/lang/String,mcastEnabled:java/lang/Boolean,offHeap:java/lang/Boolean,partitionArgs:org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$PartitionArgs,regionAttributes:org/apache/geode/cache/RegionAttributes,regionExpirationIdleTime:org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$ExpirationAttrs,regionExpirationTTL:org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$ExpirationAttrs,regionPath:java/lang/String,regionShortcut:org/apache/geode/cache/RegionShortcut,skipIfExists:java/lang/Boolean,statisticsEnabled:java/lang/Boolean,useAttributesFrom:java/lang/String,valueConstraint:java/lang/String
+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,isPartitionResolver:boolean,isSetCloningEnabled:boolean,isSetCompressor:boolean,isSetConcurrencyChecksEnabled:boolean,isSetConcurrencyLevel:boolean,isSetDiskSynchronous:boolean,isSetEnableAsyncConflation:boolean,isSetE
nableSubscriptionConflation:boolean,isSetMcastEnabled:boolean,isSetOffHeap:boolean,isSetStatisticsEnabled:boolean,keyConstraint:java/lang/String,mcastEnabled:java/lang/Boolean,offHeap:java/lang/Boolean,partitionArgs:org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$PartitionArgs,partitionResolver:java/lang/String,regionAttributes:org/apache/geode/cache/RegionAttributes,regionExpirationIdleTime:org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$ExpirationAttrs,regionExpirationTTL:org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$ExpirationAttrs,regionPath:java/lang/String,regionShortcut:org/apache/geode/cache/RegionShortcut,skipIfExists:java/lang/Boolean,statisticsEnabled:java/lang/Boolean,useAttributesFrom:java/lang/String,valueConstraint:java/lang/String
org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$ExpirationAttrs,true,1474255033398008062,action:org/apache/geode/cache/ExpirationAction,time:java/lang/Integer,type:org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$ExpirationAttrs$ExpirationFor
org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$ExpirationAttrs$ExpirationFor,false
-org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$PartitionArgs,true,5907052187323280919,hasPartitionAttributes:boolean,isSetPRLocalMaxMemory:boolean,isSetPRRecoveryDelay:boolean,isSetPRRedundantCopies:boolean,isSetPRStartupRecoveryDelay:boolean,isSetPRTotalMaxMemory:boolean,isSetPRTotalNumBuckets:boolean,prColocatedWith:java/lang/String,prLocalMaxMemory:int,prRecoveryDelay:long,prRedundantCopies:int,prStartupRecoveryDelay:long,prTotalMaxMemory:long,prTotalNumBuckets:int,userSpecifiedPartitionAttributes:java/util/Set
+org/apache/geode/management/internal/cli/functions/RegionFunctionArgs$PartitionArgs,true,5907052187323280919,hasPartitionAttributes:boolean,isPartitionResolver:boolean,isSetPRLocalMaxMemory:boolean,isSetPRRecoveryDelay:boolean,isSetPRRedundantCopies:boolean,isSetPRStartupRecoveryDelay:boolean,isSetPRTotalMaxMemory:boolean,isSetPRTotalNumBuckets:boolean,partitionResolver:java/lang/String,prColocatedWith:java/lang/String,prLocalMaxMemory:int,prRecoveryDelay:long,prRedundantCopies:int,prStartupRecoveryDelay:long,prTotalMaxMemory:long,prTotalNumBuckets:int,userSpecifiedPartitionAttributes:java/util/Set
org/apache/geode/management/internal/cli/functions/ShowMissingDiskStoresFunction,false
org/apache/geode/management/internal/cli/functions/ShutDownFunction,true,1
org/apache/geode/management/internal/cli/functions/UndeployFunction,true,1
@@ -659,10 +656,6 @@ org/apache/geode/pdx/internal/PdxInstanceImpl,true,-1669268527103938431
org/apache/geode/pdx/internal/PdxInstanceInputStream,false
org/apache/geode/pdx/internal/PdxReaderImpl,true,-6094553093860427759,blobType:org/apache/geode/pdx/internal/PdxType,dis:org/apache/geode/pdx/internal/PdxInputStream
org/apache/geode/pdx/internal/WritablePdxInstanceImpl,true,7398999150097596214,dirtyFields:java/lang/Object[]
-org/apache/geode/security/AuthenticationFailedException,true,-8202866472279088879
-org/apache/geode/security/AuthenticationRequiredException,true,4675976651103154919
-org/apache/geode/security/GemFireSecurityException,true,3814254578203076926,cause:java/lang/Throwable
-org/apache/geode/security/NotAuthorizedException,true,419215768216387745,principal:java/security/Principal
org/apache/geode/redis/internal/RedisCommandParserException,true,4707944288714910949
org/apache/geode/redis/internal/RedisCommandType,false
org/apache/geode/redis/internal/RedisCommandType$1,false,dataType:org/apache/geode/redis/internal/RedisDataType,executor:org/apache/geode/redis/internal/Executor
@@ -844,3 +837,7 @@ org/apache/geode/redis/internal/executor/SortedSetQuery$7,false
org/apache/geode/redis/internal/executor/SortedSetQuery$8,false
org/apache/geode/redis/internal/executor/SortedSetQuery$9,false
org/apache/geode/redis/internal/executor/list/ListExecutor$ListDirection,false
+org/apache/geode/security/AuthenticationFailedException,true,-8202866472279088879
+org/apache/geode/security/AuthenticationRequiredException,true,4675976651103154919
+org/apache/geode/security/GemFireSecurityException,true,3814254578203076926,cause:java/lang/Throwable
+org/apache/geode/security/NotAuthorizedException,true,419215768216387745,principal:java/security/Principal
[07/50] [abbrv] incubator-geode git commit: GEODE-1570: add a test to
verify rest security with SSL, fix the format.
Posted by kl...@apache.org.
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 Liao <ji...@pivotal.io>
Authored: Wed Nov 9 10:45:53 2016 -0800
Committer: Jinmei Liao <ji...@pivotal.io>
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() {
[16/50] [abbrv] incubator-geode git commit: GEODE-2089
entry-idle-time on client side cache is not working as expected
Posted by kl...@apache.org.
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 a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey2.java
index 57d2204..79108f3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey2.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;
@@ -341,10 +340,10 @@ public class VersionedStatsDiskLRURegionEntryHeapStringKey2
}
@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/VersionedStatsDiskLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapUUIDKey.java
index 9d409b7..1e8d1ca 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapUUIDKey.java
@@ -23,7 +23,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;
@@ -314,10 +313,10 @@ public class VersionedStatsDiskLRURegionEntryHeapUUIDKey
}
@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/VersionedStatsDiskLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapIntKey.java
index ac22ed6..e27ce67 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapIntKey.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;
@@ -370,10 +369,10 @@ public class VersionedStatsDiskLRURegionEntryOffHeapIntKey
}
@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/VersionedStatsDiskLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapLongKey.java
index 87603d8..909a885 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapLongKey.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;
@@ -370,10 +369,10 @@ public class VersionedStatsDiskLRURegionEntryOffHeapLongKey
}
@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/VersionedStatsDiskLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapObjectKey.java
index d0afe22..b4bd8d3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapObjectKey.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;
@@ -370,10 +369,10 @@ public class VersionedStatsDiskLRURegionEntryOffHeapObjectKey
}
@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/VersionedStatsDiskLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey1.java
index 7a67257..ada4de1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey1.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;
@@ -387,10 +386,10 @@ public class VersionedStatsDiskLRURegionEntryOffHeapStringKey1
}
@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/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 1790185..fd63154 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
@@ -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;
@@ -399,10 +398,10 @@ public class VersionedStatsDiskLRURegionEntryOffHeapStringKey2
}
@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/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 537ef5b..a57570b 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
@@ -23,7 +23,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;
@@ -372,10 +371,10 @@ public class VersionedStatsDiskLRURegionEntryOffHeapUUIDKey
}
@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/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 cec2536..ed51506 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
@@ -196,10 +196,10 @@ public class VersionedStatsDiskRegionEntryHeapIntKey extends VersionedStatsDiskR
}
@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/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 bc606e1..32f0528 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
@@ -196,10 +196,10 @@ public class VersionedStatsDiskRegionEntryHeapLongKey extends VersionedStatsDisk
}
@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/VersionedStatsDiskRegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapObjectKey.java
index 6d5f898..0a31af4 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapObjectKey.java
@@ -196,10 +196,10 @@ public class VersionedStatsDiskRegionEntryHeapObjectKey extends VersionedStatsDi
}
@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/VersionedStatsDiskRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey1.java
index e9705af..2606d20 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey1.java
@@ -213,10 +213,10 @@ public class VersionedStatsDiskRegionEntryHeapStringKey1 extends VersionedStatsD
}
@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/VersionedStatsDiskRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey2.java
index 4452a05..a3e3948 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapStringKey2.java
@@ -225,10 +225,10 @@ public class VersionedStatsDiskRegionEntryHeapStringKey2 extends VersionedStatsD
}
@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/VersionedStatsDiskRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapUUIDKey.java
index 0b5b8be..34b4eaf 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryHeapUUIDKey.java
@@ -198,10 +198,10 @@ public class VersionedStatsDiskRegionEntryHeapUUIDKey extends VersionedStatsDisk
}
@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/VersionedStatsDiskRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapIntKey.java
index 87589d2..7b50ebc 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapIntKey.java
@@ -255,10 +255,10 @@ public class VersionedStatsDiskRegionEntryOffHeapIntKey
}
@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/VersionedStatsDiskRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapLongKey.java
index ac5dca2..dba3d74 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapLongKey.java
@@ -255,10 +255,10 @@ public class VersionedStatsDiskRegionEntryOffHeapLongKey
}
@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/VersionedStatsDiskRegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapObjectKey.java
index 7140a0c..6afcd0d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapObjectKey.java
@@ -255,10 +255,10 @@ public class VersionedStatsDiskRegionEntryOffHeapObjectKey
}
@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/VersionedStatsDiskRegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey1.java
index e235c9b..3f5e15d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey1.java
@@ -272,10 +272,10 @@ public class VersionedStatsDiskRegionEntryOffHeapStringKey1
}
@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/VersionedStatsDiskRegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey2.java
index 16ed0f6..8030f4a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapStringKey2.java
@@ -284,10 +284,10 @@ public class VersionedStatsDiskRegionEntryOffHeapStringKey2
}
@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/VersionedStatsDiskRegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapUUIDKey.java
index be089c6..e03215d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskRegionEntryOffHeapUUIDKey.java
@@ -257,10 +257,10 @@ public class VersionedStatsDiskRegionEntryOffHeapUUIDKey
}
@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/VersionedStatsLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapIntKey.java
index 70e1a38..69fd454 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapIntKey.java
@@ -21,7 +21,6 @@ import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
@@ -215,10 +214,10 @@ public class VersionedStatsLRURegionEntryHeapIntKey extends VersionedStatsLRUReg
}
@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/VersionedStatsLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapLongKey.java
index 03e8e97..1e9bc0e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapLongKey.java
@@ -21,7 +21,6 @@ import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
@@ -216,10 +215,10 @@ public class VersionedStatsLRURegionEntryHeapLongKey extends VersionedStatsLRURe
}
@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/VersionedStatsLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapObjectKey.java
index c329e03..be5f38a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapObjectKey.java
@@ -21,7 +21,6 @@ import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
@@ -216,10 +215,10 @@ public class VersionedStatsLRURegionEntryHeapObjectKey extends VersionedStatsLRU
}
@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/VersionedStatsLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey1.java
index a22d88d..0167a34 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey1.java
@@ -21,7 +21,6 @@ import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
@@ -233,10 +232,10 @@ public class VersionedStatsLRURegionEntryHeapStringKey1 extends VersionedStatsLR
}
@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/VersionedStatsLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey2.java
index 2b92b49..8b9beec 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapStringKey2.java
@@ -21,7 +21,6 @@ import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
@@ -245,10 +244,10 @@ public class VersionedStatsLRURegionEntryHeapStringKey2 extends VersionedStatsLR
}
@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/VersionedStatsLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapUUIDKey.java
index cd0cb14..f332f92 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryHeapUUIDKey.java
@@ -22,7 +22,6 @@ import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
@@ -218,10 +217,10 @@ public class VersionedStatsLRURegionEntryHeapUUIDKey extends VersionedStatsLRURe
}
@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/VersionedStatsLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapIntKey.java
index de9b8a2..11f6abf 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapIntKey.java
@@ -21,7 +21,6 @@ import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
@@ -274,10 +273,10 @@ public class VersionedStatsLRURegionEntryOffHeapIntKey extends VersionedStatsLRU
}
@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/VersionedStatsLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapLongKey.java
index 9f2c2bb..369d5a7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapLongKey.java
@@ -21,7 +21,6 @@ import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
@@ -275,10 +274,10 @@ public class VersionedStatsLRURegionEntryOffHeapLongKey
}
@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/VersionedStatsLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java
index d521590..dabcb92 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java
@@ -21,7 +21,6 @@ import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
@@ -275,10 +274,10 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey
}
@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/VersionedStatsLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java
index 6195cb6..be0e7ee 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java
@@ -21,7 +21,6 @@ import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
@@ -292,10 +291,10 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1
}
@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/VersionedStatsLRURegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java
index 860d117..c5d601b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java
@@ -21,7 +21,6 @@ import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
@@ -304,10 +303,10 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2
}
@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/VersionedStatsLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java
index cef686e..7dcd10c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java
@@ -22,7 +22,6 @@ import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
@@ -277,10 +276,10 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey
}
@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/VersionedStatsRegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java
index ba2fcbf..5c93e8e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java
@@ -115,10 +115,10 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt
}
@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/VersionedStatsRegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java
index 3e92a43..5d169f4 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java
@@ -115,10 +115,10 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn
}
@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/VersionedStatsRegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java
index 3a13e7f..418b1f0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java
@@ -117,10 +117,10 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion
}
@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/VersionedStatsRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java
index 48365c5..8090642 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java
@@ -134,10 +134,10 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio
}
@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/VersionedStatsRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java
index 5fb13cb..335a354 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java
@@ -146,10 +146,10 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio
}
@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/VersionedStatsRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java
index 5f6a634..236121d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java
@@ -117,10 +117,10 @@ public class VersionedStatsRegionEntryHeapUUIDKey extends VersionedStatsRegionEn
}
@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/VersionedStatsRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapIntKey.java
index ac6cfc1..22e2f00 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapIntKey.java
@@ -174,10 +174,10 @@ public class VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegion
}
@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/VersionedStatsRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapLongKey.java
index 9707df1..b180e60 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapLongKey.java
@@ -174,10 +174,10 @@ public class VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegio
}
@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/VersionedStatsRegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapObjectKey.java
index 0a57429..49083ae 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapObjectKey.java
@@ -175,10 +175,10 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg
}
@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/VersionedStatsRegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java
index f03a1cc..b7017a1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java
@@ -192,10 +192,10 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe
}
@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/VersionedStatsRegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java
index 60b6e02..e2c7d00 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java
@@ -204,10 +204,10 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe
}
@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/VersionedStatsRegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java
index aa50d1c..831941c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java
@@ -176,10 +176,10 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegio
}
@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/VersionedThinDiskLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java
index b23fec5..6a0039e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java
@@ -15,13 +15,11 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
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/VersionedThinDiskLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapLongKey.java
index 58617ac..7755b24 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapLongKey.java
@@ -15,13 +15,11 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
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/VersionedThinDiskLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapObjectKey.java
index add80be..72375de 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapObjectKey.java
@@ -15,13 +15,11 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
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/VersionedThinDiskLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey1.java
index f1f5345..d7d5de2 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey1.java
@@ -15,13 +15,11 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
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/VersionedThinDiskLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey2.java
index 4ba22bd..5007c44 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapStringKey2.java
@@ -15,13 +15,11 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
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/VersionedThinDiskLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapUUIDKey.java
index ff71e93..3896858 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapUUIDKey.java
@@ -16,13 +16,11 @@ package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
import java.util.UUID;
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
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/VersionedThinDiskLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapIntKey.java
index 220b096..95e356e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapIntKey.java
@@ -15,13 +15,11 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
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/VersionedThinDiskLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapLongKey.java
index 0ca005d..0e0e0a7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapLongKey.java
@@ -15,13 +15,11 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
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/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java
index 3903e13..7a07548 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java
@@ -15,13 +15,11 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
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/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java
index 5cf2769..80ed965 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java
@@ -15,13 +15,11 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
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/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java
index 6405a29..329c9fc 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java
@@ -15,13 +15,11 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
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/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java
index e917996..61a632f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java
@@ -16,13 +16,11 @@ package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
import java.util.UUID;
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
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/VersionedThinLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.java
index eafdcd0..5a959ed 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.java
@@ -15,12 +15,10 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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/VersionedThinLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapLongKey.java
index 95f27c8..3c073a4 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapLongKey.java
@@ -15,12 +15,10 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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/VersionedThinLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapObjectKey.java
index 12dc438..0f73c2f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapObjectKey.java
@@ -15,12 +15,10 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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;
[31/50] [abbrv] incubator-geode git commit: GEODE-2101 Improve WAN
topology terminology in docs
Posted by kl...@apache.org.
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 Miller <km...@pivotal.io>
Authored: Mon Nov 14 10:07:14 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
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.
-## <a id="multisite_topologies__section_7ECE1AFB1F94446FAA0A9FD504217C76" class="no-quick-link"></a>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.
+## <a id="multisite_topologies__section_7ECE1AFB1F94446FAA0A9FD504217C76" class="no-quick-link"></a>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.
<img src="../../images/multisite-topology-parallel.png" id="multisite_topologies__image_6CB125A80DF74DCE96A94020F7003DAE" class="image" />
-## <a id="multisite_topologies__section_17EC1FD63A5241159FE2ED07F72CD5DC" class="no-quick-link"></a>Serial Multi-site Topology
+## <a id="multisite_topologies__section_17EC1FD63A5241159FE2ED07F72CD5DC" class="no-quick-link"></a>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.
<img src="../../images/multisite-topology-serial.png" id="multisite_topologies__image_876567BB077C4398BEFB13EEC34DA53C" class="image" />
-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 ring, every site must stay up to maintain the connection.
+The failure of any site breaks the ability for updates to reach
+all sites.
+If site 2 went down, for example,
+site 3 could send to site 1, but site 1 could not send to site 3.
## <a id="multisite_topologies__section_AA3A864753DF4C218133C0A7460D2D19" class="no-quick-link"></a>Hybrid Multi-site Topology
-A hybrid network topology contains both parallel and serial connections. There are numerous such configurations.
+There are numerous hybrid network topologies.
+Some of the sites are fully connected, while others form a ring.
-The following figure shows a hybrid topology composed of a serial topology with an additional link directly from site 1 to site 3, creating a parallel topology between sites 1 and 3. With this topology, no site can receive the same update twice.
+The following figure shows a hybrid topology that forms a ring,
+with an extra connection that fully connects
+sites 1 and 3.
<img src="../../images/multisite-topology-hybrid-1.png" id="multisite_topologies__image_7656D6CEC2C947F8BFE67A0BB0BA5FDE" class="image" />
-With this hybrid topology, if site 2 went down, it would not affect communication between sites 1 and 3, because both could still send to the other. If site 3 went down, however, site 2 would not be able to send to site 1.
+With this hybrid topology, if site 2 went down,
+it would not affect communication between sites 1 and 3.
+If site 3 went down, however, site 2 would not be able to send to site 1.
-In the figure below, sites 2 and 3 are isolated from one another. This topology might work for an application where there is one producer (site 1) and multiple consumers that have nothing to gain from being connected to each other. This topology also guarantees that no site receives the same update twice.
+A second example hybrid topology is shown in the figure below.
+In this tree topology with site 1 as the root of the tree,
+sites 2 and 3 do not communicate with each another.
+This topology works for an application in which site 1 is a producer
+and the consumers (sites 2 and 3) have nothing to gain from
+being connected to each other.
+This topology also guarantees that no site receives the same update twice.
<img src="../../images/multisite-topology-hybrid-2.png" id="multisite_topologies__image_1904C515A3224BE09589921A15D6D59B" class="image" />
## <a id="multisite_topologies__section_8D7912BF9D8549A491D9AE5E0DC3CC1F" class="no-quick-link"></a>Unsupported Topologies
-This section lists topologies that do not work and are unsupported.
+Topologies in which the same update may be delivered twice
+to a particular site do not work and are unsupported.
-In the topology shown in the next figure, some sites might receive multiple copies of the same message. If site 1 sends a message to sites 2 and 3, sites 2 and 3 will both forward to site 4.
+The DAG topology shown in this figure is an example of an unsupported
+technology.
+Site 4 will receive more than one copy of the same message when
+site 1 sends a message to sites 2 and 3,
+and sites 2 and 3 each forward the message to site 4.
<img src="../../images/multisite-topology-avoid-3.png" id="multisite_topologies__image_710EB20403C942D0B756F9D22B3359A6" class="image" />
[09/50] [abbrv] incubator-geode git commit: GEODE-2090 Update
off-heap statistics documentation
Posted by kl...@apache.org.
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 Miller <km...@pivotal.io>
Authored: Wed Nov 9 16:36:48 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
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. |
| `fragmentation` | This statistic gives an indication of the level of external fragmentation in the off-heap memory space by providing a ratio of the current number of fragments of free space to the largest number of fragments that could be formed from that free space. It is expressed as a percentage; the higher this value, the more fragmented the free space currently is. This statistic is 0 if the memory manager has never run its defragmentation algorithm on the off-heap space, and it is recalculated after each defragmentation. |
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/88e5d0f1/geode-docs/tools_modules/gfsh/command-pages/show.html.md.erb
----------------------------------------------------------------------
diff --git a/geode-docs/tools_modules/gfsh/command-pages/show.html.md.erb b/geode-docs/tools_modules/gfsh/command-pages/show.html.md.erb
index 98009f1..881c1c6 100644
--- a/geode-docs/tools_modules/gfsh/command-pages/show.html.md.erb
+++ b/geode-docs/tools_modules/gfsh/command-pages/show.html.md.erb
@@ -123,6 +123,10 @@ r=server1 --lines=5".
Display or export metrics for the entire distributed system, a member or a region.
+When no command line arguments are given,
+metrics under the categories of cluster, cache, diskstore, and query
+are displayed.
+
**Availability:** Online. You must be connected in `gfsh` to a JMX Manager member to use this command.
**Syntax:**
@@ -167,9 +171,8 @@ show metrics [--member=value] [--region=value] [--file=value]
<td><span class="keyword parmname">\-\-categories</span></td>
<td>Categories available based upon the parameters specified (listed above) are:
<ul>
-<li><strong>no parameters specified</strong>: cluster, cache, diskstore, query</li>
<li><strong>region specified</strong>: cluster, region, partition, diskstore, callback, eviction</li>
-<li><strong>member specified</strong>: member, jvm, region, serialization, communication, function, transaction, diskstore, lock, eviction, distribution</li>
+<li><strong>member specified</strong>: member, jvm, region, serialization, communication, function, transaction, diskstore, lock, eviction, distribution, offheap</li>
<li><strong>member and region specified</strong>: region, partition, diskstore, callback, eviction</li>
</ul></td>
</tr>
[02/50] [abbrv] incubator-geode git commit: GEODE-2068 Improve
documentation on serial/parallel gateway senders
Posted by kl...@apache.org.
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 Miller <km...@pivotal.io>
Authored: Thu Nov 3 16:42:25 2016 -0700
Committer: Karen Miller <km...@pivotal.io>
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
## <a id="topic_9AA37B43642D4DE19072CA3367C849BA__section_F7B3A17597B344F19A9E3546097AC5DB" class="no-quick-link"></a>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.
<img src="../../images/serial_sender.png" id="topic_9AA37B43642D4DE19072CA3367C849BA__image_CEF888583FAC4CCBB0445F2BF8F15F20" class="image" width="576" />
-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.
## <a id="topic_9AA37B43642D4DE19072CA3367C849BA__section_5E989CEDC4F147788B393588CFF17106" class="no-quick-link"></a>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.
<img src="../../images/parallel_sender.png" id="topic_9AA37B43642D4DE19072CA3367C849BA__image_D3BEABE6269543758DD0FAF4FFCD713A" class="image" width="576" />
-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 regions that is similar to that provided for partitioned regions.
-
-**Note:**
Replicated regions cannot use a parallel gateway sender.
-Although parallel gateway senders provide the best throughput for WAN distribution, they provide less control for ordering events. With a parallel gateway sender, you cannot preserve event ordering for the region as a whole because multiple Geode servers distribute the regions events at the same time. However, the ordering of events for a given partition (or in a given queue of a distributed region) can be preserved. See [Configuring Multi-Site (WAN) Event Queues](../../developing/events/configure_multisite_event_messaging.html#configure_multisite_event_messaging).
+Although parallel gateway senders provide the best throughput for WAN distribution, they provide less control for event ordering. Event ordering for the region as a whole is not preserved, because multiple Geode servers distribute the regions events at the same time. However, the ordering of events for a given partition can be preserved. See [Configuring Multi-Site (WAN) Event Queues](../../developing/events/configure_multisite_event_messaging.html#configure_multisite_event_messaging).
## <a id="topic_9AA37B43642D4DE19072CA3367C849BA__section_75F4588FEA404712963CE83FACB8ED1B" class="no-quick-link"></a>Gateway Sender Queues
[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
Posted by kl...@apache.org.
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 Duling <kd...@pivotal.io>
Authored: Thu Nov 10 10:44:37 2016 -0800
Committer: Jinmei Liao <ji...@pivotal.io>
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
Posted by kl...@apache.org.
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 Miller <km...@pivotal.io>
Authored: Tue Nov 8 13:31:04 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
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(-)
----------------------------------------------------------------------
[20/50] [abbrv] incubator-geode git commit: GEODE-2080 Rest POST put
call not working with region valueConstraint
Posted by kl...@apache.org.
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 Schuchardt <bs...@pivotal.io>
Authored: Thu Nov 10 15:10:43 2016 -0800
Committer: Bruce Schuchardt <bs...@pivotal.io>
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 extends AbstractRegion implements LoaderHelperFactory,
/**
* ThreadLocal used to set the current region being initialized.
*
- * Currently used by the OpLog layer to initialize the {@link KeyWithRegionContext} if required.
+ * Currently used by the OpLog layer.
*/
private final static ThreadLocal<LocalRegion> initializingRegion = new ThreadLocal<LocalRegion>();
/**
- * Set to true if the region contains keys implementing {@link KeyWithRegionContext} that require
- * setting up of region specific context after deserialization or recovery from disk.
- */
- private boolean keyRequiresRegionContext;
-
- /**
* Get the current initializing region as set in the ThreadLocal.
*
* Note that this value is cleared after the initialization of LocalRegion is done so is valid
@@ -3259,6 +3254,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
protected void validateValue(Object p_value) {
Object value = p_value;
+
// check validity of value against valueConstraint
if (this.valueConstraint != null) {
if (value != null) {
@@ -3269,11 +3265,28 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
return;
}
}
- if (!this.valueConstraint.isInstance(value))
+ if (!this.valueConstraint.isInstance(value)) {
+ String valueClassName = value.getClass().getName();
+ // check for a REST object, which has a @type field denoting its class
+ if (value instanceof PdxInstance) {
+ PdxInstance pdx = (PdxInstance) value;
+ if (pdx.getClassName().equals(JSONFormatter.JSON_CLASSNAME)) {
+ Object type = (String) pdx.getField("@type");
+ if (type != null && type instanceof String) {
+ valueClassName = (String) type;
+ } else {
+ return;
+ }
+ }
+ if (valueClassName.equals(this.valueConstraint.getName())) {
+ return;
+ }
+ }
throw new ClassCastException(
LocalizedStrings.LocalRegion_VALUE_0_DOES_NOT_SATISFY_VALUECONSTRAINT_1
.toLocalizedString(
- new Object[] {value.getClass().getName(), this.valueConstraint.getName()}));
+ new Object[] {valueClassName, this.valueConstraint.getName()}));
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d65b79a4/geode-core/src/test/java/org/apache/geode/pdx/PdxClientServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/pdx/PdxClientServerDUnitTest.java b/geode-core/src/test/java/org/apache/geode/pdx/PdxClientServerDUnitTest.java
index 9a9680a..b0820f9 100644
--- a/geode-core/src/test/java/org/apache/geode/pdx/PdxClientServerDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/pdx/PdxClientServerDUnitTest.java
@@ -30,6 +30,8 @@ import org.apache.geode.cache.Cache;
import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionFactory;
+import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.Scope;
import org.apache.geode.cache.client.ClientCache;
import org.apache.geode.cache.client.ClientCacheFactory;
@@ -70,7 +72,7 @@ public class PdxClientServerDUnitTest extends JUnit4CacheTestCase {
VM vm3 = host.getVM(3);
- createServerRegion(vm0);
+ createServerRegion(vm0, SimpleClass.class);
int port = createServerAccessor(vm3);
createClientRegion(vm1, port);
createClientRegion(vm2, port);
@@ -106,7 +108,7 @@ public class PdxClientServerDUnitTest extends JUnit4CacheTestCase {
VM vm1 = host.getVM(1);
VM vm2 = host.getVM(2);
- int port = createServerRegion(vm0);
+ int port = createServerRegion(vm0, SimpleClass.class);
createClientRegion(vm1, port, false, true);
// Define a PDX type with 2 fields that will be cached on the client
@@ -326,7 +328,7 @@ public class PdxClientServerDUnitTest extends JUnit4CacheTestCase {
VM vm2 = host.getVM(2);
- int port = createServerRegion(vm0);
+ int port = createServerRegion(vm0, SimpleClass.class);
createClientRegion(vm1, port, true);
createClientRegion(vm2, port, true);
@@ -361,7 +363,7 @@ public class PdxClientServerDUnitTest extends JUnit4CacheTestCase {
VM vm2 = host.getVM(2);
- int port = createServerRegion(vm0);
+ int port = createServerRegion(vm0, SimpleClass.class);
createClientRegion(vm1, port);
createClientRegion(vm2, port);
@@ -482,7 +484,7 @@ public class PdxClientServerDUnitTest extends JUnit4CacheTestCase {
VM vm2 = host.getVM(2);
- int port = createServerRegion(vm0);
+ int port = createServerRegion(vm0, Object.class);
createClientRegion(vm1, port);
createClientRegion(vm2, port);
@@ -523,7 +525,7 @@ public class PdxClientServerDUnitTest extends JUnit4CacheTestCase {
VM vm2 = host.getVM(2);
- final int port = createServerRegion(vm0);
+ final int port = createServerRegion(vm0, SimpleClass.class);
SerializableCallable createRegion = new SerializableCallable() {
public Object call() throws Exception {
Properties props = new Properties();
@@ -574,7 +576,7 @@ public class PdxClientServerDUnitTest extends JUnit4CacheTestCase {
VM vm1 = host.getVM(1);
- final int port = createServerRegion(vm0);
+ final int port = createServerRegion(vm0, SimpleClass.class);
SerializableCallable createRegion = new SerializableCallable() {
public Object call() throws Exception {
Properties props = new Properties();
@@ -600,16 +602,60 @@ public class PdxClientServerDUnitTest extends JUnit4CacheTestCase {
vm1.invoke(createRegion);
}
- private void createCacheWithAutoSerializer(VM vm, final String... patterns) {
- vm.invoke(new SerializableRunnable() {
- public void run() {
- CacheFactory cf = new CacheFactory();
- cf.setPdxSerializer(new ReflectionBasedAutoSerializer(patterns));
- getCache(cf);
+ @Test
+ public void testCacheRejectsJSonPdxInstanceViolatingValueConstraint() {
+ Host host = Host.getHost(0);
+ VM vm0 = host.getVM(0);
+ VM vm1 = host.getVM(1);
+
+
+ int port = createServerRegion(vm0, SimpleClass.class);
+
+ vm0.invoke(new SerializableCallable("put value in region") {
+ public Object call() throws Exception {
+ Region r = basicGetCache().getRegion("testSimplePdx");
+ String className = "objects.PersonWithoutID";
+ try {
+ r.put("pdxObject", getTypedJSONPdxInstance(className));
+ fail("expected a ClassCastException");
+ } catch (ClassCastException e) {
+ assertTrue("wrong ClassCastException message: " + e.getMessage(),
+ e.getMessage().contains(className));
+ }
+ return null;
}
});
}
+
+ public PdxInstance getTypedJSONPdxInstance(String className) throws Exception {
+
+ String aRESTishDoc = "{\"@type\": \" " + className
+ + "\" , \" firstName\" : \" John\" , \" lastName\" : \" Smith\" , \" age\" : 25 }";
+ PdxInstance pdxInstance = JSONFormatter.fromJSON(aRESTishDoc);
+
+ return pdxInstance;
+ }
+
+ private int createServerRegion(VM vm, final Class constraintClass) {
+ SerializableCallable createRegion = new SerializableCallable() {
+ public Object call() throws Exception {
+ CacheFactory cf = new CacheFactory(getDistributedSystemProperties());
+ Cache cache = getCache(cf);
+ RegionFactory rf = cache.createRegionFactory(RegionShortcut.REPLICATE);
+ rf.setValueConstraint(constraintClass);
+ rf.create("testSimplePdx");
+ CacheServer server = cache.addCacheServer();
+ int port = AvailablePortHelper.getRandomAvailableTCPPort();
+ server.setPort(port);
+ server.start();
+ return port;
+ }
+ };
+
+ return (Integer) vm.invoke(createRegion);
+ }
+
private int createServerRegion(VM vm) {
SerializableCallable createRegion = new SerializableCallable() {
public Object call() throws Exception {
[32/50] [abbrv] incubator-geode git commit: GEODE-2088: Correctly
throw TransactionDataRebalancedException when bucket is moved during
rebalance.
Posted by kl...@apache.org.
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: eshu <es...@pivotal.io>
Authored: Tue Nov 15 08:34:34 2016 -0800
Committer: eshu <es...@pivotal.io>
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 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/internal/cache/execute/PRTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java
index e2ba2b3..937059c 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/execute/PRTransactionDUnitTest.java
@@ -580,11 +580,11 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
@SuppressWarnings("unchecked")
private void moveBucketForGet(OrderId order1, boolean isCust1Local, DistributedMember source,
DistributedMember destination, PartitionedRegion prOrder) {
- if (isCust1Local) {
+ if (isCust1Local && useBucketReadHook) {
// Use TXState
setBucketReadHook(order1, source, destination, prOrder);
} else {
- // Use TXStateStub -- transaction data on remote node
+ // Use TXState and TXStateStub -- transaction data on remote node
PartitionRegionHelper.moveBucketByKey(prOrder, source, destination, order1);
}
}
@@ -648,6 +648,15 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
}
@Test
+ public void testTxWithGetOnMovedBucketUsingBucketReadHook() {
+ Op op = Op.GET;
+ useBucketReadHook = true;
+ basicPRTXWithOpOnMovedBucket(op, 0);
+ }
+
+ private boolean useBucketReadHook = false;
+
+ @Test
public void testTxWithContainsValueForKeyOnMovedBucket() {
Op op = Op.CONTAINSVALUEFORKEY;
basicPRTXWithOpOnMovedBucket(op, 0);
[34/50] [abbrv] incubator-geode git commit: GEODE-2112: Improved
cleanup for UITests
Posted by kl...@apache.org.
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 Stewart <js...@pivotal.io>
Authored: Mon Nov 14 16:06:49 2016 -0800
Committer: Kirk Lund <kl...@apache.org>
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<WebElement> elements = driver.findElements(By.xpath("//table[@id='memberList']/tbody/tr")); // gives
- // me
- // 11
- // rows
+ List<WebElement> 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());
[29/50] [abbrv] incubator-geode git commit: GEODE-2102: annotate
flaky test with FlakyTest category
Posted by kl...@apache.org.
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 Lund <kl...@apache.org>
Authored: Mon Nov 14 10:34:11 2016 -0800
Committer: Kirk Lund <kl...@apache.org>
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<String> filesToBeDeleted = new CopyOnWriteArrayList<String>();
+ @Category(FlakyTest.class) // GEODE-2102
@Test
public void testMissingDiskStore() {
final String regionName = "testShowMissingDiskStoreRegion";
[39/50] [abbrv] incubator-geode git commit: Fix formatting
Posted by kl...@apache.org.
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.
* <p>
- * 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 AtomicReference<List<Notification>> MEMBER_NOTIFICATIONS_REF = new AtomicReference<>();
- private static final AtomicReference<List<Notification>> SYSTEM_NOTIFICATIONS_REF = new AtomicReference<>();
+ private static final AtomicReference<List<Notification>> MEMBER_NOTIFICATIONS_REF =
+ new AtomicReference<>();
+ private static final AtomicReference<List<Notification>> 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<FixedPartitionAttributes> fixedPartitionAttributesList = createFixedPartitionList(primaryIndex + 1);
+ List<FixedPartitionAttributes> 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.
verifyRemoteFixedPartitionRegion(this.managerVM);
for (VM memberVM : this.memberVMs) {
@@ -247,8 +249,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
}
/**
- * Tests a Distributed Region at Managing Node side
- * while region is created in a member node asynchronously.
+ * Tests a Distributed Region at Managing Node side while region is created in a member node
+ * asynchronously.
*/
@Test
public void testRegionAggregate() throws Exception {
@@ -365,11 +367,13 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
memberVM.invoke("createDiskRegion", () -> {
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
- factory.setEvictionAttributes(EvictionAttributes.createLRUMemoryAttributes(20, new TestObjectSizerImpl(), EvictionAction.LOCAL_DESTROY));
+ factory.setEvictionAttributes(EvictionAttributes.createLRUMemoryAttributes(20,
+ new TestObjectSizerImpl(), EvictionAction.LOCAL_DESTROY));
Region region = getCache_tmp().createRegion(REGION_NAME, factory.create());
- LRUStatistics lruStats = ((AbstractRegion) region).getEvictionController().getLRUHelper().getStats();
+ LRUStatistics lruStats =
+ ((AbstractRegion) region).getEvictionController().getLRUHelper().getStats();
assertThat(lruStats).isNotNull();
RegionMXBean regionMXBean = getManagementService_tmp().getLocalRegionMBean(REGION_PATH);
@@ -387,7 +391,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
private void verifyEntrySize(final VM managerVM, final int expectedMembers) throws Exception {
managerVM.invoke("verifyEntrySize", () -> {
- DistributedRegionMXBean distributedRegionMXBean = awaitDistributedRegionMXBean(REGION_PATH, expectedMembers);
+ DistributedRegionMXBean distributedRegionMXBean =
+ awaitDistributedRegionMXBean(REGION_PATH, expectedMembers);
assertThat(distributedRegionMXBean).isNotNull();
assertThat(distributedRegionMXBean.getEntrySize()).isGreaterThan(0);
});
@@ -417,11 +422,14 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
assertThat(distributedSystemMXBean.listDistributedRegionObjectNames()).hasSize(2);
- assertThat(distributedSystemMXBean.fetchDistributedRegionObjectName(PARTITIONED_REGION_PATH)).isNotNull();
+ assertThat(distributedSystemMXBean.fetchDistributedRegionObjectName(PARTITIONED_REGION_PATH))
+ .isNotNull();
assertThat(distributedSystemMXBean.fetchDistributedRegionObjectName(REGION_PATH)).isNotNull();
- ObjectName actualName = distributedSystemMXBean.fetchDistributedRegionObjectName(PARTITIONED_REGION_PATH);
- ObjectName expectedName = MBeanJMXAdapter.getDistributedRegionMbeanName(PARTITIONED_REGION_PATH);
+ ObjectName actualName =
+ distributedSystemMXBean.fetchDistributedRegionObjectName(PARTITIONED_REGION_PATH);
+ ObjectName expectedName =
+ MBeanJMXAdapter.getDistributedRegionMbeanName(PARTITIONED_REGION_PATH);
assertThat(actualName).isEqualTo(expectedName);
actualName = distributedSystemMXBean.fetchDistributedRegionObjectName(REGION_PATH);
@@ -452,7 +460,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
expectedName = MBeanJMXAdapter.getRegionMBeanName(memberId, PARTITIONED_REGION_PATH);
awaitRegionMXBeanProxy(expectedName);
- actualName = distributedSystemMXBean.fetchRegionObjectName(memberId, PARTITIONED_REGION_PATH);
+ actualName =
+ distributedSystemMXBean.fetchRegionObjectName(memberId, PARTITIONED_REGION_PATH);
assertThat(actualName).isEqualTo(expectedName);
expectedName = MBeanJMXAdapter.getRegionMBeanName(memberId, REGION_PATH);
@@ -470,19 +479,22 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
private List<FixedPartitionAttributes> createFixedPartitionList(final int primaryIndex) {
List<FixedPartitionAttributes> fixedPartitionAttributesList = new ArrayList<>();
if (primaryIndex == 1) {
- fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q1", true, 3));
+ fixedPartitionAttributesList
+ .add(FixedPartitionAttributes.createFixedPartition("Q1", true, 3));
fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q2", 3));
fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q3", 3));
}
if (primaryIndex == 2) {
fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q1", 3));
- fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q2", true, 3));
+ fixedPartitionAttributesList
+ .add(FixedPartitionAttributes.createFixedPartition("Q2", true, 3));
fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q3", 3));
}
if (primaryIndex == 3) {
fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q1", 3));
fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q2", 3));
- fixedPartitionAttributesList.add(FixedPartitionAttributes.createFixedPartition("Q3", true, 3));
+ fixedPartitionAttributesList
+ .add(FixedPartitionAttributes.createFixedPartition("Q3", true, 3));
}
return fixedPartitionAttributesList;
}
@@ -490,7 +502,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
/**
* Invoked in member VMs
*/
- private void createFixedPartitionRegion(final List<FixedPartitionAttributes> fixedPartitionAttributesList) {
+ private void createFixedPartitionRegion(
+ final List<FixedPartitionAttributes> fixedPartitionAttributesList) {
SystemManagementService service = getSystemManagementService_tmp();
PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
@@ -513,38 +526,43 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
PartitionAttributesData partitionAttributesData = regionMXBean.listPartitionAttributes();
verifyPartitionData(regionAttributes, partitionAttributesData);
- FixedPartitionAttributesData[] fixedPartitionAttributesData = regionMXBean.listFixedPartitionAttributes();
+ FixedPartitionAttributesData[] fixedPartitionAttributesData =
+ regionMXBean.listFixedPartitionAttributes();
assertThat(fixedPartitionAttributesData).isNotNull();
assertThat(fixedPartitionAttributesData).hasSize(3);
for (int i = 0; i < fixedPartitionAttributesData.length; i++) {
- //LogWriterUtils.getLogWriter().info("<ExpectedString> Fixed PR Data is " + fixedPartitionAttributesData[i] + "</ExpectedString> ");
+ // LogWriterUtils.getLogWriter().info("<ExpectedString> Fixed PR Data is " +
+ // fixedPartitionAttributesData[i] + "</ExpectedString> ");
}
}
-// /**
-// * Invoked in manager VM
-// */
-// private void verifyRemoteFixedPartitionRegion(final VM vm) throws Exception {
-// vm.invoke("Verify Partition region", () -> {
-// Set<DistributedMember> otherMemberSet = getDistributionManager_tmp().getOtherNormalDistributionManagerIds();
-//
-// for (DistributedMember member : otherMemberSet) {
-// RegionMXBean regionMXBean = awaitRegionMXBeanProxy(member, FIXED_PR_PATH);
-//
-// PartitionAttributesData partitionAttributesData = regionMXBean.listPartitionAttributes();
-// assertNotNull(partitionAttributesData);
-//
-// FixedPartitionAttributesData[] fixedPartitionAttributesData = regionMXBean.listFixedPartitionAttributes();
-// assertNotNull(fixedPartitionAttributesData);
-// assertEquals(3, fixedPartitionAttributesData.length);
-//
-// for (int i = 0; i < fixedPartitionAttributesData.length; i++) {
-// //LogWriterUtils.getLogWriter().info("<ExpectedString> Remote PR Data is " + fixedPartitionAttributesData[i] + "</ExpectedString> ");
-// }
-// }
-// });
-// }
+ // /**
+ // * Invoked in manager VM
+ // */
+ // private void verifyRemoteFixedPartitionRegion(final VM vm) throws Exception {
+ // vm.invoke("Verify Partition region", () -> {
+ // Set<DistributedMember> otherMemberSet =
+ // getDistributionManager_tmp().getOtherNormalDistributionManagerIds();
+ //
+ // for (DistributedMember member : otherMemberSet) {
+ // RegionMXBean regionMXBean = awaitRegionMXBeanProxy(member, FIXED_PR_PATH);
+ //
+ // PartitionAttributesData partitionAttributesData = regionMXBean.listPartitionAttributes();
+ // assertNotNull(partitionAttributesData);
+ //
+ // FixedPartitionAttributesData[] fixedPartitionAttributesData =
+ // regionMXBean.listFixedPartitionAttributes();
+ // assertNotNull(fixedPartitionAttributesData);
+ // assertEquals(3, fixedPartitionAttributesData.length);
+ //
+ // for (int i = 0; i < fixedPartitionAttributesData.length; i++) {
+ // //LogWriterUtils.getLogWriter().info("<ExpectedString> Remote PR Data is " +
+ // fixedPartitionAttributesData[i] + "</ExpectedString> ");
+ // }
+ // }
+ // });
+ // }
private void addMemberNotificationListener(final VM managerVM, final int expectedMembers) {
managerVM.invoke("addMemberNotificationListener", () -> {
@@ -561,16 +579,16 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
ObjectName objectName = service.getMemberMBeanName(member);
awaitMemberMXBeanProxy(objectName);
- ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener, null, null);
+ ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener,
+ null, null);
}
});
}
/**
- * Add a Notification listener to DistributedSystemMBean which should gather
- * all the notifications which are propagated through all individual
- * MemberMBeans Hence Region created/destroyed should be visible to this
- * listener
+ * Add a Notification listener to DistributedSystemMBean which should gather all the notifications
+ * which are propagated through all individual MemberMBeans Hence Region created/destroyed should
+ * be visible to this listener
*/
private void addSystemNotificationListener(final VM managerVM) {
managerVM.invoke("addSystemNotificationListener", () -> {
@@ -579,13 +597,16 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
List<Notification> notifications = new ArrayList<>();
SYSTEM_NOTIFICATIONS_REF.set(notifications);
- DistributedSystemNotificationListener listener = new DistributedSystemNotificationListener(notifications);
+ DistributedSystemNotificationListener listener =
+ new DistributedSystemNotificationListener(notifications);
ObjectName objectName = MBeanJMXAdapter.getDistributedSystemName();
- ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener, null, null);
+ ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener, null,
+ null);
});
}
- private void verifyMemberNotifications(final VM managerVM, final String regionName, final int expectedMembers) {
+ private void verifyMemberNotifications(final VM managerVM, final String regionName,
+ final int expectedMembers) {
managerVM.invoke("verifyMemberNotifications", () -> {
assertThat(MEMBER_NOTIFICATIONS_REF.get()).isNotNull();
assertThat(MEMBER_NOTIFICATIONS_REF.get()).hasSize(expectedMembers * 2);
@@ -609,14 +630,21 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
});
}
- // <[javax.management.Notification[source=10.118.33.232(17632)<v1>-32770][type=gemfire.distributedsystem.cache.region.created][message=Region Created With Name /MANAGEMENT_TEST_REGION],
- // javax.management.Notification[source=10.118.33.232(17633)<v2>-32771][type=gemfire.distributedsystem.cache.region.created][message=Region Created With Name /MANAGEMENT_TEST_REGION],
- // javax.management.Notification[source=10.118.33.232(17634)<v3>-32772][type=gemfire.distributedsystem.cache.region.created][message=Region Created With Name /MANAGEMENT_TEST_REGION],
- // javax.management.Notification[source=10.118.33.232(17632)<v1>-32770][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
- // javax.management.Notification[source=10.118.33.232(17633)<v2>-32771][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
- // javax.management.Notification[source=10.118.33.232(17634)<v3>-32772][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION]]>
-
- private void verifySystemNotifications(final VM managerVM, final String regionName, final int expectedMembers) {
+ // <[javax.management.Notification[source=10.118.33.232(17632)<v1>-32770][type=gemfire.distributedsystem.cache.region.created][message=Region
+ // Created With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=10.118.33.232(17633)<v2>-32771][type=gemfire.distributedsystem.cache.region.created][message=Region
+ // Created With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=10.118.33.232(17634)<v3>-32772][type=gemfire.distributedsystem.cache.region.created][message=Region
+ // Created With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=10.118.33.232(17632)<v1>-32770][type=gemfire.distributedsystem.cache.region.closed][message=Region
+ // Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=10.118.33.232(17633)<v2>-32771][type=gemfire.distributedsystem.cache.region.closed][message=Region
+ // Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=10.118.33.232(17634)<v3>-32772][type=gemfire.distributedsystem.cache.region.closed][message=Region
+ // Destroyed/Closed With Name /MANAGEMENT_TEST_REGION]]>
+
+ private void verifySystemNotifications(final VM managerVM, final String regionName,
+ final int expectedMembers) {
managerVM.invoke("verifySystemNotifications", () -> {
assertThat(SYSTEM_NOTIFICATIONS_REF.get()).isNotNull();
assertThat(SYSTEM_NOTIFICATIONS_REF.get()).hasSize(expectedMembers + 2); // 2 for the manager
@@ -641,11 +669,16 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
});
}
- // <[javax.management.Notification[source=192.168.1.72(18496)<v27>-32770][type=gemfire.distributedsystem.cache.region.created][message=Region Created With Name /MANAGEMENT_TEST_REGION],
- // javax.management.Notification[source=192.168.1.72(18497)<v28>-32771][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
- // javax.management.Notification[source=192.168.1.72(18498)<v29>-32772][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
- // javax.management.Notification[source=192.168.1.72(18499)<v30>-32773][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
- // javax.management.Notification[source=192.168.1.72(18496)<v27>-32770][type=gemfire.distributedsystem.cache.region.closed][message=Region Destroyed/Closed With Name /MANAGEMENT_TEST_REGION]]>
+ // <[javax.management.Notification[source=192.168.1.72(18496)<v27>-32770][type=gemfire.distributedsystem.cache.region.created][message=Region
+ // Created With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=192.168.1.72(18497)<v28>-32771][type=gemfire.distributedsystem.cache.region.closed][message=Region
+ // Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=192.168.1.72(18498)<v29>-32772][type=gemfire.distributedsystem.cache.region.closed][message=Region
+ // Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=192.168.1.72(18499)<v30>-32773][type=gemfire.distributedsystem.cache.region.closed][message=Region
+ // Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
+ // javax.management.Notification[source=192.168.1.72(18496)<v27>-32770][type=gemfire.distributedsystem.cache.region.closed][message=Region
+ // Destroyed/Closed With Name /MANAGEMENT_TEST_REGION]]>
private void verifyProxyCleanup(final VM managerVM) {
managerVM.invoke("verifyProxyCleanup", () -> {
@@ -654,12 +687,15 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
Set<DistributedMember> otherMemberSet = getOtherNormalMembers_tmp();
for (final DistributedMember member : otherMemberSet) {
String alias = "Waiting for the proxy to get deleted at managing node";
- await(alias).until(() -> assertThat(service.getMBeanProxy(service.getRegionMBeanName(member, REGION_PATH), RegionMXBean.class)).isNull());
+ await(alias).until(
+ () -> assertThat(service.getMBeanProxy(service.getRegionMBeanName(member, REGION_PATH),
+ RegionMXBean.class)).isNull());
}
});
}
- private void verifyRemoteDistributedRegion(final VM managerVM, final int expectedMembers) throws Exception {
+ private void verifyRemoteDistributedRegion(final VM managerVM, final int expectedMembers)
+ throws Exception {
managerVM.invoke("verifyRemoteDistributedRegion", () -> {
Set<DistributedMember> otherMemberSet = getOtherNormalMembers_tmp();
assertThat(otherMemberSet).hasSize(expectedMembers);
@@ -677,7 +713,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
assertThat(evictionAttributesData).isNotNull();
}
- DistributedRegionMXBean distributedRegionMXBean = awaitDistributedRegionMXBean(REGION_PATH, expectedMembers);
+ DistributedRegionMXBean distributedRegionMXBean =
+ awaitDistributedRegionMXBean(REGION_PATH, expectedMembers);
assertThat(distributedRegionMXBean).isNotNull();
assertThat(distributedRegionMXBean.getFullPath()).isEqualTo(REGION_PATH);
@@ -689,20 +726,25 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
if (expectedMembers == 0) {
ManagementService service = getManagementService_tmp();
String alias = "Waiting for the proxy to get deleted at managing node";
- await(alias).until(() -> assertThat(service.getDistributedRegionMXBean(REGION_PATH)).isNull());
+ await(alias)
+ .until(() -> assertThat(service.getDistributedRegionMXBean(REGION_PATH)).isNull());
return;
}
- DistributedRegionMXBean distributedRegionMXBean = awaitDistributedRegionMXBean(REGION_PATH, expectedMembers);
+ DistributedRegionMXBean distributedRegionMXBean =
+ awaitDistributedRegionMXBean(REGION_PATH, expectedMembers);
assertThat(distributedRegionMXBean.getFullPath()).isEqualTo(REGION_PATH);
assertThat(distributedRegionMXBean.getMemberCount()).isEqualTo(expectedMembers);
assertThat(distributedRegionMXBean.getMembers()).hasSize(expectedMembers);
// Check Stats related Data
- //LogWriterUtils.getLogWriter().info("<ExpectedString> CacheListenerCallsAvgLatency is " + distributedRegionMXBean.getCacheListenerCallsAvgLatency() + "</ExpectedString> ");
- //LogWriterUtils.getLogWriter().info("<ExpectedString> CacheWriterCallsAvgLatency is " + distributedRegionMXBean.getCacheWriterCallsAvgLatency() + "</ExpectedString> ");
- //LogWriterUtils.getLogWriter().info("<ExpectedString> CreatesRate is " + distributedRegionMXBean.getCreatesRate() + "</ExpectedString> ");
+ // LogWriterUtils.getLogWriter().info("<ExpectedString> CacheListenerCallsAvgLatency is " +
+ // distributedRegionMXBean.getCacheListenerCallsAvgLatency() + "</ExpectedString> ");
+ // LogWriterUtils.getLogWriter().info("<ExpectedString> CacheWriterCallsAvgLatency is " +
+ // distributedRegionMXBean.getCacheWriterCallsAvgLatency() + "</ExpectedString> ");
+ // LogWriterUtils.getLogWriter().info("<ExpectedString> CreatesRate is " +
+ // distributedRegionMXBean.getCreatesRate() + "</ExpectedString> ");
});
}
@@ -717,7 +759,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
}
ManagementService service = getManagementService_tmp();
- DistributedRegionMXBean distributedRegionMXBean = service.getDistributedRegionMXBean(PARTITIONED_REGION_PATH);
+ DistributedRegionMXBean distributedRegionMXBean =
+ service.getDistributedRegionMXBean(PARTITIONED_REGION_PATH);
assertThat(distributedRegionMXBean.getMembers()).hasSize(3);
});
}
@@ -726,14 +769,16 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
memberVM.invoke("verifyReplicateRegionAfterCreate", () -> {
Cache cache = getCache_tmp();
- String memberId = MBeanJMXAdapter.getMemberNameOrId(cache.getDistributedSystem().getDistributedMember());
+ String memberId =
+ MBeanJMXAdapter.getMemberNameOrId(cache.getDistributedSystem().getDistributedMember());
ObjectName objectName = ObjectName.getInstance("GemFire:type=Member,member=" + memberId);
-// List<Notification> notifications = new ArrayList<>();
-// MEMBER_NOTIFICATIONS_REF.set(notifications);
-//
-// MemberNotificationListener listener = new MemberNotificationListener(notifications);
-// ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener, null, null);
+ // List<Notification> notifications = new ArrayList<>();
+ // MEMBER_NOTIFICATIONS_REF.set(notifications);
+ //
+ // MemberNotificationListener listener = new MemberNotificationListener(notifications);
+ // ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener,
+ // null, null);
SystemManagementService service = getSystemManagementService_tmp();
RegionMXBean regionMXBean = service.getLocalRegionMBean(REGION_PATH);
@@ -770,8 +815,10 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
RegionMXBean regionMXBean = service.getLocalRegionMBean(REGION_PATH);
assertThat(regionMXBean).isNull();
- ObjectName objectName = service.getRegionMBeanName(getCache_tmp().getDistributedSystem().getDistributedMember(), REGION_PATH);
- assertThat(service.getLocalManager().getManagementResourceRepo().getEntryFromLocalMonitoringRegion(objectName)).isNull();
+ ObjectName objectName = service.getRegionMBeanName(
+ getCache_tmp().getDistributedSystem().getDistributedMember(), REGION_PATH);
+ assertThat(service.getLocalManager().getManagementResourceRepo()
+ .getEntryFromLocalMonitoringRegion(objectName)).isNull();
});
}
@@ -786,35 +833,46 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
/**
* Invoked in member VMs
*/
- private void verifyPartitionData(final RegionAttributes expectedRegionAttributes, final PartitionAttributesData partitionAttributesData) {
- PartitionAttributes expectedPartitionAttributes = expectedRegionAttributes.getPartitionAttributes();
+ private void verifyPartitionData(final RegionAttributes expectedRegionAttributes,
+ final PartitionAttributesData partitionAttributesData) {
+ PartitionAttributes expectedPartitionAttributes =
+ expectedRegionAttributes.getPartitionAttributes();
- assertThat(partitionAttributesData.getRedundantCopies()).isEqualTo(expectedPartitionAttributes.getRedundantCopies());
+ assertThat(partitionAttributesData.getRedundantCopies())
+ .isEqualTo(expectedPartitionAttributes.getRedundantCopies());
- assertThat(partitionAttributesData.getTotalMaxMemory()).isEqualTo(expectedPartitionAttributes.getTotalMaxMemory());
+ assertThat(partitionAttributesData.getTotalMaxMemory())
+ .isEqualTo(expectedPartitionAttributes.getTotalMaxMemory());
// Total number of buckets for whole region
- assertThat(partitionAttributesData.getTotalNumBuckets()).isEqualTo(expectedPartitionAttributes.getTotalNumBuckets());
+ assertThat(partitionAttributesData.getTotalNumBuckets())
+ .isEqualTo(expectedPartitionAttributes.getTotalNumBuckets());
- assertThat(partitionAttributesData.getLocalMaxMemory()).isEqualTo(expectedPartitionAttributes.getLocalMaxMemory());
+ assertThat(partitionAttributesData.getLocalMaxMemory())
+ .isEqualTo(expectedPartitionAttributes.getLocalMaxMemory());
- assertThat(partitionAttributesData.getColocatedWith()).isEqualTo(expectedPartitionAttributes.getColocatedWith());
+ assertThat(partitionAttributesData.getColocatedWith())
+ .isEqualTo(expectedPartitionAttributes.getColocatedWith());
String partitionResolver = null;
- if (expectedPartitionAttributes.getPartitionResolver() != null) { // TODO: these conditionals should be deterministic
+ if (expectedPartitionAttributes.getPartitionResolver() != null) { // TODO: these conditionals
+ // should be deterministic
partitionResolver = expectedPartitionAttributes.getPartitionResolver().getName();
}
assertThat(partitionAttributesData.getPartitionResolver()).isEqualTo(partitionResolver);
- assertThat(partitionAttributesData.getRecoveryDelay()).isEqualTo(expectedPartitionAttributes.getRecoveryDelay());
+ assertThat(partitionAttributesData.getRecoveryDelay())
+ .isEqualTo(expectedPartitionAttributes.getRecoveryDelay());
- assertThat(partitionAttributesData.getStartupRecoveryDelay()).isEqualTo(expectedPartitionAttributes.getStartupRecoveryDelay());
+ assertThat(partitionAttributesData.getStartupRecoveryDelay())
+ .isEqualTo(expectedPartitionAttributes.getStartupRecoveryDelay());
if (expectedPartitionAttributes.getPartitionListeners() != null) {
for (int i = 0; i < expectedPartitionAttributes.getPartitionListeners().length; i++) {
- //assertEquals((expectedPartitionAttributes.getPartitionListeners())[i].getClass().getCanonicalName(), partitionAttributesData.getPartitionListeners()[i]);
- assertThat(partitionAttributesData.getPartitionListeners()[i])
- .isEqualTo(expectedPartitionAttributes.getPartitionListeners()[i].getClass().getCanonicalName());
+ // assertEquals((expectedPartitionAttributes.getPartitionListeners())[i].getClass().getCanonicalName(),
+ // partitionAttributesData.getPartitionListeners()[i]);
+ assertThat(partitionAttributesData.getPartitionListeners()[i]).isEqualTo(
+ expectedPartitionAttributes.getPartitionListeners()[i].getClass().getCanonicalName());
}
}
@@ -823,9 +881,11 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
/**
* Invoked in member VMs
*/
- private void verifyRegionAttributes(final RegionAttributes regionAttributes, final RegionAttributesData regionAttributesData) {
+ private void verifyRegionAttributes(final RegionAttributes regionAttributes,
+ final RegionAttributesData regionAttributesData) {
String compressorClassName = null;
- if (regionAttributes.getCompressor() != null) { // TODO: these conditionals should be deterministic
+ if (regionAttributes.getCompressor() != null) { // TODO: these conditionals should be
+ // deterministic
compressorClassName = regionAttributes.getCompressor().getClass().getCanonicalName();
}
assertThat(regionAttributesData.getCompressorClassName()).isEqualTo(compressorClassName);
@@ -852,7 +912,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
if (regionAttributes.getValueConstraint() != null) {
valueContstaintClassName = regionAttributes.getValueConstraint().getName();
}
- assertThat(regionAttributesData.getValueConstraintClassName()).isEqualTo(valueContstaintClassName);
+ assertThat(regionAttributesData.getValueConstraintClassName())
+ .isEqualTo(valueContstaintClassName);
CacheListener[] listeners = regionAttributes.getCacheListeners();
if (listeners != null) {
@@ -862,13 +923,17 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
}
}
- assertThat(regionAttributesData.getRegionTimeToLive()).isEqualTo(regionAttributes.getRegionTimeToLive().getTimeout());
+ assertThat(regionAttributesData.getRegionTimeToLive())
+ .isEqualTo(regionAttributes.getRegionTimeToLive().getTimeout());
- assertThat(regionAttributesData.getRegionIdleTimeout()).isEqualTo(regionAttributes.getRegionIdleTimeout().getTimeout());
+ assertThat(regionAttributesData.getRegionIdleTimeout())
+ .isEqualTo(regionAttributes.getRegionIdleTimeout().getTimeout());
- assertThat(regionAttributesData.getEntryTimeToLive()).isEqualTo(regionAttributes.getEntryTimeToLive().getTimeout());
+ assertThat(regionAttributesData.getEntryTimeToLive())
+ .isEqualTo(regionAttributes.getEntryTimeToLive().getTimeout());
- assertThat(regionAttributesData.getEntryIdleTimeout()).isEqualTo(regionAttributes.getEntryIdleTimeout().getTimeout());
+ assertThat(regionAttributesData.getEntryIdleTimeout())
+ .isEqualTo(regionAttributes.getEntryIdleTimeout().getTimeout());
String customEntryTimeToLive = null;
Object o1 = regionAttributes.getCustomEntryTimeToLive();
@@ -886,33 +951,43 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
assertThat(regionAttributesData.isIgnoreJTA()).isEqualTo(regionAttributes.getIgnoreJTA());
- assertThat(regionAttributesData.getDataPolicy()).isEqualTo(regionAttributes.getDataPolicy().toString());
+ assertThat(regionAttributesData.getDataPolicy())
+ .isEqualTo(regionAttributes.getDataPolicy().toString());
assertThat(regionAttributesData.getScope()).isEqualTo(regionAttributes.getScope().toString());
- assertThat(regionAttributesData.getInitialCapacity()).isEqualTo(regionAttributes.getInitialCapacity());
+ assertThat(regionAttributesData.getInitialCapacity())
+ .isEqualTo(regionAttributes.getInitialCapacity());
assertThat(regionAttributesData.getLoadFactor()).isEqualTo(regionAttributes.getLoadFactor());
assertThat(regionAttributesData.isLockGrantor()).isEqualTo(regionAttributes.isLockGrantor());
- assertThat(regionAttributesData.isMulticastEnabled()).isEqualTo(regionAttributes.getMulticastEnabled());
+ assertThat(regionAttributesData.isMulticastEnabled())
+ .isEqualTo(regionAttributes.getMulticastEnabled());
- assertThat(regionAttributesData.getConcurrencyLevel()).isEqualTo(regionAttributes.getConcurrencyLevel());
+ assertThat(regionAttributesData.getConcurrencyLevel())
+ .isEqualTo(regionAttributes.getConcurrencyLevel());
- assertThat(regionAttributesData.isIndexMaintenanceSynchronous()).isEqualTo(regionAttributes.getIndexMaintenanceSynchronous());
+ assertThat(regionAttributesData.isIndexMaintenanceSynchronous())
+ .isEqualTo(regionAttributes.getIndexMaintenanceSynchronous());
- assertThat(regionAttributesData.isStatisticsEnabled()).isEqualTo(regionAttributes.getStatisticsEnabled());
+ assertThat(regionAttributesData.isStatisticsEnabled())
+ .isEqualTo(regionAttributes.getStatisticsEnabled());
- assertThat(regionAttributesData.isSubscriptionConflationEnabled()).isEqualTo(regionAttributes.getEnableSubscriptionConflation());
+ assertThat(regionAttributesData.isSubscriptionConflationEnabled())
+ .isEqualTo(regionAttributes.getEnableSubscriptionConflation());
- assertThat(regionAttributesData.isAsyncConflationEnabled()).isEqualTo(regionAttributes.getEnableAsyncConflation());
+ assertThat(regionAttributesData.isAsyncConflationEnabled())
+ .isEqualTo(regionAttributes.getEnableAsyncConflation());
assertThat(regionAttributesData.getPoolName()).isEqualTo(regionAttributes.getPoolName());
- assertThat(regionAttributesData.isCloningEnabled()).isEqualTo(regionAttributes.getCloningEnabled());
+ assertThat(regionAttributesData.isCloningEnabled())
+ .isEqualTo(regionAttributes.getCloningEnabled());
- assertThat(regionAttributesData.getDiskStoreName()).isEqualTo(regionAttributes.getDiskStoreName());
+ assertThat(regionAttributesData.getDiskStoreName())
+ .isEqualTo(regionAttributes.getDiskStoreName());
String interestPolicy = null;
if (regionAttributes.getSubscriptionAttributes() != null) {
@@ -920,7 +995,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
}
assertThat(regionAttributesData.getInterestPolicy()).isEqualTo(interestPolicy);
- assertThat(regionAttributesData.isDiskSynchronous()).isEqualTo(regionAttributes.isDiskSynchronous());
+ assertThat(regionAttributesData.isDiskSynchronous())
+ .isEqualTo(regionAttributes.isDiskSynchronous());
}
private void verifyRemoteFixedPartitionRegion(final VM managerVM) throws Exception {
@@ -938,7 +1014,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
assertThat(fixedPrData).hasSize(3);
for (int i = 0; i < fixedPrData.length; i++) {
- //LogWriterUtils.getLogWriter().info("<ExpectedString> Remote PR Data is " + fixedPrData[i] + "</ExpectedString> ");
+ // LogWriterUtils.getLogWriter().info("<ExpectedString> Remote PR Data is " +
+ // fixedPrData[i] + "</ExpectedString> ");
}
}
});
@@ -955,7 +1032,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
private void createPartitionRegion_tmp(final VM vm, final String partitionRegionName) {
vm.invoke("Create Partitioned region", () -> {
SystemManagementService service = getSystemManagementService_tmp();
- RegionFactory regionFactory = getCache_tmp().createRegionFactory(RegionShortcut.PARTITION_REDUNDANT);
+ RegionFactory regionFactory =
+ getCache_tmp().createRegionFactory(RegionShortcut.PARTITION_REDUNDANT);
regionFactory.create(partitionRegionName);
});
}
@@ -968,7 +1046,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
});
}
- private void createSubRegion_tmp(final VM vm, final String parentRegionPath, final String subregionName) {
+ private void createSubRegion_tmp(final VM vm, final String parentRegionPath,
+ final String subregionName) {
vm.invoke("Create Sub region", () -> {
SystemManagementService service = getSystemManagementService_tmp();
Region region = getCache_tmp().getRegion(parentRegionPath);
@@ -977,11 +1056,13 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
}
private String getDistributedMemberId_tmp(final VM vm) {
- return vm.invoke("getMemberId", () -> getCache_tmp().getDistributedSystem().getDistributedMember().getId());
+ return vm.invoke("getMemberId",
+ () -> getCache_tmp().getDistributedSystem().getDistributedMember().getId());
}
private DistributedMember getDistributedMember_tmp(final VM anyVM) {
- return anyVM.invoke("getDistributedMember_tmp", () -> getCache_tmp().getDistributedSystem().getDistributedMember());
+ return anyVM.invoke("getDistributedMember_tmp",
+ () -> getCache_tmp().getDistributedSystem().getDistributedMember());
}
private SystemManagementService getSystemManagementService_tmp() {
@@ -989,7 +1070,7 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
}
private DM getDistributionManager_tmp() {
- return ((GemFireCacheImpl)getCache_tmp()).getDistributionManager();
+ return ((GemFireCacheImpl) getCache_tmp()).getDistributionManager();
}
private DistributedMember getDistributedMember_tmp() {
@@ -997,14 +1078,16 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
}
private Set<DistributedMember> getOtherNormalMembers_tmp() {
- Set<DistributedMember> allMembers = new HashSet<>(getDistributionManager_tmp().getNormalDistributionManagerIds());
+ Set<DistributedMember> allMembers =
+ new HashSet<>(getDistributionManager_tmp().getNormalDistributionManagerIds());
allMembers.remove(getDistributedMember_tmp());
return allMembers;
}
private void awaitMemberCount(final int expectedCount) {
DistributedSystemMXBean distributedSystemMXBean = awaitDistributedSystemMXBean();
- await().until(() -> assertThat(distributedSystemMXBean.getMemberCount()).isEqualTo(expectedCount));
+ await()
+ .until(() -> assertThat(distributedSystemMXBean.getMemberCount()).isEqualTo(expectedCount));
}
private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name) {
@@ -1015,11 +1098,13 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
return service.getDistributedRegionMXBean(name);
}
- private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name, final int memberCount) {
+ private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name,
+ final int memberCount) {
SystemManagementService service = getSystemManagementService_tmp();
await().until(() -> assertThat(service.getDistributedRegionMXBean(name)).isNotNull());
- await().until(() -> assertThat(service.getDistributedRegionMXBean(name).getMemberCount()).isEqualTo(memberCount));
+ await().until(() -> assertThat(service.getDistributedRegionMXBean(name).getMemberCount())
+ .isEqualTo(memberCount));
return service.getDistributedRegionMXBean(name);
}
@@ -1029,7 +1114,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
ObjectName objectName = service.getRegionMBeanName(member, name);
String alias = "awaiting RegionMXBean proxy for " + member;
- await(alias).until(() -> assertThat(service.getMBeanProxy(objectName, RegionMXBean.class)).isNotNull());
+ await(alias)
+ .until(() -> assertThat(service.getMBeanProxy(objectName, RegionMXBean.class)).isNotNull());
return service.getMBeanProxy(objectName, RegionMXBean.class);
}
@@ -1037,7 +1123,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
private RegionMXBean awaitRegionMXBeanProxy(final ObjectName objectName) {
SystemManagementService service = getSystemManagementService_tmp();
- await().until(() -> assertThat(service.getMBeanProxy(objectName, RegionMXBean.class)).isNotNull());
+ await()
+ .until(() -> assertThat(service.getMBeanProxy(objectName, RegionMXBean.class)).isNotNull());
return service.getMBeanProxy(objectName, RegionMXBean.class);
}
@@ -1047,14 +1134,16 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
ObjectName objectName = service.getMemberMBeanName(member);
String alias = "awaiting MemberMXBean proxy for " + member;
- await(alias).until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
+ await(alias)
+ .until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
return service.getMBeanProxy(objectName, MemberMXBean.class);
}
private MemberMXBean awaitMemberMXBeanProxy(final ObjectName objectName) {
SystemManagementService service = getSystemManagementService_tmp();
- await().until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
+ await()
+ .until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
return service.getMBeanProxy(objectName, MemberMXBean.class);
}
@@ -1091,13 +1180,14 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
public void handleNotification(final Notification notification, final Object handback) {
assertThat(notification).isNotNull();
- assertThat(JMXNotificationType.REGION_CREATED.equals(notification.getType()) ||
- JMXNotificationType.REGION_CLOSED.equals(notification.getType())).isTrue();
+ assertThat(JMXNotificationType.REGION_CREATED.equals(notification.getType())
+ || JMXNotificationType.REGION_CLOSED.equals(notification.getType())).isTrue();
notifications.add(notification);
// TODO: add better validation
- //LogWriterUtils.getLogWriter().info("<ExpectedString> Member Level Notifications" + notification + "</ExpectedString> ");
+ // LogWriterUtils.getLogWriter().info("<ExpectedString> Member Level Notifications" +
+ // notification + "</ExpectedString> ");
}
}
@@ -1121,7 +1211,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
notifications.add(notification);
// TODO: add something that will be validated
- //LogWriterUtils.getLogWriter().info("<ExpectedString> Distributed System Notifications" + notification + "</ExpectedString> ");
+ // LogWriterUtils.getLogWriter().info("<ExpectedString> Distributed System Notifications" +
+ // notification + "</ExpectedString> ");
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/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 92d685a..63cf88f 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
@@ -58,22 +58,26 @@ public class DistributedSystemStatsDUnitTest {
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
assertNotNull(cache);
- SystemManagementService service = (SystemManagementService) ManagementService.getManagementService(cache);
+ SystemManagementService service =
+ (SystemManagementService) ManagementService.getManagementService(cache);
DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
assertNotNull(distributedSystemMXBean);
- Set<DistributedMember> otherMemberSet = cache.getDistributionManager().getOtherNormalDistributionManagerIds();
+ Set<DistributedMember> otherMemberSet =
+ cache.getDistributionManager().getOtherNormalDistributionManagerIds();
assertEquals(3, otherMemberSet.size());
for (DistributedMember member : otherMemberSet) {
ObjectName memberMXBeanName = service.getMemberMBeanName(member);
- await().atMost(2, TimeUnit.MINUTES).until(() -> assertTrue(ManagementFactory.getPlatformMBeanServer().isRegistered(memberMXBeanName)));
+ await().atMost(2, TimeUnit.MINUTES).until(() -> assertTrue(
+ ManagementFactory.getPlatformMBeanServer().isRegistered(memberMXBeanName)));
MemberMXBean memberMXBean = service.getMBeanProxy(memberMXBeanName, MemberMXBean.class);
assertNotNull(memberMXBean);
final long lastRefreshTime = service.getLastUpdateTime(memberMXBeanName);
- await().atMost(1, TimeUnit.MINUTES).until(() -> assertTrue(service.getLastUpdateTime(memberMXBeanName) > lastRefreshTime));
+ await().atMost(1, TimeUnit.MINUTES)
+ .until(() -> assertTrue(service.getLastUpdateTime(memberMXBeanName) > lastRefreshTime));
}
});
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/internal/beans/QueryDataFunctionApplyLimitClauseTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/beans/QueryDataFunctionApplyLimitClauseTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/beans/QueryDataFunctionApplyLimitClauseTest.java
index 128280e..dcfd2bf 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/beans/QueryDataFunctionApplyLimitClauseTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/beans/QueryDataFunctionApplyLimitClauseTest.java
@@ -44,7 +44,9 @@ public class QueryDataFunctionApplyLimitClauseTest {
public void applyLimitClauseDoesNothingIfLimitClauseSpecified() {
String limitClause = " LIMIT 50";
String selectQueryWithLimit = selectQuery + limitClause;
- assertThat(QueryDataFunction.applyLimitClause(selectQueryWithLimit, limit_10, queryResultSetLimit_100)).isEqualTo(selectQueryWithLimit);
+ assertThat(
+ QueryDataFunction.applyLimitClause(selectQueryWithLimit, limit_10, queryResultSetLimit_100))
+ .isEqualTo(selectQueryWithLimit);
}
@Test
@@ -62,13 +64,16 @@ public class QueryDataFunctionApplyLimitClauseTest {
@Test // GEODE-1907
public void applyLimitClauseAddsQueryResultSetLimitIfMissingSpaceAfterFrom() {
String selectQueryMissingSpaceAfterFrom = "SELECT * FROM/MyRegion";
- assertThat(QueryDataFunction.applyLimitClause(selectQueryMissingSpaceAfterFrom, limit_0, queryResultSetLimit_100)).isEqualTo(selectQueryMissingSpaceAfterFrom + " LIMIT " + queryResultSetLimit_100);
+ assertThat(QueryDataFunction.applyLimitClause(selectQueryMissingSpaceAfterFrom, limit_0,
+ queryResultSetLimit_100))
+ .isEqualTo(selectQueryMissingSpaceAfterFrom + " LIMIT " + queryResultSetLimit_100);
}
@Test
public void applyLimitClauseDoesNotAddQueryResultSetLimitIfMissingSpaceAfterFromButLimitIsPresent() {
String selectQueryMissingSpaceAfterFromWithLimit = "SELECT * FROM/MyRegion LIMIT " + limit_10;
- assertThat(QueryDataFunction.applyLimitClause(selectQueryMissingSpaceAfterFromWithLimit, limit_0, queryResultSetLimit_100)).isEqualTo(selectQueryMissingSpaceAfterFromWithLimit);
+ assertThat(QueryDataFunction.applyLimitClause(selectQueryMissingSpaceAfterFromWithLimit,
+ limit_0, queryResultSetLimit_100)).isEqualTo(selectQueryMissingSpaceAfterFromWithLimit);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/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 3591cb5..a7940a4 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
@@ -63,14 +63,15 @@ import org.apache.geode.test.junit.categories.DistributedTest;
* This is for testing client IDs
*/
@Category(DistributedTest.class)
-@SuppressWarnings({ "serial", "unused" })
+@SuppressWarnings({"serial", "unused"})
public class TestClientIdsDUnitTest implements Serializable {
private static final String KEY1 = "KEY1";
private static final String KEY2 = "KEY2";
private static final String VALUE1 = "client-KEY1";
private static final String VALUE2 = "client-KEY2";
- private static final String REGION_NAME = TestClientIdsDUnitTest.class.getSimpleName() + "_Region";
+ private static final String REGION_NAME =
+ TestClientIdsDUnitTest.class.getSimpleName() + "_Region";
@Manager
private VM managerVM;
@@ -95,14 +96,16 @@ public class TestClientIdsDUnitTest implements Serializable {
int port = this.serverVM.invoke(() -> createServerCache());
- this.client1VM.invoke(() -> createClientCache(getServerHostName(this.serverVM.getHost()), port));
- this.client2VM.invoke(() -> createClientCache(getServerHostName(this.serverVM.getHost()), port));
+ this.client1VM
+ .invoke(() -> createClientCache(getServerHostName(this.serverVM.getHost()), port));
+ this.client2VM
+ .invoke(() -> createClientCache(getServerHostName(this.serverVM.getHost()), port));
DistributedMember serverMember = this.managementTestRule.getDistributedMember(this.serverVM);
DistributedMember client1Member = this.managementTestRule.getDistributedMember(this.client1VM);
DistributedMember client2Member = this.managementTestRule.getDistributedMember(this.client2VM);
-// this.managerVM.invoke(() -> verifyClientIds(serverMember, port));
+ // this.managerVM.invoke(() -> verifyClientIds(serverMember, port));
this.managerVM.invoke(() -> {
CacheServerMXBean cacheServerMXBean = awaitCacheServerMXBean(serverMember, port);
await().until(() -> {
@@ -136,24 +139,19 @@ public class TestClientIdsDUnitTest implements Serializable {
private void createClientCache(final String host, final int serverPort) {
ClientCache cache = this.managementTestRule.getClientCache();
- PoolImpl pool = (PoolImpl) PoolManager.createFactory()
- .addServer(host, serverPort)
- .setSubscriptionEnabled(false)
- .setThreadLocalConnections(true)
- .setMinConnections(1)
- .setReadTimeout(20000)
- .setPingInterval(10000)
- .setRetryAttempts(1)
- .setSubscriptionEnabled(true)
- .setStatisticInterval(1000)
- .create(getClass().getSimpleName());
-
- ClientRegionFactory factory = cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY);
+ PoolImpl pool = (PoolImpl) PoolManager.createFactory().addServer(host, serverPort)
+ .setSubscriptionEnabled(false).setThreadLocalConnections(true).setMinConnections(1)
+ .setReadTimeout(20000).setPingInterval(10000).setRetryAttempts(1)
+ .setSubscriptionEnabled(true).setStatisticInterval(1000).create(getClass().getSimpleName());
+
+ ClientRegionFactory factory =
+ cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY);
factory.setPoolName(pool.getName());
factory.create(REGION_NAME);
}
- private void verifyClientIds(final DistributedMember serverMember, final int serverPort) throws Exception {
+ private void verifyClientIds(final DistributedMember serverMember, final int serverPort)
+ throws Exception {
CacheServerMXBean cacheServerMXBean = awaitCacheServerMXBean(serverMember, serverPort);
await().until(() -> {
try {
@@ -165,11 +163,13 @@ public class TestClientIdsDUnitTest implements Serializable {
assertThat(cacheServerMXBean.getClientIds()).hasSize(2); // TODO
}
- private CacheServerMXBean awaitCacheServerMXBean(final DistributedMember serverMember, final int port) {
+ private CacheServerMXBean awaitCacheServerMXBean(final DistributedMember serverMember,
+ final int port) {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
ObjectName objectName = service.getCacheServerMBeanName(port, serverMember);
- await().until(() -> assertThat(service.getMBeanProxy(objectName, CacheServerMXBean.class)).isNotNull());
+ await().until(
+ () -> assertThat(service.getMBeanProxy(objectName, CacheServerMXBean.class)).isNotNull());
return service.getMBeanProxy(objectName, CacheServerMXBean.class);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestSubscriptionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestSubscriptionsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestSubscriptionsDUnitTest.java
index f09e7c9..52c7b9c 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestSubscriptionsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/pulse/TestSubscriptionsDUnitTest.java
@@ -51,7 +51,8 @@ import org.apache.geode.test.junit.categories.DistributedTest;
@SuppressWarnings("serial")
public class TestSubscriptionsDUnitTest extends ManagementTestBase {
- private static final String REGION_NAME = TestSubscriptionsDUnitTest.class.getSimpleName() + "_Region";
+ private static final String REGION_NAME =
+ TestSubscriptionsDUnitTest.class.getSimpleName() + "_Region";
private static final String KEY1 = "k1";
private static final String KEY2 = "k2";
@@ -137,17 +138,11 @@ public class TestSubscriptionsDUnitTest extends ManagementTestBase {
Cache cache = createCache(props);
- PoolImpl p = (PoolImpl) PoolManager.createFactory()
- .addServer(host, port1)
- .setSubscriptionEnabled(true)
- .setThreadLocalConnections(true)
- .setMinConnections(1)
- .setReadTimeout(20000)
- .setPingInterval(10000)
- .setRetryAttempts(1)
- .setSubscriptionEnabled(true)
- .setStatisticInterval(1000)
- .create("TestSubscriptionsDUnitTest");
+ PoolImpl p =
+ (PoolImpl) PoolManager.createFactory().addServer(host, port1).setSubscriptionEnabled(true)
+ .setThreadLocalConnections(true).setMinConnections(1).setReadTimeout(20000)
+ .setPingInterval(10000).setRetryAttempts(1).setSubscriptionEnabled(true)
+ .setStatisticInterval(1000).create("TestSubscriptionsDUnitTest");
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -168,15 +163,18 @@ public class TestSubscriptionsDUnitTest extends ManagementTestBase {
public boolean done() {
ManagementService service = ManagementService.getExistingManagementService(cache);
DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
- return distributedSystemMXBean != null & distributedSystemMXBean.getNumSubscriptions() > 1;
+ return distributedSystemMXBean != null
+ & distributedSystemMXBean.getNumSubscriptions() > 1;
}
+
@Override
public String description() {
return "TestSubscriptionsDUnitTest wait for getDistributedSystemMXBean to complete and get results";
}
}, 2 * 60 * 1000, 3000, true);
- DistributedSystemMXBean distributedSystemMXBean = ManagementService.getExistingManagementService(cache).getDistributedSystemMXBean();
+ DistributedSystemMXBean distributedSystemMXBean =
+ ManagementService.getExistingManagementService(cache).getDistributedSystemMXBean();
assertNotNull(distributedSystemMXBean);
assertEquals(2, distributedSystemMXBean.getNumSubscriptions());
});
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java b/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java
index 88168af..057454d 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java
@@ -316,16 +316,14 @@ public class AsyncInvocation<V> implements Future<V> {
}
/**
- * Waits if necessary for at most the given time for the computation
- * to complete.
+ * Waits if necessary for at most the given time for the computation to complete.
*
- * @param timeout the maximum time to wait
- * @param unit the time unit of the timeout argument
+ * @param timeout the maximum time to wait
+ * @param unit the time unit of the timeout argument
*
* @return this {@code AsyncInvocation}
*
- * @throws AssertionError wrapping any {@code Exception} thrown by this
- * {@code AsyncInvocation}.
+ * @throws AssertionError wrapping any {@code Exception} thrown by this {@code AsyncInvocation}.
*
* @throws CancellationException if the computation was cancelled
*
@@ -335,7 +333,8 @@ public class AsyncInvocation<V> implements Future<V> {
*
* @throws TimeoutException if the wait timed out
*/
- public AsyncInvocation<V> await(final long timeout, final TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException {
+ public AsyncInvocation<V> await(final long timeout, final TimeUnit unit)
+ throws ExecutionException, InterruptedException, TimeoutException {
long millis = unit.toMillis(timeout);
join(millis);
timeoutIfAlive(millis);
@@ -344,17 +343,15 @@ public class AsyncInvocation<V> implements Future<V> {
}
/**
- * Waits if necessary for at most the given time for the computation
- * to complete.
+ * Waits if necessary for at most the given time for the computation to complete.
*
* @return this {@code AsyncInvocation}
*
- * @throws AssertionError wrapping any {@code Exception} thrown by this
- * {@code AsyncInvocation}.
+ * @throws AssertionError wrapping any {@code Exception} thrown by this {@code AsyncInvocation}.
*
- * @throws AssertionError wrapping a {@code TimeoutException} if this
- * {@code AsyncInvocation} fails to complete within the default
- * timeout of 60 seconds as defined by {@link #DEFAULT_JOIN_MILLIS}.
+ * @throws AssertionError wrapping a {@code TimeoutException} if this {@code AsyncInvocation}
+ * fails to complete within the default timeout of 60 seconds as defined by
+ * {@link #DEFAULT_JOIN_MILLIS}.
*
* @throws CancellationException if the computation was cancelled
*
@@ -371,8 +368,8 @@ public class AsyncInvocation<V> implements Future<V> {
}
/**
- * Waits if necessary for the work to complete, and then returns the result
- * of this {@code AsyncInvocation}.
+ * Waits if necessary for the work to complete, and then returns the result of this
+ * {@code AsyncInvocation}.
*
* @return the result of this {@code AsyncInvocation}
*
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/test/dunit/VM.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/VM.java b/geode-core/src/test/java/org/apache/geode/test/dunit/VM.java
index 375deed..9a42caa 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/VM.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/VM.java
@@ -92,11 +92,11 @@ public class VM implements Serializable {
* Returns the process id of this {@code VM}.
*/
public int getPid() {
-// try {
- return invoke(() -> ProcessUtils.identifyPid());
-// } catch (PidUnavailableException e) {
-// return this.pid;
-// }
+ // try {
+ return invoke(() -> ProcessUtils.identifyPid());
+ // } catch (PidUnavailableException e) {
+ // return this.pid;
+ // }
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.java
index 5ab479b..8e89bdb 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.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;
@@ -24,21 +22,21 @@ import java.lang.annotation.Target;
import org.junit.Rule;
/**
- * Annotates a field or method as a type of {@link Rule} that can be invoked
- * across multiple VMs in a {@code DistributedTest}.
+ * Annotates a field or method as a type of {@link Rule} that can be invoked across multiple VMs in
+ * a {@code DistributedTest}.
*
- * If there are multiple annotated {@code DistributedRule}s on a class, they
- * will be applied in order of fields first, then methods. Furthermore, if
- * there are multiple fields (or methods) they will be applied in an order that
- * depends on your JVM's implementation of the reflection API, which is
- * undefined. Rules defined by fields will always be applied before Rules
- * defined by methods. You can use a {@link org.junit.rules.RuleChain} or
- * {@link org.apache.geode.test.junit.rules.RuleList} if you want to have
- * control over the order in which the Rules are applied.
+ * If there are multiple annotated {@code DistributedRule}s on a class, they will be applied in
+ * order of fields first, then methods. Furthermore, if there are multiple fields (or methods) they
+ * will be applied in an order that depends on your JVM's implementation of the reflection API,
+ * which is undefined. Rules defined by fields will always be applied before Rules defined by
+ * methods. You can use a {@link org.junit.rules.RuleChain} or
+ * {@link org.apache.geode.test.junit.rules.RuleList} if you want to have control over the order in
+ * which the Rules are applied.
*
* <p>
- * For example, here is a test class that makes a unique
- * {@link org.junit.rules.TemporaryFolder} available to each DUnit VM:
+ * For example, here is a test class that makes a unique {@link org.junit.rules.TemporaryFolder}
+ * available to each DUnit VM:
+ *
* <pre>
* {@literal @}Category(DistributedTest.class)
* public class EachVMHasItsOwnTemporaryFolder {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRunRules.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRunRules.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRunRules.java
index 7490acd..7a86613 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRunRules.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRunRules.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;
@@ -32,7 +30,8 @@ public class DistributedRunRules extends Statement implements Serializable {
private final Statement statement;
private final WhichVMs whichVMs;
- public DistributedRunRules(final Statement base, final Iterable<TestRule> rules, final Description description, final WhichVMs whichVMs) {
+ public DistributedRunRules(final Statement base, final Iterable<TestRule> rules,
+ final Description description, final WhichVMs whichVMs) {
this.statement = applyAll(base, rules, description);
this.whichVMs = whichVMs;
}
@@ -52,7 +51,8 @@ public class DistributedRunRules extends Statement implements Serializable {
}
}
- private Statement applyAll(Statement result, final Iterable<TestRule> rules, final Description description) {
+ private Statement applyAll(Statement result, final Iterable<TestRule> rules,
+ final Description description) {
for (TestRule each : rules) {
result = each.apply(result, description);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedStatement.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedStatement.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedStatement.java
index 1c78d00..cdc8dda 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedStatement.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedStatement.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;
@@ -33,6 +31,7 @@ public class DistributedStatement extends SerializableStatement {
/**
* Construct a new {@code DistributedStatement} statement.
+ *
* @param next the next {@code Statement} in the execution chain
* @param whichVMs specifies which VMs should invoke the statement
*/
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.java
index 9516cb3..31fba3d 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.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;
@@ -32,7 +30,8 @@ import org.apache.geode.test.dunit.standalone.DUnitLauncher;
/**
* Launches the DUnit framework for a {@code DistributedTest}.
*
- * <p>Enables use of {@link DistributedRule} annotations on any Rules.
+ * <p>
+ * Enables use of {@link DistributedRule} annotations on any Rules.
*
* <pre>
* {@literal @}Category(DistributedTest.class)
@@ -47,10 +46,10 @@ import org.apache.geode.test.dunit.standalone.DUnitLauncher;
* ...
* }
* </pre>
- * <p>Use the {@code Builder} to specify which {@code VM}s should invoke any
- * {@code Rule} annotated with {@literal @}DistributedRule. By default,
- * {@code controllerVM} is {@code true}, {@code everyVM} is {@code true} and
- * {@code locatorVM} is {@code false}.
+ * <p>
+ * Use the {@code Builder} to specify which {@code VM}s should invoke any {@code Rule} annotated
+ * with {@literal @}DistributedRule. By default, {@code controllerVM} is {@code true},
+ * {@code everyVM} is {@code true} and {@code locatorVM} is {@code false}.
*/
public class DistributedTestRule implements MethodRule, Serializable {
@@ -96,7 +95,8 @@ public class DistributedTestRule implements MethodRule, Serializable {
return statement;
}
- protected Statement withDUnit(final FrameworkMethod method, final Object target, final Statement statement) {
+ protected Statement withDUnit(final FrameworkMethod method, final Object target,
+ final Statement statement) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
@@ -115,50 +115,59 @@ public class DistributedTestRule implements MethodRule, Serializable {
// TODO: customize based on fields
}
- protected void tearDownDUnit() throws Exception {
- }
+ protected void tearDownDUnit() throws Exception {}
- protected Statement withRules(final FrameworkMethod method, final Object target, final Statement statement) {
+ protected Statement withRules(final FrameworkMethod method, final Object target,
+ final Statement statement) {
List<TestRule> testRules = this.testRules(target);
Statement result = statement;
-// result = withMethodRules(method, testRules, target, result);
+ // result = withMethodRules(method, testRules, target, result);
result = withTestRules(method, testRules, result);
return result;
}
-// protected Statement withMethodRules(final FrameworkMethod method, final List<TestRule> testRules, final Object target, final Statement result) {
-// Statement statement = result;
-// for (MethodRule rule : methodRules(target)) {
-// if (!testRules.contains(rule)) {
-// statement = new DistributedStatement(rule.apply((result, method, target), this.whichVMs);
-// }
-// }
-// return statement;
-// }
-
- protected Statement withTestRules(final FrameworkMethod method, final List<TestRule> testRules, final Statement statement) {
- Description description = Description.createTestDescription(this.testClass.getJavaClass(), method.getName(), method.getAnnotations());
- return testRules.isEmpty() ? statement : new DistributedRunRules(statement, testRules, description, this.whichVMs);
+ // protected Statement withMethodRules(final FrameworkMethod method, final List<TestRule>
+ // testRules, final Object target, final Statement result) {
+ // Statement statement = result;
+ // for (MethodRule rule : methodRules(target)) {
+ // if (!testRules.contains(rule)) {
+ // statement = new DistributedStatement(rule.apply((result, method, target), this.whichVMs);
+ // }
+ // }
+ // return statement;
+ // }
+
+ protected Statement withTestRules(final FrameworkMethod method, final List<TestRule> testRules,
+ final Statement statement) {
+ Description description = Description.createTestDescription(this.testClass.getJavaClass(),
+ method.getName(), method.getAnnotations());
+ return testRules.isEmpty() ? statement
+ : new DistributedRunRules(statement, testRules, description, this.whichVMs);
}
protected List<MethodRule> methodRules(final Object target) {
- List<MethodRule> rules = this.testClass.getAnnotatedMethodValues(target, DistributedRule.class, MethodRule.class);
- rules.addAll(this.testClass.getAnnotatedFieldValues(target, DistributedRule.class, MethodRule.class));
+ List<MethodRule> rules =
+ this.testClass.getAnnotatedMethodValues(target, DistributedRule.class, MethodRule.class);
+ rules.addAll(
+ this.testClass.getAnnotatedFieldValues(target, DistributedRule.class, MethodRule.class));
return rules;
}
protected List<TestRule> testRules(final Object target) {
- List<TestRule> result = this.testClass.getAnnotatedMethodValues(target, DistributedRule.class, TestRule.class);
- result.addAll(this.testClass.getAnnotatedFieldValues(target, DistributedRule.class, TestRule.class));
+ List<TestRule> result =
+ this.testClass.getAnnotatedMethodValues(target, DistributedRule.class, TestRule.class);
+ result.addAll(
+ this.testClass.getAnnotatedFieldValues(target, DistributedRule.class, TestRule.class));
return result;
}
/**
* Builds an instance of {@link DistributedTestRule}.
*
- * <p>By default, {@code controllerVM} is {@code true}, {@code everyVM} is
- * {@code true} and {@code locatorVM} is {@code false}.
+ * <p>
+ * By default, {@code controllerVM} is {@code true}, {@code everyVM} is {@code true} and
+ * {@code locatorVM} is {@code false}.
*/
public static class Builder {
@@ -166,8 +175,7 @@ public class DistributedTestRule implements MethodRule, Serializable {
private boolean locatorVM = false;
private boolean controllerVM = true;
- protected Builder() {
- }
+ protected Builder() {}
public Builder everyVM(final boolean everyVM) {
this.everyVM = everyVM;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java
index 78841fc..8c85775 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.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;
@@ -45,6 +43,7 @@ public class DistributedUseJacksonForJsonPathRule extends UseJacksonForJsonPathR
private static void invokeBefore() {
instance.before();
}
+
private static void invokeAfter() {
instance.after();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedWrapperRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedWrapperRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedWrapperRule.java
index 45311e1..6b1f8f1 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedWrapperRule.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedWrapperRule.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;
@@ -39,14 +37,15 @@ public class DistributedWrapperRule implements SerializableTestRule {
this(new RemoteInvoker(), testRule, whichVMs);
}
- public DistributedWrapperRule(final RemoteInvoker invoker, final SerializableTestRule testRule, final WhichVMs whichVMs) {
+ public DistributedWrapperRule(final RemoteInvoker invoker, final SerializableTestRule testRule,
+ final WhichVMs whichVMs) {
this.invoker = invoker;
instance = testRule;
this.whichVMs = whichVMs;
}
@Override
- public Statement apply(Statement base, Description description){
+ public Statement apply(Statement base, Description description) {
return new DistributedStatement((SerializableStatement) base, whichVMs);
}
}
[45/50] [abbrv] incubator-geode git commit: Convert from
ManagementTestCase to ManagementTestRule
Posted by kl...@apache.org.
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)}.
+ * <p>
+ * <pre>
+ * 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
+ * Test for Limit ( both row count and Depth)
+ * ORDER by orders
+ * Test all attributes are covered in an complex type
+ * </pre>
*/
-
-// 1) 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
-// Test for Limit ( both row count and Depth)
-// ORDER by orders
-// Test all attributes are covered in an complex type
-
@Category(DistributedTest.class)
-public class QueryDataDUnitTest extends ManagementTestBase {
-
- private static final long serialVersionUID = 1L;
-
- private static final int MAX_WAIT = 100 * 1000;
-
- private static final int cntDest = 30;
-
- private static final int cnt = 0;
-
- // PR 5 is co-located with 4
- static String PartitionedRegionName1 = "TestPartitionedRegion1"; // default
- // name
- static String PartitionedRegionName2 = "TestPartitionedRegion2"; // default
- // name
- static String PartitionedRegionName3 = "TestPartitionedRegion3"; // default
- // name
- static String PartitionedRegionName4 = "TestPartitionedRegion4"; // default
- // name
- static String PartitionedRegionName5 = "TestPartitionedRegion5"; // default
- // name
-
-
- static String repRegionName = "TestRepRegion"; // default name
- static String repRegionName2 = "TestRepRegion2"; // default name
- static String repRegionName3 = "TestRepRegion3"; // default name
- static String repRegionName4 = "TestRepRegion4"; // default name
- static String localRegionName = "TestLocalRegion"; // default name
-
- public static String[] queries =
- new String[] {"select * from /" + PartitionedRegionName1 + " where ID>=0",
- "Select * from /" + PartitionedRegionName1 + " r1, /" + PartitionedRegionName2
- + " r2 where r1.ID = r2.ID",
- "Select * from /" + PartitionedRegionName1 + " r1, /" + PartitionedRegionName2
- + " r2 where r1.ID = r2.ID AND r1.status = r2.status",
- "Select * from /" + PartitionedRegionName1 + " r1, /" + PartitionedRegionName2 + " r2, /"
- + PartitionedRegionName3 + " r3 where r1.ID = r2.ID and r2.ID = r3.ID",
- "Select * from /" + PartitionedRegionName1 + " r1, /" + PartitionedRegionName2 + " r2, /"
- + PartitionedRegionName3 + " r3 , /" + repRegionName
- + " r4 where r1.ID = r2.ID and r2.ID = r3.ID and r3.ID = r4.ID",
- "Select * from /" + PartitionedRegionName4 + " r4 , /" + PartitionedRegionName5
- + " r5 where r4.ID = r5.ID"};
-
- public static String[] nonColocatedQueries = new String[] {
- "Select * from /" + PartitionedRegionName1 + " r1, /" + PartitionedRegionName4
- + " r4 where r1.ID = r4.ID",
- "Select * from /" + PartitionedRegionName1 + " r1, /" + PartitionedRegionName4 + " r4 , /"
- + PartitionedRegionName5 + " r5 where r1.ID = r42.ID and r4.ID = r5.ID"};
-
- public static String[] queriesForRR =
- new String[] {"<trace> select * from /" + repRegionName + " where ID>=0",
- "Select * from /" + repRegionName + " r1, /" + repRegionName2 + " r2 where r1.ID = r2.ID",
- "select * from /" + repRegionName3 + " where ID>=0"};
-
- public static String[] queriesForLimit = new String[] {"select * from /" + repRegionName4};
-
-
- public QueryDataDUnitTest() {
- super();
- }
+@SuppressWarnings({ "serial", "unused" })
+public class QueryDataDUnitTest implements Serializable {
- @Override
- protected final void postSetUpManagementTestBase() throws Exception {
- initManagement(false);
- }
+ private static final int NUM_OF_BUCKETS = 20;
- private void initCommonRegions() {
- createRegionsInNodes();
- fillValuesInRegions();
- }
-
- /**
- * This function puts portfolio objects into the created Region (PR or Local) *
- */
- public CacheSerializableRunnable getCacheSerializableRunnableForPRPuts(final String regionName,
- final Object[] portfolio, final int from, final int to) {
- SerializableRunnable puts = new CacheSerializableRunnable("Region Puts") {
- @Override
- public void run2() throws CacheException {
- Cache cache = CacheFactory.getAnyInstance();
- Region region = cache.getRegion(regionName);
- for (int j = from; j < to; j++)
- region.put(new Integer(j), portfolio[j]);
- LogWriterUtils.getLogWriter().info(
- "PRQueryDUnitHelper#getCacheSerializableRunnableForPRPuts: Inserted Portfolio data on Region "
- + regionName);
- }
- };
- return (CacheSerializableRunnable) puts;
- }
-
- /**
- * This function puts PDX objects into the created Region (REPLICATED) *
- */
- public CacheSerializableRunnable getCacheSerializableRunnableForPDXPuts(final String regionName) {
- SerializableRunnable puts = new CacheSerializableRunnable("Region Puts") {
- @Override
- public void run2() throws CacheException {
- putPdxInstances(regionName);
-
- }
- };
- return (CacheSerializableRunnable) puts;
- }
-
- /**
- * This function puts big collections to created Region (REPLICATED) *
- */
- public CacheSerializableRunnable getCacheSerializableRunnableForBigCollPuts(
- final String regionName) {
- SerializableRunnable bigPuts = new CacheSerializableRunnable("Big Coll Puts") {
- @Override
- public void run2() throws CacheException {
- putBigInstances(regionName);
-
- }
- };
- return (CacheSerializableRunnable) bigPuts;
- }
+ // PARTITIONED_REGION_NAME5 is co-located with PARTITIONED_REGION_NAME4
+ private static final String PARTITIONED_REGION_NAME1 = "PARTITIONED_REGION_NAME1";
+ private static final String PARTITIONED_REGION_NAME2 = "PARTITIONED_REGION_NAME2";
+ private static final String PARTITIONED_REGION_NAME3 = "PARTITIONED_REGION_NAME3";
+ private static final String PARTITIONED_REGION_NAME4 = "PARTITIONED_REGION_NAME4";
+ private static final String PARTITIONED_REGION_NAME5 = "PARTITIONED_REGION_NAME5";
- public void fillValuesInRegions() {
- // Create common Portflios and NewPortfolios
- final Portfolio[] portfolio = createPortfoliosAndPositions(cntDest);
+ private static final String REPLICATE_REGION_NAME1 = "REPLICATE_REGION_NAME1";
+ private static final String REPLICATE_REGION_NAME2 = "REPLICATE_REGION_NAME2";
+ private static final String REPLICATE_REGION_NAME3 = "REPLICATE_REGION_NAME3";
+ private static final String REPLICATE_REGION_NAME4 = "REPLICATE_REGION_NAME4";
- // Fill local region
- managedNode1
- .invoke(getCacheSerializableRunnableForPRPuts(localRegionName, portfolio, cnt, cntDest));
+ private static final String LOCAL_REGION_NAME = "LOCAL_REGION_NAME";
- // Fill replicated region
- managedNode1
- .invoke(getCacheSerializableRunnableForPRPuts(repRegionName, portfolio, cnt, cntDest));
- managedNode2
- .invoke(getCacheSerializableRunnableForPRPuts(repRegionName2, portfolio, cnt, cntDest));
+ private static final String BIG_COLLECTION_ELEMENT_ = "BIG_COLLECTION_ELEMENT_";
+ private static final String BIG_COLLECTION_ = "BIG_COLLECTION_";
- // Fill Partition Region
- managedNode1.invoke(
- getCacheSerializableRunnableForPRPuts(PartitionedRegionName1, portfolio, cnt, cntDest));
- managedNode1.invoke(
- getCacheSerializableRunnableForPRPuts(PartitionedRegionName2, portfolio, cnt, cntDest));
- managedNode1.invoke(
- getCacheSerializableRunnableForPRPuts(PartitionedRegionName3, portfolio, cnt, cntDest));
- managedNode1.invoke(
- getCacheSerializableRunnableForPRPuts(PartitionedRegionName4, portfolio, cnt, cntDest));
- managedNode1.invoke(
- getCacheSerializableRunnableForPRPuts(PartitionedRegionName5, portfolio, cnt, cntDest));
-
- managedNode1.invoke(getCacheSerializableRunnableForPDXPuts(repRegionName3));
+ private static final String[] QUERIES = new String[] {
+ "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " WHERE ID >= 0",
+ "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2 + " r2 WHERE r1.ID = r2.ID",
+ "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2 + " r2 WHERE r1.ID = r2.ID AND r1.status = r2.status",
+ "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2 + " r2, /" + PARTITIONED_REGION_NAME3 + " r3 WHERE r1.ID = r2.ID AND r2.ID = r3.ID",
+ "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2 + " r2, /" + PARTITIONED_REGION_NAME3 + " r3, /" + REPLICATE_REGION_NAME1 + " r4 WHERE r1.ID = r2.ID AND r2.ID = r3.ID AND r3.ID = r4.ID",
+ "SELECT * FROM /" + PARTITIONED_REGION_NAME4 + " r4, /" + PARTITIONED_REGION_NAME5 + " r5 WHERE r4.ID = r5.ID"
+ };
- }
+ private static final String[] QUERIES_FOR_REPLICATED = new String[] {
+ "<TRACE> SELECT * FROM /" + REPLICATE_REGION_NAME1 + " WHERE ID >= 0",
+ "SELECT * FROM /" + REPLICATE_REGION_NAME1 + " r1, /" + REPLICATE_REGION_NAME2 + " r2 WHERE r1.ID = r2.ID",
+ "SELECT * FROM /" + REPLICATE_REGION_NAME3 + " WHERE ID >= 0"
+ };
- public void putPdxInstances(String regionName) throws CacheException {
- PdxInstanceFactory pf = PdxInstanceFactoryImpl.newCreator("Portfolio", false);
- Region r = getCache().getRegion(regionName);
- pf.writeInt("ID", 111);
- pf.writeString("status", "active");
- pf.writeString("secId", "IBM");
- PdxInstance pi = pf.create();
- r.put("IBM", pi);
-
- pf = PdxInstanceFactoryImpl.newCreator("Portfolio", false);
- pf.writeInt("ID", 222);
- pf.writeString("status", "inactive");
- pf.writeString("secId", "YHOO");
- pi = pf.create();
- r.put("YHOO", pi);
-
- pf = PdxInstanceFactoryImpl.newCreator("Portfolio", false);
- pf.writeInt("ID", 333);
- pf.writeString("status", "active");
- pf.writeString("secId", "GOOGL");
- pi = pf.create();
- r.put("GOOGL", pi);
-
- pf = PdxInstanceFactoryImpl.newCreator("Portfolio", false);
- pf.writeInt("ID", 111);
- pf.writeString("status", "inactive");
- pf.writeString("secId", "VMW");
- pi = pf.create();
- r.put("VMW", pi);
- }
+ private static final String[] QUERIES_FOR_LIMIT = new String[] {
+ "SELECT * FROM /" + REPLICATE_REGION_NAME4
+ };
- public void putBigInstances(String regionName) throws CacheException {
- Region r = getCache().getRegion(regionName);
+ private DistributedMember member1;
+ private DistributedMember member2;
+ private DistributedMember member3;
- for (int i = 0; i < 1200; i++) {
- List<String> bigColl1 = new ArrayList<String>();
- for (int j = 0; j < 200; j++) {
- bigColl1.add("BigColl_1_ElemenNo_" + j);
- }
- r.put("BigColl_1_" + i, bigColl1);
- }
+ @Manager
+ private VM managerVM;
- }
+ @Member
+ private VM[] memberVMs;
- private void createRegionsInNodes() {
+ @Rule
+ public DistributedUseJacksonForJsonPathRule useJacksonForJsonPathRule = new DistributedUseJacksonForJsonPathRule();
- // Create local Region on servers
- managedNode1.invoke(() -> QueryUsingFunctionContextDUnitTest.createLocalRegion());
+ @Rule
+ public ManagementTestRule managementTestRule = ManagementTestRule.builder().managersFirst(false).start(true).build();
- // Create ReplicatedRegion on servers
- managedNode1.invoke(() -> QueryUsingFunctionContextDUnitTest.createReplicatedRegion());
- managedNode2.invoke(() -> QueryUsingFunctionContextDUnitTest.createReplicatedRegion());
- managedNode3.invoke(() -> QueryUsingFunctionContextDUnitTest.createReplicatedRegion());
- try {
- this.createDistributedRegion(managedNode2, repRegionName2);
- this.createDistributedRegion(managedNode1, repRegionName3);
- this.createDistributedRegion(managedNode1, repRegionName4);
- } catch (Exception e1) {
- fail("Test Failed while creating region " + e1.getMessage());
- }
+ @Rule
+ public SerializableTestName testName = new SerializableTestName();
- // Create two colocated PartitionedRegions On Servers.
- managedNode1.invoke(() -> QueryUsingFunctionContextDUnitTest.createColocatedPR());
- managedNode2.invoke(() -> QueryUsingFunctionContextDUnitTest.createColocatedPR());
- managedNode3.invoke(() -> QueryUsingFunctionContextDUnitTest.createColocatedPR());
-
- this.managingNode
- .invoke(new SerializableRunnable("Wait for all Region Proxies to get replicated") {
-
- public void run() {
- Cache cache = getCache();
- SystemManagementService service = (SystemManagementService) getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
-
- try {
- MBeanUtil.getDistributedRegionMbean("/" + PartitionedRegionName1, 3);
- MBeanUtil.getDistributedRegionMbean("/" + PartitionedRegionName2, 3);
- MBeanUtil.getDistributedRegionMbean("/" + PartitionedRegionName3, 3);
- MBeanUtil.getDistributedRegionMbean("/" + PartitionedRegionName4, 3);
- MBeanUtil.getDistributedRegionMbean("/" + PartitionedRegionName5, 3);
- MBeanUtil.getDistributedRegionMbean("/" + repRegionName, 3);
- MBeanUtil.getDistributedRegionMbean("/" + repRegionName2, 1);
- MBeanUtil.getDistributedRegionMbean("/" + repRegionName3, 1);
- MBeanUtil.getDistributedRegionMbean("/" + repRegionName4, 1);
- } catch (Exception e) {
- fail("Region proxies not replicated in time");
- }
- }
- });
+ @Before
+ public void before() throws Exception {
+ this.member1 = this.managementTestRule.getDistributedMember(this.memberVMs[0]);
+ this.member2 = this.managementTestRule.getDistributedMember(this.memberVMs[1]);
+ this.member3 = this.managementTestRule.getDistributedMember(this.memberVMs[2]);
+ createRegionsInNodes();
+ generateValuesInRegions();
}
- // disabled for bug 49698, serialization problems introduced by r44615
@Test
public void testQueryOnPartitionedRegion() throws Exception {
-
- final DistributedMember member1 = getMember(managedNode1);
- final DistributedMember member2 = getMember(managedNode2);
- final DistributedMember member3 = getMember(managedNode3);
-
- initCommonRegions();
-
-
- this.managingNode.invoke(new SerializableRunnable("testQueryOnPartitionedRegion") {
-
- public void run() {
- Cache cache = getCache();
- SystemManagementService service = (SystemManagementService) getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
-
- assertNotNull(bean);
-
- try {
- for (int i = 0; i < queries.length; i++) {
- String jsonString = null;
- if (i == 0) {
- jsonString = bean.queryData(queries[i], null, 10);
- if (jsonString.contains("result") && !jsonString.contains("No Data Found")) {
-
- // getLogWriter().info("testQueryOnPartitionedRegion" + queries[i] + " is = " +
- // jsonString);
- JSONObject jsonObj = new JSONObject(jsonString);
- } else {
- fail("Query On Cluster should have result");
- }
- } else {
- jsonString = bean.queryData(queries[i], member1.getId(), 10);
- if (jsonString.contains("member")) {
- JSONObject jsonObj = new JSONObject(jsonString);
- // getLogWriter().info("testQueryOnPartitionedRegion" + queries[i] + " is = " +
- // jsonString);
- } else {
- fail("Query On Member should have member");
- }
- }
-
-
-
- }
- } catch (JSONException e) {
- e.printStackTrace();
- fail(e.getMessage());
- } catch (Exception e) {
- e.printStackTrace();
- fail(e.getMessage());
- }
+ this.managerVM.invoke(this.testName.getMethodName(), () -> {
+ DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+
+ String jsonString = distributedSystemMXBean.queryData(QUERIES[0], null, 10);
+ assertThat(jsonString).contains("result").doesNotContain("No Data Found");
+
+ for (int i = 0; i < QUERIES.length; i++) {
+ jsonString = distributedSystemMXBean.queryData(QUERIES[i], member1.getId(), 10);
+ assertThat(jsonString).contains("result");
+ assertThat(jsonString).contains("member");
+ assertThat("QUERIES[" + i + "]", jsonString, isJson(withJsonPath("$..result", anything())));
+
+ // TODO: better assertions
+ // assertThat("QUERIES[" + i + "]", result,
+ // isJson(withJsonPath("$..member",
+ // equalTo(JsonPath.compile(result)))));
+ // //equalTo(new JSONObject().put(String.class.getName(), member1.getId())))));
+ //System.out.println(JsonPath.read(jsonString, "$.result.*"));
+ //System.out.println(JsonPath.read(jsonString, "$['result']['member']"));
+
+ verifyJsonIsValid(jsonString);
}
});
}
@Test
public void testQueryOnReplicatedRegion() throws Exception {
+ this.managerVM.invoke(this.testName.getMethodName(), () -> {
+ DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+ String jsonString = distributedSystemMXBean.queryData(QUERIES_FOR_REPLICATED[0], null, 10);
+ assertThat(jsonString).contains("result").doesNotContain("No Data Found");
- initCommonRegions();
-
-
- this.managingNode.invoke(new SerializableRunnable("Query Test For REPL1") {
-
-
- public void run() {
- Cache cache = getCache();
- SystemManagementService service = (SystemManagementService) getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- assertNotNull(bean);
-
- try {
- for (int i = 0; i < queriesForRR.length; i++) {
- String jsonString1 = null;
- if (i == 0) {
- jsonString1 = bean.queryData(queriesForRR[i], null, 10);
- if (jsonString1.contains("result") && !jsonString1.contains("No Data Found")) {
- JSONObject jsonObj = new JSONObject(jsonString1);
- } else {
- fail("Query On Cluster should have result");
- }
- } else {
- jsonString1 = bean.queryData(queriesForRR[i], null, 10);
- if (jsonString1.contains("result")) {
- JSONObject jsonObj = new JSONObject(jsonString1);
- } else {
- LogWriterUtils.getLogWriter()
- .info("Failed Test String" + queriesForRR[i] + " is = " + jsonString1);
- fail("Join on Replicated did not work.");
- }
- }
- }
-
- } catch (JSONException e) {
- fail(e.getMessage());
- } catch (IOException e) {
- fail(e.getMessage());
- } catch (Exception e) {
- fail(e.getMessage());
- }
+ for (int i = 0; i < QUERIES_FOR_REPLICATED.length; i++) {
+ assertThat(jsonString).contains("result");
+ verifyJsonIsValid(jsonString);
}
});
}
- @Category(FlakyTest.class) // GEODE-1539
@Test
public void testMemberWise() throws Exception {
+ this.managerVM.invoke(this.testName.getMethodName(), () -> {
+ DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
- final DistributedMember member1 = getMember(managedNode1);
- final DistributedMember member2 = getMember(managedNode2);
-
-
- initCommonRegions();
-
-
- this.managingNode.invoke(new SerializableRunnable("testMemberWise") {
-
- public void run() {
- Cache cache = getCache();
- SystemManagementService service = (SystemManagementService) getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- assertNotNull(bean);
+ byte[] bytes = distributedSystemMXBean.queryDataForCompressedResult(QUERIES_FOR_REPLICATED[0], member1.getId() + "," + member2.getId(), 2);
+ String jsonString = BeanUtilFuncs.decompress(bytes);
- try {
- byte[] bytes = bean.queryDataForCompressedResult(queriesForRR[0],
- member1.getId() + "," + member2.getId(), 2);
- String jsonString = BeanUtilFuncs.decompress(bytes);
- JSONObject jsonObj = new JSONObject(jsonString);
- // String memberID = (String)jsonObj.get("member");
-
- // getLogWriter().info("testMemberWise " + queriesForRR[2] + " is = " + jsonString);
-
- } catch (JSONException e) {
- fail(e.getMessage());
- } catch (IOException e) {
- fail(e.getMessage());
- } catch (Exception e) {
- fail(e.getMessage());
- }
- }
+ verifyJsonIsValid(jsonString);
});
}
-
-
@Test
public void testLimitForQuery() throws Exception {
+ this.memberVMs[0].invoke("putBigInstances", () -> putBigInstances(REPLICATE_REGION_NAME4));
- initCommonRegions();
- managedNode1.invoke(getCacheSerializableRunnableForBigCollPuts(repRegionName4));
-
- managingNode.invoke(new SerializableRunnable("testLimitForQuery") {
- public void run() {
- SystemManagementService service = (SystemManagementService) getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- assertNotNull(bean);
+ this.managerVM.invoke(this.testName.getMethodName(), () -> {
+ DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
- try {
+ // Query With Default values
+ assertThat(distributedSystemMXBean.getQueryCollectionsDepth()).isEqualTo(TypedJson.DEFAULT_COLLECTION_ELEMENT_LIMIT);
+ assertThat(distributedSystemMXBean.getQueryResultSetLimit()).isEqualTo(DEFAULT_QUERY_LIMIT);
- // Query With Default values
- assertEquals(TypedJson.DEFAULT_COLLECTION_ELEMENT_LIMIT, bean.getQueryCollectionsDepth());
- assertEquals(ManagementConstants.DEFAULT_QUERY_LIMIT, bean.getQueryResultSetLimit());
+ String jsonString = distributedSystemMXBean.queryData(QUERIES_FOR_LIMIT[0], null, 0);
- String jsonString1 = bean.queryData(queriesForLimit[0], null, 0);
- if (jsonString1.contains("result") && !jsonString1.contains("No Data Found")) {
- JSONObject jsonObj = new JSONObject(jsonString1);
- assertTrue(jsonString1.contains("BigColl_1_ElemenNo_"));
- JSONArray arr = jsonObj.getJSONArray("result");
- assertEquals(ManagementConstants.DEFAULT_QUERY_LIMIT, arr.length());
- // Get the first element
+ verifyJsonIsValid(jsonString);
+ assertThat(jsonString).contains("result").doesNotContain("No Data Found");
+ assertThat(jsonString).contains(BIG_COLLECTION_ELEMENT_);
- JSONArray array1 = (JSONArray) arr.getJSONArray(0);
- // Get the ObjectValue
+ JSONObject jsonObject = new JSONObject(jsonString);
+ JSONArray jsonArray = jsonObject.getJSONArray("result");
+ assertThat(jsonArray.length()).isEqualTo(DEFAULT_QUERY_LIMIT);
- JSONObject collectionObject = (JSONObject) array1.get(1);
- assertEquals(100, collectionObject.length());
+ // Get the first element
+ JSONArray jsonArray1 = jsonArray.getJSONArray(0);
- } else {
- fail("Query On Cluster should have result");
- }
+ // Get the ObjectValue
+ JSONObject collectionObject = (JSONObject) jsonArray1.get(1);
+ assertThat(collectionObject.length()).isEqualTo(100);
- // Query With Ovverride Values
+ // Query With Override Values
+ int newQueryCollectionDepth = 150;
+ int newQueryResultSetLimit = 500;
- int newQueryCollectionDepth = 150;
- int newQueryResultSetLimit = 500;
- bean.setQueryCollectionsDepth(newQueryCollectionDepth);
- bean.setQueryResultSetLimit(newQueryResultSetLimit);
+ distributedSystemMXBean.setQueryCollectionsDepth(newQueryCollectionDepth);
+ distributedSystemMXBean.setQueryResultSetLimit(newQueryResultSetLimit);
- assertEquals(newQueryCollectionDepth, bean.getQueryCollectionsDepth());
- assertEquals(newQueryResultSetLimit, bean.getQueryResultSetLimit());
+ assertThat(distributedSystemMXBean.getQueryCollectionsDepth()).isEqualTo(newQueryCollectionDepth);
+ assertThat(distributedSystemMXBean.getQueryResultSetLimit()).isEqualTo(newQueryResultSetLimit);
- jsonString1 = bean.queryData(queriesForLimit[0], null, 0);
- if (jsonString1.contains("result") && !jsonString1.contains("No Data Found")) {
- JSONObject jsonObj = new JSONObject(jsonString1);
- assertTrue(jsonString1.contains("BigColl_1_ElemenNo_"));
- JSONArray arr = jsonObj.getJSONArray("result");
- assertEquals(newQueryResultSetLimit, arr.length());
- // Get the first element
+ jsonString = distributedSystemMXBean.queryData(QUERIES_FOR_LIMIT[0], null, 0);
- JSONArray array1 = (JSONArray) arr.getJSONArray(0);
- // Get the ObjectValue
+ verifyJsonIsValid(jsonString);
+ assertThat(jsonString).contains("result").doesNotContain("No Data Found");
- JSONObject collectionObject = (JSONObject) array1.get(1);
- assertEquals(newQueryCollectionDepth, collectionObject.length());
+ jsonObject = new JSONObject(jsonString);
+ assertThat(jsonString).contains(BIG_COLLECTION_ELEMENT_);
- } else {
- fail("Query On Cluster should have result");
- }
+ jsonArray = jsonObject.getJSONArray("result");
+ assertThat(jsonArray.length()).isEqualTo(newQueryResultSetLimit);
- } catch (JSONException e) {
- fail(e.getMessage());
- } catch (IOException e) {
- fail(e.getMessage());
- } catch (Exception e) {
- fail(e.getMessage());
- }
+ // Get the first element
+ jsonArray1 = jsonArray.getJSONArray(0);
- }
+ // Get the ObjectValue
+ collectionObject = (JSONObject) jsonArray1.get(1);
+ assertThat(collectionObject.length()).isEqualTo(newQueryCollectionDepth);
});
}
@Test
public void testErrors() throws Exception {
+ this.managerVM.invoke(this.testName.getMethodName(), () -> {
+ DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
- final DistributedMember member1 = getMember(managedNode1);
- final DistributedMember member2 = getMember(managedNode2);
- final DistributedMember member3 = getMember(managedNode3);
-
- initCommonRegions();
-
- this.managingNode.invoke(new SerializableRunnable("Test Error") {
- public void run() {
- SystemManagementService service = (SystemManagementService) getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- assertNotNull(bean);
-
- try {
- Cache cache = getCache();
- try {
- String message = bean.queryData("Select * from TestPartitionedRegion1", null, 2);
-
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("message", ManagementStrings.QUERY__MSG__INVALID_QUERY
- .toLocalizedString("Region mentioned in query probably missing /"));
- String expectedMessage = jsonObject.toString();
- assertEquals(expectedMessage, message);
-
- } catch (Exception e) {
- fail(e.getLocalizedMessage());
- }
-
- try {
- String query =
- "Select * from /PartitionedRegionName9 r1, PartitionedRegionName2 r2 where r1.ID = r2.ID";
- String message = bean.queryData(query, null, 2);
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("message", ManagementStrings.QUERY__MSG__REGIONS_NOT_FOUND
- .toLocalizedString("/PartitionedRegionName9"));
- String expectedMessage = jsonObject.toString();
- assertEquals(expectedMessage, message);
- } catch (Exception e) {
- fail(e.getLocalizedMessage());
-
- }
-
- final String testTemp = "testTemp";
- try {
- RegionFactory rf = cache.createRegionFactory(RegionShortcut.REPLICATE);
-
- rf.create(testTemp);
- String query = "Select * from /" + testTemp;
-
- String message = bean.queryData(query, member1.getId(), 2);
-
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("message", ManagementStrings.QUERY__MSG__REGIONS_NOT_FOUND_ON_MEMBERS
- .toLocalizedString("/" + testTemp));
- String expectedMessage = jsonObject.toString();
- assertEquals(expectedMessage, message);
- } catch (Exception e) {
- fail(e.getLocalizedMessage());
- }
-
- try {
- String query = queries[1];
- String message = bean.queryData(query, null, 2);
-
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("message", ManagementStrings.QUERY__MSG__JOIN_OP_EX.toLocalizedString());
- String expectedMessage = jsonObject.toString();
-
- assertEquals(expectedMessage, message);
- } catch (Exception e) {
- fail(e.getLocalizedMessage());
- }
-
- } catch (Exception e) {
- fail(e.getMessage());
- }
+ String invalidQuery = "SELECT * FROM " + PARTITIONED_REGION_NAME1;
+ String invalidQueryResult = distributedSystemMXBean.queryData(invalidQuery, null, 2);
+ assertThat(invalidQueryResult, isJson(withJsonPath("$.message", equalTo(QUERY__MSG__INVALID_QUERY.toLocalizedString("Region mentioned in query probably missing /")))));
- }
+ String nonexistentRegionName = this.testName.getMethodName() + "_NONEXISTENT_REGION";
+ String regionsNotFoundQuery = "SELECT * FROM /" + nonexistentRegionName + " r1, PARTITIONED_REGION_NAME2 r2 WHERE r1.ID = r2.ID";
+ String regionsNotFoundResult = distributedSystemMXBean.queryData(regionsNotFoundQuery, null, 2);
+ assertThat(regionsNotFoundResult, isJson(withJsonPath("$.message", equalTo(QUERY__MSG__REGIONS_NOT_FOUND.toLocalizedString("/" + nonexistentRegionName)))));
+
+ String regionName = this.testName.getMethodName() + "_REGION";
+ String regionsNotFoundOnMembersQuery = "SELECT * FROM /" + regionName;
+
+ RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE);
+ regionFactory.create(regionName);
+
+ String regionsNotFoundOnMembersResult = distributedSystemMXBean.queryData(regionsNotFoundOnMembersQuery, member1.getId(), 2);
+ assertThat(regionsNotFoundOnMembersResult, isJson(withJsonPath("$.message", equalTo(QUERY__MSG__REGIONS_NOT_FOUND_ON_MEMBERS.toLocalizedString("/" + regionName)))));
+
+ String joinMissingMembersQuery = QUERIES[1];
+ String joinMissingMembersResult = distributedSystemMXBean.queryData(joinMissingMembersQuery, null, 2);
+ assertThat(joinMissingMembersResult, isJson(withJsonPath("$.message", equalTo(QUERY__MSG__JOIN_OP_EX.toLocalizedString()))));
});
}
@Test
public void testNormalRegions() throws Exception {
+ this.managerVM.invoke(this.testName.getMethodName(), () -> {
+ DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
- final DistributedMember member1 = getMember(managedNode1);
- final DistributedMember member2 = getMember(managedNode2);
- final DistributedMember member3 = getMember(managedNode3);
- initCommonRegions();
-
- this.managingNode.invoke(new SerializableRunnable("Test Error") {
- public void run() {
- SystemManagementService service = (SystemManagementService) getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- assertNotNull(bean);
- final String testNormal = "testNormal";
- final String testTemp = "testTemp";
-
- final String testSNormal = "testSNormal"; // to Reverse order of regions while getting
- // Random region in QueryDataFunction
- final String testATemp = "testATemp";
-
- try {
- Cache cache = getCache();
- RegionFactory rf = cache.createRegionFactory(RegionShortcut.LOCAL_HEAP_LRU);
- rf.create(testNormal);
- rf.create(testSNormal);
-
-
- Region region = cache.getRegion("/" + testNormal);
- assertTrue(region.getAttributes().getDataPolicy() == DataPolicy.NORMAL);
-
- RegionFactory rf1 = cache.createRegionFactory(RegionShortcut.REPLICATE);
- rf1.create(testTemp);
- rf1.create(testATemp);
- String query1 = "Select * from /testTemp r1,/testNormal r2 where r1.ID = r2.ID";
- String query2 = "Select * from /testSNormal r1,/testATemp r2 where r1.ID = r2.ID";
- String query3 = "Select * from /testSNormal";
-
- try {
-
- bean.queryDataForCompressedResult(query1, null, 2);
- bean.queryDataForCompressedResult(query2, null, 2);
- bean.queryDataForCompressedResult(query3, null, 2);
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- } catch (Exception e) {
- fail(e.getMessage());
- }
+ String normalRegionName1 = this.testName.getMethodName() + "_NORMAL_REGION_1";
+ String tempRegionName1 = this.testName.getMethodName() + "_TEMP_REGION_1";
- }
+ String normalRegionName2 = this.testName.getMethodName() + "_NORMAL_REGION_2"; // to Reverse order of regions while getting Random region in QueryDataFunction [?]
+ String tempRegionName2 = this.testName.getMethodName() + "_TEMP_REGION_2";
+
+ Cache cache = this.managementTestRule.getCache();
+
+ RegionFactory regionFactory = cache.createRegionFactory(RegionShortcut.LOCAL_HEAP_LRU);
+ regionFactory.create(normalRegionName1);
+ regionFactory.create(normalRegionName2);
+
+ Region region = cache.getRegion("/" + normalRegionName1);
+ assertThat(region.getAttributes().getDataPolicy()).isEqualTo(DataPolicy.NORMAL);
+
+ RegionFactory regionFactory1 = cache.createRegionFactory(RegionShortcut.REPLICATE);
+ regionFactory1.create(tempRegionName1);
+ regionFactory1.create(tempRegionName2);
+
+ String query1 = "SELECT * FROM /" + tempRegionName1 + " r1, /" + normalRegionName1 + " r2 WHERE r1.ID = r2.ID";
+ String query2 = "SELECT * FROM /" + normalRegionName2 + " r1, /" + tempRegionName2 + " r2 WHERE r1.ID = r2.ID";
+ String query3 = "SELECT * FROM /" + normalRegionName2;
+
+ distributedSystemMXBean.queryDataForCompressedResult(query1, null, 2);
+ distributedSystemMXBean.queryDataForCompressedResult(query2, null, 2);
+ distributedSystemMXBean.queryDataForCompressedResult(query3, null, 2);
+
+ // TODO: assert results of queryDataForCompressedResult?
});
}
@Test
public void testRegionsLocalDataSet() throws Exception {
+ String partitionedRegionName = this.testName.getMethodName() + "_PARTITIONED_REGION";
- final DistributedMember member1 = getMember(managedNode1);
- final DistributedMember member2 = getMember(managedNode2);
- final DistributedMember member3 = getMember(managedNode3);
+ String[] values1 = new String[] { "val1", "val2", "val3" };
+ String[] values2 = new String[] { "val4", "val5", "val6" };
- final String PartitionedRegionName6 = "LocalDataSetTest";
+ this.memberVMs[0].invoke(this.testName.getMethodName() + " Create Region", () -> {
+ PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
+ partitionAttributesFactory.setRedundantCopies(2).setTotalNumBuckets(12);
- final String[] valArray1 = new String[] {"val1", "val2", "val3"};
- final String[] valArray2 = new String[] {"val4", "val5", "val6"};
- this.managedNode1.invoke(new SerializableRunnable("testRegionsLocalDataSet:Create Region") {
- public void run() {
- try {
+ List<FixedPartitionAttributes> fixedPartitionAttributesList = createFixedPartitionList(1);
+ for (FixedPartitionAttributes fixedPartitionAttributes : fixedPartitionAttributesList) {
+ partitionAttributesFactory.addFixedPartitionAttributes(fixedPartitionAttributes);
+ }
+ partitionAttributesFactory.setPartitionResolver(new SingleHopQuarterPartitionResolver());
- Cache cache = getCache();
- PartitionAttributesFactory paf = new PartitionAttributesFactory();
+ RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(partitionAttributesFactory.create());
+ Region region = regionFactory.create(partitionedRegionName);
- paf.setRedundantCopies(2).setTotalNumBuckets(12);
+ for (int i = 0; i < values1.length; i++) {
+ region.put(getDate(2013, 1, i + 5), values1[i]);
+ }
+ });
- List<FixedPartitionAttributes> fpaList = createFixedPartitionList(1);
- for (FixedPartitionAttributes fpa : fpaList) {
- paf.addFixedPartitionAttributes(fpa);
- }
- paf.setPartitionResolver(new SingleHopQuarterPartitionResolver());
+ this.memberVMs[1].invoke(this.testName.getMethodName() + " Create Region", () -> {
+ PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
+ partitionAttributesFactory.setRedundantCopies(2).setTotalNumBuckets(12);
- RegionFactory rf = cache.createRegionFactory(RegionShortcut.PARTITION)
- .setPartitionAttributes(paf.create());
+ List<FixedPartitionAttributes> fixedPartitionAttributesList = createFixedPartitionList(2);
+ for (FixedPartitionAttributes fixedPartitionAttributes : fixedPartitionAttributesList) {
+ partitionAttributesFactory.addFixedPartitionAttributes(fixedPartitionAttributes);
+ }
+ partitionAttributesFactory.setPartitionResolver(new SingleHopQuarterPartitionResolver());
- Region r = rf.create(PartitionedRegionName6);
+ RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(partitionAttributesFactory.create());
+ Region region = regionFactory.create(partitionedRegionName);
- for (int i = 0; i < valArray1.length; i++) {
- r.put(new Date(2013, 1, i + 5), valArray1[i]);
- }
- } catch (Exception e) {
- e.printStackTrace();
- fail(e.getMessage());
- }
+ for (int i = 0; i < values2.length; i++) {
+ region.put(getDate(2013, 5, i + 5), values2[i]);
+ }
+ });
+
+ this.memberVMs[2].invoke(this.testName.getMethodName() + " Create Region", () -> {
+ PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
+ partitionAttributesFactory.setRedundantCopies(2).setTotalNumBuckets(12);
+ List<FixedPartitionAttributes> fixedPartitionAttributesList = createFixedPartitionList(3);
+ for (FixedPartitionAttributes fixedPartitionAttributes : fixedPartitionAttributesList) {
+ partitionAttributesFactory.addFixedPartitionAttributes(fixedPartitionAttributes);
}
+ partitionAttributesFactory.setPartitionResolver(new SingleHopQuarterPartitionResolver());
+
+ RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(partitionAttributesFactory.create());
+ regionFactory.create(partitionedRegionName);
});
- this.managedNode2.invoke(new SerializableRunnable("testRegionsLocalDataSet: Create Region") {
- public void run() {
- try {
+ final List<String> member1RealData = this.memberVMs[0].invoke(() -> getLocalDataSet(partitionedRegionName));
+ final List<String> member2RealData = this.memberVMs[1].invoke(() -> getLocalDataSet(partitionedRegionName));
+ final List<String> member3RealData = this.memberVMs[2].invoke(() -> getLocalDataSet(partitionedRegionName));
- Cache cache = getCache();
- PartitionAttributesFactory paf = new PartitionAttributesFactory();
+ this.managerVM.invoke(this.testName.getMethodName(), () -> {
+ DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+ DistributedRegionMXBean distributedRegionMXBean = awaitDistributedRegionMXBean("/" + partitionedRegionName, 3);
- paf.setRedundantCopies(2).setTotalNumBuckets(12);
+ String alias = "Waiting for all entries to get reflected at managing node";
+ int expectedEntryCount = values1.length + values2.length;
+ await(alias).until(() -> assertThat(distributedRegionMXBean.getSystemRegionEntryCount()).isEqualTo(expectedEntryCount));
- List<FixedPartitionAttributes> fpaList = createFixedPartitionList(2);
- for (FixedPartitionAttributes fpa : fpaList) {
- paf.addFixedPartitionAttributes(fpa);
- }
- paf.setPartitionResolver(new SingleHopQuarterPartitionResolver());
+ String query = "Select * from /" + partitionedRegionName;
- RegionFactory rf = cache.createRegionFactory(RegionShortcut.PARTITION)
- .setPartitionAttributes(paf.create());
+ String member1Result = distributedSystemMXBean.queryData(query, member1.getId(), 0);
+ verifyJsonIsValid(member1Result);
- Region r = rf.create(PartitionedRegionName6);
+ String member2Result = distributedSystemMXBean.queryData(query, member2.getId(), 0);
+ verifyJsonIsValid(member2Result);
- for (int i = 0; i < valArray2.length; i++) {
- r.put(new Date(2013, 5, i + 5), valArray2[i]);
- }
+ String member3Result = distributedSystemMXBean.queryData(query, member3.getId(), 0);
+ verifyJsonIsValid(member3Result);
- } catch (Exception e) {
- fail(e.getMessage());
- }
+ for (String val : member1RealData) {
+ assertThat(member1Result).contains(val);
+ }
+ for (String val : member2RealData) {
+ assertThat(member2Result).contains(val);
}
- });
- this.managedNode3.invoke(new SerializableRunnable("testRegionsLocalDataSet: Create Region") {
- public void run() {
- try {
+ assertThat(member3Result).contains("No Data Found");
+ });
+ }
- Cache cache = getCache();
- PartitionAttributesFactory paf = new PartitionAttributesFactory();
+ private Date getDate(final int year, final int month, final int date) {
+ Calendar calendar = Calendar.getInstance();
+ calendar.set(year, month, date);
+ return calendar.getTime();
+ }
- paf.setRedundantCopies(2).setTotalNumBuckets(12);
+ private void verifyJsonIsValid(final String jsonString) throws JSONException {
+ assertThat(jsonString, isJson());
+ assertThat(jsonString, hasJsonPath("$.result"));
+ assertThat(new JSONObject(jsonString)).isNotNull();
+ }
- List<FixedPartitionAttributes> fpaList = createFixedPartitionList(3);
- for (FixedPartitionAttributes fpa : fpaList) {
- paf.addFixedPartitionAttributes(fpa);
- }
- paf.setPartitionResolver(new SingleHopQuarterPartitionResolver());
+ private void putDataInRegion(final String regionName, final Object[] portfolio, final int from, final int to) {
+ Region region = this.managementTestRule.getCache().getRegion(regionName);
+ for (int i = from; i < to; i++) {
+ region.put(new Integer(i), portfolio[i]);
+ }
+ }
- RegionFactory rf = cache.createRegionFactory(RegionShortcut.PARTITION)
- .setPartitionAttributes(paf.create());
+ private void generateValuesInRegions() {
+ int COUNT_DESTINATION = 30;
+ int COUNT_FROM = 0;
- Region r = rf.create(PartitionedRegionName6);
+ // Create common Portfolios and NewPortfolios
+ final Portfolio[] portfolio = createPortfoliosAndPositions(COUNT_DESTINATION);
+ // Fill local region
+ this.memberVMs[0].invoke(() -> putDataInRegion(LOCAL_REGION_NAME, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ // Fill replicated region
+ this.memberVMs[0].invoke(() -> putDataInRegion(REPLICATE_REGION_NAME1, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[1].invoke(() -> putDataInRegion(REPLICATE_REGION_NAME2, portfolio, COUNT_FROM, COUNT_DESTINATION));
- } catch (Exception e) {
- fail(e.getMessage());
- }
+ // Fill Partition Region
+ this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME1, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME2, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME3, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME4, portfolio, COUNT_FROM, COUNT_DESTINATION));
+ this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME5, portfolio, COUNT_FROM, COUNT_DESTINATION));
- }
- });
+ this.memberVMs[0].invoke(() -> putPdxInstances(REPLICATE_REGION_NAME3));
+ }
- final List<String> member1RealData = (List<String>) managedNode1
- .invoke(() -> QueryDataDUnitTest.getLocalDataSet(PartitionedRegionName6));
+ private void putPdxInstances(final String regionName) throws CacheException {
+ Region region = this.managementTestRule.getCache().getRegion(regionName);
+
+ PdxInstanceFactory pdxInstanceFactory = PdxInstanceFactoryImpl.newCreator("Portfolio", false);
+ pdxInstanceFactory.writeInt("ID", 111);
+ pdxInstanceFactory.writeString("status", "active");
+ pdxInstanceFactory.writeString("secId", "IBM");
+ PdxInstance pdxInstance = pdxInstanceFactory.create();
+ region.put("IBM", pdxInstance);
+
+ pdxInstanceFactory = PdxInstanceFactoryImpl.newCreator("Portfolio", false);
+ pdxInstanceFactory.writeInt("ID", 222);
+ pdxInstanceFactory.writeString("status", "inactive");
+ pdxInstanceFactory.writeString("secId", "YHOO");
+ pdxInstance = pdxInstanceFactory.create();
+ region.put("YHOO", pdxInstance);
+
+ pdxInstanceFactory = PdxInstanceFactoryImpl.newCreator("Portfolio", false);
+ pdxInstanceFactory.writeInt("ID", 333);
+ pdxInstanceFactory.writeString("status", "active");
+ pdxInstanceFactory.writeString("secId", "GOOGL");
+ pdxInstance = pdxInstanceFactory.create();
+ region.put("GOOGL", pdxInstance);
+
+ pdxInstanceFactory = PdxInstanceFactoryImpl.newCreator("Portfolio", false);
+ pdxInstanceFactory.writeInt("ID", 111);
+ pdxInstanceFactory.writeString("status", "inactive");
+ pdxInstanceFactory.writeString("secId", "VMW");
+ pdxInstance = pdxInstanceFactory.create();
+ region.put("VMW", pdxInstance);
+ }
- final List<String> member2RealData = (List<String>) managedNode2
- .invoke(() -> QueryDataDUnitTest.getLocalDataSet(PartitionedRegionName6));
+ private void putBigInstances(final String regionName) {
+ Region region = this.managementTestRule.getCache().getRegion(regionName);
- final List<String> member3RealData = (List<String>) managedNode3
- .invoke(() -> QueryDataDUnitTest.getLocalDataSet(PartitionedRegionName6));
+ for (int i = 0; i < 1200; i++) {
+ List<String> bigCollection = new ArrayList<>();
+ for (int j = 0; j < 200; j++) {
+ bigCollection.add(BIG_COLLECTION_ELEMENT_ + j);
+ }
+ region.put(BIG_COLLECTION_ + i, bigCollection);
+ }
+ }
+ private void createLocalRegion() {
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.LOCAL).create(LOCAL_REGION_NAME);
+ }
+ private void createReplicatedRegion() {
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE).create(REPLICATE_REGION_NAME1);
+ }
- this.managingNode.invoke(new SerializableRunnable("testRegionsLocalDataSet") {
- public void run() {
- SystemManagementService service = (SystemManagementService) getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- assertNotNull(bean);
+ private void createColocatedPR() {
+ PartitionResolver testKeyBasedResolver = new TestPartitionResolver();
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).create()).create(PARTITIONED_REGION_NAME1);
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME1).create()).create(PARTITIONED_REGION_NAME2);
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME2).create()).create(PARTITIONED_REGION_NAME3);
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).create()).create(PARTITIONED_REGION_NAME4); // not collocated
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME4).create()).create(PARTITIONED_REGION_NAME5); // collocated with 4
+ }
- try {
- String query = "Select * from /" + PartitionedRegionName6;
+ private void createDistributedRegion(final String regionName) {
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE).create(regionName);
+ }
- try {
- final DistributedRegionMXBean regionMBean =
- MBeanUtil.getDistributedRegionMbean("/" + PartitionedRegionName6, 3);
+ private void createRegionsInNodes() throws InterruptedException, TimeoutException, ExecutionException {
+ // Create local Region on servers
+ this.memberVMs[0].invoke(() -> createLocalRegion());
- Wait.waitForCriterion(new WaitCriterion() {
+ // Create ReplicatedRegion on servers
+ this.memberVMs[0].invoke(() -> createReplicatedRegion());
+ this.memberVMs[1].invoke(() -> createReplicatedRegion());
+ this.memberVMs[2].invoke(() -> createReplicatedRegion());
+
+ this.memberVMs[1].invoke(() -> createDistributedRegion(REPLICATE_REGION_NAME2));
+ this.memberVMs[0].invoke(() -> createDistributedRegion(REPLICATE_REGION_NAME3));
+ this.memberVMs[0].invoke(() -> createDistributedRegion(REPLICATE_REGION_NAME4));
+
+ // Create two co-located PartitionedRegions On Servers.
+ this.memberVMs[0].invoke(() -> createColocatedPR());
+ this.memberVMs[1].invoke(() -> createColocatedPR());
+ this.memberVMs[2].invoke(() -> createColocatedPR());
+
+ this.managerVM.invoke("Wait for all Region Proxies to get replicated", () -> {
+ awaitDistributedRegionMXBean("/" + PARTITIONED_REGION_NAME1, 3);
+ awaitDistributedRegionMXBean("/" + PARTITIONED_REGION_NAME2, 3);
+ awaitDistributedRegionMXBean("/" + PARTITIONED_REGION_NAME3, 3);
+ awaitDistributedRegionMXBean("/" + PARTITIONED_REGION_NAME4, 3);
+ awaitDistributedRegionMXBean("/" + PARTITIONED_REGION_NAME5, 3);
+ awaitDistributedRegionMXBean("/" + REPLICATE_REGION_NAME1, 3);
+ awaitDistributedRegionMXBean("/" + REPLICATE_REGION_NAME2, 1);
+ awaitDistributedRegionMXBean("/" + REPLICATE_REGION_NAME3, 1);
+ awaitDistributedRegionMXBean("/" + REPLICATE_REGION_NAME4, 1);
+ });
+ }
- public String description() {
- return "Waiting for all entries to get reflected at managing node";
- }
+ private List<String> getLocalDataSet(final String region) {
+ PartitionedRegion partitionedRegion = PartitionedRegionHelper.getPartitionedRegion(region, this.managementTestRule.getCache());
+ Set<BucketRegion> localPrimaryBucketRegions = partitionedRegion.getDataStore().getAllLocalPrimaryBucketRegions();
- public boolean done() {
+ List<String> allPrimaryValues = new ArrayList<>();
- boolean done = (regionMBean
- .getSystemRegionEntryCount() == (valArray1.length + valArray2.length));
- return done;
- }
+ for (BucketRegion bucketRegion : localPrimaryBucketRegions) {
+ for (Object value : bucketRegion.values()) {
+ allPrimaryValues.add((String) value);
+ }
+ }
- }, MAX_WAIT, 1000, true);
+ return allPrimaryValues;
+ }
- LogWriterUtils.getLogWriter().info("member1RealData is = " + member1RealData);
- LogWriterUtils.getLogWriter().info("member2RealData is = " + member2RealData);
- LogWriterUtils.getLogWriter().info("member3RealData is = " + member3RealData);
+ private List<FixedPartitionAttributes> createFixedPartitionList(final int primaryIndex) {
+ List<FixedPartitionAttributes> fixedPartitionAttributesList = new ArrayList<>();
+ if (primaryIndex == 1) {
+ fixedPartitionAttributesList.add(createFixedPartition("Q1", true, 3));
+ fixedPartitionAttributesList.add(createFixedPartition("Q2", 3));
+ fixedPartitionAttributesList.add(createFixedPartition("Q3", 3));
+ }
+ if (primaryIndex == 2) {
+ fixedPartitionAttributesList.add(createFixedPartition("Q1", 3));
+ fixedPartitionAttributesList.add(createFixedPartition("Q2", true, 3));
+ fixedPartitionAttributesList.add(createFixedPartition("Q3", 3));
+ }
+ if (primaryIndex == 3) {
+ fixedPartitionAttributesList.add(createFixedPartition("Q1", 3));
+ fixedPartitionAttributesList.add(createFixedPartition("Q2", 3));
+ fixedPartitionAttributesList.add(createFixedPartition("Q3", true, 3));
+ }
+ return fixedPartitionAttributesList;
+ }
- String member1Result = bean.queryData(query, member1.getId(), 0);
- LogWriterUtils.getLogWriter().info("member1Result " + query + " is = " + member1Result);
+ private MemberMXBean awaitMemberMXBeanProxy(final DistributedMember member) {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ ObjectName objectName = service.getMemberMBeanName(member);
+ String alias = "awaiting MemberMXBean proxy for " + member;
+ await(alias).until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
- String member2Result = bean.queryData(query, member2.getId(), 0);
- LogWriterUtils.getLogWriter().info("member2Result " + query + " is = " + member2Result);
+ return service.getMBeanProxy(objectName, MemberMXBean.class);
+ }
- String member3Result = bean.queryData(query, member3.getId(), 0);
- LogWriterUtils.getLogWriter().info("member3Result " + query + " is = " + member3Result);
+ private DistributedSystemMXBean awaitDistributedSystemMXBean() {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
- for (String val : member1RealData) {
- assertTrue(member1Result.contains(val));
- }
+ await().until(() -> assertThat(service.getDistributedSystemMXBean()).isNotNull());
- for (String val : member2RealData) {
- assertTrue(member2Result.contains(val));
- }
+ return service.getDistributedSystemMXBean();
+ }
- assertTrue(member3Result.contains("No Data Found"));
- } catch (Exception e) {
- fail(e.getMessage());
- }
+ private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name) {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
- } catch (Exception e) {
- fail(e.getMessage());
- }
+ await().until(() -> assertThat(service.getDistributedRegionMXBean(name)).isNotNull());
- }
- });
+ return service.getDistributedRegionMXBean(name);
}
+ private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name, final int memberCount) {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
- private static List<String> getLocalDataSet(String region) {
- PartitionedRegion parRegion =
- PartitionedRegionHelper.getPartitionedRegion(region, GemFireCacheImpl.getExisting());
- Set<BucketRegion> localPrimaryBucketRegions =
- parRegion.getDataStore().getAllLocalPrimaryBucketRegions();
- List<String> allPrimaryVals = new ArrayList<String>();
- for (BucketRegion brRegion : localPrimaryBucketRegions) {
- for (Object obj : brRegion.values()) {
- allPrimaryVals.add((String) obj);
- }
+ await().until(() -> assertThat(service.getDistributedRegionMXBean(name)).isNotNull());
+ await().until(() -> assertThat(service.getDistributedRegionMXBean(name).getMemberCount()).isEqualTo(memberCount));
- }
+ return service.getDistributedRegionMXBean(name);
+ }
- return allPrimaryVals;
+ private ConditionFactory await() {
+ return Awaitility.await().atMost(2, MINUTES);
}
- /**
- * creates a Fixed Partition List to be used for Fixed Partition Region
- *
- * @param primaryIndex index for each fixed partition
- */
- private static List<FixedPartitionAttributes> createFixedPartitionList(int primaryIndex) {
- List<FixedPartitionAttributes> fpaList = new ArrayList<FixedPartitionAttributes>();
- if (primaryIndex == 1) {
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", true, 3));
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", 3));
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", 3));
+ private ConditionFactory await(final String alias) {
+ return Awaitility.await(alias).atMost(2, MINUTES);
+ }
+
+ private static class TestPartitionResolver implements PartitionResolver {
+
+ @Override
+ public void close() {
}
- if (primaryIndex == 2) {
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", 3));
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", true, 3));
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", 3));
+
+ @Override
+ public Serializable getRoutingObject(EntryOperation opDetails) {
+ return (((Integer)opDetails.getKey()).intValue() % NUM_OF_BUCKETS);
}
- if (primaryIndex == 3) {
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q1", 3));
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q2", 3));
- fpaList.add(FixedPartitionAttributes.createFixedPartition("Q3", true, 3));
+
+ @Override
+ public String getName() {
+ return getClass().getName();
}
- return fpaList;
}
}
[47/50] [abbrv] incubator-geode git commit: Convert from
ManagementTestCase to ManagementTestRule
Posted by kl...@apache.org.
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 + "]");
+ props.setProperty(LOCATORS, this.hostName + "[" + this.port + "]");
props.setProperty(JMX_MANAGER, "true");
props.setProperty(JMX_MANAGER_START, "false");
props.setProperty(JMX_MANAGER_PORT, "0");
props.setProperty(JMX_MANAGER_HTTP_PORT, "0");
- createCache(managingNode, props);
- startManagingNode(managingNode);
- DistributedMember locatorMember = getMember(locator);
- remoteLocatorMBeanExist(managingNode, locatorMember);
+ this.managementTestRule.createManager(this.managerVM, props, false);
+ this.managementTestRule.startManager(this.managerVM);
+
+ verifyRemoteLocatorMXBeanProxy(this.managerVM, this.managementTestRule.getDistributedMember(this.locatorVM));
}
@Test
public void testPeerLocationWithPortZero() throws Exception {
- // Start the locator with port=0
- int locPort = startLocator(locator, true, 0);
- locatorMBeanExist(locator, locPort, true);
+ this.port = startLocator(this.locatorVM, true, ZERO);
+ //this.locatorVM.invoke(() -> this.managementTestRule.getCache());
+
+ this.locatorVM.invoke(() -> assertHasCache());
+
+ 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 + "]");
+ props.setProperty(LOCATORS, this.hostName + "[" + this.port + "]");
props.setProperty(JMX_MANAGER, "true");
props.setProperty(JMX_MANAGER_START, "false");
props.setProperty(JMX_MANAGER_PORT, "0");
props.setProperty(JMX_MANAGER_HTTP_PORT, "0");
- createCache(managingNode, props);
- startManagingNode(managingNode);
- DistributedMember locatorMember = getMember(locator);
- remoteLocatorMBeanExist(managingNode, locatorMember);
+ this.managementTestRule.createManager(this.managerVM, props, false);
+ this.managementTestRule.startManager(this.managerVM);
+
+ verifyRemoteLocatorMXBeanProxy(this.managerVM, this.managementTestRule.getDistributedMember(this.locatorVM));
+ }
+
+ private void assertHasCache() {
+ assertThat(GemFireCacheImpl.getInstance()).isNotNull();
+ assertThat(GemFireCacheImpl.getInstance().isClosed()).isFalse();
+ assertThat(InternalDistributedSystem.getAnyInstance()).isNotNull();
+ assertThat(InternalDistributedSystem.getAnyInstance().isConnected()).isTrue();
}
/**
@@ -116,262 +150,199 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
*/
@Test
public void testColocatedLocator() throws Exception {
- initManagement(false);
- int locPort = AvailablePortHelper.getRandomAvailableTCPPort();
- startLocator(locator, false, locPort);
- locatorMBeanExist(locator, locPort, false);
+ this.managementTestRule.createMembers();
+ this.managementTestRule.createManagers();
+
+ startLocator(this.locatorVM, false, this.port);
+ verifyLocalLocatorMXBean(this.locatorVM, this.port, false);
}
@Test
public void testColocatedLocatorWithPortZero() throws Exception {
- initManagement(false);
- int locPort = startLocator(locator, false, 0);
- locatorMBeanExist(locator, locPort, false);
+ this.managementTestRule.createMembers();
+ this.managementTestRule.createManagers();
+
+ this.port = startLocator(this.locatorVM, false, ZERO);
+ verifyLocalLocatorMXBean(this.locatorVM, this.port, false);
}
@Test
public void testListManagers() throws Exception {
- initManagement(false);
- int locPort = AvailablePortHelper.getRandomAvailableTCPPort();
- startLocator(locator, false, locPort);
- listManagers(locator, locPort, false);
+ this.managementTestRule.createMembers();
+ this.managementTestRule.createManagers();
+
+ startLocator(this.locatorVM, false, this.port);
+
+ verifyListManagers(this.locatorVM);
}
@Test
public void testListManagersWithPortZero() throws Exception {
- initManagement(false);
- int locPort = startLocator(locator, false, 0);
- listManagers(locator, locPort, false);
+ this.managementTestRule.createMembers();
+ this.managementTestRule.createManagers();
+
+ this.port = startLocator(this.locatorVM, false, ZERO);
+
+ verifyListManagers(this.locatorVM);
}
@Test
public void testWillingManagers() throws Exception {
- int locPort = AvailablePortHelper.getRandomAvailableTCPPort();
- startLocator(locator, true, locPort);
-
- Host host = Host.getHost(0);
- String host0 = getServerHostName(host);
+ startLocator(this.locatorVM, true, this.port);
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
- props.setProperty(LOCATORS, host0 + "[" + locPort + "]");
+ props.setProperty(LOCATORS, this.hostName + "[" + this.port + "]");
props.setProperty(JMX_MANAGER, "true");
- createCache(managedNode2, props);
- createCache(managedNode3, props);
+ this.managementTestRule.createMember(this.membersVM[1], props);
+ this.managementTestRule.createMember(this.membersVM[2], props);
- listWillingManagers(locator, locPort, false);
+ verifyListPotentialManagers(this.locatorVM);
}
@Test
public void testWillingManagersWithPortZero() throws Exception {
- int locPort = startLocator(locator, true, 0);
-
- Host host = Host.getHost(0);
- String host0 = getServerHostName(host);
+ this.port = startLocator(this.locatorVM, true, 0);
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
- props.setProperty(LOCATORS, host0 + "[" + locPort + "]");
+ props.setProperty(LOCATORS, this.hostName + "[" + this.port + "]");
props.setProperty(JMX_MANAGER, "true");
- createCache(managedNode2, props);
- createCache(managedNode3, props);
+ this.managementTestRule.createMember(this.membersVM[1], props);
+ this.managementTestRule.createMember(this.membersVM[2], props);
- listWillingManagers(locator, locPort, false);
+ verifyListPotentialManagers(this.locatorVM);
}
/**
- * Starts a locator with given configuration. If DS is already started it will use the same DS
- *
- * @param vm reference to VM
+ * Starts a locator with given configuration.
+ * If DS is already started it will use the same DS
*/
- protected Integer startLocator(final VM vm, final boolean isPeer, final int port) {
-
- return (Integer) vm.invoke(new SerializableCallable("Start Locator In VM") {
+ private int startLocator(final VM locatorVM, final boolean isPeer, final int port) {
+ return locatorVM.invoke("startLocator", () -> {
+ assertThat(InternalLocator.hasLocator()).isFalse();
- public Object call() throws Exception {
+ Properties properties = new Properties();
+ properties.setProperty(MCAST_PORT, "0");
+ properties.setProperty(LOCATORS, "");
- assertFalse(InternalLocator.hasLocator());
+ InetAddress bindAddress = InetAddress.getByName(this.hostName);
+ File logFile = this.temporaryFolder.newFile(testName.getMethodName() + "-locator-" + port + ".log");
+ Locator locator = Locator.startLocatorAndDS(port, logFile, bindAddress, properties, isPeer, true, null);
- Properties props = new Properties();
- props.setProperty(MCAST_PORT, "0");
+ assertThat(InternalLocator.hasLocator()).isTrue();
- props.setProperty(LOCATORS, "");
- props.setProperty(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel());
-
- InetAddress bindAddr = null;
- try {
- bindAddr = InetAddress.getByName(getServerHostName(vm.getHost()));
- } catch (UnknownHostException uhe) {
- Assert.fail("While resolving bind address ", uhe);
- }
-
- Locator locator = null;
- try {
- File logFile = new File(getTestMethodName() + "-locator" + port + ".log");
- locator = Locator.startLocatorAndDS(port, logFile, bindAddr, props, isPeer, true, null);
- } catch (IOException ex) {
- Assert.fail("While starting locator on port " + port, ex);
- }
-
- assertTrue(InternalLocator.hasLocator());
- return locator.getPort();
- }
+ return locator.getPort();
});
}
- /**
- * Creates a persistent region
- *
- * @param vm reference to VM
- */
- protected String stopLocator(VM vm) {
+ private void stopLocator(final VM locatorVM) {
+ locatorVM.invoke("stopLocator", () -> {
+ assertThat(InternalLocator.hasLocator()).isTrue();
+ InternalLocator.getLocator().stop();
+ });
+ }
- return (String) vm.invoke(new SerializableCallable("Stop Locator In VM") {
+ private void verifyLocalLocatorMXBean(final VM locatorVM, final int port, final boolean isPeer) {
+ locatorVM.invoke("verifyLocalLocatorMXBean", () -> {
+ //ManagementService service = this.managementTestRule.getExistingManagementService();
+ GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ ManagementService service = ManagementService.getExistingManagementService(cache);
+ assertThat(service).isNotNull();
- public Object call() throws Exception {
+ LocatorMXBean locatorMXBean = service.getLocalLocatorMXBean();
+ assertThat(locatorMXBean).isNotNull();
+ assertThat(locatorMXBean.getPort()).isEqualTo(port);
- assertTrue(InternalLocator.hasLocator());
- InternalLocator.getLocator().stop();
- return null;
- }
- });
- }
+ // LogWriterUtils.getLogWriter().info("Log of Locator" + bean.viewLog());
+ // LogWriterUtils.getLogWriter().info("BindAddress" + bean.getBindAddress());
- /**
- * Creates a persistent region
- *
- * @param vm reference to VM
- */
- protected void locatorMBeanExist(VM vm, final int locPort, final boolean isPeer) {
-
- vm.invoke(new SerializableCallable("Locator MBean created") {
-
- public Object call() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-
- ManagementService service = ManagementService.getExistingManagementService(cache);
- assertNotNull(service);
- LocatorMXBean bean = service.getLocalLocatorMXBean();
- assertNotNull(bean);
- assertEquals(locPort, bean.getPort());
- LogWriterUtils.getLogWriter().info("Log of Locator" + bean.viewLog());
- LogWriterUtils.getLogWriter().info("BindAddress" + bean.getBindAddress());
- assertEquals(isPeer, bean.isPeerLocator());
- return null;
- }
+ assertThat(locatorMXBean.isPeerLocator()).isEqualTo(isPeer);
});
}
- /**
- * Creates a persistent region
- *
- * @param vm reference to VM
- */
- protected void remoteLocatorMBeanExist(VM vm, final DistributedMember member) {
-
- vm.invoke(new SerializableCallable("Locator MBean created") {
-
- public Object call() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- ManagementService service = ManagementService.getExistingManagementService(cache);
- assertNotNull(service);
- LocatorMXBean bean = MBeanUtil.getLocatorMbeanProxy(member);
- assertNotNull(bean);
+ private void verifyRemoteLocatorMXBeanProxy(final VM managerVM, final DistributedMember locatorMember) {
+ managerVM.invoke("verifyRemoteLocatorMXBeanProxy", () -> {
+ //ManagementService service = this.managementTestRule.getExistingManagementService();
+ GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ ManagementService service = ManagementService.getExistingManagementService(cache);
+ assertThat(service).isNotNull();
- LogWriterUtils.getLogWriter().info("Log of Locator" + bean.viewLog());
- LogWriterUtils.getLogWriter().info("BindAddress" + bean.getBindAddress());
+ // LocatorMXBean locatorMXBean = MBeanUtil.getLocatorMbeanProxy(locatorMember); // TODO
+ LocatorMXBean locatorMXBean = awaitLockServiceMXBeanProxy(locatorMember);
+ assertThat(locatorMXBean).isNotNull();
- return null;
- }
+ // LogWriterUtils.getLogWriter().info("Log of Locator" + bean.viewLog());
+ // LogWriterUtils.getLogWriter().info("BindAddress" + bean.getBindAddress());
});
}
- /**
- * Creates a persistent region
- *
- * @param vm reference to VM
- */
- protected void listManagers(VM vm, final int locPort, final boolean isPeer) {
-
- vm.invoke(new SerializableCallable("List Managers") {
-
- public Object call() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ private void verifyListManagers(final VM locatorVM) {
+ locatorVM.invoke("verifyListManagers", () -> {
+ //ManagementService service = this.managementTestRule.getExistingManagementService();
+ GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ ManagementService service = ManagementService.getExistingManagementService(cache);
+ assertThat(service).isNotNull();
- ManagementService service = ManagementService.getExistingManagementService(cache);
- assertNotNull(service);
- final LocatorMXBean bean = service.getLocalLocatorMXBean();
- assertNotNull(bean);
+ LocatorMXBean locatorMXBean = service.getLocalLocatorMXBean();
+ assertThat(locatorMXBean).isNotNull();
- Wait.waitForCriterion(new WaitCriterion() {
+ await().until(() -> assertThat(locatorMXBean.listManagers()).hasSize(1));
+ });
+ }
- public String description() {
- return "Waiting for the managers List";
- }
+ private void verifyListPotentialManagers(final VM locatorVM) {
+ locatorVM.invoke("verifyListPotentialManagers", () -> {
+ //ManagementService service = this.managementTestRule.getExistingManagementService();
+ GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ ManagementService service = ManagementService.getExistingManagementService(cache);
+ assertThat(service).isNotNull();
- public boolean done() {
+ //LocatorMXBean locatorMXBean = service.getLocalLocatorMXBean();
+ LocatorMXBean locatorMXBean = awaitLockServiceMXBean();
+ assertThat(locatorMXBean).isNotNull();
- boolean done = bean.listManagers().length == 1;
- return done;
- }
+ await("listPotentialManagers has size 3").until(() -> assertThat(locatorMXBean.listPotentialManagers()).hasSize(3));
+ });
+ }
- }, MAX_WAIT, 500, true);
+ private ConditionFactory await() {
+ return Awaitility.await().atMost(MAX_WAIT_MILLIS, MILLISECONDS);
+ }
- return null;
- }
- });
+ private ConditionFactory await(final String alias) {
+ return Awaitility.await(alias).atMost(MAX_WAIT_MILLIS, MILLISECONDS);
}
/**
- * Creates a persistent region
- *
- * @param vm reference to VM
+ * Await and return a LocatorMXBean proxy for a specific member.
*/
- protected void listWillingManagers(VM vm, final int locPort, final boolean isPeer) {
-
- vm.invoke(new SerializableCallable("List Willing Managers") {
-
- public Object call() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-
- ManagementService service = ManagementService.getExistingManagementService(cache);
- assertNotNull(service);
- final LocatorMXBean bean = service.getLocalLocatorMXBean();
- assertNotNull(bean);
-
- Wait.waitForCriterion(new WaitCriterion() {
+ private LocatorMXBean awaitLockServiceMXBeanProxy(final DistributedMember member) {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ ObjectName locatorMBeanName = service.getLocatorMBeanName(member);
- public String description() {
- return "Waiting for the Willing managers List";
- }
+ await().until(() -> assertThat(service.getMBeanProxy(locatorMBeanName, LocatorMXBean.class)).isNotNull());
- public boolean done() {
+ return service.getMBeanProxy(locatorMBeanName, LocatorMXBean.class);
+ }
- boolean done = bean.listPotentialManagers().length == 3;
- return done;
- }
+ /**
+ * Await creation of local LocatorMXBean.
+ */
+ private LocatorMXBean awaitLockServiceMXBean() {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
- }, MAX_WAIT, 500, true);
+ await().until(() -> assertThat(service.getLocalLocatorMXBean()).isNotNull());
- return null;
- }
- });
+ return service.getLocalLocatorMXBean();
}
- /**
- * get the host name to use for a server cache in client/server dunit testing
- *
- * @param host
- * @return the host name
- */
public static String getServerHostName(Host host) {
- return System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "server-bind-address") != null
- ? System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "server-bind-address")
- : host.getHostName();
+ return System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "server-bind-address") != null ?
+ System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "server-bind-address") : host.getHostName();
}
-
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/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 85d42ee..6b86f45 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
@@ -17,15 +17,17 @@ package org.apache.geode.management;
import static org.apache.geode.distributed.ConfigurationProperties.*;
import static org.junit.Assert.*;
+import java.lang.management.ManagementFactory;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.Set;
-import javax.management.MBeanServer;
+
import javax.management.ObjectName;
-import org.apache.geode.LogWriter;
+import org.junit.Rule;
+
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.Region;
@@ -35,39 +37,32 @@ import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.DistributedSystem;
import org.apache.geode.distributed.internal.InternalDistributedSystem;
import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.statistics.SampleCollector;
import org.apache.geode.management.internal.FederatingManager;
import org.apache.geode.management.internal.LocalManager;
-import org.apache.geode.management.internal.MBeanJMXAdapter;
import org.apache.geode.management.internal.ManagementStrings;
import org.apache.geode.management.internal.SystemManagementService;
import org.apache.geode.test.dunit.Assert;
import org.apache.geode.test.dunit.AsyncInvocation;
import org.apache.geode.test.dunit.Host;
import org.apache.geode.test.dunit.Invoke;
+import org.apache.geode.test.dunit.LogWriterUtils;
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.dunit.cache.internal.JUnit4CacheTestCase;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
+import org.apache.geode.test.dunit.rules.DistributedRestoreSystemProperties;
@SuppressWarnings("serial")
-public abstract class ManagementTestBase extends JUnit4DistributedTestCase {
+public abstract class ManagementTestBase extends JUnit4CacheTestCase {
private static final int MAX_WAIT = 70 * 1000;
- /**
- * log writer instance
- */
- private static LogWriter logWriter;
-
- private static Properties props = new Properties();
-
- /**
- * Distributed System
- */
- protected static DistributedSystem ds;
+// protected static DistributedSystem ds;
+ protected static ManagementService managementService;
+// protected static Cache cache;
/**
* List containing all the Managed Node VM
@@ -79,23 +74,13 @@ public abstract class ManagementTestBase extends JUnit4DistributedTestCase {
*/
protected static VM managingNode;
- /**
- * Management Service
- */
- protected static ManagementService managementService;
-
protected static VM managedNode1;
protected static VM managedNode2;
protected static VM managedNode3;
protected static VM locatorVM;
- private static SampleCollector sampleCollector;
-
- protected static MBeanServer mbeanServer = MBeanJMXAdapter.mbeanServer;
-
- private static int mcastPort;
-
- protected static Cache cache;
+ @Rule
+ public DistributedRestoreSystemProperties restoreSystemProperties = new DistributedRestoreSystemProperties();
@Override
public final void postSetUp() throws Exception {
@@ -119,16 +104,14 @@ public abstract class ManagementTestBase extends JUnit4DistributedTestCase {
protected void postSetUpManagementTestBase() throws Exception {}
@Override
- public final void preTearDown() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
preTearDownManagementTestBase();
- closeAllCache();
- managementService = null;
-
- mcastPort = 0;
- disconnectAllFromDS();
- props.clear();
+ }
+ @Override
+ public final void postTearDownCacheTestCase() throws Exception {
+ managementService = null;
postTearDownManagementTestBase();
}
@@ -136,99 +119,49 @@ public abstract class ManagementTestBase extends JUnit4DistributedTestCase {
protected void postTearDownManagementTestBase() throws Exception {}
- public void closeAllCache() throws Exception {
- closeCache(managingNode);
- closeCache(managedNode1);
- closeCache(managedNode2);
- closeCache(managedNode3);
- cache = null;
- }
-
- /**
- * Enable system property gemfire.disableManagement false in each VM.
- */
- public void enableManagement() {
- Invoke.invokeInEveryVM(new SerializableRunnable("Enable Management") {
- public void run() {
- System.setProperty(InternalDistributedSystem.DISABLE_MANAGEMENT_PROPERTY, "false");
- }
- });
-
- }
-
- /**
- * Disable system property gemfire.disableManagement true in each VM.
- */
- public void disableManagement() {
- Invoke.invokeInEveryVM(new SerializableRunnable("Disable Management") {
- public void run() {
- System.setProperty(InternalDistributedSystem.DISABLE_MANAGEMENT_PROPERTY, "true");
- }
- });
-
- }
-
/**
* managingNodeFirst variable tests for two different test cases where Managing & Managed Node
* creation time lines are reversed.
*/
- public void initManagement(boolean managingNodeFirst) throws Exception {
-
+ protected void initManagement(final boolean managingNodeFirst) throws Exception {
if (managingNodeFirst) {
createManagementCache(managingNode);
startManagingNode(managingNode);
-
for (VM vm : managedNodeList) {
createCache(vm);
-
}
} else {
for (VM vm : managedNodeList) {
createCache(vm);
-
}
createManagementCache(managingNode);
startManagingNode(managingNode);
}
}
- public void createCache(VM vm1) throws Exception {
- vm1.invoke(new SerializableRunnable("Create Cache") {
- public void run() {
- createCache(false);
- }
+ protected void createCache(final VM vm1) throws Exception {
+ vm1.invoke("Create Cache", () -> {
+ createCache(false);
});
-
}
- public void createCache(VM vm1, final Properties props) throws Exception {
- vm1.invoke(new SerializableRunnable("Create Cache") {
- public void run() {
- createCache(props);
- }
+ protected void createCache(final VM vm1, final Properties props) throws Exception {
+ vm1.invoke("Create Cache", () -> {
+ createCache(props);
});
-
}
- public Cache createCache(Properties props) {
- System.setProperty("dunitLogPerTest", "true");
- props.setProperty(LOG_FILE, getTestMethodName() + "-.log");
- ds = getSystem(props);
- cache = CacheFactory.create(ds);
+ private Cache createCache(final Properties props) {
+ Cache cache = getCache(props);
managementService = ManagementService.getManagementService(cache);
- logWriter = ds.getLogWriter();
- assertNotNull(cache);
- assertNotNull(managementService);
- return cache;
- }
- public Cache getCache() {
return cache;
}
- public Cache createCache(boolean management) {
- System.setProperty("dunitLogPerTest", "true");
+ protected Cache createCache(final boolean management) {
+
+ Properties props = new Properties();
if (management) {
props.setProperty(JMX_MANAGER, "true");
props.setProperty(JMX_MANAGER_START, "false");
@@ -238,68 +171,46 @@ public abstract class ManagementTestBase extends JUnit4DistributedTestCase {
props.setProperty(ENABLE_TIME_STATISTICS, "true");
props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
props.setProperty(LOG_FILE, getTestMethodName() + "-.log");
- ds = getSystem(props);
- cache = CacheFactory.create(ds);
+
+ Cache cache = getCache(props);
managementService = ManagementService.getManagementService(cache);
- logWriter = ds.getLogWriter();
- assertNotNull(cache);
- assertNotNull(managementService);
+
return cache;
}
- public void createManagementCache(VM vm1) throws Exception {
- vm1.invoke(new SerializableRunnable("Create Management Cache") {
- public void run() {
- createCache(true);
- }
+ protected void createManagementCache(final VM vm1) throws Exception {
+ vm1.invoke("Create Management Cache", () -> {
+ createCache(true);
});
}
- public void closeCache(VM vm1) throws Exception {
- vm1.invoke(new SerializableRunnable("Close Cache") {
- public void run() {
- GemFireCacheImpl existingInstance = GemFireCacheImpl.getInstance();
- if (existingInstance != null) {
- existingInstance.close();
- }
- InternalDistributedSystem ds = InternalDistributedSystem.getConnectedInstance();
- if (ds != null) {
- ds.disconnect();
- }
+ protected void closeCache(final VM vm1) throws Exception {
+ vm1.invoke("Close Cache", () -> {
+ GemFireCacheImpl existingInstance = GemFireCacheImpl.getInstance();
+ if (existingInstance != null) {
+ existingInstance.close();
+ }
+ InternalDistributedSystem ds = InternalDistributedSystem.getConnectedInstance();
+ if (ds != null) {
+ ds.disconnect();
}
});
-
- }
-
- public void closeCache() throws Exception {
- GemFireCacheImpl existingInstance = GemFireCacheImpl.getInstance();
- if (existingInstance != null) {
- existingInstance.close();
- }
- InternalDistributedSystem ds = InternalDistributedSystem.getConnectedInstance();
- if (ds != null) {
- ds.disconnect();
- }
}
- public String getMemberId(final VM vm) {
- SerializableCallable getMember = new SerializableCallable("getMemberId") {
- public Object call() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- return cache.getDistributedSystem().getDistributedMember().getId();
- }
- };
- return (String) vm.invoke(getMember);
+ protected String getMemberId(final VM vm) {
+ return vm.invoke("getMemberId", () -> {
+ GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ return cache.getDistributedSystem().getDistributedMember().getId();
+ });
}
protected static void waitForProxy(final ObjectName objectName, final Class interfaceClass) {
-
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;
if (service.getMBeanProxy(objectName, interfaceClass) != null) {
@@ -308,205 +219,54 @@ public abstract class ManagementTestBase extends JUnit4DistributedTestCase {
return false;
}
}
-
}, MAX_WAIT, 500, true);
}
- protected void runManagementTaskAdhoc() {
- SystemManagementService service = (SystemManagementService) managementService;
- service.getLocalManager().runManagementTaskAdhoc();
- }
-
/**
* Marks a VM as Managing
- *
- * @throws Exception
*/
- public void startManagingNode(VM vm1) throws Exception {
- vm1.invoke(new SerializableRunnable("Start Being Managing Node") {
- public void run() {
- startBeingManagingNode();
- }
- });
-
- }
-
- public void startBeingManagingNode() {
- Cache existingCache = GemFireCacheImpl.getInstance();
- if (existingCache != null && !existingCache.isClosed()) {
+ protected void startManagingNode(final VM vm1) {
+ vm1.invoke("Start Being Managing Node", () -> {
+ Cache existingCache = GemFireCacheImpl.getInstance();
+ // if (existingCache != null && !existingCache.isClosed()) {
managementService = ManagementService.getManagementService(existingCache);
SystemManagementService service = (SystemManagementService) managementService;
service.createManager();
service.startManager();
- }
- }
-
- /**
- * Marks a VM as Managing
- *
- * @throws Exception
- */
- public void startManagingNodeAsync(VM vm1) throws Exception {
- vm1.invokeAsync(new SerializableRunnable("Start Being Managing Node") {
-
- public void run() {
- Cache existingCache = GemFireCacheImpl.getInstance();
- if (existingCache != null && !existingCache.isClosed()) {
- managementService = ManagementService.getManagementService(existingCache);
- managementService.startManager();
- }
-
- }
+ // }
});
-
}
/**
* Stops a VM as a Managing node
- *
- * @throws Exception
- */
- public void stopManagingNode(VM vm1) throws Exception {
- vm1.invoke(new SerializableRunnable("Stop Being Managing Node") {
- public void run() {
- Cache existingCache = GemFireCacheImpl.getInstance();
- if (existingCache != null && !existingCache.isClosed()) {
- if (managementService.isManager()) {
- managementService.stopManager();
- }
-
- }
-
- }
- });
-
- }
-
- /**
- * Check various resources clean up Once a VM stops being managable it should remove all the
- * artifacts of management namely a) Notification region b) Monitoring Region c) Management task
- * should stop
- */
- public void checkManagedNodeCleanup(VM vm) throws Exception {
- vm.invoke(new SerializableRunnable("Managing Node Clean up") {
-
- public void run() {
- Cache existingCache = GemFireCacheImpl.getInstance();
- if (existingCache != null) {
- // Cache is closed
- assertEquals(true, existingCache.isClosed());
- // ManagementService should throw exception
- LocalManager localManager =
- ((SystemManagementService) managementService).getLocalManager();
- // Check Monitoring region destroyed
- Region monitoringRegion =
- localManager.getManagementResourceRepo().getLocalMonitoringRegion();
- assertEquals(null, monitoringRegion);
- // check Notification region is destroyed
- Region notifRegion =
- localManager.getManagementResourceRepo().getLocalNotificationRegion();
- assertEquals(null, notifRegion);
- // check ManagementTask is stopped
- assertEquals(true, localManager.getFederationSheduler().isShutdown());
-
- }
-
- }
- });
-
- }
-
- /**
- * Check various resources clean up Once a VM stops being Managing.It should remove all the
- * artifacts of management namely a) proxies b) Monitoring Region c) Management task should stop
*/
-
- public void checkProxyCleanup(VM vm) throws Exception {
-
- vm.invoke(new SerializableRunnable("Managing Node Clean up") {
-
- public void run() {
-
- try {
- GemFireCacheImpl existingCache = GemFireCacheImpl.getInstance();
- if (existingCache == null) {
- return;
- }
-
- assertEquals(false, existingCache.isClosed());
- // ManagementService should not be closed
-
- Set<DistributedMember> otherMemberSet =
- existingCache.getDistributionManager().getOtherDistributionManagerIds();
-
- Iterator<DistributedMember> it = otherMemberSet.iterator();
- FederatingManager federatingManager =
- ((SystemManagementService) managementService).getFederatingManager();
-
- // check Proxy factory. There should not be any proxies left
- DistributedMember member;
- while (it.hasNext()) {
- member = it.next();
-
- assertNull(federatingManager.getProxyFactory().findAllProxies(member));
- }
-
- } catch (ManagementException e) {
- Assert.fail("failed with ManagementException", e);
+ protected void stopManagingNode(final VM vm1) {
+ vm1.invoke("Stop Being Managing Node", () -> {
+ Cache existingCache = GemFireCacheImpl.getInstance();
+ if (existingCache != null && !existingCache.isClosed()) {
+ if (managementService.isManager()) {
+ managementService.stopManager();
}
}
});
-
- }
-
- /**
- * All the expected exceptions are checked here
- *
- * @param e
- * @return is failed
- */
- public boolean checkManagementExceptions(ManagementException e) {
-
- if (e.getMessage().equals(ManagementStrings.Management_Service_CLOSED_CACHE)
- || e.getMessage().equals(
- ManagementStrings.Management_Service_MANAGEMENT_SERVICE_IS_CLOSED.toLocalizedString())
- || e.getMessage()
- .equals(ManagementStrings.Management_Service_MANAGEMENT_SERVICE_NOT_STARTED_YET
- .toLocalizedString())
- || e.getMessage().equals(
- ManagementStrings.Management_Service_NOT_A_GEMFIRE_DOMAIN_MBEAN.toLocalizedString())
- || e.getMessage().equals(
- ManagementStrings.Management_Service_NOT_A_MANAGING_NODE_YET.toLocalizedString())
- || e.getMessage()
- .equals(ManagementStrings.Management_Service_OPERATION_NOT_ALLOWED_FOR_CLIENT_CACHE
- .toLocalizedString())
- || e.getMessage()
- .equals(ManagementStrings.Management_Service_PROXY_NOT_AVAILABLE.toLocalizedString())) {
-
- return false;
- }
- return true;
}
- public static List<VM> getManagedNodeList() {
+ protected static List<VM> getManagedNodeList() {
return managedNodeList;
}
- public static VM getManagingNode() {
+ protected static VM getManagingNode() {
return managingNode;
}
- public static ManagementService getManagementService() {
+ protected static ManagementService getManagementService() {
return managementService;
}
/**
* Creates a Distributed region
- *
- * @param vm reference to VM
- * @param regionName name of the distributed region
*/
- protected void createDistributedRegion(VM vm, final String regionName) throws Exception {
+ protected void createDistributedRegion(final VM vm, final String regionName) throws InterruptedException {
AsyncInvocation future = createDistributedRegionAsync(vm, regionName);
future.join(MAX_WAIT);
if (future.isAlive()) {
@@ -519,169 +279,99 @@ public abstract class ManagementTestBase extends JUnit4DistributedTestCase {
/**
* Creates a Local region
- *
- * @param vm reference to VM
- * @param localRegionName name of the local region
*/
- protected void createLocalRegion(VM vm, final String localRegionName) throws Exception {
- SerializableRunnable createLocalRegion = new SerializableRunnable("Create Local region") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- SystemManagementService service = (SystemManagementService) getManagementService();
- RegionFactory rf = cache.createRegionFactory(RegionShortcut.LOCAL);
-
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("Creating Local Region");
- rf.create(localRegionName);
-
- }
- };
- vm.invoke(createLocalRegion);
+ protected void createLocalRegion(final VM vm, final String localRegionName) throws Exception {
+ vm.invoke("Create Local region", () -> {
+ GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ SystemManagementService service = (SystemManagementService) getManagementService();
+ RegionFactory rf = cache.createRegionFactory(RegionShortcut.LOCAL);
+
+ LogWriterUtils.getLogWriter().info("Creating Local Region");
+ rf.create(localRegionName);
+ });
}
/**
* Creates a Sub region
- *
- * @param vm reference to VM
- */
- protected void createSubRegion(VM vm, final String parentRegionPath, final String subregionName)
- throws Exception {
- SerializableRunnable createSubRegion = new SerializableRunnable("Create Sub region") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- SystemManagementService service = (SystemManagementService) getManagementService();
- Region region = cache.getRegion(parentRegionPath);
-
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("Creating Sub Region");
- region.createSubregion(subregionName, region.getAttributes());
-
- }
- };
- vm.invoke(createSubRegion);
- }
-
- /**
- * Puts in distributed region
- *
- * @param vm
*/
- protected void putInDistributedRegion(final VM vm, final String key, final String value,
- final String regionPath) {
- SerializableRunnable put = new SerializableRunnable("Put In Distributed Region") {
- public void run() {
-
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Region region = cache.getRegion(regionPath);
- region.put(key, value);
-
- }
- };
- vm.invoke(put);
+ 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();
+ Region region = cache.getRegion(parentRegionPath);
+
+ LogWriterUtils.getLogWriter().info("Creating Sub Region");
+ region.createSubregion(subregionName, region.getAttributes());
+ });
}
/**
* Creates a Distributed Region
- *
- * @param vm
*/
- protected AsyncInvocation createDistributedRegionAsync(final VM vm, final String regionName) {
- SerializableRunnable createRegion = new SerializableRunnable("Create Distributed region") {
- public void run() {
-
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- SystemManagementService service = (SystemManagementService) getManagementService();
-
- RegionFactory rf = cache.createRegionFactory(RegionShortcut.REPLICATE);
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("Creating Dist Region");
- rf.create(regionName);
-
- }
- };
- return vm.invokeAsync(createRegion);
+ private AsyncInvocation createDistributedRegionAsync(final VM vm, final String regionName) {
+ return vm.invokeAsync("Create Distributed region", () -> {
+ GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ SystemManagementService service = (SystemManagementService) getManagementService();
+
+ RegionFactory rf = cache.createRegionFactory(RegionShortcut.REPLICATE);
+ LogWriterUtils.getLogWriter().info("Creating Dist Region");
+ rf.create(regionName);
+ });
}
/**
* Creates a partition Region
- *
- * @param vm
*/
protected void createPartitionRegion(final VM vm, final String partitionRegionName) {
- SerializableRunnable createParRegion = new SerializableRunnable("Create Partitioned region") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- SystemManagementService service = (SystemManagementService) getManagementService();
- RegionFactory rf = cache.createRegionFactory(RegionShortcut.PARTITION_REDUNDANT);
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("Creating Par Region");
- rf.create(partitionRegionName);
-
- }
- };
- vm.invoke(createParRegion);
- }
-
- /**
- * closes a Distributed Region
- *
- * @param vm
- */
- protected void closeRegion(final VM vm, final String regionPath) {
- SerializableRunnable closeRegion = new SerializableRunnable("Close Distributed region") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("Closing Dist Region");
- Region region = cache.getRegion(regionPath);
- region.close();
-
- }
- };
- vm.invoke(closeRegion);
+ vm.invoke("Create Partitioned region", () -> {
+ GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ SystemManagementService service = (SystemManagementService) getManagementService();
+ RegionFactory rf = cache.createRegionFactory(RegionShortcut.PARTITION_REDUNDANT);
+ LogWriterUtils.getLogWriter().info("Creating Par Region");
+ rf.create(partitionRegionName);
+ });
}
- public void waitForAllMembers(final int expectedCount) {
+ protected void waitForAllMembers(final int expectedCount) {
ManagementService service = getManagementService();
final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
assertNotNull(service.getDistributedSystemMXBean());
Wait.waitForCriterion(new WaitCriterion() {
+ @Override
public String description() {
return "Waiting All members to intimate DistributedSystemMBean";
}
-
+ @Override
public boolean done() {
if (bean.listMemberObjectNames() != null) {
-
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
- .info("Member Length " + bean.listMemberObjectNames().length);
-
+ LogWriterUtils.getLogWriter().info("Member Length " + bean.listMemberObjectNames().length);
}
-
if (bean.listMemberObjectNames().length >= expectedCount) {
return true;
} else {
return false;
}
-
}
-
}, MAX_WAIT, 500, true);
assertNotNull(bean.getManagerObjectName());
}
- public static void waitForRefresh(final int expectedRefreshCount, final ObjectName objectName) {
+ protected static void waitForRefresh(final int expectedRefreshCount, final ObjectName objectName) {
final ManagementService service = getManagementService();
- final long currentTime = System.currentTimeMillis();
-
Wait.waitForCriterion(new WaitCriterion() {
- int actualRefreshCount = 0;
- long lastRefreshTime = service.getLastUpdateTime(objectName);
+ private int actualRefreshCount = 0;
+ private long lastRefreshTime = service.getLastUpdateTime(objectName);
+ @Override
public String description() {
return "Waiting For Proxy Refresh Count = " + expectedRefreshCount;
}
+ @Override
public boolean done() {
long newRefreshTime = service.getLastUpdateTime(objectName);
if (newRefreshTime > lastRefreshTime) {
@@ -694,12 +384,10 @@ public abstract class ManagementTestBase extends JUnit4DistributedTestCase {
}
return false;
}
-
}, MAX_WAIT, 500, true);
-
}
- public DistributedMember getMember(final VM vm) {
+ protected DistributedMember getMember(final VM vm) {
SerializableCallable getMember = new SerializableCallable("Get Member") {
public Object call() {
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
@@ -709,4 +397,13 @@ public abstract class ManagementTestBase extends JUnit4DistributedTestCase {
};
return (DistributedMember) vm.invoke(getMember);
}
+
+ protected boolean mbeanExists(final ObjectName objectName) {
+ return ManagementFactory.getPlatformMBeanServer().isRegistered(objectName);
+ }
+
+ protected <T> T getMBeanProxy(final ObjectName objectName, Class<T> interfaceClass) {
+ SystemManagementService service = (SystemManagementService)ManagementService.getManagementService(getCache());
+ return service.getMBeanProxy(objectName, interfaceClass);
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/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
new file mode 100644
index 0000000..630c95e
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/management/ManagementTestRule.java
@@ -0,0 +1,430 @@
+/*
+ * 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.apache.geode.distributed.ConfigurationProperties.*;
+import static org.apache.geode.test.dunit.Host.*;
+import static org.assertj.core.api.Assertions.*;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.rules.MethodRule;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.Statement;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.DistributedSystemDisconnectedException;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.management.internal.SystemManagementService;
+import org.apache.geode.test.dunit.Invoke;
+import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
+import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
+import org.apache.geode.test.dunit.standalone.DUnitLauncher;
+
+/**
+ * Overriding MethodRule is only way to get {@code Object target}
+ */
+@SuppressWarnings("unused")
+public class ManagementTestRule implements MethodRule, Serializable {
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ private final int managersCount;
+ private final int membersCount;
+ private final boolean start;
+ private final boolean managersFirst;
+ private final boolean createManagers;
+ private final boolean createMembers;
+
+ private JUnit4CacheTestCase helper;
+
+ private VM[] managers;
+ private VM[] members;
+
+ protected ManagementTestRule(final Builder builder) {
+ this.helper = new JUnit4CacheTestCase() {
+ };
+ this.managersCount = builder.managersCount;
+ this.membersCount = builder.membersCount;
+ this.start = builder.start;
+ this.managersFirst = builder.managersFirst;
+ this.createManagers = builder.createManagers;
+ this.createMembers = builder.createMembers;
+ }
+
+ public DistributedMember getDistributedMember() {
+ return getCache().getDistributedSystem().getDistributedMember();
+ }
+
+ public DistributedMember getDistributedMember(final VM vm) {
+ return vm.invoke("getDistributedMember", () -> getDistributedMember());
+ }
+
+ public void createManagers() {
+ for (VM manager : this.managers) {
+ manager.invoke(() -> createManager(true));
+ }
+ }
+
+ public void createMembers() {
+ for (VM member : this.members) {
+ member.invoke(() -> createMember());
+ }
+ }
+
+ public void createManager() {
+ createManager(true);
+ }
+
+ public void createManager(final Properties properties) {
+ createManager(properties, true);
+ }
+
+ public void createManager(final boolean start) {
+ createManager(new Properties(), start);
+ }
+
+ public void createManager(final Properties properties, final boolean start) {
+ setPropertyIfNotSet(properties, JMX_MANAGER, "true");
+ setPropertyIfNotSet(properties, JMX_MANAGER_START, "false");
+ setPropertyIfNotSet(properties, JMX_MANAGER_PORT, "0");
+ setPropertyIfNotSet(properties, HTTP_SERVICE_PORT, "0");
+ setPropertyIfNotSet(properties, ENABLE_TIME_STATISTICS, "true");
+ setPropertyIfNotSet(properties, STATISTIC_SAMPLING_ENABLED, "true");
+
+ this.helper.getCache(properties);
+
+ if (start) {
+ startManager();
+ }
+ }
+
+ public void createManager(final VM managerVM) {
+ managerVM.invoke("createManager", () -> createManager());
+ }
+
+ public void createManager(final VM managerVM, final boolean start) {
+ managerVM.invoke("createManager", () -> createManager(start));
+ }
+
+ public void createManager(final VM managerVM, final Properties properties) {
+ managerVM.invoke("createManager", () -> createManager(properties, true));
+ }
+
+ public void createManager(final VM managerVM, final Properties properties, final boolean start) {
+ managerVM.invoke("createManager", () -> createManager(properties, start));
+ }
+
+ public void createMember() {
+ createMember(new Properties());
+ }
+
+ public void createMember(final Properties properties) {
+ setPropertyIfNotSet(properties, JMX_MANAGER, "false");
+ setPropertyIfNotSet(properties, ENABLE_TIME_STATISTICS, "true");
+ setPropertyIfNotSet(properties, STATISTIC_SAMPLING_ENABLED, "true");
+
+ System.out.println("KIRK: creating " + properties.getProperty(NAME));
+ this.helper.getCache(properties);
+ }
+
+ public void createMember(final VM memberVM) {
+ Properties properties = new Properties();
+ properties.setProperty(NAME, "memberVM-" + memberVM.getPid());
+ memberVM.invoke("createMember", () -> createMember(properties));
+ }
+
+ public void createMember(final VM memberVM, final Properties properties) throws Exception {
+ memberVM.invoke("createMember", () -> createMember(properties));
+ }
+
+ public Cache getCache() {
+// Cache cache = GemFireCacheImpl.getInstance();
+// if (cache != null && !cache.isClosed()) {
+// return cache;
+// }
+ return this.helper.getCache();
+ }
+
+ public boolean hasCache() {
+// Cache cache = GemFireCacheImpl.getInstance();
+// if (cache != null && !cache.isClosed()) {
+// return true;
+// }
+ return this.helper.hasCache();
+ }
+
+ public Cache basicGetCache() {
+// Cache cache = GemFireCacheImpl.getInstance();
+// if (cache != null && !cache.isClosed()) {
+// return cache;
+// }
+ return this.helper.basicGetCache();
+ }
+
+ public ManagementService getManagementService() {
+ assertThat(hasCache()).isTrue();
+ return ManagementService.getManagementService(basicGetCache());
+ }
+
+ public SystemManagementService getSystemManagementService() {
+ assertThat(hasCache()).isTrue();
+ return (SystemManagementService) ManagementService.getManagementService(basicGetCache());
+ }
+
+ public ManagementService getExistingManagementService() {
+ assertThat(hasCache()).isTrue();
+ return ManagementService.getExistingManagementService(basicGetCache());
+ }
+
+ public void startManager() {
+ SystemManagementService service = getSystemManagementService();
+ service.createManager();
+ service.startManager();
+ }
+
+ public void startManager(final VM managerVM) {
+ managerVM.invoke("startManager", () -> startManager());
+ }
+
+ public void stopManager() {
+ if (getManagementService().isManager()) {
+ getManagementService().stopManager();
+ }
+ }
+
+ public void stopManager(final VM managerVM) {
+ managerVM.invoke("stopManager", () -> stopManager());
+ }
+
+ public Set<DistributedMember> getOtherNormalMembers() {
+ Set<DistributedMember> allMembers = new HashSet<>(getAllNormalMembers());
+ allMembers.remove(getDistributedMember());
+ return allMembers;
+ }
+
+ public Set<DistributedMember> getAllNormalMembers() {
+ return getDistributionManager().getNormalDistributionManagerIds(); // excludes LOCATOR_DM_TYPE
+ }
+
+ private DM getDistributionManager() {
+ return ((GemFireCacheImpl)getCache()).getDistributionManager();
+ }
+
+ public void disconnectAllFromDS() {
+ stopManagerQuietly();
+ Invoke.invokeInEveryVM("stopManager", () -> stopManagerQuietly());
+ JUnit4DistributedTestCase.disconnectFromDS();
+ Invoke.invokeInEveryVM("disconnectFromDS", () -> JUnit4DistributedTestCase.disconnectFromDS());
+ }
+
+ private void setPropertyIfNotSet(final Properties properties, final String key, final String value) {
+ if (!properties.containsKey(key)) {
+ properties.setProperty(key, value);
+ }
+ }
+
+ private void stopManagerQuietly() {
+ try {
+ if (hasCache() && !basicGetCache().isClosed()) {
+ stopManager();
+ }
+ } catch (DistributedSystemDisconnectedException | NullPointerException ignore) {
+ }
+ }
+
+ @Override
+ public Statement apply(final Statement base, final FrameworkMethod method, final Object target) {
+ return new Statement() {
+ @Override
+ public void evaluate() throws Throwable {
+ setUp(target);
+ try {
+ base.evaluate();
+ } finally {
+ tearDown();
+ }
+ }
+ };
+ }
+
+ private void setUp(final Object target) throws Exception {
+ DUnitLauncher.launchIfNeeded();
+ JUnit4DistributedTestCase.disconnectAllFromDS();
+
+ int whichVM = 0;
+
+ this.managers = new VM[this.managersCount];
+ for (int i = 0; i < this.managersCount; i++) {
+ this.managers[i] = getHost(0).getVM(whichVM);
+ whichVM++;
+ }
+
+ this.members = new VM[this.membersCount];
+ for (int i = 0; i < this.membersCount; i++) {
+ this.members[i] = getHost(0).getVM(whichVM);
+ whichVM++;
+ }
+
+ if (this.start) {
+ start();
+ }
+
+ processAnnotations(target);
+ }
+
+ private void start() {
+ if (this.createManagers && this.managersFirst) {
+ createManagers();
+ }
+ if (this.createMembers) {
+ createMembers();
+ }
+ if (this.createManagers && !this.managersFirst) {
+ createManagers();
+ }
+ }
+
+ private void tearDown() throws Exception {
+ JUnit4DistributedTestCase.disconnectAllFromDS();
+ }
+
+ private void processAnnotations(final Object target) {
+ try {
+ Class<?> clazz = target.getClass();
+
+ Field[] fields = clazz.getDeclaredFields();
+ for (Field field : fields) {
+ boolean alreadyAssigned = false;
+ for (Annotation annotation : field.getAnnotations()) {
+ if (annotation.annotationType().equals(Manager.class)) {
+ // annotated with @Manager
+ throwIfAlreadyAssigned(field, alreadyAssigned);
+ assignManagerField(target, field);
+ alreadyAssigned = true;
+ }
+ if (annotation.annotationType().equals(Member.class)) {
+ // annotated with @Manager
+ throwIfAlreadyAssigned(field, alreadyAssigned);
+ assignMemberField(target, field);
+ alreadyAssigned = true;
+ }
+ }
+ }
+ } catch (IllegalAccessException e) {
+ throw new Error(e);
+ }
+ }
+
+ private void throwIfAlreadyAssigned(final Field field, final boolean alreadyAssigned) {
+ if (alreadyAssigned) {
+ throw new IllegalStateException("Field " + field.getName() + " is already annotated with " + field.getAnnotations());
+ }
+ }
+
+ private void assignManagerField(final Object target, final Field field) throws IllegalAccessException {
+ throwIfNotSameType(field, VM.class);
+
+ field.setAccessible(true);
+ if (field.getType().isArray()) {
+ field.set(target, this.managers);
+ } else {
+ field.set(target, this.managers[0]);
+ }
+ }
+
+ private void assignMemberField(final Object target, final Field field) throws IllegalAccessException {
+ throwIfNotSameType(field, VM.class);
+
+ field.setAccessible(true);
+ if (field.getType().isArray()) {
+ field.set(target, this.members);
+ } else {
+ field.set(target, this.members[0]);
+ }
+ }
+
+ private void throwIfNotSameType(final Field field, final Class clazz) {
+ if (!field.getType().equals(clazz) && // non-array
+ !field.getType().getComponentType().equals(clazz)) { // array
+ throw new IllegalArgumentException("Field " + field.getName() + " is not same type as " + clazz.getName());
+ }
+ }
+
+ public static class Builder {
+
+ private boolean start = false;
+
+ private boolean createManagers = true;
+
+ private boolean createMembers = true;
+
+ private int managersCount = 1;
+
+ private int membersCount = 3;
+
+ private boolean managersFirst = true;
+
+ protected Builder() {
+ }
+
+ public Builder createManagers(final boolean value) {
+ this.createManagers = value;
+ return this;
+ }
+
+ public Builder createMembers(final boolean value) {
+ this.createMembers = value;
+ return this;
+ }
+
+ public Builder withManagers(final int count) {
+ this.managersCount = count;
+ return this;
+ }
+
+ public Builder withMembers(final int count) {
+ this.membersCount = count;
+ return this;
+ }
+
+ public Builder managersFirst(final boolean value) {
+ this.managersFirst = value;
+ return this;
+ }
+
+ public Builder start(final boolean value) {
+ this.start = value;
+ return this;
+ }
+
+ public ManagementTestRule build() {
+ return new ManagementTestRule(this);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/Manager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/Manager.java b/geode-core/src/test/java/org/apache/geode/management/Manager.java
new file mode 100644
index 0000000..0de158e
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/management/Manager.java
@@ -0,0 +1,31 @@
+/*
+ * 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 java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Target(FIELD)
+@Retention(RUNTIME)
+@Documented
+public @interface Manager {
+ String name() default "";
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/Member.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/Member.java b/geode-core/src/test/java/org/apache/geode/management/Member.java
new file mode 100644
index 0000000..e90d278
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/management/Member.java
@@ -0,0 +1,31 @@
+/*
+ * 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 java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Target(FIELD)
+@Retention(RUNTIME)
+@Documented
+public @interface Member {
+ String name() default "";
+}
[36/50] [abbrv] incubator-geode git commit: GEODE-1617: add test for
region names
Posted by kl...@apache.org.
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 Duling <kd...@pivotal.io>
Authored: Tue Nov 15 09:33:59 2016 -0800
Committer: Kirk Lund <kl...@apache.org>
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 0000000..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) {
+ }
+ }
+
+ @Test
+ public void testInternalRegionNames() {
+ InternalRegionArguments ira = new InternalRegionArguments();
+ ira.setInternalRegion(true);
+ LocalRegion.validateRegionName("__ValidInternalRegionName", ira);
+ }
+
+ private void validateCharacters(InternalRegionArguments ira) {
+ for (int x = 0; x < Character.MAX_VALUE; x++) {
+ String name = (char) x + REGION_NAME;
+ Matcher matcher = NAME_PATTERN.matcher(name);
+ if (matcher.matches()) {
+ LocalRegion.validateRegionName(name, ira);
+ } else {
+ try {
+ LocalRegion.validateRegionName(name, ira);
+ fail("Should have received an IllegalArgumentException for character: " + (char) x + "["
+ + x + "]");
+ } catch (IllegalArgumentException ignore) {
+ }
+ }
+ }
+ }
+}
[41/50] [abbrv] incubator-geode git commit: Fix formatting
Posted by kl...@apache.org.
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 Lund <kl...@apache.org>
Authored: Mon Nov 7 12:33:04 2016 -0800
Committer: Kirk Lund <kl...@apache.org>
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&q=SELECT%20*%20FROM%20/People";
- private static final String findPeopleByGenderQuery = "/queries?id=filterByGender&q=SELECT%20*%20from%20/People%20where%20gender=$1";
- private static final String findPeopleByLastNameQuery = "/queries?id=filterByLastName&q=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\": \"Raj\","
- + " \"birthDate\": \"12/04/1982\"," + "\"gender\": \"FEMALE\""
- + "},"
- + "\"@new\" :"
- + "{"
- + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\","
- + "\"id\": 1101," + " \"firstName\": \"Virat\","
- + " \"middleName\": \"Premkumar\"," + " \"lastName\": \"Kohli\","
- + " \"birthDate\": \"08/11/1988\"," + "\"gender\": \"MALE\""
- + "}"
- + "}";
-
- final static String PERSON_AS_JSON_REPLACE = "{"
- + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\","
- + "\"id\": 501," + " \"firstName\": \"Barack\","
- + " \"middleName\": \"Hussein\"," + " \"lastName\": \"Obama\","
- + " \"birthDate\": \"04/08/1961\"," + "\"gender\": \"MALE\""
- + "}";
+ private static final String findAllPeopleQuery =
+ "/queries?id=findAllPeople&q=SELECT%20*%20FROM%20/People";
+ private static final String findPeopleByGenderQuery =
+ "/queries?id=filterByGender&q=SELECT%20*%20from%20/People%20where%20gender=$1";
+ private static final String findPeopleByLastNameQuery =
+ "/queries?id=filterByLastName&q=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\": \"Raj\","
+ + " \"birthDate\": \"12/04/1982\"," + "\"gender\": \"FEMALE\"" + "}," + "\"@new\" :" + "{"
+ + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\"," + "\"id\": 1101,"
+ + " \"firstName\": \"Virat\"," + " \"middleName\": \"Premkumar\","
+ + " \"lastName\": \"Kohli\"," + " \"birthDate\": \"08/11/1988\"," + "\"gender\": \"MALE\""
+ + "}" + "}";
+
+ final static String PERSON_AS_JSON_REPLACE =
+ "{" + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\"," + "\"id\": 501,"
+ + " \"firstName\": \"Barack\"," + " \"middleName\": \"Hussein\","
+ + " \"lastName\": \"Obama\"," + " \"birthDate\": \"04/08/1961\"," + "\"gender\": \"MALE\""
+ + "}";
private static final String PERSON_LIST_AS_JSON = "[" + "{"
+ "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\"," + "\"id\": 3,"
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/main/java/org/apache/geode/management/OSMetrics.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/OSMetrics.java b/geode-core/src/main/java/org/apache/geode/management/OSMetrics.java
index e6f27a7..c9de92f 100644
--- a/geode-core/src/main/java/org/apache/geode/management/OSMetrics.java
+++ b/geode-core/src/main/java/org/apache/geode/management/OSMetrics.java
@@ -25,7 +25,7 @@ import java.io.Serializable;
*
*/
public class OSMetrics implements Serializable {
-
+
/**
* Maximum number file descriptor which can be opened
*/
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java b/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
index 0d243c7..fe0f59f 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
@@ -350,7 +350,8 @@ public final class SystemManagementService extends BaseManagementService {
}
- public <T> T getMBeanProxy(ObjectName objectName, Class<T> interfaceClass) { // TODO: this is too generic
+ public <T> T getMBeanProxy(ObjectName objectName, Class<T> interfaceClass) { // TODO: this is too
+ // generic
if (!isStartedAndOpen()) {
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java
index f04a01d..690449d 100755
--- a/geode-core/src/test/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java
@@ -97,15 +97,15 @@ public class DistributedLockServiceDUnitTest extends JUnit4DistributedTestCase {
@Override
public final void preTearDown() throws Exception {
Invoke.invokeInEveryVM(() -> destroyAllDLockServices());
-// invokeInEveryVMAndController(DistributedLockServiceDUnitTest.class,
-// "remoteDumpAllDLockServices");
-
- //InternalDistributedLockService.destroyAll();
-
-// // Disconnects the DistributedSystem in every VM - since
-// // each test randomly chooses whether shared memory is used
-// disconnectAllFromDS();
-
+ // invokeInEveryVMAndController(DistributedLockServiceDUnitTest.class,
+ // "remoteDumpAllDLockServices");
+
+ // InternalDistributedLockService.destroyAll();
+
+ // // Disconnects the DistributedSystem in every VM - since
+ // // each test randomly chooses whether shared memory is used
+ // disconnectAllFromDS();
+
this.lockGrantor = null;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java
index 2213700..5213ebc 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java
@@ -40,19 +40,19 @@ public class ConnectDisconnectDUnitTest extends JUnit4CacheTestCase {
// see bugs #50785 and #46438
@Test
public void testManyConnectsAndDisconnects() throws Throwable {
-// invokeInEveryVMAndController(new SerializableRunnable() {
-//
-// @Override
-// public void run() {
-// Log.setLogWriterLevel("info");
-// }
-// });
-
-// uncomment these lines to use stand-alone locators
-// int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(4);
-// setLocatorPorts(ports);
-
- for(int i = 0; i < 20; i++) {
+ // invokeInEveryVMAndController(new SerializableRunnable() {
+ //
+ // @Override
+ // public void run() {
+ // Log.setLogWriterLevel("info");
+ // }
+ // });
+
+ // uncomment these lines to use stand-alone locators
+ // int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(4);
+ // setLocatorPorts(ports);
+
+ for (int i = 0; i < 20; i++) {
LogWriterUtils.getLogWriter().info("Test run: " + i);
runOnce();
tearDown();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
index 0cb6693..82498df 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
@@ -443,10 +443,10 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest
}
});
-// invokeInEveryVMAndController(new SerializableRunnable("") {
-//
-// }
-
+ // invokeInEveryVMAndController(new SerializableRunnable("") {
+ //
+ // }
+
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java
index 82c7628..aca1dc3 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java
@@ -88,12 +88,11 @@ public class TXLockServiceDUnitTest extends JUnit4DistributedTestCase {
@Override
public final void preTearDown() throws Exception {
-// invokeInEveryVMAndController(TXLockServiceDUnitTest.class,
-// "remoteDumpAllDLockServices");
-
- Invoke.invokeInEveryVM(TXLockServiceDUnitTest.class,
- "destroyServices");
-
+ // invokeInEveryVMAndController(TXLockServiceDUnitTest.class,
+ // "remoteDumpAllDLockServices");
+
+ Invoke.invokeInEveryVM(TXLockServiceDUnitTest.class, "destroyServices");
+
destroyServices();
// // Disconnects the DistributedSystem in every VM - since
@@ -113,9 +112,10 @@ public class TXLockServiceDUnitTest extends JUnit4DistributedTestCase {
@Test
public void testGetAndDestroy() {
forEachVMInvoke("checkGetAndDestroy", new Object[] {});
- /*invokeInEveryVMAndController(TXLockServiceDUnitTest.class,
- "destroyServices");
- forEachVMInvoke("checkGetAndDestroy", new Object[] {});*/
+ /*
+ * invokeInEveryVMAndController(TXLockServiceDUnitTest.class, "destroyServices");
+ * forEachVMInvoke("checkGetAndDestroy", new Object[] {});
+ */
}
@Test
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/CacheManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/CacheManagementDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/CacheManagementDUnitTest.java
index a40bfd1..62d0b9b 100644
--- a/geode-core/src/test/java/org/apache/geode/management/CacheManagementDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/CacheManagementDUnitTest.java
@@ -64,14 +64,16 @@ import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
* This class checks and verifies various data and operations exposed through MemberMXBean
* interface.
* <p>
- * <p>Goal of the Test : MemberMBean gets created once cache is created. Data like
- * config data and stats are of proper value To check proper federation of
- * MemberMBean including remote ops and remote data access
* <p>
- * <p>This test is a mess and needs to be rewritten.
+ * Goal of the Test : MemberMBean gets created once cache is created. Data like config data and
+ * stats are of proper value To check proper federation of MemberMBean including remote ops and
+ * remote data access
+ * <p>
+ * <p>
+ * This test is a mess and needs to be rewritten.
*/
@Category(DistributedTest.class)
-@SuppressWarnings({ "serial", "unused" })
+@SuppressWarnings({"serial", "unused"})
public class CacheManagementDUnitTest implements Serializable {
/** used in memberVMs */
@@ -107,7 +109,8 @@ public class CacheManagementDUnitTest implements Serializable {
Map<DistributedMember, DistributionConfig> configMap = new HashMap<>();
for (VM memberVM : this.memberVMs) {
- Map<DistributedMember, DistributionConfig> configMapMember = memberVM.invoke(() -> verifyConfigData());
+ Map<DistributedMember, DistributionConfig> configMapMember =
+ memberVM.invoke(() -> verifyConfigData());
configMap.putAll(configMapMember);
}
@@ -122,7 +125,8 @@ public class CacheManagementDUnitTest implements Serializable {
int i = 1;
for (VM memberVM : this.memberVMs) {
Properties props = new Properties();
- props.setProperty(LOG_FILE, this.temporaryFolder.newFile(this.testName.getMethodName() + "-VM" + i + ".log").getAbsolutePath());
+ props.setProperty(LOG_FILE, this.temporaryFolder
+ .newFile(this.testName.getMethodName() + "-VM" + i + ".log").getAbsolutePath());
this.managementTestRule.createMember(memberVM, props);
i++;
}
@@ -160,8 +164,7 @@ public class CacheManagementDUnitTest implements Serializable {
}
/**
- * Creates and starts a managerVM.
- * Multiple Managers
+ * Creates and starts a managerVM. Multiple Managers
*/
@Test
public void testManager() throws Exception {
@@ -184,8 +187,7 @@ public class CacheManagementDUnitTest implements Serializable {
}
/**
- * Creates and starts a managerVM.
- * Multiple Managers
+ * Creates and starts a managerVM. Multiple Managers
*/
@Test
public void testManagerShutdown() throws Exception {
@@ -196,7 +198,8 @@ public class CacheManagementDUnitTest implements Serializable {
this.managementTestRule.createManager(this.managerVM, false);
this.managementTestRule.startManager(this.managerVM);
- verifyManagerStarted(this.managerVM, this.managementTestRule.getDistributedMember(this.memberVMs[0]));
+ verifyManagerStarted(this.managerVM,
+ this.managementTestRule.getDistributedMember(this.memberVMs[0]));
this.managementTestRule.stopManager(this.managerVM);
verifyManagerStopped(this.managerVM, this.memberVMs.length);
@@ -265,7 +268,8 @@ public class CacheManagementDUnitTest implements Serializable {
attachListenerToDistributedSystemMXBean(this.managerVM);
// Step : 3 : Verify Notification count, notification region sizes
- verifyNotificationsAndRegionSize(this.memberVMs[0], this.memberVMs[1], this.memberVMs[2], this.managerVM);
+ verifyNotificationsAndRegionSize(this.memberVMs[0], this.memberVMs[1], this.memberVMs[2],
+ this.managerVM);
}
@Test
@@ -283,7 +287,8 @@ public class CacheManagementDUnitTest implements Serializable {
this.managementTestRule.createMember(this.memberVMs[2]);
// Step : 3 : Verify Notification count, notification region sizes
- verifyNotificationsAndRegionSize(this.memberVMs[0], this.memberVMs[1], this.memberVMs[2], this.managerVM);
+ verifyNotificationsAndRegionSize(this.memberVMs[0], this.memberVMs[1], this.memberVMs[2],
+ this.managerVM);
}
@Test
@@ -318,7 +323,8 @@ public class CacheManagementDUnitTest implements Serializable {
assertThat(objectNames.contains(memberMBeanName)).isTrue();
}
- Set<ObjectName> names = service.queryMBeanNames(this.managementTestRule.getDistributedMember());
+ Set<ObjectName> names =
+ service.queryMBeanNames(this.managementTestRule.getDistributedMember());
ObjectName[] arrayOfNames = names.toArray(new ObjectName[names.size()]);
assertThat(superSet).doesNotContain(arrayOfNames); // TODO: what value does this method have?
@@ -357,10 +363,11 @@ public class CacheManagementDUnitTest implements Serializable {
ObjectName memberMBeanName = service.getMemberMBeanName(otherMember);
- await().until(() -> assertThat(service.getMBeanProxy(memberMBeanName, MemberMXBean.class)).isNotNull());
+ await().until(
+ () -> assertThat(service.getMBeanProxy(memberMBeanName, MemberMXBean.class)).isNotNull());
MemberMXBean memberMXBean = service.getMBeanProxy(memberMBeanName, MemberMXBean.class);
- //Ensure Data getting federated from Managing node
+ // Ensure Data getting federated from Managing node
long start = memberMXBean.getMemberUpTime();
await().until(() -> assertThat(memberMXBean.getMemberUpTime()).isGreaterThan(start));
});
@@ -382,7 +389,8 @@ public class CacheManagementDUnitTest implements Serializable {
assertThat(otherMembers).hasSize(otherMembersCount);
for (DistributedMember member : otherMembers) {
- Set<ObjectName> proxyNames = service.getFederatingManager().getProxyFactory().findAllProxies(member);
+ Set<ObjectName> proxyNames =
+ service.getFederatingManager().getProxyFactory().findAllProxies(member);
assertThat(proxyNames).isEmpty();
ObjectName proxyMBeanName = service.getMemberMBeanName(member);
@@ -393,7 +401,8 @@ public class CacheManagementDUnitTest implements Serializable {
private Map<DistributedMember, DistributionConfig> verifyConfigData() {
ManagementService service = this.managementTestRule.getManagementService();
- InternalDistributedSystem ids = (InternalDistributedSystem) this.managementTestRule.getCache().getDistributedSystem();
+ InternalDistributedSystem ids =
+ (InternalDistributedSystem) this.managementTestRule.getCache().getDistributedSystem();
DistributionConfig config = ids.getConfig();
MemberMXBean bean = service.getMemberMXBean();
@@ -409,7 +418,8 @@ public class CacheManagementDUnitTest implements Serializable {
* This is to check whether the config data has been propagated to the Managing node properly or
* not.
*/
- private void verifyConfigDataRemote(final Map<DistributedMember, DistributionConfig> configMap) throws Exception {
+ private void verifyConfigDataRemote(final Map<DistributedMember, DistributionConfig> configMap)
+ throws Exception {
Set<DistributedMember> otherMembers = this.managementTestRule.getOtherNormalMembers();
for (DistributedMember member : otherMembers) {
@@ -424,7 +434,8 @@ public class CacheManagementDUnitTest implements Serializable {
/**
* Asserts that distribution config and gemfireProperty composite types hold the same values
*/
- private void verifyGemFirePropertiesData(final DistributionConfig config, final GemFireProperties data) {
+ private void verifyGemFirePropertiesData(final DistributionConfig config,
+ final GemFireProperties data) {
assertThat(data.getMemberName()).isEqualTo(config.getName());
// **TODO **
@@ -434,19 +445,23 @@ public class CacheManagementDUnitTest implements Serializable {
assertThat(data.getMcastAddress()).isEqualTo(config.getMcastAddress().getHostAddress());
assertThat(data.getBindAddress()).isEqualTo(config.getBindAddress());
assertThat(data.getTcpPort()).isEqualTo(config.getTcpPort());
- assertThat(removeVMDir(data.getCacheXMLFile())).isEqualTo(removeVMDir(config.getCacheXmlFile().getAbsolutePath()));
+ assertThat(removeVMDir(data.getCacheXMLFile()))
+ .isEqualTo(removeVMDir(config.getCacheXmlFile().getAbsolutePath()));
// **TODO **
assertThat(data.getMcastTTL()).isEqualTo(config.getMcastTtl());
assertThat(data.getServerBindAddress()).isEqualTo(config.getServerBindAddress());
assertThat(data.getLocators()).isEqualTo(config.getLocators());
- //The start locator may contain a directory
- assertThat(removeVMDir(data.getStartLocator())).isEqualTo(removeVMDir(config.getStartLocator()));
- assertThat(removeVMDir(data.getLogFile())).isEqualTo(removeVMDir(config.getLogFile().getAbsolutePath()));
+ // The start locator may contain a directory
+ assertThat(removeVMDir(data.getStartLocator()))
+ .isEqualTo(removeVMDir(config.getStartLocator()));
+ assertThat(removeVMDir(data.getLogFile()))
+ .isEqualTo(removeVMDir(config.getLogFile().getAbsolutePath()));
assertThat(data.getLogLevel()).isEqualTo(config.getLogLevel());
assertThat(data.isStatisticSamplingEnabled()).isEqualTo(config.getStatisticSamplingEnabled());
- assertThat(removeVMDir(data.getStatisticArchiveFile())).isEqualTo(removeVMDir(config.getStatisticArchiveFile().getAbsolutePath()));
+ assertThat(removeVMDir(data.getStatisticArchiveFile()))
+ .isEqualTo(removeVMDir(config.getStatisticArchiveFile().getAbsolutePath()));
// ** TODO **
String includeFile = null;
@@ -460,20 +475,25 @@ public class CacheManagementDUnitTest implements Serializable {
assertThat(data.getClusterSSLCiphers()).isEqualTo(config.getClusterSSLCiphers());
assertThat(data.getClusterSSLProtocols()).isEqualTo(config.getClusterSSLProtocols());
- assertThat(data.isClusterSSLRequireAuthentication()).isEqualTo(config.getClusterSSLRequireAuthentication());
+ assertThat(data.isClusterSSLRequireAuthentication())
+ .isEqualTo(config.getClusterSSLRequireAuthentication());
assertThat(data.getSocketLeaseTime()).isEqualTo(config.getSocketLeaseTime());
assertThat(data.getSocketBufferSize()).isEqualTo(config.getSocketBufferSize());
assertThat(data.getMcastSendBufferSize()).isEqualTo(config.getMcastSendBufferSize());
assertThat(data.getMcastRecvBufferSize()).isEqualTo(config.getMcastRecvBufferSize());
- assertThat(data.getMcastByteAllowance()).isEqualTo(config.getMcastFlowControl().getByteAllowance());
- assertThat(data.getMcastRechargeThreshold()).isEqualTo(config.getMcastFlowControl().getRechargeThreshold());
- assertThat(data.getMcastRechargeBlockMs()).isEqualTo(config.getMcastFlowControl().getRechargeBlockMs());
+ assertThat(data.getMcastByteAllowance())
+ .isEqualTo(config.getMcastFlowControl().getByteAllowance());
+ assertThat(data.getMcastRechargeThreshold())
+ .isEqualTo(config.getMcastFlowControl().getRechargeThreshold());
+ assertThat(data.getMcastRechargeBlockMs())
+ .isEqualTo(config.getMcastFlowControl().getRechargeBlockMs());
assertThat(data.getUdpFragmentSize()).isEqualTo(config.getUdpFragmentSize());
assertThat(data.getUdpSendBufferSize()).isEqualTo(config.getUdpSendBufferSize());
assertThat(data.getUdpRecvBufferSize()).isEqualTo(config.getUdpRecvBufferSize());
assertThat(data.isDisableTcp()).isEqualTo(config.getDisableTcp());
assertThat(data.isEnableTimeStatistics()).isEqualTo(config.getEnableTimeStatistics());
- assertThat(data.isEnableNetworkPartitionDetection()).isEqualTo(config.getEnableNetworkPartitionDetection());
+ assertThat(data.isEnableNetworkPartitionDetection())
+ .isEqualTo(config.getEnableNetworkPartitionDetection());
assertThat(data.getMemberTimeout()).isEqualTo(config.getMemberTimeout());
assertThat(data.getMembershipPortRange()).containsExactly(config.getMembershipPortRange());
@@ -488,15 +508,19 @@ public class CacheManagementDUnitTest implements Serializable {
assertThat(data.getDurableClientId()).isEqualTo(config.getDurableClientId());
assertThat(data.getDurableClientTimeout()).isEqualTo(config.getDurableClientTimeout());
assertThat(data.getSecurityClientAuthInit()).isEqualTo(config.getSecurityClientAuthInit());
- assertThat(data.getSecurityClientAuthenticator()).isEqualTo(config.getSecurityClientAuthenticator());
+ assertThat(data.getSecurityClientAuthenticator())
+ .isEqualTo(config.getSecurityClientAuthenticator());
assertThat(data.getSecurityClientDHAlgo()).isEqualTo(config.getSecurityClientDHAlgo());
assertThat(data.getSecurityPeerAuthInit()).isEqualTo(config.getSecurityPeerAuthInit());
- assertThat(data.getSecurityClientAuthenticator()).isEqualTo(config.getSecurityPeerAuthenticator());
+ assertThat(data.getSecurityClientAuthenticator())
+ .isEqualTo(config.getSecurityPeerAuthenticator());
assertThat(data.getSecurityClientAccessor()).isEqualTo(config.getSecurityClientAccessor());
assertThat(data.getSecurityClientAccessorPP()).isEqualTo(config.getSecurityClientAccessorPP());
assertThat(data.getSecurityLogLevel()).isEqualTo(config.getSecurityLogLevel());
- assertThat(removeVMDir(data.getSecurityLogFile())).isEqualTo(removeVMDir(config.getSecurityLogFile().getAbsolutePath()));
- assertThat(data.getSecurityPeerMembershipTimeout()).isEqualTo(config.getSecurityPeerMembershipTimeout());
+ assertThat(removeVMDir(data.getSecurityLogFile()))
+ .isEqualTo(removeVMDir(config.getSecurityLogFile().getAbsolutePath()));
+ assertThat(data.getSecurityPeerMembershipTimeout())
+ .isEqualTo(config.getSecurityPeerMembershipTimeout());
assertThat(data.isRemoveUnresponsiveClient()).isEqualTo(config.getRemoveUnresponsiveClient());
assertThat(data.isDeltaPropagation()).isEqualTo(config.getDeltaPropagation());
assertThat(data.getRedundancyZone()).isEqualTo(config.getRedundancyZone());
@@ -557,8 +581,10 @@ public class CacheManagementDUnitTest implements Serializable {
}
private void verifyExpectedMembers(final int otherMembersCount) {
- String alias = "awaiting " + this.managementTestRule.getOtherNormalMembers() + " to have size " + otherMembersCount;
- await(alias).until(() -> assertThat(this.managementTestRule.getOtherNormalMembers()).hasSize(otherMembersCount));
+ String alias = "awaiting " + this.managementTestRule.getOtherNormalMembers() + " to have size "
+ + otherMembersCount;
+ await(alias).until(() -> assertThat(this.managementTestRule.getOtherNormalMembers())
+ .hasSize(otherMembersCount));
}
private void invokeRemoteMemberMXBeanOps() throws Exception {
@@ -574,9 +600,9 @@ public class CacheManagementDUnitTest implements Serializable {
// TODO: need assertions
- //("<ExpectedString> JVMMetrics is " + metrics.toString() + "</ExpectedString> ");
- //("<ExpectedString> OSMetrics is " + metrics.toString() + "</ExpectedString> ");
- //("<ExpectedString> Boolean Data Check " + bean.isManager() + "</ExpectedString> ");
+ // ("<ExpectedString> JVMMetrics is " + metrics.toString() + "</ExpectedString> ");
+ // ("<ExpectedString> OSMetrics is " + metrics.toString() + "</ExpectedString> ");
+ // ("<ExpectedString> Boolean Data Check " + bean.isManager() + "</ExpectedString> ");
}
}
@@ -591,11 +617,13 @@ public class CacheManagementDUnitTest implements Serializable {
}
};
- ManagementFactory.getPlatformMBeanServer().addNotificationListener(MBeanJMXAdapter.getDistributedSystemName(), listener, null, null);
+ ManagementFactory.getPlatformMBeanServer().addNotificationListener(
+ MBeanJMXAdapter.getDistributedSystemName(), listener, null, null);
});
}
- private void verifyNotificationsAndRegionSize(final VM memberVM1, final VM memberVM2, final VM memberVM3, final VM managerVM) {
+ private void verifyNotificationsAndRegionSize(final VM memberVM1, final VM memberVM2,
+ final VM memberVM3, final VM managerVM) {
DistributedMember member1 = this.managementTestRule.getDistributedMember(memberVM1);
DistributedMember member2 = this.managementTestRule.getDistributedMember(memberVM2);
DistributedMember member3 = this.managementTestRule.getDistributedMember(memberVM3);
@@ -628,15 +656,18 @@ public class CacheManagementDUnitTest implements Serializable {
private void createNotificationRegion(final String memberId) {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
- Map<ObjectName, NotificationHubListener> notificationHubListenerMap = service.getNotificationHub().getListenerObjectMap();
+ Map<ObjectName, NotificationHubListener> notificationHubListenerMap =
+ service.getNotificationHub().getListenerObjectMap();
await().until(() -> assertThat(notificationHubListenerMap.size()).isEqualTo(1));
- RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE);
+ RegionFactory regionFactory =
+ this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE);
for (int i = 1; i <= 15; i++) {
regionFactory.create(NOTIFICATION_REGION_NAME + i);
}
- Region region = this.managementTestRule.getCache().getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + memberId);
+ Region region = this.managementTestRule.getCache()
+ .getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + memberId);
assertThat(region).isEmpty();
}
@@ -646,7 +677,8 @@ public class CacheManagementDUnitTest implements Serializable {
ObjectName objectName = service.getMemberMBeanName(member);
String alias = "awaiting MemberMXBean proxy for " + member;
- await(alias).until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
+ await(alias)
+ .until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
return service.getMBeanProxy(objectName, MemberMXBean.class);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/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 d6c0f0a..cebfddc 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
@@ -58,7 +58,7 @@ import org.apache.geode.test.junit.categories.DistributedTest;
* Client health stats check
*/
@Category(DistributedTest.class)
-@SuppressWarnings({ "serial", "unused" })
+@SuppressWarnings({"serial", "unused"})
public class ClientHealthStatsDUnitTest implements Serializable {
private static final int NUMBER_PUTS = 100;
@@ -68,7 +68,8 @@ public class ClientHealthStatsDUnitTest implements Serializable {
private static final String VALUE1 = "VALUE1";
private static final String VALUE2 = "VALUE2";
- private static final String REGION_NAME = ClientHealthStatsDUnitTest.class.getSimpleName() + "_Region";
+ private static final String REGION_NAME =
+ ClientHealthStatsDUnitTest.class.getSimpleName() + "_Region";
// client1VM and client2VM VM fields
private static ClientCache clientCache;
@@ -174,19 +175,28 @@ public class ClientHealthStatsDUnitTest implements Serializable {
public void testStatsMatchWithSize() throws Exception {
int port = this.serverVM.invoke(() -> createServerCache()); // start a serverVM
- this.client1VM.invoke(() -> createClientCache(this.hostName, port, 1, true)); // create durable client1VM, with durable RI
+ this.client1VM.invoke(() -> createClientCache(this.hostName, port, 1, true)); // create durable
+ // client1VM, with
+ // durable RI
- this.serverVM.invoke(() -> doPuts()); // do puts on serverVM from three different threads, pause after 500 puts each.
+ this.serverVM.invoke(() -> doPuts()); // do puts on serverVM from three different threads, pause
+ // after 500 puts each.
this.client1VM.invoke(() -> clientCache.close(true)); // close durable client1VM
- this.serverVM.invoke(() -> await().atMost(2, MINUTES).until(() -> cacheClientProxyHasBeenPause()));
+ this.serverVM
+ .invoke(() -> await().atMost(2, MINUTES).until(() -> cacheClientProxyHasBeenPause()));
this.serverVM.invoke(() -> resumePuts()); // resume puts on serverVM, add another 100.
- this.client1VM.invoke(() -> createClientCache(this.hostName, port, 1, true)); // start durable client1VM
+ this.client1VM.invoke(() -> createClientCache(this.hostName, port, 1, true)); // start durable
+ // client1VM
- this.client1VM.invoke(() -> await().atMost(1, MINUTES).until(() -> lastKeyReceived)); // wait for full queue dispatch
+ this.client1VM.invoke(() -> await().atMost(1, MINUTES).until(() -> lastKeyReceived)); // wait
+ // for
+ // full
+ // queue
+ // dispatch
this.serverVM.invoke(() -> verifyStats(port)); // verify the stats
}
@@ -196,11 +206,12 @@ public class ClientHealthStatsDUnitTest implements Serializable {
*/
private boolean cacheClientProxyHasBeenPause() {
CacheClientNotifier clientNotifier = CacheClientNotifier.getInstance(); // TODO
- //CacheClientNotifier clientNotifier = ((CacheServerImpl)this.managementTestRule.getCache().getCacheServers().get(0)).getAcceptor().getCacheClientNotifier();
+ // CacheClientNotifier clientNotifier =
+ // ((CacheServerImpl)this.managementTestRule.getCache().getCacheServers().get(0)).getAcceptor().getCacheClientNotifier();
Collection<CacheClientProxy> clientProxies = clientNotifier.getClientProxies();
- for (CacheClientProxy clientProxy: clientProxies) {
+ for (CacheClientProxy clientProxy : clientProxies) {
if (clientProxy.isPaused()) {
return true;
}
@@ -214,7 +225,8 @@ public class ClientHealthStatsDUnitTest implements Serializable {
private int createServerCache() throws Exception {
Cache cache = this.managementTestRule.getCache();
- RegionFactory<String, String> regionFactory = cache.createRegionFactory(RegionShortcut.REPLICATE);
+ RegionFactory<String, String> regionFactory =
+ cache.createRegionFactory(RegionShortcut.REPLICATE);
regionFactory.setConcurrencyChecksEnabled(false);
regionFactory.create(REGION_NAME);
@@ -227,10 +239,8 @@ public class ClientHealthStatsDUnitTest implements Serializable {
/**
* Invoked in client1VM and client2VM
*/
- private void createClientCache(final String hostName,
- final Integer port,
- final int clientNum,
- final boolean subscriptionEnabled) throws Exception {
+ private void createClientCache(final String hostName, final Integer port, final int clientNum,
+ final boolean subscriptionEnabled) throws Exception {
Properties props = new Properties();
props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
@@ -247,7 +257,8 @@ public class ClientHealthStatsDUnitTest implements Serializable {
cacheFactory.addPoolServer(hostName, port);
clientCache = cacheFactory.create();
- ClientRegionFactory<String, String> regionFactory = clientCache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY);
+ ClientRegionFactory<String, String> regionFactory =
+ clientCache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY);
regionFactory.setConcurrencyChecksEnabled(false);
regionFactory.addCacheListener(new CacheListenerAdapter<String, String>() {
@@ -325,7 +336,8 @@ public class ClientHealthStatsDUnitTest implements Serializable {
/**
* Invoked in managerVM
*/
- private void verifyClientStats(final DistributedMember serverMember, final int serverPort, final int numSubscriptions) throws Exception {
+ private void verifyClientStats(final DistributedMember serverMember, final int serverPort,
+ final int numSubscriptions) throws Exception {
ManagementService service = this.managementTestRule.getManagementService();
CacheServerMXBean cacheServerMXBean = awaitCacheServerMXBean(serverMember, serverPort);
@@ -350,7 +362,7 @@ public class ClientHealthStatsDUnitTest implements Serializable {
* Invoked in client1VM and client2VM
*/
private void put() throws Exception {
- Cache cache = (Cache)clientCache;
+ Cache cache = (Cache) clientCache;
Region<String, String> region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
region.put(KEY1, VALUE1);
@@ -382,14 +394,16 @@ public class ClientHealthStatsDUnitTest implements Serializable {
assertThat(clientProxy.getQueueSizeStat()).isEqualTo(clientProxy.getQueueSize());
ClientQueueDetail queueDetails = serverBean.showClientQueueDetails()[0];
- assertThat(clientProxy.getQueueSizeStat()).isEqualTo((int)queueDetails.getQueueSize());
+ assertThat(clientProxy.getQueueSizeStat()).isEqualTo((int) queueDetails.getQueueSize());
}
- private CacheServerMXBean awaitCacheServerMXBean(final DistributedMember serverMember, final int port) {
+ private CacheServerMXBean awaitCacheServerMXBean(final DistributedMember serverMember,
+ final int port) {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
ObjectName objectName = service.getCacheServerMBeanName(port, serverMember);
- await().until(() -> assertThat(service.getMBeanProxy(objectName, CacheServerMXBean.class)).isNotNull());
+ await().until(
+ () -> assertThat(service.getMBeanProxy(objectName, CacheServerMXBean.class)).isNotNull());
return service.getMBeanProxy(objectName, CacheServerMXBean.class);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/CompositeTypeTestDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/CompositeTypeTestDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/CompositeTypeTestDUnitTest.java
index 3176bda..cdb55a9 100644
--- a/geode-core/src/test/java/org/apache/geode/management/CompositeTypeTestDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/CompositeTypeTestDUnitTest.java
@@ -33,7 +33,7 @@ import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.junit.categories.DistributedTest;
@Category(DistributedTest.class)
-@SuppressWarnings({ "serial", "unused" })
+@SuppressWarnings({"serial", "unused"})
public class CompositeTypeTestDUnitTest implements Serializable {
@Manager
@@ -46,7 +46,7 @@ public class CompositeTypeTestDUnitTest implements Serializable {
public ManagementTestRule managementTestRule = ManagementTestRule.builder().start(true).build();
@Test
- public void testCompositeTypeGetters() throws Exception{
+ public void testCompositeTypeGetters() throws Exception {
registerMBeanWithCompositeTypeGetters(this.memberVM);
String memberName = MBeanJMXAdapter.makeCompliantName(getMemberId(this.memberVM));
@@ -65,14 +65,17 @@ public class CompositeTypeTestDUnitTest implements Serializable {
});
}
- private void verifyMBeanWithCompositeTypeGetters(final VM managerVM, final String memberId) throws Exception {
+ private void verifyMBeanWithCompositeTypeGetters(final VM managerVM, final String memberId)
+ throws Exception {
managerVM.invoke("verifyMBeanWithCompositeTypeGetters", () -> {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
- ObjectName objectName = new ObjectName("GemFire:service=custom,type=composite,member=" + memberId);
+ ObjectName objectName =
+ new ObjectName("GemFire:service=custom,type=composite,member=" + memberId);
await().until(() -> service.getMBeanInstance(objectName, CompositeTestMXBean.class) != null);
- CompositeTestMXBean compositeTestMXBean = service.getMBeanInstance(objectName, CompositeTestMXBean.class);
+ CompositeTestMXBean compositeTestMXBean =
+ service.getMBeanInstance(objectName, CompositeTestMXBean.class);
assertThat(compositeTestMXBean).isNotNull();
CompositeStats listCompositeStatsData = compositeTestMXBean.listCompositeStats();
@@ -90,7 +93,8 @@ public class CompositeTypeTestDUnitTest implements Serializable {
}
private String getMemberId(final VM memberVM) {
- return memberVM.invoke("getMemberId", () -> this.managementTestRule.getDistributedMember().getId());
+ return memberVM.invoke("getMemberId",
+ () -> this.managementTestRule.getDistributedMember().getId());
}
private ConditionFactory await() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/DLockManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/DLockManagementDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/DLockManagementDUnitTest.java
index 9c8e5c9..cc8e611 100644
--- a/geode-core/src/test/java/org/apache/geode/management/DLockManagementDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/DLockManagementDUnitTest.java
@@ -40,12 +40,13 @@ import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.junit.categories.DistributedTest;
@Category(DistributedTest.class)
-@SuppressWarnings({ "serial", "unused" })
+@SuppressWarnings({"serial", "unused"})
public class DLockManagementDUnitTest implements Serializable {
private static final int MAX_WAIT_MILLIS = 120 * 1000; // 2 MINUTES
- private static final String LOCK_SERVICE_NAME = DLockManagementDUnitTest.class.getSimpleName() + "_testLockService";
+ private static final String LOCK_SERVICE_NAME =
+ DLockManagementDUnitTest.class.getSimpleName() + "_testLockService";
@Manager
private VM managerVM;
@@ -54,7 +55,8 @@ public class DLockManagementDUnitTest implements Serializable {
private VM[] memberVMs;
@Rule
- public ManagementTestRule managementTestRule = ManagementTestRule.builder().managersFirst(false).start(true).build();
+ public ManagementTestRule managementTestRule =
+ ManagementTestRule.builder().managersFirst(false).start(true).build();
@Test
public void testLockServiceMXBean() throws Throwable {
@@ -103,7 +105,8 @@ public class DLockManagementDUnitTest implements Serializable {
for (final DistributedMember member : otherMembers) {
ObjectName objectName = service.getRegionMBeanName(member, LOCK_SERVICE_NAME);
- await().until(() -> assertThat(service.getMBeanProxy(objectName, LockServiceMXBean.class)).isNull());
+ await().until(
+ () -> assertThat(service.getMBeanProxy(objectName, LockServiceMXBean.class)).isNull());
}
});
}
@@ -112,7 +115,8 @@ public class DLockManagementDUnitTest implements Serializable {
memberVM.invoke("createLockServiceGrantor", () -> {
assertThat(DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME)).isNull();
- DLockService lockService = (DLockService) DistributedLockService.create(LOCK_SERVICE_NAME, this.managementTestRule.getCache().getDistributedSystem());
+ DLockService lockService = (DLockService) DistributedLockService.create(LOCK_SERVICE_NAME,
+ this.managementTestRule.getCache().getDistributedSystem());
DistributedMember grantor = lockService.getLockGrantorId().getLockGrantorMember();
assertThat(grantor).isNotNull();
@@ -122,7 +126,8 @@ public class DLockManagementDUnitTest implements Serializable {
assertThat(lockServiceMXBean.isDistributed()).isTrue();
assertThat(lockServiceMXBean.getName()).isEqualTo(LOCK_SERVICE_NAME);
assertThat(lockServiceMXBean.isLockGrantor()).isTrue();
- assertThat(lockServiceMXBean.fetchGrantorMember()).isEqualTo(this.managementTestRule.getDistributedMember().getId());
+ assertThat(lockServiceMXBean.fetchGrantorMember())
+ .isEqualTo(this.managementTestRule.getDistributedMember().getId());
});
}
@@ -130,7 +135,8 @@ public class DLockManagementDUnitTest implements Serializable {
anyVM.invoke("createLockService", () -> {
assertThat(DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME)).isNull();
- DistributedLockService.create(LOCK_SERVICE_NAME, this.managementTestRule.getCache().getDistributedSystem());
+ DistributedLockService.create(LOCK_SERVICE_NAME,
+ this.managementTestRule.getCache().getDistributedSystem());
LockServiceMXBean lockServiceMXBean = awaitLockServiceMXBean(LOCK_SERVICE_NAME);
@@ -155,7 +161,8 @@ public class DLockManagementDUnitTest implements Serializable {
private void verifyLockServiceMXBeanInMember(final VM memberVM) {
memberVM.invoke("verifyLockServiceMXBeanInManager", () -> {
- DistributedLockService lockService = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
+ DistributedLockService lockService =
+ DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
lockService.lock("lockObject_" + identifyPid(), MAX_WAIT_MILLIS, -1);
ManagementService service = this.managementTestRule.getManagementService();
@@ -178,7 +185,8 @@ public class DLockManagementDUnitTest implements Serializable {
Set<DistributedMember> otherMembers = this.managementTestRule.getOtherNormalMembers();
for (DistributedMember member : otherMembers) {
- LockServiceMXBean lockServiceMXBean = awaitLockServiceMXBeanProxy(member, LOCK_SERVICE_NAME);
+ LockServiceMXBean lockServiceMXBean =
+ awaitLockServiceMXBeanProxy(member, LOCK_SERVICE_NAME);
assertThat(lockServiceMXBean).isNotNull();
String[] listHeldLock = lockServiceMXBean.listHeldLocks();
@@ -195,11 +203,16 @@ public class DLockManagementDUnitTest implements Serializable {
ManagementService service = this.managementTestRule.getManagementService();
DistributedSystemMXBean distributedSystemMXBean = awaitDistributedSystemMXBean();
- ObjectName distributedLockServiceMXBeanName = MBeanJMXAdapter.getDistributedLockServiceName(LOCK_SERVICE_NAME);
- assertThat(distributedSystemMXBean.fetchDistributedLockServiceObjectName(LOCK_SERVICE_NAME)).isEqualTo(distributedLockServiceMXBeanName);
-
- ObjectName lockServiceMXBeanName = MBeanJMXAdapter.getLockServiceMBeanName(member.getId(), LOCK_SERVICE_NAME);
- assertThat(distributedSystemMXBean.fetchLockServiceObjectName(member.getId(), LOCK_SERVICE_NAME)).isEqualTo(lockServiceMXBeanName);
+ ObjectName distributedLockServiceMXBeanName =
+ MBeanJMXAdapter.getDistributedLockServiceName(LOCK_SERVICE_NAME);
+ assertThat(distributedSystemMXBean.fetchDistributedLockServiceObjectName(LOCK_SERVICE_NAME))
+ .isEqualTo(distributedLockServiceMXBeanName);
+
+ ObjectName lockServiceMXBeanName =
+ MBeanJMXAdapter.getLockServiceMBeanName(member.getId(), LOCK_SERVICE_NAME);
+ assertThat(
+ distributedSystemMXBean.fetchLockServiceObjectName(member.getId(), LOCK_SERVICE_NAME))
+ .isEqualTo(lockServiceMXBeanName);
});
}
@@ -211,11 +224,13 @@ public class DLockManagementDUnitTest implements Serializable {
ManagementService service = this.managementTestRule.getManagementService();
if (memberCount == 0) {
- await().until(() -> assertThat(service.getDistributedLockServiceMXBean(LOCK_SERVICE_NAME)).isNull());
+ await().until(
+ () -> assertThat(service.getDistributedLockServiceMXBean(LOCK_SERVICE_NAME)).isNull());
return;
}
- DistributedLockServiceMXBean distributedLockServiceMXBean = awaitDistributedLockServiceMXBean(LOCK_SERVICE_NAME, memberCount);
+ DistributedLockServiceMXBean distributedLockServiceMXBean =
+ awaitDistributedLockServiceMXBean(LOCK_SERVICE_NAME, memberCount);
assertThat(distributedLockServiceMXBean).isNotNull();
assertThat(distributedLockServiceMXBean.getName()).isEqualTo(LOCK_SERVICE_NAME);
});
@@ -230,29 +245,32 @@ public class DLockManagementDUnitTest implements Serializable {
}
/**
- * Await and return a DistributedRegionMXBean proxy with specified member
- * count.
+ * Await and return a DistributedRegionMXBean proxy with specified member count.
*/
- private DistributedLockServiceMXBean awaitDistributedLockServiceMXBean(final String lockServiceName, final int memberCount) {
+ private DistributedLockServiceMXBean awaitDistributedLockServiceMXBean(
+ final String lockServiceName, final int memberCount) {
ManagementService service = this.managementTestRule.getManagementService();
await().until(() -> {
assertThat(service.getDistributedLockServiceMXBean(lockServiceName)).isNotNull();
- assertThat(service.getDistributedLockServiceMXBean(lockServiceName).getMemberCount()).isEqualTo(memberCount);
+ assertThat(service.getDistributedLockServiceMXBean(lockServiceName).getMemberCount())
+ .isEqualTo(memberCount);
});
return service.getDistributedLockServiceMXBean(lockServiceName);
}
/**
- * Await and return a LockServiceMXBean proxy for a specific member and
- * lockServiceName.
+ * Await and return a LockServiceMXBean proxy for a specific member and lockServiceName.
*/
- private LockServiceMXBean awaitLockServiceMXBeanProxy(final DistributedMember member, final String lockServiceName) {
+ private LockServiceMXBean awaitLockServiceMXBeanProxy(final DistributedMember member,
+ final String lockServiceName) {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
ObjectName lockServiceMXBeanName = service.getLockServiceMBeanName(member, lockServiceName);
- await().until(() -> assertThat(service.getMBeanProxy(lockServiceMXBeanName, LockServiceMXBean.class)).isNotNull());
+ await().until(
+ () -> assertThat(service.getMBeanProxy(lockServiceMXBeanName, LockServiceMXBean.class))
+ .isNotNull());
return service.getMBeanProxy(lockServiceMXBeanName, LockServiceMXBean.class);
}
@@ -269,8 +287,7 @@ public class DLockManagementDUnitTest implements Serializable {
}
/**
- * Await destruction of local LockServiceMXBean for specified
- * lockServiceName.
+ * Await destruction of local LockServiceMXBean for specified lockServiceName.
*/
private void awaitLockServiceMXBeanIsNull(final String lockServiceName) {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/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 bfeebea..50533d3 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
@@ -54,14 +54,14 @@ 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)
-@SuppressWarnings({ "serial", "unused" })
+@SuppressWarnings({"serial", "unused"})
public class DiskManagementDUnitTest implements Serializable {
- private static final String REGION_NAME = DiskManagementDUnitTest.class.getSimpleName() + "_region";
+ private static final String REGION_NAME =
+ DiskManagementDUnitTest.class.getSimpleName() + "_region";
private File diskDir;
@@ -83,8 +83,8 @@ public class DiskManagementDUnitTest implements Serializable {
}
/**
- * Tests Disk Compaction from a MemberMXBean which is at cache level. All the
- * disks which belong to the cache should be compacted.
+ * Tests Disk Compaction from a MemberMXBean which is at cache level. All the disks which belong
+ * to the cache should be compacted.
*/
@Test
public void testDiskCompact() throws Exception {
@@ -99,8 +99,8 @@ public class DiskManagementDUnitTest implements Serializable {
}
/**
- * Tests Disk Compaction from a MemberMXBean which is at cache level. All the
- * disks which belong to the cache should be compacted.
+ * Tests Disk Compaction from a MemberMXBean which is at cache level. All the disks which belong
+ * to the cache should be compacted.
*/
@Test
public void testDiskCompactRemote() throws Exception {
@@ -137,8 +137,7 @@ public class DiskManagementDUnitTest implements Serializable {
}
/**
- * Checks the test case of missing disks and revoking them through MemberMXBean
- * interfaces
+ * Checks the test case of missing disks and revoking them through MemberMXBean interfaces
*/
@Test
public void testMissingMembers() throws Exception {
@@ -166,14 +165,12 @@ public class DiskManagementDUnitTest implements Serializable {
AsyncInvocation creatingPersistentRegionAsync = createPersistentRegionAsync(memberVM1);
- memberVM1.invoke(() ->
- await().until(() -> {
- GemFireCacheImpl cache = (GemFireCacheImpl) this.managementTestRule.getCache();
- PersistentMemberManager persistentMemberManager = cache.getPersistentMemberManager();
- Map<String, Set<PersistentMemberID>> regions = persistentMemberManager.getWaitingRegions();
- return !regions.isEmpty();
- })
- );
+ memberVM1.invoke(() -> await().until(() -> {
+ GemFireCacheImpl cache = (GemFireCacheImpl) this.managementTestRule.getCache();
+ PersistentMemberManager persistentMemberManager = cache.getPersistentMemberManager();
+ Map<String, Set<PersistentMemberID>> regions = persistentMemberManager.getWaitingRegions();
+ return !regions.isEmpty();
+ }));
assertThat(creatingPersistentRegionAsync.isAlive()).isTrue();
@@ -346,7 +343,8 @@ public class DiskManagementDUnitTest implements Serializable {
});
}
- private void createPersistentRegion(final VM memberVM) throws InterruptedException, ExecutionException, TimeoutException {
+ private void createPersistentRegion(final VM memberVM)
+ throws InterruptedException, ExecutionException, TimeoutException {
await(createPersistentRegionAsync(memberVM));
}
@@ -357,7 +355,7 @@ public class DiskManagementDUnitTest implements Serializable {
Cache cache = this.managementTestRule.getCache();
DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
- diskStoreFactory.setDiskDirs(new File[] { dir });
+ diskStoreFactory.setDiskDirs(new File[] {dir});
diskStoreFactory.setMaxOplogSize(1);
diskStoreFactory.setAllowForceCompaction(true);
diskStoreFactory.setAutoCompact(false);
@@ -392,11 +390,13 @@ public class DiskManagementDUnitTest implements Serializable {
private MemberMXBean awaitMemberMXBeanProxy(final DistributedMember member) {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
ObjectName objectName = service.getMemberMBeanName(member);
- await().until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
+ await()
+ .until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
return service.getMBeanProxy(objectName, MemberMXBean.class);
}
- private void await(final AsyncInvocation createPersistentRegionAsync) throws InterruptedException, ExecutionException, TimeoutException {
+ private void await(final AsyncInvocation createPersistentRegionAsync)
+ throws InterruptedException, ExecutionException, TimeoutException {
createPersistentRegionAsync.await(2, MINUTES);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/DistributedSystemDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/DistributedSystemDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/DistributedSystemDUnitTest.java
index cd05cde..79a4ce4 100644
--- a/geode-core/src/test/java/org/apache/geode/management/DistributedSystemDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/DistributedSystemDUnitTest.java
@@ -64,15 +64,11 @@ import org.apache.geode.test.junit.categories.DistributedTest;
/**
* Distributed System management tests
* <p>
- * a) For all the notifications
- * i) gemfire.distributedsystem.member.joined
- * ii) gemfire.distributedsystem.member.left
- * iii) gemfire.distributedsystem.member.suspect
- * iv ) All notifications emitted by member mbeans
- * vi) Alerts
+ * a) For all the notifications i) gemfire.distributedsystem.member.joined ii)
+ * gemfire.distributedsystem.member.left iii) gemfire.distributedsystem.member.suspect iv ) All
+ * notifications emitted by member mbeans vi) Alerts
* <p>
- * b) Concurrently modify proxy list by removing member and accessing the
- * distributed system MBean
+ * b) Concurrently modify proxy list by removing member and accessing the distributed system MBean
* <p>
* c) Aggregate Operations like shutDownAll
* <p>
@@ -81,7 +77,7 @@ import org.apache.geode.test.junit.categories.DistributedTest;
* e ) Statistics
*/
@Category(DistributedTest.class)
-@SuppressWarnings({ "serial", "unused" })
+@SuppressWarnings({"serial", "unused"})
public class DistributedSystemDUnitTest implements Serializable {
private static final Logger logger = LogService.getLogger();
@@ -145,9 +141,11 @@ public class DistributedSystemDUnitTest implements Serializable {
addAlertListener(this.managerVM);
verifyAlertCount(this.managerVM, 0, 0);
- DistributedMember managerDistributedMember = this.managementTestRule.getDistributedMember(this.managerVM);
+ DistributedMember managerDistributedMember =
+ this.managementTestRule.getDistributedMember(this.managerVM);
- // Before we start we need to ensure that the initial (implicit) SEVERE alert has propagated everywhere.
+ // Before we start we need to ensure that the initial (implicit) SEVERE alert has propagated
+ // everywhere.
for (VM memberVM : this.memberVMs) {
verifyAlertAppender(memberVM, managerDistributedMember, Alert.SEVERE);
}
@@ -228,7 +226,8 @@ public class DistributedSystemDUnitTest implements Serializable {
for (ObjectName objectName : distributedSystemMXBean.listMemberObjectNames()) {
NotificationHubTestListener listener = new NotificationHubTestListener();
- ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener, null, null);
+ ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener,
+ null, null);
notificationListenerMap.put(objectName, listener);
}
});
@@ -239,26 +238,30 @@ public class DistributedSystemDUnitTest implements Serializable {
memberVM.invoke("checkNotificationHubListenerCount", () -> {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
NotificationHub notificationHub = service.getNotificationHub();
- Map<ObjectName, NotificationHubListener> listenerMap = notificationHub.getListenerObjectMap();
+ Map<ObjectName, NotificationHubListener> listenerMap =
+ notificationHub.getListenerObjectMap();
assertThat(listenerMap.keySet()).hasSize(1);
- ObjectName memberMBeanName = MBeanJMXAdapter.getMemberMBeanName(this.managementTestRule.getDistributedMember());
+ ObjectName memberMBeanName =
+ MBeanJMXAdapter.getMemberMBeanName(this.managementTestRule.getDistributedMember());
NotificationHubListener listener = listenerMap.get(memberMBeanName);
/*
- * Counter of listener should be 2 . One for default Listener which is
- * added for each member mbean by distributed system mbean One for the
- * added listener in test
+ * Counter of listener should be 2 . One for default Listener which is added for each member
+ * mbean by distributed system mbean One for the added listener in test
*/
assertThat(listener.getNumCounter()).isEqualTo(2);
// Raise some notifications
NotificationBroadcasterSupport notifier = (MemberMBean) service.getMemberMXBean();
- String memberSource = MBeanJMXAdapter.getMemberNameOrId(this.managementTestRule.getDistributedMember());
+ String memberSource =
+ MBeanJMXAdapter.getMemberNameOrId(this.managementTestRule.getDistributedMember());
// Only a dummy notification , no actual region is created
- Notification notification = new Notification(JMXNotificationType.REGION_CREATED, memberSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.REGION_CREATED_PREFIX + "/test");
+ Notification notification = new Notification(JMXNotificationType.REGION_CREATED,
+ memberSource, SequenceNumber.next(), System.currentTimeMillis(),
+ ManagementConstants.REGION_CREATED_PREFIX + "/test");
notifier.sendNotification(notification);
});
}
@@ -283,12 +286,13 @@ public class DistributedSystemDUnitTest implements Serializable {
Map<ObjectName, NotificationHubListener> listenerObjectMap = hub.getListenerObjectMap();
assertThat(listenerObjectMap.keySet().size()).isEqualTo(1);
- ObjectName memberMBeanName = MBeanJMXAdapter.getMemberMBeanName(this.managementTestRule.getDistributedMember());
+ ObjectName memberMBeanName =
+ MBeanJMXAdapter.getMemberMBeanName(this.managementTestRule.getDistributedMember());
NotificationHubListener listener = listenerObjectMap.get(memberMBeanName);
/*
- * Counter of listener should be 1 for the default Listener which is
- * added for each member mbean by distributed system mbean.
+ * Counter of listener should be 1 for the default Listener which is added for each member
+ * mbean by distributed system mbean.
*/
assertThat(listener.getNumCounter()).isEqualTo(1);
});
@@ -303,9 +307,11 @@ public class DistributedSystemDUnitTest implements Serializable {
for (ObjectName objectName : distributedSystemMXBean.listMemberObjectNames()) {
NotificationHubTestListener listener = new NotificationHubTestListener();
try {
- ManagementFactory.getPlatformMBeanServer().removeNotificationListener(objectName, listener); // because new instance!!
+ ManagementFactory.getPlatformMBeanServer().removeNotificationListener(objectName,
+ listener); // because new instance!!
} catch (ListenerNotFoundException e) {
- // TODO: [old] apparently there is never a notification listener on any these mbeans at this point [fix this]
+ // TODO: [old] apparently there is never a notification listener on any these mbeans at
+ // this point [fix this]
// fix this test so it doesn't hit these unexpected exceptions -- getLogWriter().error(e);
}
}
@@ -320,7 +326,9 @@ public class DistributedSystemDUnitTest implements Serializable {
for (ObjectName objectName : notificationListenerMap.keySet()) {
NotificationListener listener = notificationListenerMap.get(objectName);
- assertThatThrownBy(() -> ManagementFactory.getPlatformMBeanServer().removeNotificationListener(objectName, listener)).isExactlyInstanceOf(ListenerNotFoundException.class);
+ assertThatThrownBy(() -> ManagementFactory.getPlatformMBeanServer()
+ .removeNotificationListener(objectName, listener))
+ .isExactlyInstanceOf(ListenerNotFoundException.class);
}
});
}
@@ -335,7 +343,8 @@ public class DistributedSystemDUnitTest implements Serializable {
addAlertListener(this.managerVM);
resetAlertCounts(this.managerVM);
- DistributedMember managerDistributedMember = this.managementTestRule.getDistributedMember(this.managerVM);
+ DistributedMember managerDistributedMember =
+ this.managementTestRule.getDistributedMember(this.managerVM);
generateWarningAlert(this.managerVM);
generateSevereAlert(this.managerVM);
@@ -376,16 +385,23 @@ public class DistributedSystemDUnitTest implements Serializable {
verifyAlertCount(this.managerVM, 0, 0);
}
- private void verifyAlertAppender(final VM memberVM, final DistributedMember member, final int alertLevel) {
- memberVM.invoke("verifyAlertAppender", () -> await().until(() -> assertThat(AlertAppender.getInstance().hasAlertListener(member, alertLevel)).isTrue()));
+ private void verifyAlertAppender(final VM memberVM, final DistributedMember member,
+ final int alertLevel) {
+ memberVM.invoke("verifyAlertAppender",
+ () -> await().until(
+ () -> assertThat(AlertAppender.getInstance().hasAlertListener(member, alertLevel))
+ .isTrue()));
}
- private void verifyAlertCount(final VM managerVM, final int expectedSevereAlertCount, final int expectedWarningAlertCount) {
+ private void verifyAlertCount(final VM managerVM, final int expectedSevereAlertCount,
+ final int expectedWarningAlertCount) {
managerVM.invoke("verifyAlertCount", () -> {
AlertNotificationListener listener = AlertNotificationListener.getInstance();
- await().until(() -> assertThat(listener.getSevereAlertCount()).isEqualTo(expectedSevereAlertCount));
- await().until(() -> assertThat(listener.getWarningAlertCount()).isEqualTo(expectedWarningAlertCount));
+ await().until(
+ () -> assertThat(listener.getSevereAlertCount()).isEqualTo(expectedSevereAlertCount));
+ await().until(
+ () -> assertThat(listener.getWarningAlertCount()).isEqualTo(expectedWarningAlertCount));
});
}
@@ -399,7 +415,8 @@ public class DistributedSystemDUnitTest implements Serializable {
private void generateWarningAlert(final VM anyVM) {
anyVM.invoke("generateWarningAlert", () -> {
- IgnoredException ignoredException = IgnoredException.addIgnoredException(WARNING_LEVEL_MESSAGE);
+ IgnoredException ignoredException =
+ IgnoredException.addIgnoredException(WARNING_LEVEL_MESSAGE);
logger.warn(WARNING_LEVEL_MESSAGE);
ignoredException.remove();
});
@@ -414,7 +431,8 @@ public class DistributedSystemDUnitTest implements Serializable {
private void generateSevereAlert(final VM anyVM) {
anyVM.invoke("generateSevereAlert", () -> {
- IgnoredException ignoredException = IgnoredException.addIgnoredException(SEVERE_LEVEL_MESSAGE);
+ IgnoredException ignoredException =
+ IgnoredException.addIgnoredException(SEVERE_LEVEL_MESSAGE);
logger.fatal(SEVERE_LEVEL_MESSAGE);
ignoredException.remove();
});
@@ -425,9 +443,11 @@ public class DistributedSystemDUnitTest implements Serializable {
AlertNotificationListener listener = AlertNotificationListener.getInstance();
listener.resetCount();
- NotificationFilter notificationFilter = (Notification notification) -> notification.getType().equals(JMXNotificationType.SYSTEM_ALERT);
+ NotificationFilter notificationFilter = (Notification notification) -> notification.getType()
+ .equals(JMXNotificationType.SYSTEM_ALERT);
- ManagementFactory.getPlatformMBeanServer().addNotificationListener(MBeanJMXAdapter.getDistributedSystemName(), listener, notificationFilter, null);
+ ManagementFactory.getPlatformMBeanServer().addNotificationListener(
+ MBeanJMXAdapter.getDistributedSystemName(), listener, notificationFilter, null);
});
}
@@ -455,7 +475,8 @@ public class DistributedSystemDUnitTest implements Serializable {
assertThat(distributedSystemMXBean).isNotNull();
DistributedSystemNotificationListener listener = new DistributedSystemNotificationListener();
- ManagementFactory.getPlatformMBeanServer().addNotificationListener(MBeanJMXAdapter.getDistributedSystemName(), listener, null, null);
+ ManagementFactory.getPlatformMBeanServer().addNotificationListener(
+ MBeanJMXAdapter.getDistributedSystemName(), listener, null, null);
});
}
@@ -474,7 +495,8 @@ public class DistributedSystemDUnitTest implements Serializable {
ManagementService service = this.managementTestRule.getManagementService();
DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
- await().until(() -> assertThat(distributedSystemMXBean.listMemberObjectNames()).hasSize(memberCount));
+ await().until(
+ () -> assertThat(distributedSystemMXBean.listMemberObjectNames()).hasSize(memberCount));
String memberId = this.managementTestRule.getDistributedMember().getId();
ObjectName thisMemberName = MBeanJMXAdapter.getMemberMBeanName(memberId);
@@ -508,16 +530,19 @@ public class DistributedSystemDUnitTest implements Serializable {
}
@Override
- public synchronized void handleNotification(final Notification notification, final Object handback) {
+ public synchronized void handleNotification(final Notification notification,
+ final Object handback) {
assertThat(notification).isNotNull();
Map<String, String> notificationUserData = (Map<String, String>) notification.getUserData();
- if (notificationUserData.get(JMXNotificationUserData.ALERT_LEVEL).equalsIgnoreCase("warning")) {
+ if (notificationUserData.get(JMXNotificationUserData.ALERT_LEVEL)
+ .equalsIgnoreCase("warning")) {
assertThat(notification.getMessage()).isEqualTo(WARNING_LEVEL_MESSAGE);
warningAlertCount++;
}
- if (notificationUserData.get(JMXNotificationUserData.ALERT_LEVEL).equalsIgnoreCase("severe")) {
+ if (notificationUserData.get(JMXNotificationUserData.ALERT_LEVEL)
+ .equalsIgnoreCase("severe")) {
assertThat(notification.getMessage()).isEqualTo(SEVERE_LEVEL_MESSAGE);
severeAlertCount++;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/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 1a2e3d7..a574815 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
@@ -53,7 +53,7 @@ import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
* Distributed tests for managing {@code Locator} with {@link LocatorMXBean}.
*/
@Category(DistributedTest.class)
-@SuppressWarnings({ "serial", "unused" })
+@SuppressWarnings({"serial", "unused"})
public class LocatorManagementDUnitTest implements Serializable {
private static final int MAX_WAIT_MILLIS = 120 * 1000;
@@ -80,8 +80,8 @@ public class LocatorManagementDUnitTest implements Serializable {
@Before
public void before() throws Exception {
-// this.managerVM = managingNode;
-// this.membersVM = getManagedNodeList().toArray(new VM[getManagedNodeList().size()]);
+ // this.managerVM = managingNode;
+ // this.membersVM = getManagedNodeList().toArray(new VM[getManagedNodeList().size()]);
this.locatorVM = this.membersVM[0];
this.hostName = getServerHostName(getHost(0));
this.port = getRandomAvailableTCPPort();
@@ -112,13 +112,14 @@ public class LocatorManagementDUnitTest implements Serializable {
this.managementTestRule.createManager(this.managerVM, props, false);
this.managementTestRule.startManager(this.managerVM);
- verifyRemoteLocatorMXBeanProxy(this.managerVM, this.managementTestRule.getDistributedMember(this.locatorVM));
+ verifyRemoteLocatorMXBeanProxy(this.managerVM,
+ this.managementTestRule.getDistributedMember(this.locatorVM));
}
@Test
public void testPeerLocationWithPortZero() throws Exception {
this.port = startLocator(this.locatorVM, true, ZERO);
- //this.locatorVM.invoke(() -> this.managementTestRule.getCache());
+ // this.locatorVM.invoke(() -> this.managementTestRule.getCache());
this.locatorVM.invoke(() -> assertHasCache());
@@ -135,7 +136,8 @@ public class LocatorManagementDUnitTest implements Serializable {
this.managementTestRule.createManager(this.managerVM, props, false);
this.managementTestRule.startManager(this.managerVM);
- verifyRemoteLocatorMXBeanProxy(this.managerVM, this.managementTestRule.getDistributedMember(this.locatorVM));
+ verifyRemoteLocatorMXBeanProxy(this.managerVM,
+ this.managementTestRule.getDistributedMember(this.locatorVM));
}
private void assertHasCache() {
@@ -219,8 +221,7 @@ public class LocatorManagementDUnitTest implements Serializable {
}
/**
- * Starts a locator with given configuration.
- * If DS is already started it will use the same DS
+ * Starts a locator with given configuration. If DS is already started it will use the same DS
*/
private int startLocator(final VM locatorVM, final boolean isPeer, final int port) {
return locatorVM.invoke("startLocator", () -> {
@@ -231,8 +232,10 @@ public class LocatorManagementDUnitTest implements Serializable {
properties.setProperty(LOCATORS, "");
InetAddress bindAddress = InetAddress.getByName(this.hostName);
- File logFile = this.temporaryFolder.newFile(testName.getMethodName() + "-locator-" + port + ".log");
- Locator locator = Locator.startLocatorAndDS(port, logFile, bindAddress, properties, isPeer, true, null);
+ File logFile =
+ this.temporaryFolder.newFile(testName.getMethodName() + "-locator-" + port + ".log");
+ Locator locator =
+ Locator.startLocatorAndDS(port, logFile, bindAddress, properties, isPeer, true, null);
assertThat(InternalLocator.hasLocator()).isTrue();
@@ -249,7 +252,7 @@ public class LocatorManagementDUnitTest implements Serializable {
private void verifyLocalLocatorMXBean(final VM locatorVM, final int port, final boolean isPeer) {
locatorVM.invoke("verifyLocalLocatorMXBean", () -> {
- //ManagementService service = this.managementTestRule.getExistingManagementService();
+ // ManagementService service = this.managementTestRule.getExistingManagementService();
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
ManagementService service = ManagementService.getExistingManagementService(cache);
assertThat(service).isNotNull();
@@ -258,16 +261,17 @@ public class LocatorManagementDUnitTest implements Serializable {
assertThat(locatorMXBean).isNotNull();
assertThat(locatorMXBean.getPort()).isEqualTo(port);
- // LogWriterUtils.getLogWriter().info("Log of Locator" + bean.viewLog());
- // LogWriterUtils.getLogWriter().info("BindAddress" + bean.getBindAddress());
+ // LogWriterUtils.getLogWriter().info("Log of Locator" + bean.viewLog());
+ // LogWriterUtils.getLogWriter().info("BindAddress" + bean.getBindAddress());
assertThat(locatorMXBean.isPeerLocator()).isEqualTo(isPeer);
});
}
- private void verifyRemoteLocatorMXBeanProxy(final VM managerVM, final DistributedMember locatorMember) {
+ private void verifyRemoteLocatorMXBeanProxy(final VM managerVM,
+ final DistributedMember locatorMember) {
managerVM.invoke("verifyRemoteLocatorMXBeanProxy", () -> {
- //ManagementService service = this.managementTestRule.getExistingManagementService();
+ // ManagementService service = this.managementTestRule.getExistingManagementService();
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
ManagementService service = ManagementService.getExistingManagementService(cache);
assertThat(service).isNotNull();
@@ -276,14 +280,14 @@ public class LocatorManagementDUnitTest implements Serializable {
LocatorMXBean locatorMXBean = awaitLockServiceMXBeanProxy(locatorMember);
assertThat(locatorMXBean).isNotNull();
- // LogWriterUtils.getLogWriter().info("Log of Locator" + bean.viewLog());
- // LogWriterUtils.getLogWriter().info("BindAddress" + bean.getBindAddress());
+ // LogWriterUtils.getLogWriter().info("Log of Locator" + bean.viewLog());
+ // LogWriterUtils.getLogWriter().info("BindAddress" + bean.getBindAddress());
});
}
private void verifyListManagers(final VM locatorVM) {
locatorVM.invoke("verifyListManagers", () -> {
- //ManagementService service = this.managementTestRule.getExistingManagementService();
+ // ManagementService service = this.managementTestRule.getExistingManagementService();
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
ManagementService service = ManagementService.getExistingManagementService(cache);
assertThat(service).isNotNull();
@@ -297,16 +301,17 @@ public class LocatorManagementDUnitTest implements Serializable {
private void verifyListPotentialManagers(final VM locatorVM) {
locatorVM.invoke("verifyListPotentialManagers", () -> {
- //ManagementService service = this.managementTestRule.getExistingManagementService();
+ // ManagementService service = this.managementTestRule.getExistingManagementService();
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
ManagementService service = ManagementService.getExistingManagementService(cache);
assertThat(service).isNotNull();
- //LocatorMXBean locatorMXBean = service.getLocalLocatorMXBean();
+ // LocatorMXBean locatorMXBean = service.getLocalLocatorMXBean();
LocatorMXBean locatorMXBean = awaitLockServiceMXBean();
assertThat(locatorMXBean).isNotNull();
- await("listPotentialManagers has size 3").until(() -> assertThat(locatorMXBean.listPotentialManagers()).hasSize(3));
+ await("listPotentialManagers has size 3")
+ .until(() -> assertThat(locatorMXBean.listPotentialManagers()).hasSize(3));
});
}
@@ -325,7 +330,8 @@ public class LocatorManagementDUnitTest implements Serializable {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
ObjectName locatorMBeanName = service.getLocatorMBeanName(member);
- await().until(() -> assertThat(service.getMBeanProxy(locatorMBeanName, LocatorMXBean.class)).isNotNull());
+ await().until(
+ () -> assertThat(service.getMBeanProxy(locatorMBeanName, LocatorMXBean.class)).isNotNull());
return service.getMBeanProxy(locatorMBeanName, LocatorMXBean.class);
}
@@ -342,7 +348,8 @@ public class LocatorManagementDUnitTest implements Serializable {
}
public static String getServerHostName(Host host) {
- return System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "server-bind-address") != null ?
- System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "server-bind-address") : host.getHostName();
+ return System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "server-bind-address") != null
+ ? System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "server-bind-address")
+ : host.getHostName();
}
}
[05/50] [abbrv] incubator-geode git commit: GEODE-1570: add a test to
verify rest security with SSL.
Posted by kl...@apache.org.
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 Liao <ji...@pivotal.io>
Authored: Mon Nov 7 18:10:52 2016 -0800
Committer: Jinmei Liao <ji...@pivotal.io>
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 IOException, JSONException {
+ JSONTokener tokener = new JSONTokener(new InputStreamReader(response.getEntity().getContent()));
+ return new JSONObject(tokener);
+ }
+
+ public static JSONArray getJsonArray(HttpResponse response) throws IOException, JSONException {
+ JSONTokener tokener = new JSONTokener(new InputStreamReader(response.getEntity().getContent()));
+ return new JSONArray(tokener);
+ }
+
+ public HttpResponse doHEAD(String query, String username, String password) throws Exception {
HttpHead httpHead = new HttpHead(CONTEXT + query);
return doRequest(httpHead, username, password);
}
public HttpResponse doPost(String query, String username, String password, String body)
- throws MalformedURLException {
+ throws Exception {
HttpPost httpPost = new HttpPost(CONTEXT + query);
httpPost.addHeader("content-type", "application/json");
httpPost.setEntity(new StringEntity(body, StandardCharsets.UTF_8));
@@ -77,83 +113,69 @@ public class GeodeRestClient {
}
public HttpResponse doPut(String query, String username, String password, String body)
- throws MalformedURLException {
+ throws Exception {
HttpPut httpPut = new HttpPut(CONTEXT + query);
httpPut.addHeader("content-type", "application/json");
httpPut.setEntity(new StringEntity(body, StandardCharsets.UTF_8));
return doRequest(httpPut, username, password);
}
- public HttpResponse doGet(String uri, String username, String password)
- throws MalformedURLException {
+ public HttpResponse doGet(String uri, String username, String password) throws Exception {
HttpGet getRequest = new HttpGet(CONTEXT + uri);
return doRequest(getRequest, username, password);
}
- public HttpResponse doGetRequest(String url) throws MalformedURLException {
+ public HttpResponse doGetRequest(String url) throws Exception {
HttpGet getRequest = new HttpGet(url);
return doRequest(getRequest, null, null);
}
-
- public HttpResponse doDelete(String uri, String username, String password)
- throws MalformedURLException {
+ public HttpResponse doDelete(String uri, String username, String password) throws Exception {
HttpDelete httpDelete = new HttpDelete(CONTEXT + uri);
return doRequest(httpDelete, username, password);
}
- 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 IOException, JSONException {
- JSONTokener tokener = new JSONTokener(new InputStreamReader(response.getEntity().getContent()));
- return new JSONObject(tokener);
- }
-
- public static JSONArray getJsonArray(HttpResponse response) throws IOException, JSONException {
- JSONTokener tokener = new JSONTokener(new InputStreamReader(response.getEntity().getContent()));
- return new JSONArray(tokener);
- }
-
public HttpResponse doRequest(HttpRequestBase request, String username, String password)
- throws MalformedURLException {
- HttpHost targetHost = new HttpHost(bindAddress, restPort, PROTOCOL);
- CloseableHttpClient httpclient = HttpClients.custom().build();
+ throws Exception {
+ HttpHost targetHost = new HttpHost(bindAddress, restPort, protocol);
+
+ HttpClientBuilder clientBuilder = HttpClients.custom();
HttpClientContext clientContext = HttpClientContext.create();
- // if username is null, do not put in authentication
+
+ // configures the clientBuilder and clientContext
if (username != null) {
CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(new AuthScope(targetHost.getHostName(), targetHost.getPort()),
new UsernamePasswordCredentials(username, password));
- httpclient = HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build();
- AuthCache authCache = new BasicAuthCache();
- BasicScheme basicAuth = new BasicScheme();
- authCache.put(targetHost, basicAuth);
- clientContext.setCredentialsProvider(credsProvider);
- clientContext.setAuthCache(authCache);
+ clientBuilder.setDefaultCredentialsProvider(credsProvider);
+ }
+
+ if (useHttps) {
+ SSLContext ctx = SSLContext.getInstance("TLS");
+ ctx.init(new KeyManager[0], new TrustManager[]{new DefaultTrustManager()},
+ new SecureRandom());
+ clientBuilder.setSSLContext(ctx);
+ clientBuilder.setSSLHostnameVerifier(new NoopHostnameVerifier());
+ }
+
+ return clientBuilder.build().execute(targetHost, request, clientContext);
+ }
+
+ private static class DefaultTrustManager implements X509TrustManager {
+
+ @Override
+ public void checkClientTrusted(X509Certificate[] arg0, String arg1)
+ throws CertificateException {
+ }
+
+ @Override
+ public void checkServerTrusted(X509Certificate[] arg0, String arg1)
+ throws CertificateException {
}
- try {
- return httpclient.execute(targetHost, request, clientContext);
- } catch (ClientProtocolException e) {
- e.printStackTrace();
- Assert.fail("Rest GET should not have thrown ClientProtocolException!");
- } catch (IOException e) {
- e.printStackTrace();
- Assert.fail("Rest GET Request should not have thrown IOException!");
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return null;
}
- return null;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a515ee06/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java
new file mode 100644
index 0000000..f1df632
--- /dev/null
+++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java
@@ -0,0 +1,85 @@
+/*
+ * 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.SSL_ENABLED_COMPONENTS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_TYPE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.junit.Assert.assertEquals;
+
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.internal.security.SecurableCommunicationChannel;
+import org.apache.geode.security.templates.SimpleSecurityManager;
+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.junit.After;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.net.URL;
+import java.util.Properties;
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityWithSSLTest {
+
+ private static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+ ServerStarterRule serverStarter = null;
+
+ @Test
+ public void testRestSecurityWithSSL() throws Exception {
+ URL keystoreUrl =
+ RestSecurityWithSSLTest.class.getClassLoader().getResource("ssl/trusted.keystore");
+
+ Properties properties = new Properties();
+ properties.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
+ properties.setProperty(START_DEV_REST_API, "true");
+ properties.setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+ properties.setProperty(HTTP_SERVICE_PORT, restPort + "");
+ properties.setProperty(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.WEB.getConstant());
+ properties.setProperty(SSL_KEYSTORE, keystoreUrl.getPath());
+ properties.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+ properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
+ properties.setProperty(SSL_TRUSTSTORE, keystoreUrl.getPath());
+ properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
+ properties.setProperty(SSL_PROTOCOLS, "TLSv1.2,TLSv1.1");
+
+ serverStarter = new ServerStarterRule(properties);
+ serverStarter.startServer();
+
+ GeodeRestClient restClient = new GeodeRestClient("localhost", restPort, true);
+ HttpResponse response = restClient.doGet("/servers", "cluster", "cluster");
+
+ assertEquals(200, GeodeRestClient.getCode(response));
+ }
+
+ @After
+ public void after() {
+ if (serverStarter != null) {
+ serverStarter.after();
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a515ee06/geode-assembly/src/test/resources/ssl/trusted.keystore
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/resources/ssl/trusted.keystore b/geode-assembly/src/test/resources/ssl/trusted.keystore
new file mode 100644
index 0000000..bd75039
Binary files /dev/null and b/geode-assembly/src/test/resources/ssl/trusted.keystore differ
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a515ee06/geode-core/src/test/java/org/apache/geode/security/SecurityClusterConfigDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/SecurityClusterConfigDUnitTest.java b/geode-core/src/test/java/org/apache/geode/security/SecurityClusterConfigDUnitTest.java
index cce4fdb..5d843d8 100644
--- a/geode-core/src/test/java/org/apache/geode/security/SecurityClusterConfigDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/SecurityClusterConfigDUnitTest.java
@@ -15,17 +15,14 @@
package org.apache.geode.security;
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.assertj.core.api.Java6Assertions.*;
-import static org.junit.Assert.*;
-
-import java.util.Properties;
-
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_START;
+import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static org.assertj.core.api.Java6Assertions.assertThatThrownBy;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import org.apache.geode.GemFireConfigException;
import org.apache.geode.distributed.DistributedSystem;
@@ -34,8 +31,15 @@ import org.apache.geode.security.templates.SimpleSecurityManager;
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
import org.apache.geode.test.junit.categories.DistributedTest;
import org.apache.geode.test.junit.categories.SecurityTest;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.util.Properties;
@Category({DistributedTest.class, SecurityTest.class})
public class SecurityClusterConfigDUnitTest extends JUnit4DistributedTestCase {
@@ -51,9 +55,9 @@ public class SecurityClusterConfigDUnitTest extends JUnit4DistributedTestCase {
.addIgnoredException(LocalizedStrings.GEMFIRE_CACHE_SECURITY_MISCONFIGURATION_2.toString());
Properties props = new Properties();
props.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
- props.put(JMX_MANAGER, "false");
- props.put(JMX_MANAGER_START, "false");
- props.put(JMX_MANAGER_PORT, 0);
+ props.setProperty(JMX_MANAGER, "false");
+ props.setProperty(JMX_MANAGER_START, "false");
+ props.setProperty(JMX_MANAGER_PORT, 0 + "");
props.setProperty(SECURITY_POST_PROCESSOR, PDXPostProcessor.class.getName());
lsRule.getLocatorVM(0, props);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a515ee06/geode-core/src/test/java/org/apache/geode/test/dunit/rules/LocatorStarterRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/LocatorStarterRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/LocatorStarterRule.java
index 72627a0..3329a40 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/LocatorStarterRule.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/LocatorStarterRule.java
@@ -15,6 +15,9 @@
package org.apache.geode.test.dunit.rules;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_START;
import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
import static org.junit.Assert.assertTrue;
@@ -51,6 +54,17 @@ public class LocatorStarterRule extends ExternalResource implements Serializable
if (!properties.containsKey(MCAST_PORT)) {
properties.setProperty(MCAST_PORT, "0");
}
+ if (properties.containsKey(JMX_MANAGER_PORT)) {
+ int jmxPort = Integer.parseInt(properties.getProperty(JMX_MANAGER_PORT));
+ if (jmxPort > 0) {
+ if (!properties.containsKey(JMX_MANAGER)) {
+ properties.put(JMX_MANAGER, "true");
+ }
+ if (!properties.containsKey(JMX_MANAGER_START)) {
+ properties.put(JMX_MANAGER_START, "true");
+ }
+ }
+ }
locator = (InternalLocator) Locator.startLocatorAndDS(0, null, properties);
int locatorPort = locator.getPort();
locator.resetInternalLocatorFileNamesWithCorrectPortNumber(locatorPort);
[23/50] [abbrv] incubator-geode git commit: Adding option
partition-resolver in gfsh while creating a region.
Posted by kl...@apache.org.
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: adongre <av...@ampool.io>
Authored: Fri Oct 28 16:04:15 2016 +0530
Committer: Anthony Baker <ab...@apache.org>
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 CreateAlterDestroyRegionCommands extends AbstractCommandsSupport {
xmlEntity = regionCreateResult.getXmlEntity();
}
}
-
result = ResultBuilder.buildResult(tabularResultData);
verifyDistributedRegionMbean(cache, regionPath);
@@ -550,7 +546,7 @@ public class CreateAlterDestroyRegionCommands extends AbstractCommandsSupport {
regionFunctionArgs = new RegionFunctionArgs(regionPath, null, null, false, null, null, null,
entryIdle, entryTTL, regionIdle, regionTTL, null, null, null, null, cacheListeners,
cacheLoader, cacheWriter, asyncEventQueueIds, gatewaySenderIds, null, cloningEnabled,
- null, null, null, null, null, null, null, null, evictionMax, null, null, null);
+ null, null, null, null, null, null, null, null, evictionMax, null, null, null, null);
Set<String> cacheListenersSet = regionFunctionArgs.getCacheListeners();
if (cacheListenersSet != null && !cacheListenersSet.isEmpty()) {
@@ -907,6 +903,31 @@ public class CreateAlterDestroyRegionCommands extends AbstractCommandsSupport {
new Object[] {regionFunctionArgs.getCompressor()}));
}
}
+
+ 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)) {
+ throw new IllegalArgumentException(
+ CliStrings.format(CliStrings.CREATE_REGION__MSG__INVALID_PARTITION_RESOLVER,
+ new Object[] {regionFunctionArgs.getCompressor()}));
+ }
+ }
+ }
}
private boolean diskStoreExists(Cache cache, String diskStoreName) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/95ad1643/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 c7c27cc..b925936 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,6 +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.logging.log4j.Logger;
import org.apache.geode.cache.Cache;
@@ -26,6 +28,7 @@ import org.apache.geode.cache.CacheWriter;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.PartitionAttributes;
import org.apache.geode.cache.PartitionAttributesFactory;
+import org.apache.geode.cache.PartitionResolver;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.RegionAttributes;
import org.apache.geode.cache.RegionExistsException;
@@ -405,9 +408,48 @@ public class RegionCreateFunction extends FunctionAdapter implements InternalEnt
prAttrFactory.setStartupRecoveryDelay(partitionArgs.getPrStartupRecoveryDelay());
}
+ if (regionCreateArgs.isPartitionResolverSet()) {
+ Class<?> partitionResolverClass = forName(regionCreateArgs.getPartitionResolver(),
+ CliStrings.CREATE_REGION__PARTITION_RESOLVER);
+ prAttrFactory
+ .setPartitionResolver((PartitionResolver<K, V>) newInstance(partitionResolverClass,
+ CliStrings.CREATE_REGION__PARTITION_RESOLVER));
+ }
return prAttrFactory.create();
}
+
+ private static Class<?> forName(String className, String neededFor) {
+ if (Strings.isNullOrEmpty(className)) {
+ return null;
+ }
+ try {
+ return ClassPathLoader.getLatest().forName(className);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(CliStrings.format(
+ CliStrings.CREATE_REGION_PARTITION_RESOLVER__MSG__COULDNOT_FIND_CLASS_0_SPECIFIED_FOR_1,
+ new Object[] {className, neededFor}), e);
+ } catch (ClassCastException e) {
+ throw new RuntimeException(CliStrings.format(
+ CliStrings.CREATE_REGION__MSG__PARTITION_RESOLVER__CLASS_0_SPECIFIED_FOR_1_IS_NOT_OF_EXPECTED_TYPE,
+ new Object[] {className, neededFor}), e);
+ }
+ }
+
+ private static Object newInstance(Class<?> klass, String neededFor) {
+ try {
+ return klass.newInstance();
+ } catch (InstantiationException e) {
+ throw new RuntimeException(CliStrings.format(
+ CliStrings.CREATE_REGION__MSG__PARTITION_RESOLVER__COULDNOT_INSTANTIATE_CLASS_0_SPECIFIED_FOR_1,
+ new Object[] {klass, neededFor}), e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(CliStrings.format(
+ CliStrings.CREATE_REGION__MSG__PARTITION_RESOLVER__COULDNOT_ACCESS_CLASS_0_SPECIFIED_FOR_1,
+ new Object[] {klass, neededFor}), e);
+ }
+ }
+
@Override
public String getId() {
return ID;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/95ad1643/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionFunctionArgs.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionFunctionArgs.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionFunctionArgs.java
index c1a8d1f..573b82e 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionFunctionArgs.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionFunctionArgs.java
@@ -77,6 +77,8 @@ public class RegionFunctionArgs implements Serializable {
private Boolean offHeap;
private final boolean isSetOffHeap;
private RegionAttributes<?, ?> regionAttributes;
+ private final boolean isPartitionResolver;
+ private String partitionResolver;
public RegionFunctionArgs(String regionPath, RegionShortcut regionShortcut,
String useAttributesFrom, boolean skipIfExists, String keyConstraint, String valueConstraint,
@@ -90,7 +92,7 @@ public class RegionFunctionArgs implements Serializable {
Integer concurrencyLevel, String prColocatedWith, Integer prLocalMaxMemory,
Long prRecoveryDelay, Integer prRedundantCopies, Long prStartupRecoveryDelay,
Long prTotalMaxMemory, Integer prTotalNumBuckets, Integer evictionMax, String compressor,
- Boolean offHeap, Boolean mcastEnabled) {
+ Boolean offHeap, Boolean mcastEnabled, final String partitionResolver) {
this.regionPath = regionPath;
this.regionShortcut = regionShortcut;
this.useAttributesFrom = useAttributesFrom;
@@ -155,8 +157,9 @@ public class RegionFunctionArgs implements Serializable {
if (this.isSetConcurrencyLevel) {
this.concurrencyLevel = concurrencyLevel;
}
- this.partitionArgs = new PartitionArgs(prColocatedWith, prLocalMaxMemory, prRecoveryDelay,
- prRedundantCopies, prStartupRecoveryDelay, prTotalMaxMemory, prTotalNumBuckets);
+ this.partitionArgs =
+ new PartitionArgs(prColocatedWith, prLocalMaxMemory, prRecoveryDelay, prRedundantCopies,
+ prStartupRecoveryDelay, prTotalMaxMemory, prTotalNumBuckets, partitionResolver);
this.isSetCompressor = (compressor != null);
if (this.isSetCompressor) {
@@ -166,6 +169,10 @@ public class RegionFunctionArgs implements Serializable {
if (this.isSetOffHeap) {
this.offHeap = offHeap;
}
+ this.isPartitionResolver = (partitionResolver != null);
+ if (this.isPartitionResolver) {
+ this.partitionResolver = partitionResolver;
+ }
}
// Constructor to be used for supplied region attributes
@@ -181,7 +188,7 @@ public class RegionFunctionArgs implements Serializable {
Integer concurrencyLevel, String prColocatedWith, Integer prLocalMaxMemory,
Long prRecoveryDelay, Integer prRedundantCopies, Long prStartupRecoveryDelay,
Long prTotalMaxMemory, Integer prTotalNumBuckets, Boolean offHeap, Boolean mcastEnabled,
- RegionAttributes<?, ?> regionAttributes) {
+ RegionAttributes<?, ?> regionAttributes, final String partitionResolver) {
this(regionPath, null, useAttributesFrom, skipIfExists, keyConstraint, valueConstraint,
statisticsEnabled, entryExpirationIdleTime, entryExpirationTTL, regionExpirationIdleTime,
regionExpirationTTL, diskStore, diskSynchronous, enableAsyncConflation,
@@ -189,7 +196,7 @@ public class RegionFunctionArgs implements Serializable {
gatewaySenderIds, concurrencyChecksEnabled, cloningEnabled, concurrencyLevel,
prColocatedWith, prLocalMaxMemory, prRecoveryDelay, prRedundantCopies,
prStartupRecoveryDelay, prTotalMaxMemory, prTotalNumBuckets, null, null, offHeap,
- mcastEnabled);
+ mcastEnabled, partitionResolver);
this.regionAttributes = regionAttributes;
}
@@ -387,6 +394,20 @@ public class RegionFunctionArgs implements Serializable {
}
/**
+ * @return the PartitionResolver
+ */
+ public String getPartitionResolver() {
+ return this.partitionResolver;
+ }
+
+ /**
+ * @return True if Partition Resolver is set otherwise False
+ */
+ public Boolean isPartitionResolverSet() {
+ return this.isPartitionResolver;
+ }
+
+ /**
* @return the concurrencyChecksEnabled
*/
public Boolean isConcurrencyChecksEnabled() {
@@ -590,13 +611,15 @@ public class RegionFunctionArgs implements Serializable {
private final boolean isSetPRTotalMaxMemory;
private int prTotalNumBuckets;
private final boolean isSetPRTotalNumBuckets;
+ private final boolean isPartitionResolver;
+ private String partitionResolver;
private boolean hasPartitionAttributes;
private final Set<String> userSpecifiedPartitionAttributes = new HashSet<String>();
public PartitionArgs(String prColocatedWith, Integer prLocalMaxMemory, Long prRecoveryDelay,
Integer prRedundantCopies, Long prStartupRecoveryDelay, Long prTotalMaxMemory,
- Integer prTotalNumBuckets) {
+ Integer prTotalNumBuckets, String partitionResolver) {
this.prColocatedWith = prColocatedWith;
if (this.prColocatedWith != null) {
this.hasPartitionAttributes = true;
@@ -638,6 +661,13 @@ public class RegionFunctionArgs implements Serializable {
this.hasPartitionAttributes = true;
userSpecifiedPartitionAttributes.add(CliStrings.CREATE_REGION__TOTALNUMBUCKETS);
}
+ this.isPartitionResolver = partitionResolver != null;
+ if (this.isPartitionResolver) {
+ this.partitionResolver = partitionResolver;
+ this.hasPartitionAttributes = true;
+ userSpecifiedPartitionAttributes.add(CliStrings.CREATE_REGION__PARTITION_RESOLVER);
+ }
+
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/95ad1643/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
index 3aa6db1..9aaef4d 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
@@ -1006,6 +1006,27 @@ public class CliStrings {
public static final String CREATE_REGION__OFF_HEAP__HELP =
"Causes the values of the region to be stored in off-heap memory. The default is on heap.";
+ public static final String CREATE_REGION__PARTITION_RESOLVER = "partition-resolver";
+ public static final String CREATE_REGION__PARTITION_RESOLVER__HELP =
+ "The fully-qualified class name of the region's partition resolver";
+ public static final String CREATE_REGION__MSG__PARTITION_RESOLVER_ONLY_FOR_REGION_TYPE_PARTITION =
+ "partition resolver property is only applicable to PARTITION region type";
+
+ public static final String CREATE_REGION_PARTITION_RESOLVER__MSG__COULDNOT_FIND_CLASS_0_SPECIFIED_FOR_1 =
+ "Could not find class \"{0}\" specified for \"{1}\".";
+
+ public static final String CREATE_REGION__MSG__PARTITION_RESOLVER__CLASS_0_SPECIFIED_FOR_1_IS_NOT_OF_EXPECTED_TYPE =
+ "Class \"{0}\" specified for \"{1}\" is not of an expected type.";
+
+ public static final String CREATE_REGION__MSG__PARTITION_RESOLVER__COULDNOT_INSTANTIATE_CLASS_0_SPECIFIED_FOR_1 =
+ "Could not instantiate class \"{0}\" specified for \"{1}\".";
+
+ public static final String CREATE_REGION__MSG__PARTITION_RESOLVER__COULDNOT_ACCESS_CLASS_0_SPECIFIED_FOR_1 =
+ "Could not access class \"{0}\" specified for \"{1}\".";
+
+ public static final String CREATE_REGION__MSG__INVALID_PARTITION_RESOLVER =
+ "{0} is an invalid Partition Resolver.";
+
/* debug command */
public static final String DEBUG = "debug";
public static final String DEBUG__HELP = "Enable/Disable debugging output in GFSH.";
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/95ad1643/geode-core/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/redis/internal/RegionProvider.java b/geode-core/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
index 07e313b..5994d7d 100644
--- a/geode-core/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
+++ b/geode-core/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
@@ -405,7 +405,7 @@ public class RegionProvider implements Closeable {
Result result = cliCmds.createRegion(key, defaultRegionType, null, null, true, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
- null);
+ null, null);
r = cache.getRegion(key);
if (result.getStatus() == Status.ERROR && r == null) {
String err = "";
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/95ad1643/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommandsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommandsDUnitTest.java
index 9e3b804..4896ead 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommandsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommandsDUnitTest.java
@@ -35,17 +35,12 @@ import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
+import org.apache.geode.cache.*;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
-import org.apache.geode.cache.Cache;
-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.internal.cache.PartitionedRegion;
import org.apache.geode.cache.asyncqueue.AsyncEvent;
import org.apache.geode.cache.asyncqueue.AsyncEventListener;
import org.apache.geode.cache.wan.GatewaySenderFactory;
@@ -1091,6 +1086,126 @@ public class CreateAlterDestroyRegionCommandsDUnitTest extends CliCommandTestBas
});
}
+
+ final String PR_STRING = " package com.cadrdunit;"
+ + " public class TestPartitionResolver implements org.apache.geode.cache.PartitionResolver { "
+ + " @Override" + " public void close() {" + " }" + " @Override"
+ + " public Object getRoutingObject(org.apache.geode.cache.EntryOperation opDetails) { "
+ + " return null; " + " }" + " @Override" + " public String getName() { "
+ + " return \"TestPartitionResolver\";" + " }" + " }";
+
+ /**
+ * Test Description 1. Deploy a JAR with Custom Partition Resolver 2. Create Region with Partition
+ * Resolver 3. Region should get created with no Errors 4. Verify Region Partition Attributes for
+ * Partition Resolver
+ *
+ * @throws IOException
+ */
+ @Test
+ public void testCreateRegionWithPartitionResolver() throws IOException {
+ setUpJmxManagerOnVm0ThenConnect(null);
+ VM vm = Host.getHost(0).getVM(1);
+ // Create a cache in vm 1
+ vm.invoke(() -> {
+ assertNotNull(getCache());
+ });
+
+ ClassBuilder classBuilder = new ClassBuilder();
+ // classBuilder.addToClassPath(".");
+ final File prJarFile = new File(new File(".").getAbsolutePath(), "myPartitionResolver.jar");
+ this.filesToBeDeleted.add(prJarFile.getAbsolutePath());
+ byte[] jarBytes =
+ classBuilder.createJarFromClassContent("com/cadrdunit/TestPartitionResolver", PR_STRING);
+ writeJarBytesToFile(prJarFile, jarBytes);
+
+ CommandResult cmdResult = executeCommand("deploy --jar=myPartitionResolver.jar");
+ assertEquals(Result.Status.OK, cmdResult.getStatus());
+
+
+ // Create a region with an unrecognized compressor
+ CommandStringBuilder commandStringBuilder = new CommandStringBuilder(CliStrings.CREATE_REGION);
+ commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGION, "regionWithPartitionResolver");
+ commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGIONSHORTCUT, "PARTITION");
+ commandStringBuilder.addOption(CliStrings.CREATE_REGION__PARTITION_RESOLVER,
+ "com.cadrdunit.TestPartitionResolver");
+ CommandResult cmdResult1 = executeCommand(commandStringBuilder.toString());
+ assertEquals(Result.Status.OK, cmdResult1.getStatus());
+
+ // Assert that our region was not created
+ vm.invoke(() -> {
+ Region region = getCache().getRegion("regionWithPartitionResolver");
+ assertNotNull(region);
+
+ PartitionedRegion pr = (PartitionedRegion) region;
+ PartitionAttributes partitionAttributes = pr.getPartitionAttributes();
+ assertNotNull(partitionAttributes);
+ PartitionResolver partitionResolver = partitionAttributes.getPartitionResolver();
+ assertNotNull(partitionResolver);
+ assertEquals("TestPartitionResolver", partitionResolver.getName());
+ });
+
+ vm.invoke(() -> {
+ getCache().getRegion("regionWithPartitionResolver").destroyRegion();
+ });
+ }
+
+ @Test
+ public void testCreateRegionWithInvalidPartitionResolver() {
+ setUpJmxManagerOnVm0ThenConnect(null);
+ VM vm = Host.getHost(0).getVM(1);
+ // Create a cache in vm 1
+ vm.invoke(() -> {
+ assertNotNull(getCache());
+ });
+
+ // Create a region with an unrecognized compressor
+ CommandStringBuilder commandStringBuilder = new CommandStringBuilder(CliStrings.CREATE_REGION);
+ commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGION,
+ "testCreateRegionWithInvalidPartitionResolver");
+ commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGIONSHORTCUT, "PARTITION");
+ commandStringBuilder.addOption(CliStrings.CREATE_REGION__PARTITION_RESOLVER, "a.b.c.d");
+ CommandResult cmdResult = executeCommand(commandStringBuilder.toString());
+ assertEquals(Result.Status.ERROR, cmdResult.getStatus());
+
+ // Assert that our region was not created
+ vm.invoke(() -> {
+ Region region = getCache().getRegion("testCreateRegionWithInvalidPartitionResolver");
+ assertNull(region);
+ });
+ }
+
+ /**
+ * Test Description Try creating region of type REPLICATED and specify partition resolver Region
+ * Creation should fail.
+ */
+ @Test
+ public void testCreateRegionForReplicatedRegionWithParitionResolver() {
+ setUpJmxManagerOnVm0ThenConnect(null);
+ VM vm = Host.getHost(0).getVM(1);
+ // Create a cache in vm 1
+ vm.invoke(() -> {
+ assertNotNull(getCache());
+ });
+
+ // Create a region with an unrecognized compressor
+ CommandStringBuilder commandStringBuilder = new CommandStringBuilder(CliStrings.CREATE_REGION);
+ commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGION,
+ "testCreateRegionForReplicatedRegionWithParitionResolver");
+ commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGIONSHORTCUT, "REPLICATE");
+ commandStringBuilder.addOption(CliStrings.CREATE_REGION__PARTITION_RESOLVER, "a.b.c.d");
+ CommandResult cmdResult = executeCommand(commandStringBuilder.toString());
+ System.out.println("Result --> " + cmdResult);
+ assertEquals(Result.Status.ERROR, cmdResult.getStatus());
+
+ // Assert that our region was not created
+ vm.invoke(() -> {
+ Region region =
+ getCache().getRegion("testCreateRegionForReplicatedRegionWithParitionResolver");
+ assertNull(region);
+ });
+ }
+
+
@Override
protected final void preTearDownCliCommandTestBase() throws Exception {
for (String path : this.filesToBeDeleted) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/95ad1643/geode-core/src/test/resources/org/apache/geode/management/internal/cli/commands/golden-help-offline.properties
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/org/apache/geode/management/internal/cli/commands/golden-help-offline.properties b/geode-core/src/test/resources/org/apache/geode/management/internal/cli/commands/golden-help-offline.properties
index 7ee735b..f08a257 100644
--- a/geode-core/src/test/resources/org/apache/geode/management/internal/cli/commands/golden-help-offline.properties
+++ b/geode-core/src/test/resources/org/apache/geode/management/internal/cli/commands/golden-help-offline.properties
@@ -885,10 +885,11 @@ SYNTAX\n\
\ \ \ \ [--entry-idle-time-expiration-action=value] [--entry-time-to-live-expiration=value]\n\
\ \ \ \ [--entry-time-to-live-expiration-action=value] [--gateway-sender-id=value(,value)*]\n\
\ \ \ \ [--key-constraint=value] [--local-max-memory=value] [--off-heap(=value)?]\n\
-\ \ \ \ [--region-idle-time-expiration=value] [--region-idle-time-expiration-action=value]\n\
-\ \ \ \ [--region-time-to-live-expiration=value] [--region-time-to-live-expiration-action=value]\n\
-\ \ \ \ [--recovery-delay=value] [--redundant-copies=value] [--startup-recovery-delay=value]\n\
-\ \ \ \ [--total-max-memory=value] [--total-num-buckets=value] [--value-constraint=value]\n\
+\ \ \ \ [--partition-resolver=value] [--region-idle-time-expiration=value]\n\
+\ \ \ \ [--region-idle-time-expiration-action=value] [--region-time-to-live-expiration=value]\n\
+\ \ \ \ [--region-time-to-live-expiration-action=value] [--recovery-delay=value]\n\
+\ \ \ \ [--redundant-copies=value] [--startup-recovery-delay=value] [--total-max-memory=value]\n\
+\ \ \ \ [--total-num-buckets=value] [--value-constraint=value]\n\
PARAMETERS\n\
\ \ \ \ name\n\
\ \ \ \ \ \ \ \ Name/Path of the region to be created.\n\
@@ -1005,6 +1006,9 @@ PARAMETERS\n\
\ \ \ \ \ \ \ \ Causes the values of the region to be stored in off-heap memory. The default is on heap.\n\
\ \ \ \ \ \ \ \ Required: false\n\
\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): true\n\
+\ \ \ \ partition-resolver\n\
+\ \ \ \ \ \ \ \ The fully-qualified class name of the region's partition resolver\n\
+\ \ \ \ \ \ \ \ Required: false\n\
\ \ \ \ region-idle-time-expiration\n\
\ \ \ \ \ \ \ \ How long the region can remain in the cache without being accessed. The default is no\n\
\ \ \ \ \ \ \ \ expiration of this type.\n\
[35/50] [abbrv] incubator-geode git commit: GEODE-2110 Revised
wording of gfsh start server --password
Posted by kl...@apache.org.
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 Miller <km...@pivotal.io>
Authored: Tue Nov 15 10:49:14 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
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 <code>gfsh</code> will prompt for the password.
</tr>
<tr class="even">
<td><span class="keyword parmname">\-\-password</span></td>
-<td>The password portion of the credential to use in authenticating to the cluster.
+<td>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.
</td>
<td></td>
</tr>
[15/50] [abbrv] incubator-geode git commit: GEODE-2089
entry-idle-time on client side cache is not working as expected
Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e584c4e6/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey1.java
index 8f9438b..672f5b3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey1.java
@@ -15,12 +15,10 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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/VersionedThinLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey2.java
index 5ee384b..10ee64d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapStringKey2.java
@@ -15,12 +15,10 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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/VersionedThinLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapUUIDKey.java
index 977cd75..9140cc7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapUUIDKey.java
@@ -16,12 +16,10 @@ package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
import java.util.UUID;
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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/VersionedThinLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapIntKey.java
index 848cb1d..00d143d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapIntKey.java
@@ -15,12 +15,10 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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/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 7184106..8fe2fae 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
@@ -15,12 +15,10 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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/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 f1aea63..cd8c1c6 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
@@ -15,12 +15,10 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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/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 b517e63..f09495f 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
@@ -15,12 +15,10 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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/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 d433994..6c3940d 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
@@ -15,12 +15,10 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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/VersionedThinLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java
index e9d3d9e..ab6ecba 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java
@@ -16,12 +16,10 @@ package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
import java.util.UUID;
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.internal.cache.lru.EnableLRU;
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/test/java/org/apache/geode/cache30/ClientServerCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/ClientServerCCEDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/ClientServerCCEDUnitTest.java
index 7cf632f..19e9ea6 100644
--- a/geode-core/src/test/java/org/apache/geode/cache30/ClientServerCCEDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/ClientServerCCEDUnitTest.java
@@ -17,6 +17,8 @@ package org.apache.geode.cache30;
import static org.apache.geode.distributed.ConfigurationProperties.*;
import static org.junit.Assert.*;
+import com.jayway.awaitility.Awaitility;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -25,7 +27,13 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import org.apache.geode.cache.AttributesMutator;
+import org.apache.geode.cache.ExpirationAction;
+import org.apache.geode.cache.ExpirationAttributes;
+import org.apache.geode.test.dunit.IgnoredException;
+import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@@ -43,6 +51,7 @@ 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.internal.AvailablePortHelper;
+import org.apache.geode.internal.cache.AbstractRegionEntry;
import org.apache.geode.internal.cache.LocalRegion;
import org.apache.geode.internal.cache.ha.HARegionQueue;
import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier;
@@ -68,15 +77,88 @@ import org.apache.geode.test.junit.categories.DistributedTest;
public class ClientServerCCEDUnitTest extends JUnit4CacheTestCase {
public static LocalRegion TestRegion;
+ @Before
public void setup() {
// for bug #50683 we need a short queue-removal-message processing interval
HARegionQueue.setMessageSyncInterval(5);
+ IgnoredException.addIgnoredException("java.net.ConnectException");
}
@Override
public final void preTearDownCacheTestCase() {
disconnectAllFromDS();
HARegionQueue.setMessageSyncInterval(HARegionQueue.DEFAULT_MESSAGE_SYNC_INTERVAL);
+ TestRegion = null;
+ }
+
+
+ @Test
+ public void testClientDoesNotExpireEntryPrematurely() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm0 = host.getVM(0);
+ VM vm1 = host.getVM(1);
+ final String name = this.getUniqueName() + "Region";
+ final String key = "testKey";
+
+ int port = createServerRegion(vm0, name, true);
+
+ vm0.invoke(new SerializableCallable("create old entry") {
+ public Object call() throws Exception {
+ LocalRegion r = (LocalRegion) basicGetCache().getRegion(name);
+ r.put(key, "value");
+ AbstractRegionEntry entry = (AbstractRegionEntry) r.basicGetEntry(key);
+ // set an old timestamp in the entry - thirty minutes ago
+ entry.getVersionStamp().setVersionTimeStamp(System.currentTimeMillis() - 1800000L);
+ return null;
+ }
+ });
+
+ createClientRegion(vm1, name, port, true, ClientRegionShortcut.CACHING_PROXY, false);
+
+ vm1.invoke(new SerializableCallable("fetch entry and validate") {
+ public Object call() throws Exception {
+ final Long[] expirationTimeMillis = new Long[1];
+ int expirationSeconds = 15;
+
+ LocalRegion r = (LocalRegion) basicGetCache().getRegion(name);
+ AttributesMutator mutator = r.getAttributesMutator();
+ mutator.setEntryIdleTimeout(
+ new ExpirationAttributes(expirationSeconds, ExpirationAction.LOCAL_DESTROY));
+ mutator.addCacheListener(new CacheListenerAdapter() {
+ @Override
+ public void afterDestroy(EntryEvent event) {
+ expirationTimeMillis[0] = System.currentTimeMillis();
+ }
+ });
+
+ // fetch the entry from the server and make sure it doesn't expire early
+ if (!r.containsKey(key)) {
+ r.get(key);
+ }
+
+ final long expirationTime = System.currentTimeMillis() + (expirationSeconds * 1000);
+
+ Awaitility.await("waiting for object to expire")
+ .atMost(expirationSeconds * 2, TimeUnit.SECONDS).until(() -> {
+ return expirationTimeMillis[0] != null;
+ });
+
+ disconnectFromDS();
+
+ assertTrue(
+ "entry expired " + (expirationTime - expirationTimeMillis[0]) + " milliseconds early",
+ expirationTimeMillis[0] >= expirationTime);
+
+ return null;
+ }
+ });
+
+ vm0.invoke(new SerializableRunnable() {
+ public void run() {
+ disconnectFromDS();
+ }
+ });
+
}
public ClientServerCCEDUnitTest() {
@@ -644,17 +726,28 @@ public class ClientServerCCEDUnitTest extends JUnit4CacheTestCase {
private void createClientRegion(final VM vm, final String regionName, final int port,
final boolean ccEnabled, final ClientRegionShortcut clientRegionShortcut) {
+ createClientRegion(vm, regionName, port, ccEnabled, clientRegionShortcut, true);
+ }
+
+ private void createClientRegion(final VM vm, final String regionName, final int port,
+ final boolean ccEnabled, final ClientRegionShortcut clientRegionShortcut,
+ final boolean registerInterest) {
SerializableCallable createRegion = new SerializableCallable() {
public Object call() throws Exception {
ClientCacheFactory cf = new ClientCacheFactory();
cf.addPoolServer(NetworkUtils.getServerHostName(vm.getHost()), port);
- cf.setPoolSubscriptionEnabled(true);
+ if (registerInterest) {
+ cf.setPoolSubscriptionEnabled(true);
+ }
cf.set(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel());
ClientCache cache = getClientCache(cf);
ClientRegionFactory crf = cache.createClientRegionFactory(clientRegionShortcut);
crf.setConcurrencyChecksEnabled(ccEnabled);
+ crf.setStatisticsEnabled(true);
TestRegion = (LocalRegion) crf.create(regionName);
- TestRegion.registerInterestRegex(".*", InterestResultPolicy.KEYS_VALUES, false, true);
+ if (registerInterest) {
+ TestRegion.registerInterestRegex(".*", InterestResultPolicy.KEYS_VALUES, false, true);
+ }
return null;
}
};
[50/50] [abbrv] incubator-geode git commit: Convert from
ManagementTestCase to ManagementTestRule
Posted by kl...@apache.org.
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 Lund <kl...@apache.org>
Authored: Mon Oct 31 13:45:28 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
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 org.apache.geode.pdx.PdxInstance;
import org.apache.geode.test.dunit.Host;
import org.apache.geode.test.dunit.NetworkUtils;
@@ -78,55 +77,51 @@ import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactor
*
* @since GemFire 8.0
*/
-
@Category(DistributedTest.class)
@RunWith(Parameterized.class)
@Parameterized.UseParametersRunnerFactory(CategoryWithParameterizedRunnerFactory.class)
+@SuppressWarnings("serial")
public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase {
- private static final long serialVersionUID = -254776154266339226L;
-
- @Parameterized.Parameter
- public String urlContext;
-
- @Parameterized.Parameters
- public static Collection<String> data() {
- return Arrays.asList("/geode", "/gemfire-api");
- }
-
- private ManagementTestBase helper;
-
public static final String PEOPLE_REGION_NAME = "People";
- // private static RestTemplate restTemplate;
-
- private static final String findAllPeopleQuery =
- "/queries?id=findAllPeople&q=SELECT%20*%20FROM%20/People";
- private static final String findPeopleByGenderQuery =
- "/queries?id=filterByGender&q=SELECT%20*%20from%20/People%20where%20gender=$1";
- private static final String findPeopleByLastNameQuery =
- "/queries?id=filterByLastName&q=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\": \"Raj\","
- + " \"birthDate\": \"12/04/1982\"," + "\"gender\": \"FEMALE\"" + "}," + "\"@new\" :" + "{"
- + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\"," + "\"id\": 1101,"
- + " \"firstName\": \"Virat\"," + " \"middleName\": \"Premkumar\","
- + " \"lastName\": \"Kohli\"," + " \"birthDate\": \"08/11/1988\"," + "\"gender\": \"MALE\""
- + "}" + "}";
-
- final static String PERSON_AS_JSON_REPLACE =
- "{" + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\"," + "\"id\": 501,"
- + " \"firstName\": \"Barack\"," + " \"middleName\": \"Hussein\","
- + " \"lastName\": \"Obama\"," + " \"birthDate\": \"04/08/1961\"," + "\"gender\": \"MALE\""
- + "}";
+ private static final String findAllPeopleQuery = "/queries?id=findAllPeople&q=SELECT%20*%20FROM%20/People";
+ private static final String findPeopleByGenderQuery = "/queries?id=filterByGender&q=SELECT%20*%20from%20/People%20where%20gender=$1";
+ private static final String findPeopleByLastNameQuery = "/queries?id=filterByLastName&q=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\": \"Raj\","
+ + " \"birthDate\": \"12/04/1982\"," + "\"gender\": \"FEMALE\""
+ + "},"
+ + "\"@new\" :"
+ + "{"
+ + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\","
+ + "\"id\": 1101," + " \"firstName\": \"Virat\","
+ + " \"middleName\": \"Premkumar\"," + " \"lastName\": \"Kohli\","
+ + " \"birthDate\": \"08/11/1988\"," + "\"gender\": \"MALE\""
+ + "}"
+ + "}";
+
+ final static String PERSON_AS_JSON_REPLACE = "{"
+ + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\","
+ + "\"id\": 501," + " \"firstName\": \"Barack\","
+ + " \"middleName\": \"Hussein\"," + " \"lastName\": \"Obama\","
+ + " \"birthDate\": \"04/08/1961\"," + "\"gender\": \"MALE\""
+ + "}";
private static final String PERSON_LIST_AS_JSON = "[" + "{"
+ "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\"," + "\"id\": 3,"
@@ -161,23 +156,12 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase {
+ " \"lastName\": \"Patel\"," + " \"birthDate\": \"23/08/2012\"," + "\"gender\": \"MALE\""
+ "}" + "]";
- public RestAPIsAndInterOpsDUnitTest() {
- super();
- this.helper = new ManagementTestBase() {
- {
- }
- };
-
- }
-
- @Override
- public final void preSetUp() throws Exception {
- disconnectAllFromDS();
- }
+ @Parameterized.Parameter
+ public String urlContext;
- @Override
- protected final void postTearDownLocatorTestBase() throws Exception {
- disconnectAllFromDS();
+ @Parameterized.Parameters
+ public static Collection<String> data() {
+ return Arrays.asList("/geode", "/gemfire-api");
}
public String startBridgeServerWithRestService(final String hostName, final String[] groups,
@@ -828,14 +812,6 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase {
// Querying
doQueryOpsUsingRestApis(restEndpoint);
-
- // stop the client and make sure the bridge server notifies
- // stopBridgeMemberVM(client);
- helper.closeCache(locator);
- helper.closeCache(manager);
- helper.closeCache(server);
- helper.closeCache(client);
-
}
private void createClientCache(final String host, final int port) throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/build.gradle
----------------------------------------------------------------------
diff --git a/geode-core/build.gradle b/geode-core/build.gradle
index 067bafc..383e071 100755
--- a/geode-core/build.gradle
+++ b/geode-core/build.gradle
@@ -114,6 +114,7 @@ dependencies {
// Test Dependencies
// External
+ testCompile 'com.jayway.jsonpath:json-path-assert:' + project.'json-path-assert.version'
testCompile 'org.apache.bcel:bcel:' + project.'bcel.version'
testRuntime 'org.apache.derby:derby:' + project.'derby.version'
testCompile 'org.mockito:mockito-core:' + project.'mockito-core.version'
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/main/java/org/apache/geode/management/JVMMetrics.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/JVMMetrics.java b/geode-core/src/main/java/org/apache/geode/management/JVMMetrics.java
index 127592a..388c8f6 100644
--- a/geode-core/src/main/java/org/apache/geode/management/JVMMetrics.java
+++ b/geode-core/src/main/java/org/apache/geode/management/JVMMetrics.java
@@ -15,6 +15,7 @@
package org.apache.geode.management;
import java.beans.ConstructorProperties;
+import java.io.Serializable;
import org.apache.geode.cache.Region;
@@ -25,7 +26,7 @@ import org.apache.geode.cache.Region;
* @since GemFire 7.0
*
*/
-public class JVMMetrics {
+public class JVMMetrics implements Serializable {
/**
* Number of GCs performed
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/main/java/org/apache/geode/management/OSMetrics.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/OSMetrics.java b/geode-core/src/main/java/org/apache/geode/management/OSMetrics.java
index d90c8be..e6f27a7 100644
--- a/geode-core/src/main/java/org/apache/geode/management/OSMetrics.java
+++ b/geode-core/src/main/java/org/apache/geode/management/OSMetrics.java
@@ -15,6 +15,7 @@
package org.apache.geode.management;
import java.beans.ConstructorProperties;
+import java.io.Serializable;
/**
* Composite data type used to distribute metrics for the operating system hosting a member of the
@@ -23,8 +24,8 @@ import java.beans.ConstructorProperties;
* @since GemFire 7.0
*
*/
-public class OSMetrics {
-
+public class OSMetrics implements Serializable {
+
/**
* Maximum number file descriptor which can be opened
*/
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java b/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
index cb75591..0d243c7 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
@@ -350,7 +350,7 @@ public final class SystemManagementService extends BaseManagementService {
}
- public <T> T getMBeanProxy(ObjectName objectName, Class<T> interfaceClass) {
+ public <T> T getMBeanProxy(ObjectName objectName, Class<T> interfaceClass) { // TODO: this is too generic
if (!isStartedAndOpen()) {
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java
index dcbca7e..f04a01d 100755
--- a/geode-core/src/test/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java
@@ -97,15 +97,15 @@ public class DistributedLockServiceDUnitTest extends JUnit4DistributedTestCase {
@Override
public final void preTearDown() throws Exception {
Invoke.invokeInEveryVM(() -> destroyAllDLockServices());
- // invokeInEveryVM(DistributedLockServiceDUnitTest.class,
- // "remoteDumpAllDLockServices");
-
- // InternalDistributedLockService.destroyAll();
-
- // // Disconnects the DistributedSystem in every VM - since
- // // each test randomly chooses whether shared memory is used
- // disconnectAllFromDS();
-
+// invokeInEveryVMAndController(DistributedLockServiceDUnitTest.class,
+// "remoteDumpAllDLockServices");
+
+ //InternalDistributedLockService.destroyAll();
+
+// // Disconnects the DistributedSystem in every VM - since
+// // each test randomly chooses whether shared memory is used
+// disconnectAllFromDS();
+
this.lockGrantor = null;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java
index de63433..2213700 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java
@@ -40,19 +40,19 @@ public class ConnectDisconnectDUnitTest extends JUnit4CacheTestCase {
// see bugs #50785 and #46438
@Test
public void testManyConnectsAndDisconnects() throws Throwable {
- // invokeInEveryVM(new SerializableRunnable() {
- //
- // @Override
- // public void run() {
- // Log.setLogWriterLevel("info");
- // }
- // });
-
- // uncomment these lines to use stand-alone locators
- // int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(4);
- // setLocatorPorts(ports);
-
- for (int i = 0; i < 20; i++) {
+// invokeInEveryVMAndController(new SerializableRunnable() {
+//
+// @Override
+// public void run() {
+// Log.setLogWriterLevel("info");
+// }
+// });
+
+// uncomment these lines to use stand-alone locators
+// int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(4);
+// setLocatorPorts(ports);
+
+ for(int i = 0; i < 20; i++) {
LogWriterUtils.getLogWriter().info("Test run: " + i);
runOnce();
tearDown();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
index ed23f2a..0cb6693 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
@@ -443,12 +443,10 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest
}
});
- // final int bucketPerHost = (int) Math.ceil(((double) maxBuckets / Host.getHostCount()));
-
- // invokeInEveryVM(new SerializableRunnable("") {
- //
- // }
-
+// invokeInEveryVMAndController(new SerializableRunnable("") {
+//
+// }
+
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java
index 6a5eae8..82c7628 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java
@@ -88,11 +88,12 @@ public class TXLockServiceDUnitTest extends JUnit4DistributedTestCase {
@Override
public final void preTearDown() throws Exception {
- // invokeInEveryVM(TXLockServiceDUnitTest.class,
- // "remoteDumpAllDLockServices");
-
- Invoke.invokeInEveryVM(TXLockServiceDUnitTest.class, "destroyServices");
-
+// invokeInEveryVMAndController(TXLockServiceDUnitTest.class,
+// "remoteDumpAllDLockServices");
+
+ Invoke.invokeInEveryVM(TXLockServiceDUnitTest.class,
+ "destroyServices");
+
destroyServices();
// // Disconnects the DistributedSystem in every VM - since
@@ -112,10 +113,9 @@ public class TXLockServiceDUnitTest extends JUnit4DistributedTestCase {
@Test
public void testGetAndDestroy() {
forEachVMInvoke("checkGetAndDestroy", new Object[] {});
- /*
- * invokeInEveryVM(TXLockServiceDUnitTest.class, "destroyServices");
- * forEachVMInvoke("checkGetAndDestroy", new Object[] {});
- */
+ /*invokeInEveryVMAndController(TXLockServiceDUnitTest.class,
+ "destroyServices");
+ forEachVMInvoke("checkGetAndDestroy", new Object[] {});*/
}
@Test
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/CacheManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/CacheManagementDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/CacheManagementDUnitTest.java
index 680579d..a40bfd1 100644
--- a/geode-core/src/test/java/org/apache/geode/management/CacheManagementDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/CacheManagementDUnitTest.java
@@ -14,11 +14,14 @@
*/
package org.apache.geode.management;
-import static org.apache.geode.distributed.ConfigurationProperties.*;
import static com.jayway.awaitility.Awaitility.*;
+import static java.util.concurrent.TimeUnit.*;
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+import static org.assertj.core.api.Assertions.*;
import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import java.io.Serializable;
+import java.lang.management.ManagementFactory;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -26,13 +29,16 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import javax.management.InstanceNotFoundException;
+
import javax.management.JMException;
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.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@@ -43,57 +49,69 @@ import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.management.internal.LocalManager;
import org.apache.geode.management.internal.MBeanJMXAdapter;
import org.apache.geode.management.internal.ManagementConstants;
import org.apache.geode.management.internal.NotificationHub.NotificationHubListener;
import org.apache.geode.management.internal.SystemManagementService;
-import org.apache.geode.test.dunit.AsyncInvocation;
-import org.apache.geode.test.dunit.LogWriterUtils;
-import org.apache.geode.test.dunit.SerializableRunnable;
+import org.apache.geode.test.dunit.Invoke;
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;
/**
* This class checks and verifies various data and operations exposed through MemberMXBean
* interface.
* <p>
- * Goal of the Test : MemberMBean gets created once cache is created. Data like config data and
- * stats are of proper value To check proper federation of MemberMBean including remote ops and
- * remote data access
+ * <p>Goal of the Test : MemberMBean gets created once cache is created. Data like
+ * config data and stats are of proper value To check proper federation of
+ * MemberMBean including remote ops and remote data access
+ * <p>
+ * <p>This test is a mess and needs to be rewritten.
*/
@Category(DistributedTest.class)
-public class CacheManagementDUnitTest extends ManagementTestBase {
+@SuppressWarnings({ "serial", "unused" })
+public class CacheManagementDUnitTest implements Serializable {
+
+ /** used in memberVMs */
+ private static final String NOTIFICATION_REGION_NAME = "NotifTestRegion_";
+
+ /** used in managerVM */
+ private static final List<Notification> notifications = new ArrayList<>();
+
+ @Manager
+ private VM managerVM;
+
+ @Member
+ private VM[] memberVMs;
- private final String VERIFY_CONFIG_METHOD = "verifyConfigData";
+ @Rule
+ public ManagementTestRule managementTestRule = ManagementTestRule.builder().build();
- private final String VERIFY_REMOTE_CONFIG_METHOD = "verifyConfigDataRemote";
+ @Rule
+ public SerializableTemporaryFolder temporaryFolder = new SerializableTemporaryFolder();
- static final List<Notification> notifList = new ArrayList<Notification>();
+ @Rule
+ public SerializableTestName testName = new SerializableTestName();
- // 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;
+ @Before
+ public void before() throws Exception {
+ this.managerVM.invoke(() -> notifications.clear());
+ }
@Test
public void testGemFireConfigData() throws Exception {
- initManagement(false);
-
- Map<DistributedMember, DistributionConfig> configMap =
- new HashMap<DistributedMember, DistributionConfig>();
- for (VM vm : getManagedNodeList()) {
- Map<DistributedMember, DistributionConfig> configMapMember =
- (Map<DistributedMember, DistributionConfig>) vm.invoke(CacheManagementDUnitTest.class,
- VERIFY_CONFIG_METHOD);
+ this.managementTestRule.createMembers();
+ this.managementTestRule.createManagers();
+
+ Map<DistributedMember, DistributionConfig> configMap = new HashMap<>();
+ for (VM memberVM : this.memberVMs) {
+ Map<DistributedMember, DistributionConfig> configMapMember = memberVM.invoke(() -> verifyConfigData());
configMap.putAll(configMapMember);
}
- Object[] args = new Object[1];
- args[0] = configMap;
- getManagingNode().invoke(CacheManagementDUnitTest.class, VERIFY_REMOTE_CONFIG_METHOD, args);
+ this.managerVM.invoke(() -> verifyConfigDataRemote(configMap));
}
/**
@@ -101,30 +119,34 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
*/
@Test
public void testMemberMBeanOperations() throws Exception {
- initManagement(false);
+ int i = 1;
+ for (VM memberVM : this.memberVMs) {
+ Properties props = new Properties();
+ props.setProperty(LOG_FILE, this.temporaryFolder.newFile(this.testName.getMethodName() + "-VM" + i + ".log").getAbsolutePath());
+ this.managementTestRule.createMember(memberVM, props);
+ i++;
+ }
- for (VM vm : managedNodeList) {
+ this.managementTestRule.createManagers();
- // Do some operations to fill the logs
+ for (VM memberVM : this.memberVMs) {
+ String logMessage = "This line should be in the log";
+ memberVM.invoke(() -> this.managementTestRule.getCache().getLogger().info(logMessage));
- createLocalRegion(vm, "testRegion");
+ String log = memberVM.invoke(() -> fetchLog(30));
+ assertThat(log).isNotNull();
+ assertThat(log).contains(logMessage);
- String log = (String) vm.invoke(() -> CacheManagementDUnitTest.fetchLog());
- assertNotNull(log);
- LogWriterUtils.getLogWriter()
- .info("<ExpectedString> Log Of Member is " + log.toString() + "</ExpectedString> ");
+ JVMMetrics jvmMetrics = memberVM.invoke(() -> fetchJVMMetrics());
- vm.invoke(() -> CacheManagementDUnitTest.fetchJVMMetrics());
+ OSMetrics osMetrics = memberVM.invoke(() -> fetchOSMetrics());
- vm.invoke(() -> CacheManagementDUnitTest.fetchOSMetrics());
+ // TODO: need assertions
- vm.invoke(() -> CacheManagementDUnitTest.shutDownMember());
+ memberVM.invoke(() -> shutDownMember());
}
- VM managingNode = getManagingNode();
- Object[] args = new Object[1];
- args[0] = 1;// Only locator member wont be shutdown
- managingNode.invoke(CacheManagementDUnitTest.class, "assertExpectedMembers", args);
+ this.managerVM.invoke(() -> verifyExpectedMembers(0));
}
/**
@@ -132,270 +154,254 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
*/
@Test
public void testMemberMBeanOpsRemote() throws Exception {
- initManagement(false);
- getManagingNode().invoke(() -> CacheManagementDUnitTest.invokeRemoteOps());
+ this.managementTestRule.createMembers();
+ this.managementTestRule.createManagers();
+ this.managerVM.invoke(() -> invokeRemoteMemberMXBeanOps());
}
/**
- * Creates and starts a manager. Multiple Managers
+ * Creates and starts a managerVM.
+ * Multiple Managers
*/
@Test
public void testManager() throws Exception {
- List<VM> managedNodeList = getManagedNodeList();
- VM node1 = managedNodeList.get(0);
- VM node2 = managedNodeList.get(1);
- VM node3 = managedNodeList.get(2);
- VM managingNode = getManagingNode();
+ this.managementTestRule.createMember(this.memberVMs[0]);
+ this.managementTestRule.createMember(this.memberVMs[1]);
- createCache(node1);
- createCache(node2);
- createManagementCache(node3);
+ this.managementTestRule.createManager(this.memberVMs[2], false);
- // Only creates a cache in Managing Node
- // Does not start the manager
- createManagementCache(managingNode);
+ this.managementTestRule.createManager(this.managerVM, false);
- node3.invoke(() -> CacheManagementDUnitTest.startManager());
+ this.memberVMs[2].invoke(() -> startManager());
- // Now start Managing node manager. System will have two Managers now which
+ // Now start Managing node managerVM. System will have two Managers now which
// should be OK
- DistributedMember member = getMember(node3);
- startManagingNode(managingNode);
- checkManagerView(managingNode, member);
- stopManagingNode(managingNode);
+ DistributedMember member = this.managementTestRule.getDistributedMember(this.memberVMs[2]);
+ this.managementTestRule.startManager(this.managerVM);
+
+ verifyManagerStarted(this.managerVM, member);
+ this.managementTestRule.stopManager(this.managerVM);
}
/**
- * Creates and starts a manager. Multiple Managers
+ * Creates and starts a managerVM.
+ * Multiple Managers
*/
@Test
public void testManagerShutdown() throws Exception {
- List<VM> managedNodeList = getManagedNodeList();
- VM node1 = managedNodeList.get(0);
- VM node2 = managedNodeList.get(1);
- VM node3 = managedNodeList.get(2);
- VM managingNode = getManagingNode();
+ this.managementTestRule.createMember(this.memberVMs[0]);
+ this.managementTestRule.createMember(this.memberVMs[1]);
+ this.managementTestRule.createMember(this.memberVMs[2]);
- createCache(node1);
- createCache(node2);
- createCache(node3);
+ this.managementTestRule.createManager(this.managerVM, false);
+ this.managementTestRule.startManager(this.managerVM);
- // Only creates a cache in Managing Node
- // Does not start the manager
- createManagementCache(managingNode);
+ verifyManagerStarted(this.managerVM, this.managementTestRule.getDistributedMember(this.memberVMs[0]));
- startManagingNode(managingNode);
- DistributedMember member = getMember(managingNode);
- checkManagerView(managingNode, member);
- stopManagingNode(managingNode);
- checkNonManagerView(managingNode);
+ this.managementTestRule.stopManager(this.managerVM);
+ verifyManagerStopped(this.managerVM, this.memberVMs.length);
}
@Test
- public void testServiceCloseManagedNode() throws Exception {
- List<VM> managedNodeList = getManagedNodeList();
- VM node1 = managedNodeList.get(0);
- VM node2 = managedNodeList.get(1);
- VM node3 = managedNodeList.get(2);
- VM managingNode = getManagingNode();
+ public void closeCacheShouldStopLocalManager() throws Exception {
+ this.managementTestRule.createMember(this.memberVMs[0]);
+ this.managementTestRule.createMember(this.memberVMs[1]);
- createCache(node1);
- createCache(node2);
- createManagementCache(node3);
+ this.managementTestRule.createManager(this.memberVMs[2], false);
// Only creates a cache in Managing Node
- // Does not start the manager
- createManagementCache(managingNode);
-
- node3.invoke(() -> CacheManagementDUnitTest.startManager());
-
- closeCache(node3);
- validateServiceResource(node3);
+ // Does not start the managerVM
+ this.managementTestRule.createManager(this.managerVM, false);
+
+ this.memberVMs[2].invoke(() -> startManager());
+
+ this.memberVMs[2].invoke(() -> {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ LocalManager localManager = service.getLocalManager();
+ this.managementTestRule.getCache().close();
+ assertThat(localManager.isRunning()).isFalse();
+ assertThat(service.isManager()).isFalse();
+ assertThat(service.getLocalManager()).isNull();
+ });
}
@Test
public void testGetMBean() throws Exception {
- List<VM> managedNodeList = getManagedNodeList();
- VM node1 = managedNodeList.get(0);
- VM node2 = managedNodeList.get(1);
- VM node3 = managedNodeList.get(2);
- VM managingNode = getManagingNode();
-
- createCache(node1);
- createCache(node2);
- createCache(node3);
+ this.managementTestRule.createMember(this.memberVMs[0]);
+ this.managementTestRule.createMember(this.memberVMs[1]);
+ this.managementTestRule.createMember(this.memberVMs[2]);
- createManagementCache(managingNode);
+ this.managementTestRule.createManager(this.managerVM, false);
- startManagingNode(managingNode);
+ this.managementTestRule.startManager(this.managerVM);
- checkGetMBean(managingNode);
+ verifyGetMBeanInstance(this.managerVM);
}
@Test
public void testQueryMBeans() throws Exception {
- List<VM> managedNodeList = getManagedNodeList();
- VM node1 = managedNodeList.get(0);
- VM node2 = managedNodeList.get(1);
- VM node3 = managedNodeList.get(2);
- VM managingNode = getManagingNode();
+ this.managementTestRule.createMember(this.memberVMs[0]);
+ this.managementTestRule.createMember(this.memberVMs[1]);
+ this.managementTestRule.createMember(this.memberVMs[2]);
- createCache(node1);
- createCache(node2);
- createCache(node3);
+ this.managementTestRule.createManager(this.managerVM, false);
- createManagementCache(managingNode);
+ this.managementTestRule.startManager(this.managerVM);
- startManagingNode(managingNode);
-
- checkQueryMBeans(managingNode);
+ verifyQueryMBeans(this.managerVM);
}
- protected void checkQueryMBeans(final VM vm) {
- SerializableRunnable validateServiceResource = new SerializableRunnable("Check Query MBeans") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ @Test
+ public void testNotification() throws Exception {
+ // Step : 1 : Create Managed Node Caches
+ this.managementTestRule.createMember(this.memberVMs[0]);
+ this.managementTestRule.createMember(this.memberVMs[1]);
+ this.managementTestRule.createMember(this.memberVMs[2]);
- Set<DistributedMember> otherMembers =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
+ // Step : 2 : Create Managing Node Cache, start managerVM, add a notification
+ // handler to DistributedSystemMXBean
+ this.managementTestRule.createManager(this.managerVM, false);
+ this.managementTestRule.startManager(this.managerVM);
+ attachListenerToDistributedSystemMXBean(this.managerVM);
- Set<ObjectName> superSet = new HashSet<ObjectName>();
+ // Step : 3 : Verify Notification count, notification region sizes
+ verifyNotificationsAndRegionSize(this.memberVMs[0], this.memberVMs[1], this.memberVMs[2], this.managerVM);
+ }
- for (DistributedMember member : otherMembers) {
+ @Test
+ public void testNotificationManagingNodeFirst() throws Exception {
+ // Step : 1 : Create Managing Node Cache, start managerVM, add a notification
+ // handler to DistributedSystemMXBean
+ this.managementTestRule.createManager(this.managerVM, false);
+ this.managementTestRule.startManager(this.managerVM);
- ObjectName memberMBeanName = managementService.getMemberMBeanName(member);
+ attachListenerToDistributedSystemMXBean(this.managerVM);
- waitForProxy(memberMBeanName, MemberMXBean.class);
- Set<ObjectName> names = managementService.queryMBeanNames(member);
- superSet.addAll(names);
- assertTrue(names.contains(memberMBeanName));
+ // Step : 2 : Create Managed Node Caches
+ this.managementTestRule.createMember(this.memberVMs[0]);
+ this.managementTestRule.createMember(this.memberVMs[1]);
+ this.managementTestRule.createMember(this.memberVMs[2]);
- }
+ // Step : 3 : Verify Notification count, notification region sizes
+ verifyNotificationsAndRegionSize(this.memberVMs[0], this.memberVMs[1], this.memberVMs[2], this.managerVM);
+ }
- Set<ObjectName> names =
- managementService.queryMBeanNames(cache.getDistributedSystem().getDistributedMember());
- assertTrue(!superSet.contains(names));
- }
- };
- vm.invoke(validateServiceResource);
+ @Test
+ public void testRedundancyZone() throws Exception {
+ String redundancyZone = "ARMY_ZONE";
+ Properties props = new Properties();
+ props.setProperty(REDUNDANCY_ZONE, redundancyZone);
+
+ this.managementTestRule.createMember(this.memberVMs[0], props);
+
+ this.memberVMs[0].invoke("verifyRedundancyZone", () -> {
+ ManagementService service = this.managementTestRule.getExistingManagementService();
+ MemberMXBean memberMXBean = service.getMemberMXBean();
+ assertThat(memberMXBean.getRedundancyZone()).isEqualTo(redundancyZone);
+ });
}
- protected void checkGetMBean(final VM vm) {
- SerializableRunnable validateServiceResource = new SerializableRunnable("Check Get MBean") {
- public void run() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Set<DistributedMember> otherMembers =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
+ private void verifyQueryMBeans(final VM vm) {
+ vm.invoke("validateQueryMBeans", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ Set<DistributedMember> otherMembers = this.managementTestRule.getOtherNormalMembers();
+ Set<ObjectName> superSet = new HashSet<>();
- for (DistributedMember member : otherMembers) {
+ for (DistributedMember member : otherMembers) {
+ ObjectName memberMBeanName = service.getMemberMBeanName(member);
- ObjectName memberMBeanName = managementService.getMemberMBeanName(member);
+ awaitMemberMXBeanProxy(member);
- waitForProxy(memberMBeanName, MemberMXBean.class);
+ Set<ObjectName> objectNames = service.queryMBeanNames(member);
+ superSet.addAll(objectNames);
+ assertThat(objectNames.contains(memberMBeanName)).isTrue();
+ }
- MemberMXBean bean =
- managementService.getMBeanInstance(memberMBeanName, MemberMXBean.class);
- assertNotNull(bean);
- }
+ Set<ObjectName> names = service.queryMBeanNames(this.managementTestRule.getDistributedMember());
+ ObjectName[] arrayOfNames = names.toArray(new ObjectName[names.size()]);
+
+ assertThat(superSet).doesNotContain(arrayOfNames); // TODO: what value does this method have?
+ });
+ }
+
+ private void verifyGetMBeanInstance(final VM vm) {
+ vm.invoke("verifyGetMBeanInstance", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ Set<DistributedMember> otherMembers = this.managementTestRule.getOtherNormalMembers();
+
+ for (DistributedMember member : otherMembers) {
+ ObjectName memberMBeanName = service.getMemberMBeanName(member);
- DistributedMember thisMember = cache.getDistributedSystem().getDistributedMember();
- ObjectName memberMBeanName = managementService.getMemberMBeanName(thisMember);
- MemberMXBean bean = managementService.getMBeanInstance(memberMBeanName, MemberMXBean.class);
- assertNotNull(bean);
+ awaitMemberMXBeanProxy(member);
+ MemberMXBean memberMXBean = service.getMBeanInstance(memberMBeanName, MemberMXBean.class);
+ assertThat(memberMXBean).isNotNull();
}
- };
- vm.invoke(validateServiceResource);
+
+ DistributedMember distributedMember = this.managementTestRule.getDistributedMember();
+ ObjectName memberMBeanName = service.getMemberMBeanName(distributedMember);
+ MemberMXBean memberMXBean = service.getMBeanInstance(memberMBeanName, MemberMXBean.class);
+ assertThat(memberMXBean).isNotNull();
+ });
}
- protected void validateServiceResource(final VM vm) {
- SerializableRunnable validateServiceResource =
- new SerializableRunnable("Valideate Management Service Resource") {
- public void run() {
+ private void verifyManagerStarted(final VM managerVM, final DistributedMember otherMember) {
+ managerVM.invoke("verifyManagerStarted", () -> {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ assertThat(service.isManager()).isTrue();
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- assertNull(cache);
- assertFalse(managementService.isManager());
+ assertThat(service.getLocalManager().isRunning()).isTrue();
- SystemManagementService service = (SystemManagementService) managementService;
- assertNull(service.getLocalManager());
- }
- };
- vm.invoke(validateServiceResource);
- }
+ assertThat(service.getLocalManager().getFederationSheduler().isShutdown()).isFalse();
- /**
- * Creates a Distributed Region
- */
- protected AsyncInvocation checkManagerView(final VM vm, final DistributedMember oneManager) {
- SerializableRunnable createRegion = new SerializableRunnable("Check Manager View") {
- public void run() {
-
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- SystemManagementService service = (SystemManagementService) getManagementService();
- ObjectName memberMBeanName = service.getMemberMBeanName(oneManager);
- MemberMXBean bean = service.getMBeanProxy(memberMBeanName, MemberMXBean.class);
- assertNotNull(bean);
- // Ensure Data getting federated from Managing node
- long t1 = bean.getMemberUpTime();
- try {
- this.wait(ManagementConstants.REFRESH_TIME * 3);
- } catch (InterruptedException e) {
- fail("interrupted");
- }
- long t2 = bean.getMemberUpTime();
+ ObjectName memberMBeanName = service.getMemberMBeanName(otherMember);
- assertTrue(t2 > t1);
+ await().until(() -> assertThat(service.getMBeanProxy(memberMBeanName, MemberMXBean.class)).isNotNull());
+ MemberMXBean memberMXBean = service.getMBeanProxy(memberMBeanName, MemberMXBean.class);
- }
- };
- return vm.invokeAsync(createRegion);
+ //Ensure Data getting federated from Managing node
+ long start = memberMXBean.getMemberUpTime();
+ await().until(() -> assertThat(memberMXBean.getMemberUpTime()).isGreaterThan(start));
+ });
}
/**
* Add any Manager clean up asserts here
*/
- protected void checkNonManagerView(final VM vm) {
- SerializableRunnable checkNonManagerView = new SerializableRunnable("Check Non Manager View") {
- public void run() {
-
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- assertNotNull(cache);
- assertFalse(managementService.isManager());
-
- SystemManagementService service = (SystemManagementService) managementService;
- assertTrue(service.getLocalManager().isRunning());
- assertFalse(service.getLocalManager().getFederationSheduler().isShutdown());
-
- // Check for Proxies
- Set<DistributedMember> otherMembers =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
- assertTrue(otherMembers.size() > 0);
- for (DistributedMember member : otherMembers) {
- Set<ObjectName> proxyNames =
- service.getFederatingManager().getProxyFactory().findAllProxies(member);
- assertTrue(proxyNames.isEmpty());
- ObjectName proxyMBeanName = service.getMemberMBeanName(member);
- assertFalse(MBeanJMXAdapter.mbeanServer.isRegistered(proxyMBeanName));
- }
+ private void verifyManagerStopped(final VM managerVM, final int otherMembersCount) {
+ managerVM.invoke("verifyManagerStopped", () -> {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+
+ assertThat(service.isManager()).isFalse();
+ assertThat(service.getLocalManager().isRunning()).isTrue();
+ assertThat(service.getLocalManager().getFederationSheduler().isShutdown()).isFalse();
+
+ // Check for Proxies
+ Set<DistributedMember> otherMembers = this.managementTestRule.getOtherNormalMembers();
+ assertThat(otherMembers).hasSize(otherMembersCount);
+
+ for (DistributedMember member : otherMembers) {
+ Set<ObjectName> proxyNames = service.getFederatingManager().getProxyFactory().findAllProxies(member);
+ assertThat(proxyNames).isEmpty();
+ ObjectName proxyMBeanName = service.getMemberMBeanName(member);
+ assertThat(MBeanJMXAdapter.mbeanServer.isRegistered(proxyMBeanName)).isFalse();
}
- };
- vm.invoke(checkNonManagerView);
+ });
}
- public static Map<DistributedMember, DistributionConfig> verifyConfigData() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- ManagementService service = getManagementService();
- DistributionConfig config =
- ((InternalDistributedSystem) cache.getDistributedSystem()).getConfig();
+ private Map<DistributedMember, DistributionConfig> verifyConfigData() {
+ ManagementService service = this.managementTestRule.getManagementService();
+ InternalDistributedSystem ids = (InternalDistributedSystem) this.managementTestRule.getCache().getDistributedSystem();
+ DistributionConfig config = ids.getConfig();
+
MemberMXBean bean = service.getMemberMXBean();
GemFireProperties data = bean.listGemFireProperties();
- assertConfigEquals(config, data);
- Map<DistributedMember, DistributionConfig> configMap =
- new HashMap<DistributedMember, DistributionConfig>();
- configMap.put(cache.getMyId(), config);
+ verifyGemFirePropertiesData(config, data);
+
+ Map<DistributedMember, DistributionConfig> configMap = new HashMap<>();
+ configMap.put(ids.getDistributedMember(), config);
return configMap;
}
@@ -403,398 +409,253 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
* This is to check whether the config data has been propagated to the Managing node properly or
* not.
*/
- public static void verifyConfigDataRemote(Map<DistributedMember, DistributionConfig> configMap)
- throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Set<DistributedMember> otherMemberSet =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
-
- for (DistributedMember member : otherMemberSet) {
- MemberMXBean bean = MBeanUtil.getMemberMbeanProxy(member);
- GemFireProperties data = bean.listGemFireProperties();
+ private void verifyConfigDataRemote(final Map<DistributedMember, DistributionConfig> configMap) throws Exception {
+ Set<DistributedMember> otherMembers = this.managementTestRule.getOtherNormalMembers();
+
+ for (DistributedMember member : otherMembers) {
+ MemberMXBean memberMXBean = awaitMemberMXBeanProxy(member);
+
+ GemFireProperties data = memberMXBean.listGemFireProperties();
DistributionConfig config = configMap.get(member);
- assertConfigEquals(config, data);
+ verifyGemFirePropertiesData(config, data);
}
}
/**
* Asserts that distribution config and gemfireProperty composite types hold the same values
*/
- public static void assertConfigEquals(DistributionConfig config, GemFireProperties data) {
+ private void verifyGemFirePropertiesData(final DistributionConfig config, final GemFireProperties data) {
+ assertThat(data.getMemberName()).isEqualTo(config.getName());
- assertEquals(data.getMemberName(), config.getName());
// **TODO **
String memberGroups = null;
- assertEquals(data.getMcastPort(), config.getMcastPort());
- assertEquals(data.getMcastAddress(), config.getMcastAddress().getHostAddress());
- assertEquals(data.getBindAddress(), config.getBindAddress());
- assertEquals(data.getTcpPort(), config.getTcpPort());
- assertEquals(removeVMDir(data.getCacheXMLFile()),
- removeVMDir(config.getCacheXmlFile().getAbsolutePath()));
+ assertThat(data.getMcastPort()).isEqualTo(config.getMcastPort());
+ assertThat(data.getMcastAddress()).isEqualTo(config.getMcastAddress().getHostAddress());
+ assertThat(data.getBindAddress()).isEqualTo(config.getBindAddress());
+ assertThat(data.getTcpPort()).isEqualTo(config.getTcpPort());
+ assertThat(removeVMDir(data.getCacheXMLFile())).isEqualTo(removeVMDir(config.getCacheXmlFile().getAbsolutePath()));
+
// **TODO **
- assertEquals(data.getMcastTTL(), config.getMcastTtl());
- assertEquals(data.getServerBindAddress(), config.getServerBindAddress());
- assertEquals(data.getLocators(), config.getLocators());
- // The start locator may contain a directory
- assertEquals(removeVMDir(data.getStartLocator()), removeVMDir(config.getStartLocator()));
- assertEquals(removeVMDir(data.getLogFile()),
- removeVMDir(config.getLogFile().getAbsolutePath()));
- assertEquals(data.getLogLevel(), config.getLogLevel());
- assertEquals(data.isStatisticSamplingEnabled(), config.getStatisticSamplingEnabled());
- assertEquals(removeVMDir(data.getStatisticArchiveFile()),
- removeVMDir(config.getStatisticArchiveFile().getAbsolutePath()));
+ assertThat(data.getMcastTTL()).isEqualTo(config.getMcastTtl());
+ assertThat(data.getServerBindAddress()).isEqualTo(config.getServerBindAddress());
+ assertThat(data.getLocators()).isEqualTo(config.getLocators());
+
+ //The start locator may contain a directory
+ assertThat(removeVMDir(data.getStartLocator())).isEqualTo(removeVMDir(config.getStartLocator()));
+ assertThat(removeVMDir(data.getLogFile())).isEqualTo(removeVMDir(config.getLogFile().getAbsolutePath()));
+ assertThat(data.getLogLevel()).isEqualTo(config.getLogLevel());
+ assertThat(data.isStatisticSamplingEnabled()).isEqualTo(config.getStatisticSamplingEnabled());
+ assertThat(removeVMDir(data.getStatisticArchiveFile())).isEqualTo(removeVMDir(config.getStatisticArchiveFile().getAbsolutePath()));
+
// ** TODO **
String includeFile = null;
- assertEquals(data.getAckWaitThreshold(), config.getAckWaitThreshold());
- assertEquals(data.getAckSevereAlertThreshold(), config.getAckSevereAlertThreshold());
- assertEquals(data.getArchiveFileSizeLimit(), config.getArchiveFileSizeLimit());
- assertEquals(data.getArchiveDiskSpaceLimit(), config.getArchiveDiskSpaceLimit());
- assertEquals(data.getLogFileSizeLimit(), config.getLogFileSizeLimit());
- assertEquals(data.getLogDiskSpaceLimit(), config.getLogDiskSpaceLimit());
- assertEquals(data.isClusterSSLEnabled(), config.getClusterSSLEnabled());
-
- assertEquals(data.getClusterSSLCiphers(), config.getClusterSSLCiphers());
- assertEquals(data.getClusterSSLProtocols(), config.getClusterSSLProtocols());
- assertEquals(data.isClusterSSLRequireAuthentication(),
- config.getClusterSSLRequireAuthentication());
- assertEquals(data.getSocketLeaseTime(), config.getSocketLeaseTime());
- assertEquals(data.getSocketBufferSize(), config.getSocketBufferSize());
- assertEquals(data.getMcastSendBufferSize(), config.getMcastSendBufferSize());
- assertEquals(data.getMcastRecvBufferSize(), config.getMcastRecvBufferSize());
- assertEquals(data.getMcastByteAllowance(), config.getMcastFlowControl().getByteAllowance());
- assertEquals(data.getMcastRechargeThreshold(),
- config.getMcastFlowControl().getRechargeThreshold(), 0);
- assertEquals(data.getMcastRechargeBlockMs(), config.getMcastFlowControl().getRechargeBlockMs());
- assertEquals(data.getUdpFragmentSize(), config.getUdpFragmentSize());
- assertEquals(data.getUdpSendBufferSize(), config.getUdpSendBufferSize());
- assertEquals(data.getUdpRecvBufferSize(), config.getUdpRecvBufferSize());
- assertEquals(data.isDisableTcp(), config.getDisableTcp());
- assertEquals(data.isEnableTimeStatistics(), config.getEnableTimeStatistics());
- assertEquals(data.isEnableNetworkPartitionDetection(),
- config.getEnableNetworkPartitionDetection());
- assertEquals(data.getMemberTimeout(), config.getMemberTimeout());
-
- int[] configPortRange = config.getMembershipPortRange();
- int[] dataPortRange = data.getMembershipPortRange();
-
- assertEquals(dataPortRange.length, configPortRange.length);
- for (int i = 0; i < dataPortRange.length; i++) {
- assertEquals(dataPortRange[i], configPortRange[i]);
- }
- assertEquals(data.isConserveSockets(), config.getConserveSockets());
- assertEquals(data.getRoles(), config.getRoles());
- assertEquals(data.getMaxWaitTimeForReconnect(), config.getMaxWaitTimeForReconnect());
- assertEquals(data.getMaxNumReconnectTries(), config.getMaxNumReconnectTries());
- assertEquals(data.getAsyncDistributionTimeout(), config.getAsyncDistributionTimeout());
- assertEquals(data.getAsyncQueueTimeout(), config.getAsyncQueueTimeout());
- assertEquals(data.getAsyncMaxQueueSize(), config.getAsyncMaxQueueSize());
- assertEquals(data.getClientConflation(), config.getClientConflation());
- assertEquals(data.getDurableClientId(), config.getDurableClientId());
- assertEquals(data.getDurableClientTimeout(), config.getDurableClientTimeout());
- assertEquals(data.getSecurityClientAuthInit(), config.getSecurityClientAuthInit());
- assertEquals(data.getSecurityClientAuthenticator(), config.getSecurityClientAuthenticator());
- assertEquals(data.getSecurityClientDHAlgo(), config.getSecurityClientDHAlgo());
- assertEquals(data.getSecurityPeerAuthInit(), config.getSecurityPeerAuthInit());
- assertEquals(data.getSecurityClientAuthenticator(), config.getSecurityPeerAuthenticator());
- assertEquals(data.getSecurityClientAccessor(), config.getSecurityClientAccessor());
- assertEquals(data.getSecurityClientAccessorPP(), config.getSecurityClientAccessorPP());
- assertEquals(data.getSecurityLogLevel(), config.getSecurityLogLevel());
- assertEquals(removeVMDir(data.getSecurityLogFile()),
- removeVMDir(config.getSecurityLogFile().getAbsolutePath()));
- assertEquals(data.getSecurityPeerMembershipTimeout(),
- config.getSecurityPeerMembershipTimeout());
- assertEquals(data.isRemoveUnresponsiveClient(), config.getRemoveUnresponsiveClient());
- assertEquals(data.isDeltaPropagation(), config.getDeltaPropagation());
- assertEquals(data.getRedundancyZone(), config.getRedundancyZone());
- assertEquals(data.isEnforceUniqueHost(), config.getEnforceUniqueHost());
- assertEquals(data.getStatisticSampleRate(), config.getStatisticSampleRate());
+ assertThat(data.getAckWaitThreshold()).isEqualTo(config.getAckWaitThreshold());
+ assertThat(data.getAckSevereAlertThreshold()).isEqualTo(config.getAckSevereAlertThreshold());
+ assertThat(data.getArchiveFileSizeLimit()).isEqualTo(config.getArchiveFileSizeLimit());
+ assertThat(data.getArchiveDiskSpaceLimit()).isEqualTo(config.getArchiveDiskSpaceLimit());
+ assertThat(data.getLogFileSizeLimit()).isEqualTo(config.getLogFileSizeLimit());
+ assertThat(data.getLogDiskSpaceLimit()).isEqualTo(config.getLogDiskSpaceLimit());
+ assertThat(data.isClusterSSLEnabled()).isEqualTo(config.getClusterSSLEnabled());
+
+ assertThat(data.getClusterSSLCiphers()).isEqualTo(config.getClusterSSLCiphers());
+ assertThat(data.getClusterSSLProtocols()).isEqualTo(config.getClusterSSLProtocols());
+ assertThat(data.isClusterSSLRequireAuthentication()).isEqualTo(config.getClusterSSLRequireAuthentication());
+ assertThat(data.getSocketLeaseTime()).isEqualTo(config.getSocketLeaseTime());
+ assertThat(data.getSocketBufferSize()).isEqualTo(config.getSocketBufferSize());
+ assertThat(data.getMcastSendBufferSize()).isEqualTo(config.getMcastSendBufferSize());
+ assertThat(data.getMcastRecvBufferSize()).isEqualTo(config.getMcastRecvBufferSize());
+ assertThat(data.getMcastByteAllowance()).isEqualTo(config.getMcastFlowControl().getByteAllowance());
+ assertThat(data.getMcastRechargeThreshold()).isEqualTo(config.getMcastFlowControl().getRechargeThreshold());
+ assertThat(data.getMcastRechargeBlockMs()).isEqualTo(config.getMcastFlowControl().getRechargeBlockMs());
+ assertThat(data.getUdpFragmentSize()).isEqualTo(config.getUdpFragmentSize());
+ assertThat(data.getUdpSendBufferSize()).isEqualTo(config.getUdpSendBufferSize());
+ assertThat(data.getUdpRecvBufferSize()).isEqualTo(config.getUdpRecvBufferSize());
+ assertThat(data.isDisableTcp()).isEqualTo(config.getDisableTcp());
+ assertThat(data.isEnableTimeStatistics()).isEqualTo(config.getEnableTimeStatistics());
+ assertThat(data.isEnableNetworkPartitionDetection()).isEqualTo(config.getEnableNetworkPartitionDetection());
+ assertThat(data.getMemberTimeout()).isEqualTo(config.getMemberTimeout());
+
+ assertThat(data.getMembershipPortRange()).containsExactly(config.getMembershipPortRange());
+
+ assertThat(data.isConserveSockets()).isEqualTo(config.getConserveSockets());
+ assertThat(data.getRoles()).isEqualTo(config.getRoles());
+ assertThat(data.getMaxWaitTimeForReconnect()).isEqualTo(config.getMaxWaitTimeForReconnect());
+ assertThat(data.getMaxNumReconnectTries()).isEqualTo(config.getMaxNumReconnectTries());
+ assertThat(data.getAsyncDistributionTimeout()).isEqualTo(config.getAsyncDistributionTimeout());
+ assertThat(data.getAsyncMaxQueueSize()).isEqualTo(config.getAsyncMaxQueueSize());
+ assertThat(data.getClientConflation()).isEqualTo(config.getClientConflation());
+ assertThat(data.getDurableClientId()).isEqualTo(config.getDurableClientId());
+ assertThat(data.getDurableClientTimeout()).isEqualTo(config.getDurableClientTimeout());
+ assertThat(data.getSecurityClientAuthInit()).isEqualTo(config.getSecurityClientAuthInit());
+ assertThat(data.getSecurityClientAuthenticator()).isEqualTo(config.getSecurityClientAuthenticator());
+ assertThat(data.getSecurityClientDHAlgo()).isEqualTo(config.getSecurityClientDHAlgo());
+ assertThat(data.getSecurityPeerAuthInit()).isEqualTo(config.getSecurityPeerAuthInit());
+ assertThat(data.getSecurityClientAuthenticator()).isEqualTo(config.getSecurityPeerAuthenticator());
+ assertThat(data.getSecurityClientAccessor()).isEqualTo(config.getSecurityClientAccessor());
+ assertThat(data.getSecurityClientAccessorPP()).isEqualTo(config.getSecurityClientAccessorPP());
+ assertThat(data.getSecurityLogLevel()).isEqualTo(config.getSecurityLogLevel());
+ assertThat(removeVMDir(data.getSecurityLogFile())).isEqualTo(removeVMDir(config.getSecurityLogFile().getAbsolutePath()));
+ assertThat(data.getSecurityPeerMembershipTimeout()).isEqualTo(config.getSecurityPeerMembershipTimeout());
+ assertThat(data.isRemoveUnresponsiveClient()).isEqualTo(config.getRemoveUnresponsiveClient());
+ assertThat(data.isDeltaPropagation()).isEqualTo(config.getDeltaPropagation());
+ assertThat(data.getRedundancyZone()).isEqualTo(config.getRedundancyZone());
+ assertThat(data.isEnforceUniqueHost()).isEqualTo(config.getEnforceUniqueHost());
+ assertThat(data.getStatisticSampleRate()).isEqualTo(config.getStatisticSampleRate());
}
private static String removeVMDir(String string) {
return string.replaceAll("vm.", "");
}
- public static void startManager() {
- MemberMXBean bean = getManagementService().getMemberMXBean();
- // When the cache is created if jmx-manager is true then we create the manager.
- // So it may already exist when we get here.
- if (!bean.isManagerCreated()) {
- if (!bean.createManager()) {
- fail("Could not create Manager");
- } else if (!bean.isManagerCreated()) {
- fail("Should have been a manager after createManager returned true.");
- }
+ private void startManager() throws JMException {
+ ManagementService service = this.managementTestRule.getManagementService();
+ MemberMXBean memberMXBean = service.getMemberMXBean();
+ if (memberMXBean.isManagerCreated()) {
+ return;
}
- ManagerMXBean mngrBean = getManagementService().getManagerMXBean();
- try {
- mngrBean.start();
- } catch (JMException e) {
- fail("Could not start Manager " + e);
- }
- assertTrue(mngrBean.isRunning());
- assertTrue(getManagementService().isManager());
- assertTrue(bean.isManager());
- }
-
- public static void isManager() {
- MemberMXBean bean = getManagementService().getMemberMXBean();
- if (bean.createManager()) {
- ManagerMXBean mngrBean = getManagementService().getManagerMXBean();
- try {
- mngrBean.start();
- } catch (JMException e) {
- fail("Could not start Manager " + e);
- }
- } else {
- fail(" Could not create Manager");
- }
- }
- public static String fetchLog() {
- MemberMXBean bean = getManagementService().getMemberMXBean();
- String log = bean.showLog(30);
- return log;
- }
-
- public static void fetchJVMMetrics() {
- MemberMXBean bean = getManagementService().getMemberMXBean();
- JVMMetrics metrics = bean.showJVMMetrics();
+ // TODO: cleanup this mess
+ // When the cache is created if jmx-managerVM is true then we create the managerVM.
+ // So it may already exist when we get here.
- LogWriterUtils.getLogWriter()
- .info("<ExpectedString> JVMMetrics is " + metrics.toString() + "</ExpectedString> ");
- }
+ assertThat(memberMXBean.createManager()).isTrue();
+ assertThat(memberMXBean.isManagerCreated()).isTrue();
- public static void fetchOSMetrics() {
- MemberMXBean bean = getManagementService().getMemberMXBean();
- OSMetrics metrics = bean.showOSMetrics();
+ ManagerMXBean managerMXBean = service.getManagerMXBean();
+ managerMXBean.start();
- LogWriterUtils.getLogWriter()
- .info("<ExpectedString> OSMetrics is " + metrics.toString() + "</ExpectedString> ");
+ assertThat(managerMXBean.isRunning()).isTrue();
+ assertThat(memberMXBean.isManager()).isTrue();
+ assertThat(service.isManager()).isTrue();
}
- public static void shutDownMember() {
- MemberMXBean bean = getManagementService().getMemberMXBean();
- bean.shutDownMember();
+ private String fetchLog(final int numberOfLines) {
+ ManagementService service = this.managementTestRule.getManagementService();
+ MemberMXBean memberMXBean = service.getMemberMXBean();
+ return memberMXBean.showLog(numberOfLines);
}
- public static void assertExpectedMembers(int expectedMemberCount) {
- Wait.waitForCriterion(new WaitCriterion() {
- public String description() {
- return "Waiting all nodes to shutDown";
- }
-
- public boolean done() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Set<DistributedMember> setOfOtherMembers =
- cache.getDistributedSystem().getAllOtherMembers();
- boolean done = (setOfOtherMembers != null && setOfOtherMembers.size() == 1);
- return done;
- }
-
- }, MAX_WAIT, 500, true);
+ private JVMMetrics fetchJVMMetrics() {
+ ManagementService service = this.managementTestRule.getManagementService();
+ MemberMXBean memberMXBean = service.getMemberMXBean();
+ JVMMetrics metrics = memberMXBean.showJVMMetrics();
+ return metrics;
}
- public static void invokeRemoteOps() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Set<DistributedMember> otherMemberSet =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
-
- for (DistributedMember member : otherMemberSet) {
- MemberMXBean bean = MBeanUtil.getMemberMbeanProxy(member);
- JVMMetrics metrics = bean.showJVMMetrics();
+ private OSMetrics fetchOSMetrics() {
+ ManagementService service = this.managementTestRule.getManagementService();
+ MemberMXBean memberMXBean = service.getMemberMXBean();
+ OSMetrics metrics = memberMXBean.showOSMetrics();
+ return metrics;
+ }
- LogWriterUtils.getLogWriter()
- .info("<ExpectedString> JVMMetrics is " + metrics.toString() + "</ExpectedString> ");
- LogWriterUtils.getLogWriter()
- .info("<ExpectedString> OSMetrics is " + metrics.toString() + "</ExpectedString> ");
+ private void shutDownMember() {
+ ManagementService service = this.managementTestRule.getManagementService();
+ MemberMXBean memberMXBean = service.getMemberMXBean();
+ memberMXBean.shutDownMember();
+ }
- LogWriterUtils.getLogWriter()
- .info("<ExpectedString> Boolean Data Check " + bean.isManager() + "</ExpectedString> ");
- }
+ private void verifyExpectedMembers(final int otherMembersCount) {
+ String alias = "awaiting " + this.managementTestRule.getOtherNormalMembers() + " to have size " + otherMembersCount;
+ await(alias).until(() -> assertThat(this.managementTestRule.getOtherNormalMembers()).hasSize(otherMembersCount));
}
- @Test
- public void testNotification() throws Exception {
- List<VM> managedNodeList = getManagedNodeList();
- VM node1 = managedNodeList.get(0);
- VM node2 = managedNodeList.get(1);
- VM node3 = managedNodeList.get(2);
- VM managingNode = getManagingNode();
+ private void invokeRemoteMemberMXBeanOps() throws Exception {
+ Set<DistributedMember> otherMembers = this.managementTestRule.getOtherNormalMembers();
- // Step : 1 : Create Managed Node Caches
- createCache(node1);
- createCache(node2);
- createCache(node3);
+ for (DistributedMember member : otherMembers) {
+ MemberMXBean memberMXBean = awaitMemberMXBeanProxy(member);
- // Step : 2 : Create Managing Node Cache, start manager, add a notification
- // handler to DistributedSystemMXBean
- createManagementCache(managingNode);
- startManagingNode(managingNode);
- attchListenerToDSMBean(managingNode);
+ JVMMetrics metrics = memberMXBean.showJVMMetrics();
- // Step : 3 : Verify Notification count, notification region sizes
- countNotificationsAndCheckRegionSize(node1, node2, node3, managingNode);
- }
+ String value = metrics.toString();
+ boolean isManager = memberMXBean.isManager();
- @Test
- public void testNotificationManagingNodeFirst() throws Exception {
- List<VM> managedNodeList = getManagedNodeList();
- VM node1 = managedNodeList.get(0);
- VM node2 = managedNodeList.get(1);
- VM node3 = managedNodeList.get(2);
- VM managingNode = getManagingNode();
-
- // Step : 1 : Create Managing Node Cache, start manager, add a notification
- // handler to DistributedSystemMXBean
- createManagementCache(managingNode);
- startManagingNode(managingNode);
- attchListenerToDSMBean(managingNode);
-
- // Step : 2 : Create Managed Node Caches
- createCache(node1);
- createCache(node2);
- createCache(node3);
+ // TODO: need assertions
- // Step : 3 : Verify Notification count, notification region sizes
- countNotificationsAndCheckRegionSize(node1, node2, node3, managingNode);
+ //("<ExpectedString> JVMMetrics is " + metrics.toString() + "</ExpectedString> ");
+ //("<ExpectedString> OSMetrics is " + metrics.toString() + "</ExpectedString> ");
+ //("<ExpectedString> Boolean Data Check " + bean.isManager() + "</ExpectedString> ");
+ }
}
- @Test
- public void testRedundancyZone() throws Exception {
- List<VM> managedNodeList = getManagedNodeList();
- VM node1 = managedNodeList.get(0);
- VM node2 = managedNodeList.get(1);
- VM node3 = managedNodeList.get(2);
- Properties props = new Properties();
- props.setProperty(REDUNDANCY_ZONE, "ARMY_ZONE");
+ private void attachListenerToDistributedSystemMXBean(final VM managerVM) {
+ managerVM.invoke("attachListenerToDistributedSystemMXBean", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ assertThat(service.isManager()).isTrue();
- createCache(node1, props);
-
- node1.invoke(new SerializableRunnable("Assert Redundancy Zone") {
+ NotificationListener listener = (final Notification notification, final Object handback) -> {
+ if (notification.getType().equals(JMXNotificationType.REGION_CREATED)) {
+ notifications.add(notification);
+ }
+ };
- public void run() {
- ManagementService service = ManagementService.getExistingManagementService(getCache());
- MemberMXBean bean = service.getMemberMXBean();
- assertEquals("ARMY_ZONE", bean.getRedundancyZone());
- }
+ ManagementFactory.getPlatformMBeanServer().addNotificationListener(MBeanJMXAdapter.getDistributedSystemName(), listener, null, null);
});
}
- protected void attchListenerToDSMBean(final VM vm) {
- SerializableRunnable attchListenerToDSMBean =
- new SerializableRunnable("Attach Listener to DS MBean") {
- public void run() {
- assertTrue(managementService.isManager());
- DistributedSystemMXBean dsMBean = managementService.getDistributedSystemMXBean();
-
- // First clear the notification list
- notifList.clear();
-
- NotificationListener nt = new NotificationListener() {
- @Override
- public void handleNotification(Notification notification, Object handback) {
- if (notification.getType().equals(JMXNotificationType.REGION_CREATED)) {
- notifList.add(notification);
- }
- }
- };
-
- try {
- mbeanServer.addNotificationListener(MBeanJMXAdapter.getDistributedSystemName(), nt,
- null, null);
- } catch (InstanceNotFoundException e) {
- throw new AssertionError("Failed With Exception ", e);
- }
-
- }
- };
- vm.invoke(attchListenerToDSMBean);
- }
-
- public void waitForManagerToRegisterListener() {
- SystemManagementService service = (SystemManagementService) getManagementService();
- final Map<ObjectName, NotificationHubListener> hubMap =
- service.getNotificationHub().getListenerObjectMap();
-
- Wait.waitForCriterion(new WaitCriterion() {
- public String description() {
- return "Waiting for manager to register the listener";
- }
-
- public boolean done() {
- boolean done = (1 == hubMap.size());
- return done;
- }
+ private void verifyNotificationsAndRegionSize(final VM memberVM1, final VM memberVM2, final VM memberVM3, final VM managerVM) {
+ DistributedMember member1 = this.managementTestRule.getDistributedMember(memberVM1);
+ DistributedMember member2 = this.managementTestRule.getDistributedMember(memberVM2);
+ DistributedMember member3 = this.managementTestRule.getDistributedMember(memberVM3);
- }, MAX_WAIT, 500, true);
- }
+ String memberId1 = MBeanJMXAdapter.getUniqueIDForMember(member1);
+ String memberId2 = MBeanJMXAdapter.getUniqueIDForMember(member2);
+ String memberId3 = MBeanJMXAdapter.getUniqueIDForMember(member3);
- public void countNotificationsAndCheckRegionSize(VM node1, VM node2, VM node3, VM managingNode) {
+ memberVM1.invoke("createNotificationRegion", () -> createNotificationRegion(memberId1));
+ memberVM2.invoke("createNotificationRegion", () -> createNotificationRegion(memberId2));
+ memberVM3.invoke("createNotificationRegion", () -> createNotificationRegion(memberId3));
- DistributedMember member1 = getMember(node1);
- DistributedMember member2 = getMember(node2);
- DistributedMember member3 = getMember(node3);
+ managerVM.invoke("verify notifications size", () -> {
+ await().until(() -> assertThat(notifications.size()).isEqualTo(45));
- final String appender1 = MBeanJMXAdapter.getUniqueIDForMember(member1);
- final String appender2 = MBeanJMXAdapter.getUniqueIDForMember(member2);
- final String appender3 = MBeanJMXAdapter.getUniqueIDForMember(member3);
+ Cache cache = this.managementTestRule.getCache();
- node1.invoke("Create Regions", () -> createNotifTestRegion(appender1));
- node2.invoke("Create Regions", () -> createNotifTestRegion(appender2));
- node3.invoke("Create Regions", () -> createNotifTestRegion(appender3));
+ Region region1 = cache.getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + memberId1);
+ Region region2 = cache.getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + memberId2);
+ Region region3 = cache.getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + memberId3);
- managingNode.invoke(new SerializableRunnable("Validate Notification Count") {
+ // Even though we got 15 notification only 10 should be there due to
+ // eviction attributes set in notification region
- public void run() {
+ await().until(() -> assertThat(region1).hasSize(10));
+ await().until(() -> assertThat(region2).hasSize(10));
+ await().until(() -> assertThat(region3).hasSize(10));
+ });
+ }
- Wait.waitForCriterion(new WaitCriterion() {
- public String description() {
- return "Waiting for all the RegionCreated notification to reach the manager "
- + notifList.size();
- }
+ private void createNotificationRegion(final String memberId) {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ Map<ObjectName, NotificationHubListener> notificationHubListenerMap = service.getNotificationHub().getListenerObjectMap();
- public boolean done() {
- boolean done = (45 == notifList.size());
- return done;
- }
+ await().until(() -> assertThat(notificationHubListenerMap.size()).isEqualTo(1));
- }, MAX_WAIT, 500, true);
+ RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE);
+ for (int i = 1; i <= 15; i++) {
+ regionFactory.create(NOTIFICATION_REGION_NAME + i);
+ }
+ Region region = this.managementTestRule.getCache().getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + memberId);
- assertEquals(45, notifList.size());
- Cache cache = getCache();
- SystemManagementService service = (SystemManagementService) getManagementService();
+ assertThat(region).isEmpty();
+ }
- Region member1NotifRegion =
- cache.getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + appender1);
- Region member2NotifRegion =
- cache.getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + appender2);
- Region member3NotifRegion =
- cache.getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + appender3);
+ private MemberMXBean awaitMemberMXBeanProxy(final DistributedMember member) {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ ObjectName objectName = service.getMemberMBeanName(member);
- // Even though we got 15 notification only 10 should be there due to
- // eviction attributes set in notification region
-
- waitAtMost(5, TimeUnit.SECONDS).untilCall(to(member1NotifRegion).size(), equalTo(10));
- waitAtMost(5, TimeUnit.SECONDS).untilCall(to(member2NotifRegion).size(), equalTo(10));
- waitAtMost(5, TimeUnit.SECONDS).untilCall(to(member3NotifRegion).size(), equalTo(10));
- }
- });
+ String alias = "awaiting MemberMXBean proxy for " + member;
+ await(alias).until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
+ return service.getMBeanProxy(objectName, MemberMXBean.class);
}
- private void createNotifTestRegion(final String appender1) {
- Cache cache = getCache();
-
- waitForManagerToRegisterListener();
- RegionFactory rf = cache.createRegionFactory(RegionShortcut.REPLICATE);
- for (int i = 1; i <= 15; i++) {
- rf.create("NotifTestRegion_" + i);
- }
- Region member1NotifRegion =
- cache.getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + appender1);
-
- assertEquals(0, member1NotifRegion.size());
+ private ConditionFactory await() {
+ return Awaitility.await().atMost(2, MINUTES);
}
+ private ConditionFactory await(final String alias) {
+ return Awaitility.await(alias).atMost(2, MINUTES);
+ }
}
[12/50] [abbrv] incubator-geode git commit: GEODE-1785: add script to
generate region entry source
Posted by kl...@apache.org.
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 VMStatsRegionEntryHeapStringKey1(RegionEntryContext context, String 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/VMStatsRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey2.java
index e4a5c6a..c20bdac 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapStringKey2.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 VMStatsRegionEntryHeapStringKey2 extends VMStatsRegionEntryHeap {
public VMStatsRegionEntryHeapStringKey2(RegionEntryContext context, String 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/VMStatsRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapUUIDKey.java
index 6e7bded..e582894 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryHeapUUIDKey.java
@@ -36,7 +36,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 VMStatsRegionEntryHeapUUIDKey extends VMStatsRegionEntryHeap {
public VMStatsRegionEntryHeapUUIDKey(RegionEntryContext context, UUID 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/VMStatsRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapIntKey.java
index bb209f1..c9248d2 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapIntKey.java
@@ -39,7 +39,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 VMStatsRegionEntryOffHeapIntKey extends VMStatsRegionEntryOffHeap {
public VMStatsRegionEntryOffHeapIntKey(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/VMStatsRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapLongKey.java
index e292854..3084591 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapLongKey.java
@@ -39,7 +39,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 VMStatsRegionEntryOffHeapLongKey extends VMStatsRegionEntryOffHeap {
public VMStatsRegionEntryOffHeapLongKey(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/VMStatsRegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapObjectKey.java
index 8af273b..307299c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapObjectKey.java
@@ -39,7 +39,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 VMStatsRegionEntryOffHeapObjectKey extends VMStatsRegionEntryOffHeap {
public VMStatsRegionEntryOffHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey1.java
index 38e4e17..9ad2691 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey1.java
@@ -39,7 +39,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 VMStatsRegionEntryOffHeapStringKey1 extends VMStatsRegionEntryOffHeap {
public VMStatsRegionEntryOffHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey2.java
index 969b8dc..3c718b3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapStringKey2.java
@@ -39,7 +39,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 VMStatsRegionEntryOffHeapStringKey2 extends VMStatsRegionEntryOffHeap {
public VMStatsRegionEntryOffHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapUUIDKey.java
index 9b12b4a..b629978 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsRegionEntryOffHeapUUIDKey.java
@@ -40,7 +40,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 VMStatsRegionEntryOffHeapUUIDKey extends VMStatsRegionEntryOffHeap {
public VMStatsRegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapIntKey.java
index dc31295..dd3e5db 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapIntKey.java
@@ -38,7 +38,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 VMThinDiskLRURegionEntryHeapIntKey extends VMThinDiskLRURegionEntryHeap {
public VMThinDiskLRURegionEntryHeapIntKey(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/VMThinDiskLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapLongKey.java
index 8733cb3..f8f0cb6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapLongKey.java
@@ -38,7 +38,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 VMThinDiskLRURegionEntryHeapLongKey extends VMThinDiskLRURegionEntryHeap {
public VMThinDiskLRURegionEntryHeapLongKey(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/VMThinDiskLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapObjectKey.java
index 1d177e3..0a79e41 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapObjectKey.java
@@ -38,7 +38,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 VMThinDiskLRURegionEntryHeapObjectKey extends VMThinDiskLRURegionEntryHeap {
public VMThinDiskLRURegionEntryHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapStringKey1.java
index 8de3f2c..ac7d52b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapStringKey1.java
@@ -38,7 +38,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 VMThinDiskLRURegionEntryHeapStringKey1 extends VMThinDiskLRURegionEntryHeap {
public VMThinDiskLRURegionEntryHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapStringKey2.java
index d682214..c4ed061 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapStringKey2.java
@@ -38,7 +38,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 VMThinDiskLRURegionEntryHeapStringKey2 extends VMThinDiskLRURegionEntryHeap {
public VMThinDiskLRURegionEntryHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapUUIDKey.java
index 68e0c17..87fcd5f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryHeapUUIDKey.java
@@ -39,7 +39,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 VMThinDiskLRURegionEntryHeapUUIDKey extends VMThinDiskLRURegionEntryHeap {
public VMThinDiskLRURegionEntryHeapUUIDKey(RegionEntryContext context, UUID 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/VMThinDiskLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapIntKey.java
index 500ef2a..f970843 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapIntKey.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 VMThinDiskLRURegionEntryOffHeapIntKey extends VMThinDiskLRURegionEntryOffHeap {
public VMThinDiskLRURegionEntryOffHeapIntKey(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/VMThinDiskLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapLongKey.java
index b8fd123..ee939c0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapLongKey.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 VMThinDiskLRURegionEntryOffHeapLongKey extends VMThinDiskLRURegionEntryOffHeap {
public VMThinDiskLRURegionEntryOffHeapLongKey(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/VMThinDiskLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapObjectKey.java
index ca869ec..9aa4ec6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapObjectKey.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 VMThinDiskLRURegionEntryOffHeapObjectKey extends VMThinDiskLRURegionEntryOffHeap {
public VMThinDiskLRURegionEntryOffHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapStringKey1.java
index 44f4b6f..05923e1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapStringKey1.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 VMThinDiskLRURegionEntryOffHeapStringKey1 extends VMThinDiskLRURegionEntryOffHeap {
public VMThinDiskLRURegionEntryOffHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapStringKey2.java
index 13a94b4..8113149 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapStringKey2.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 VMThinDiskLRURegionEntryOffHeapStringKey2 extends VMThinDiskLRURegionEntryOffHeap {
public VMThinDiskLRURegionEntryOffHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapUUIDKey.java
index 5924846..07d4814 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskLRURegionEntryOffHeapUUIDKey.java
@@ -43,7 +43,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 VMThinDiskLRURegionEntryOffHeapUUIDKey extends VMThinDiskLRURegionEntryOffHeap {
public VMThinDiskLRURegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapIntKey.java
index 6d0555a..1838cc3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapIntKey.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 VMThinDiskRegionEntryHeapIntKey extends VMThinDiskRegionEntryHeap {
public VMThinDiskRegionEntryHeapIntKey(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/VMThinDiskRegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapLongKey.java
index 8914996..116c3ef 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapLongKey.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 VMThinDiskRegionEntryHeapLongKey extends VMThinDiskRegionEntryHeap {
public VMThinDiskRegionEntryHeapLongKey(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/VMThinDiskRegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapObjectKey.java
index e428c32..4904542 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapObjectKey.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 VMThinDiskRegionEntryHeapObjectKey extends VMThinDiskRegionEntryHeap {
public VMThinDiskRegionEntryHeapObjectKey(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/VMThinDiskRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapStringKey1.java
index 853fd2e..015e44b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapStringKey1.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 VMThinDiskRegionEntryHeapStringKey1 extends VMThinDiskRegionEntryHeap {
public VMThinDiskRegionEntryHeapStringKey1(RegionEntryContext context, String 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/VMThinDiskRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapStringKey2.java
index f0413ec..86e6a82 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapStringKey2.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 VMThinDiskRegionEntryHeapStringKey2 extends VMThinDiskRegionEntryHeap {
public VMThinDiskRegionEntryHeapStringKey2(RegionEntryContext context, String 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/VMThinDiskRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapUUIDKey.java
index 73ba9d6..39a3044 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryHeapUUIDKey.java
@@ -36,7 +36,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 VMThinDiskRegionEntryHeapUUIDKey extends VMThinDiskRegionEntryHeap {
public VMThinDiskRegionEntryHeapUUIDKey(RegionEntryContext context, UUID 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/VMThinDiskRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapIntKey.java
index d786dab..7c22916 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapIntKey.java
@@ -39,7 +39,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 VMThinDiskRegionEntryOffHeapIntKey extends VMThinDiskRegionEntryOffHeap {
public VMThinDiskRegionEntryOffHeapIntKey(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/VMThinDiskRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapLongKey.java
index a67f37b..3776696 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapLongKey.java
@@ -39,7 +39,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 VMThinDiskRegionEntryOffHeapLongKey extends VMThinDiskRegionEntryOffHeap {
public VMThinDiskRegionEntryOffHeapLongKey(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/VMThinDiskRegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapObjectKey.java
index 57a8fb9..1f36b65 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapObjectKey.java
@@ -39,7 +39,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 VMThinDiskRegionEntryOffHeapObjectKey extends VMThinDiskRegionEntryOffHeap {
public VMThinDiskRegionEntryOffHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapStringKey1.java
index c8baec2..40a31ba 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapStringKey1.java
@@ -39,7 +39,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 VMThinDiskRegionEntryOffHeapStringKey1 extends VMThinDiskRegionEntryOffHeap {
public VMThinDiskRegionEntryOffHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapStringKey2.java
index 4fece65..0ebc581 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapStringKey2.java
@@ -39,7 +39,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 VMThinDiskRegionEntryOffHeapStringKey2 extends VMThinDiskRegionEntryOffHeap {
public VMThinDiskRegionEntryOffHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapUUIDKey.java
index 5f1a27a..4c4b7d1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinDiskRegionEntryOffHeapUUIDKey.java
@@ -40,7 +40,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 VMThinDiskRegionEntryOffHeapUUIDKey extends VMThinDiskRegionEntryOffHeap {
public VMThinDiskRegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapIntKey.java
index 84d23f7..077cb20 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapIntKey.java
@@ -37,7 +37,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 VMThinLRURegionEntryHeapIntKey extends VMThinLRURegionEntryHeap {
public VMThinLRURegionEntryHeapIntKey(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/VMThinLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapLongKey.java
index c43cc44..0f535fb 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapLongKey.java
@@ -37,7 +37,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 VMThinLRURegionEntryHeapLongKey extends VMThinLRURegionEntryHeap {
public VMThinLRURegionEntryHeapLongKey(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/VMThinLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapObjectKey.java
index c6fcf20..6faec9a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapObjectKey.java
@@ -37,7 +37,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 VMThinLRURegionEntryHeapObjectKey extends VMThinLRURegionEntryHeap {
public VMThinLRURegionEntryHeapObjectKey(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/VMThinLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapStringKey1.java
index 3dfd8c9..733eb93 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapStringKey1.java
@@ -37,7 +37,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 VMThinLRURegionEntryHeapStringKey1 extends VMThinLRURegionEntryHeap {
public VMThinLRURegionEntryHeapStringKey1(RegionEntryContext context, String 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/VMThinLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapStringKey2.java
index 670c78b..78ceffe 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapStringKey2.java
@@ -37,7 +37,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 VMThinLRURegionEntryHeapStringKey2 extends VMThinLRURegionEntryHeap {
public VMThinLRURegionEntryHeapStringKey2(RegionEntryContext context, String 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/VMThinLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapUUIDKey.java
index 90c635a..a04dc2c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryHeapUUIDKey.java
@@ -38,7 +38,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 VMThinLRURegionEntryHeapUUIDKey extends VMThinLRURegionEntryHeap {
public VMThinLRURegionEntryHeapUUIDKey(RegionEntryContext context, UUID 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/VMThinLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapIntKey.java
index cd9b38d..dc6d52e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapIntKey.java
@@ -41,7 +41,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 VMThinLRURegionEntryOffHeapIntKey extends VMThinLRURegionEntryOffHeap {
public VMThinLRURegionEntryOffHeapIntKey(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/VMThinLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapLongKey.java
index 0e3e766..d2960c5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapLongKey.java
@@ -41,7 +41,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 VMThinLRURegionEntryOffHeapLongKey extends VMThinLRURegionEntryOffHeap {
public VMThinLRURegionEntryOffHeapLongKey(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/VMThinLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapObjectKey.java
index bcad963..5e5707c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapObjectKey.java
@@ -41,7 +41,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 VMThinLRURegionEntryOffHeapObjectKey extends VMThinLRURegionEntryOffHeap {
public VMThinLRURegionEntryOffHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapStringKey1.java
index dca3715..25b1438 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapStringKey1.java
@@ -41,7 +41,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 VMThinLRURegionEntryOffHeapStringKey1 extends VMThinLRURegionEntryOffHeap {
public VMThinLRURegionEntryOffHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapStringKey2.java
index 9edb25a..c412854 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapStringKey2.java
@@ -41,7 +41,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 VMThinLRURegionEntryOffHeapStringKey2 extends VMThinLRURegionEntryOffHeap {
public VMThinLRURegionEntryOffHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapUUIDKey.java
index 9121804..c572d2d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinLRURegionEntryOffHeapUUIDKey.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 VMThinLRURegionEntryOffHeapUUIDKey extends VMThinLRURegionEntryOffHeap {
public VMThinLRURegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapIntKey.java
index b66850e..29e86b8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapIntKey.java
@@ -33,7 +33,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 VMThinRegionEntryHeapIntKey extends VMThinRegionEntryHeap {
public VMThinRegionEntryHeapIntKey(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/VMThinRegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapLongKey.java
index 1c59cc6..37e61e1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapLongKey.java
@@ -33,7 +33,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 VMThinRegionEntryHeapLongKey extends VMThinRegionEntryHeap {
public VMThinRegionEntryHeapLongKey(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/VMThinRegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapObjectKey.java
index b05179a..76f724d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapObjectKey.java
@@ -33,7 +33,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 VMThinRegionEntryHeapObjectKey extends VMThinRegionEntryHeap {
public VMThinRegionEntryHeapObjectKey(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/VMThinRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapStringKey1.java
index 3faa44d..cfddee9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapStringKey1.java
@@ -33,7 +33,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 VMThinRegionEntryHeapStringKey1 extends VMThinRegionEntryHeap {
public VMThinRegionEntryHeapStringKey1(RegionEntryContext context, String 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/VMThinRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapStringKey2.java
index 8a523ad..963c78c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapStringKey2.java
@@ -33,7 +33,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 VMThinRegionEntryHeapStringKey2 extends VMThinRegionEntryHeap {
public VMThinRegionEntryHeapStringKey2(RegionEntryContext context, String 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/VMThinRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapUUIDKey.java
index 8b21523..8d18eef 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryHeapUUIDKey.java
@@ -34,7 +34,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 VMThinRegionEntryHeapUUIDKey extends VMThinRegionEntryHeap {
public VMThinRegionEntryHeapUUIDKey(RegionEntryContext context, UUID 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/VMThinRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapIntKey.java
index ecb4971..89afccc 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapIntKey.java
@@ -37,7 +37,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 VMThinRegionEntryOffHeapIntKey extends VMThinRegionEntryOffHeap {
public VMThinRegionEntryOffHeapIntKey(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/VMThinRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapLongKey.java
index e4bbbba..71c2ce7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapLongKey.java
@@ -37,7 +37,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 VMThinRegionEntryOffHeapLongKey extends VMThinRegionEntryOffHeap {
public VMThinRegionEntryOffHeapLongKey(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/VMThinRegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapObjectKey.java
index 95c8dc1..ad60bb1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapObjectKey.java
@@ -37,7 +37,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 VMThinRegionEntryOffHeapObjectKey extends VMThinRegionEntryOffHeap {
public VMThinRegionEntryOffHeapObjectKey(RegionEntryContext context, Object key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapStringKey1.java
index f23fb6f..95e448e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapStringKey1.java
@@ -37,7 +37,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 VMThinRegionEntryOffHeapStringKey1 extends VMThinRegionEntryOffHeap {
public VMThinRegionEntryOffHeapStringKey1(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapStringKey2.java
index 7f688a3..bf0670f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapStringKey2.java
@@ -37,7 +37,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 VMThinRegionEntryOffHeapStringKey2 extends VMThinRegionEntryOffHeap {
public VMThinRegionEntryOffHeapStringKey2(RegionEntryContext context, String key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapUUIDKey.java
index d18456a..4e740c0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMThinRegionEntryOffHeapUUIDKey.java
@@ -38,7 +38,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 VMThinRegionEntryOffHeapUUIDKey extends VMThinRegionEntryOffHeap {
public VMThinRegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapIntKey.java
index cfce458..c99b4a3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapIntKey.java
@@ -44,7 +44,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 VersionedStatsDiskLRURegionEntryHeapIntKey
extends VersionedStatsDiskLRURegionEntryHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/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 138db42..5bf2887 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
@@ -44,7 +44,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 VersionedStatsDiskLRURegionEntryHeapLongKey
extends VersionedStatsDiskLRURegionEntryHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/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 ec89e1e..099c493 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
@@ -44,7 +44,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 VersionedStatsDiskLRURegionEntryHeapObjectKey
extends VersionedStatsDiskLRURegionEntryHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/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 828f2da..6ca9e57 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
@@ -44,7 +44,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 VersionedStatsDiskLRURegionEntryHeapStringKey1
extends VersionedStatsDiskLRURegionEntryHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey2.java
index 8e55f60..57d2204 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapStringKey2.java
@@ -44,7 +44,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 VersionedStatsDiskLRURegionEntryHeapStringKey2
extends VersionedStatsDiskLRURegionEntryHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapUUIDKey.java
index 42c841e..9d409b7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryHeapUUIDKey.java
@@ -45,7 +45,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 VersionedStatsDiskLRURegionEntryHeapUUIDKey
extends VersionedStatsDiskLRURegionEntryHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapIntKey.java
index 3773fc7..ac22ed6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapIntKey.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 VersionedStatsDiskLRURegionEntryOffHeapIntKey
extends VersionedStatsDiskLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapLongKey.java
index 85194c9..87603d8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapLongKey.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 VersionedStatsDiskLRURegionEntryOffHeapLongKey
extends VersionedStatsDiskLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapObjectKey.java
index 6814f8d..d0afe22 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapObjectKey.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 VersionedStatsDiskLRURegionEntryOffHeapObjectKey
extends VersionedStatsDiskLRURegionEntryOffHeap {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/df2f0c96/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey1.java
index 4b4bfde..7a67257 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsDiskLRURegionEntryOffHeapStringKey1.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 VersionedStatsDiskLRURegionEntryOffHeapStringKey1
extends VersionedStatsDiskLRURegionEntryOffHeap {
[28/50] [abbrv] incubator-geode git commit: reformatted recent commit
with spotlessApply
Posted by kl...@apache.org.
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 Schuchardt <bs...@pivotal.io>
Authored: Mon Nov 14 10:31:57 2016 -0800
Committer: Bruce Schuchardt <bs...@pivotal.io>
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);
}
[48/50] [abbrv] incubator-geode git commit: Convert from
ManagementTestCase to ManagementTestRule
Posted by kl...@apache.org.
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 Compaction from a MemberMbean which is at cache level. All the disks which belong to
- * the cache should be compacted.
- *
- * @throws Exception
+ * Tests Disk Compaction from a MemberMXBean which is at cache level. All the
+ * disks which belong to the cache should be compacted.
*/
-
@Test
- public void testDiskCompact() throws Throwable {
- initManagement(false);
- for (VM vm : getManagedNodeList()) {
- createPersistentRegion(vm);
- makeDiskCompactable(vm);
+ public void testDiskCompact() throws Exception {
+ for (VM memberVM : this.memberVMs) {
+ createPersistentRegion(memberVM);
+ makeDiskCompactable(memberVM);
}
- for (VM vm : getManagedNodeList()) {
- compactAllDiskStores(vm);
+ for (VM memberVM : this.memberVMs) {
+ compactAllDiskStores(memberVM);
}
-
}
/**
- * Tests Disk Compaction from a MemberMbean which is at cache level. All the disks which belong to
- * the cache should be compacted.
- *
- * @throws Exception
+ * Tests Disk Compaction from a MemberMXBean which is at cache level. All the
+ * disks which belong to the cache should be compacted.
*/
-
@Test
- public void testDiskCompactRemote() throws Throwable {
-
- initManagement(false);
- for (VM vm : getManagedNodeList()) {
- createPersistentRegion(vm);
- makeDiskCompactable(vm);
+ public void testDiskCompactRemote() throws Exception {
+ for (VM memberVM : this.memberVMs) {
+ createPersistentRegion(memberVM);
+ makeDiskCompactable(memberVM);
}
- compactDiskStoresRemote(managingNode);
+ compactDiskStoresRemote(this.managerVM, this.memberVMs.length);
}
/**
* Tests various operations defined on DiskStore Mbean
- *
- * @throws Exception
*/
-
@Test
- public void testDiskOps() throws Throwable {
-
- initManagement(false);
- for (VM vm : getManagedNodeList()) {
- createPersistentRegion(vm);
- makeDiskCompactable(vm);
- invokeFlush(vm);
- invokeForceRoll(vm);
- invokeForceCompaction(vm);
+ public void testDiskOps() throws Exception {
+ for (VM memberVM : this.memberVMs) {
+ createPersistentRegion(memberVM);
+ makeDiskCompactable(memberVM);
+ invokeFlush(memberVM);
+ invokeForceRoll(memberVM);
+ invokeForceCompaction(memberVM);
}
-
}
@Test
- public void testDiskBackupAllMembers() throws Throwable {
- initManagement(false);
- for (VM vm : getManagedNodeList()) {
- createPersistentRegion(vm);
- makeDiskCompactable(vm);
-
+ public void testDiskBackupAllMembers() throws Exception {
+ for (VM memberVM : this.memberVMs) {
+ createPersistentRegion(memberVM);
+ makeDiskCompactable(memberVM);
}
- backupAllMembers(managingNode);
+
+ backupAllMembers(this.managerVM, this.memberVMs.length);
}
/**
- * Checks the test case of missing disks and revoking them through MemberMbean interfaces
- *
- * @throws Throwable
+ * Checks the test case of missing disks and revoking them through MemberMXBean
+ * interfaces
*/
- @SuppressWarnings("serial")
@Test
- public void testMissingMembers() throws Throwable {
+ public void testMissingMembers() throws Exception {
+ VM memberVM1 = this.memberVMs[0];
+ VM memberVM2 = this.memberVMs[1];
- initManagement(false);
- VM vm0 = getManagedNodeList().get(0);
- VM vm1 = getManagedNodeList().get(1);
- VM vm2 = getManagedNodeList().get(2);
+ createPersistentRegion(memberVM1);
+ createPersistentRegion(memberVM2);
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("Creating region in VM0");
- createPersistentRegion(vm0);
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("Creating region in VM1");
- createPersistentRegion(vm1);
+ putAnEntry(memberVM1);
- putAnEntry(vm0);
+ this.managerVM.invoke("checkForMissingDiskStores", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
+ PersistentMemberDetails[] missingDiskStores = distributedSystemMXBean.listMissingDiskStores();
+ assertThat(missingDiskStores).isNull();
+ });
- managingNode.invoke(new SerializableRunnable("Check for waiting regions") {
+ closeRegion(memberVM1);
- public void run() {
- Cache cache = getCache();
- ManagementService service = getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- PersistentMemberDetails[] missingDiskStores = bean.listMissingDiskStores();
+ updateTheEntry(memberVM2, "C");
- assertNull(missingDiskStores);
- }
- });
+ closeRegion(memberVM2);
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("closing region in vm0");
- closeRegion(vm0);
-
- updateTheEntry(vm1);
-
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("closing region in vm1");
- closeRegion(vm1);
- AsyncInvocation future = createPersistentRegionAsync(vm0);
- waitForBlockedInitialization(vm0);
- assertTrue(future.isAlive());
-
- managingNode.invoke(new SerializableRunnable("Revoke the member") {
-
- public void run() {
- Cache cache = getCache();
- GemFireCacheImpl cacheImpl = (GemFireCacheImpl) cache;
- ManagementService service = getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- PersistentMemberDetails[] missingDiskStores = bean.listMissingDiskStores();
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
- .info("waiting members=" + missingDiskStores);
- assertNotNull(missingDiskStores);
- assertEquals(1, missingDiskStores.length);
-
- for (PersistentMemberDetails id : missingDiskStores) {
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
- .info("Missing DiskStoreID is =" + id.getDiskStoreId());
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
- .info("Missing Host is =" + id.getHost());
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
- .info("Missing Directory is =" + id.getDirectory());
-
- try {
- bean.revokeMissingDiskStores(id.getDiskStoreId());
- } catch (Exception e) {
- fail("revokeMissingDiskStores failed with exception " + e);
- }
- }
- }
- });
+ AsyncInvocation creatingPersistentRegionAsync = createPersistentRegionAsync(memberVM1);
- future.join(MAX_WAIT);
- if (future.isAlive()) {
- fail("Region not created within" + MAX_WAIT);
- }
- if (future.exceptionOccurred()) {
- throw new Exception(future.getException());
- }
- checkForRecoveryStat(vm0, true);
- // Check to make sure we recovered the old
- // value of the entry.
- SerializableRunnable checkForEntry = new SerializableRunnable("check for the entry") {
-
- public void run() {
- Cache cache = getCache();
- Region region = cache.getRegion(REGION_NAME);
- assertEquals("B", region.get("A"));
- }
- };
- vm0.invoke(checkForEntry);
+ memberVM1.invoke(() ->
+ await().until(() -> {
+ GemFireCacheImpl cache = (GemFireCacheImpl) this.managementTestRule.getCache();
+ PersistentMemberManager persistentMemberManager = cache.getPersistentMemberManager();
+ Map<String, Set<PersistentMemberID>> regions = persistentMemberManager.getWaitingRegions();
+ return !regions.isEmpty();
+ })
+ );
- }
+ assertThat(creatingPersistentRegionAsync.isAlive()).isTrue();
- protected void checkNavigation(final VM vm, final DistributedMember diskMember,
- final String diskStoreName) {
- SerializableRunnable checkNavigation = new SerializableRunnable("Check Navigation") {
- public void run() {
+ this.managerVM.invoke("revokeMissingDiskStore", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
+ PersistentMemberDetails[] missingDiskStores = bean.listMissingDiskStores();
- final ManagementService service = getManagementService();
+ assertThat(missingDiskStores).isNotNull().hasSize(1);
- DistributedSystemMXBean disMBean = service.getDistributedSystemMXBean();
- try {
- ObjectName expected =
- MBeanJMXAdapter.getDiskStoreMBeanName(diskMember.getId(), diskStoreName);
- ObjectName actual = disMBean.fetchDiskStoreObjectName(diskMember.getId(), diskStoreName);
- assertEquals(expected, actual);
- } catch (Exception e) {
- fail("Disk Store Navigation Failed " + e);
- }
+ assertThat(bean.revokeMissingDiskStores(missingDiskStores[0].getDiskStoreId())).isTrue();
+ });
+ await(creatingPersistentRegionAsync);
- }
- };
- vm.invoke(checkNavigation);
- }
+ verifyRecoveryStats(memberVM1, true);
- /**
- * get Distributed member for a given vm
- */
- @SuppressWarnings("serial")
- protected static DistributedMember getMember() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- return cache.getDistributedSystem().getDistributedMember();
+ // Check to make sure we recovered the old value of the entry.
+ memberVM1.invoke("check for the entry", () -> {
+ Cache cache = this.managementTestRule.getCache();
+ Region region = cache.getRegion(REGION_NAME);
+ assertThat(region.get("A")).isEqualTo("B");
+ });
}
/**
* Invokes flush on the given disk store by MBean interface
- *
- * @param vm reference to VM
*/
- @SuppressWarnings("serial")
- public void invokeFlush(final VM vm) {
- SerializableRunnable invokeFlush = new SerializableRunnable("Invoke Flush On Disk") {
- public void run() {
- Cache cache = getCache();
- DiskStoreFactory dsf = cache.createDiskStoreFactory();
- String name = "testFlush_" + vm.getPid();
- DiskStore ds = dsf.create(name);
-
- ManagementService service = getManagementService();
- DiskStoreMXBean bean = service.getLocalDiskStoreMBean(name);
- assertNotNull(bean);
- bean.flush();
- }
- };
- vm.invoke(invokeFlush);
+ private void invokeFlush(final VM memberVM) {
+ memberVM.invoke("invokeFlush", () -> {
+ Cache cache = this.managementTestRule.getCache();
+ DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
+ String name = "testFlush_" + ProcessUtils.identifyPid();
+ DiskStore diskStore = diskStoreFactory.create(name);
+
+ ManagementService service = this.managementTestRule.getManagementService();
+ DiskStoreMXBean diskStoreMXBean = service.getLocalDiskStoreMBean(name);
+ assertThat(diskStoreMXBean).isNotNull();
+ assertThat(diskStoreMXBean.getName()).isEqualTo(diskStore.getName());
+
+ diskStoreMXBean.flush();
+ });
}
/**
* Invokes force roll on disk store by MBean interface
- *
- * @param vm reference to VM
*/
- @SuppressWarnings("serial")
- public void invokeForceRoll(final VM vm) {
- SerializableRunnable invokeForceRoll = new SerializableRunnable("Invoke Force Roll") {
- public void run() {
- Cache cache = getCache();
- DiskStoreFactory dsf = cache.createDiskStoreFactory();
- String name = "testForceRoll_" + vm.getPid();
- DiskStore ds = dsf.create(name);
- ManagementService service = getManagementService();
- DiskStoreMXBean bean = service.getLocalDiskStoreMBean(name);
- assertNotNull(bean);
- bean.forceRoll();
- }
- };
- vm.invoke(invokeForceRoll);
+ private void invokeForceRoll(final VM memberVM) {
+ memberVM.invoke("invokeForceRoll", () -> {
+ Cache cache = this.managementTestRule.getCache();
+ DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
+ String name = "testForceRoll_" + ProcessUtils.identifyPid();
+ DiskStore diskStore = diskStoreFactory.create(name);
+
+ ManagementService service = this.managementTestRule.getManagementService();
+ DiskStoreMXBean diskStoreMXBean = service.getLocalDiskStoreMBean(name);
+ assertThat(diskStoreMXBean).isNotNull();
+ assertThat(diskStoreMXBean.getName()).isEqualTo(diskStore.getName());
+
+ diskStoreMXBean.forceRoll();
+ });
}
/**
* Invokes force compaction on disk store by MBean interface
- *
- * @param vm reference to VM
*/
- @SuppressWarnings("serial")
- public void invokeForceCompaction(final VM vm) {
- SerializableRunnable invokeForceCompaction =
- new SerializableRunnable("Invoke Force Compaction") {
- public void run() {
- Cache cache = getCache();
- DiskStoreFactory dsf = cache.createDiskStoreFactory();
- dsf.setAllowForceCompaction(true);
- String name = "testForceCompaction_" + vm.getPid();
- DiskStore ds = dsf.create(name);
- ManagementService service = getManagementService();
- DiskStoreMXBean bean = service.getLocalDiskStoreMBean(name);
- assertNotNull(bean);
- assertEquals(false, bean.forceCompaction());
- }
- };
- vm.invoke(invokeForceCompaction);
+ private void invokeForceCompaction(final VM memberVM) {
+ memberVM.invoke("invokeForceCompaction", () -> {
+ Cache cache = this.managementTestRule.getCache();
+ DiskStoreFactory dsf = cache.createDiskStoreFactory();
+ dsf.setAllowForceCompaction(true);
+ String name = "testForceCompaction_" + ProcessUtils.identifyPid();
+ DiskStore diskStore = dsf.create(name);
+
+ ManagementService service = this.managementTestRule.getManagementService();
+ DiskStoreMXBean diskStoreMXBean = service.getLocalDiskStoreMBean(name);
+ assertThat(diskStoreMXBean).isNotNull();
+ assertThat(diskStoreMXBean.getName()).isEqualTo(diskStore.getName());
+
+ assertThat(diskStoreMXBean.forceCompaction()).isFalse();
+ });
}
/**
* Makes the disk compactable by adding and deleting some entries
- *
- * @throws Exception
*/
- @SuppressWarnings("serial")
- public void makeDiskCompactable(VM vm1) throws Exception {
- vm1.invoke(new SerializableRunnable("Make The Disk Compactable") {
-
- public void run() {
- Cache cache = getCache();
- Region region = cache.getRegion(REGION_NAME);
- DiskRegion dr = ((LocalRegion) region).getDiskRegion();
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("putting key1");
- region.put("key1", "value1");
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("putting key2");
- region.put("key2", "value2");
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("removing key2");
- region.remove("key2");
- // now that it is compactable the following forceCompaction should
- // go ahead and do a roll and compact it.
- }
+ private void makeDiskCompactable(final VM memberVM) throws Exception {
+ memberVM.invoke("makeDiskCompactable", () -> {
+ Cache cache = this.managementTestRule.getCache();
+ Region region = cache.getRegion(REGION_NAME);
+ region.put("key1", "value1");
+ region.put("key2", "value2");
+ region.remove("key2");
+ // now that it is compactable the following forceCompaction should
+ // go ahead and do a roll and compact it.
});
-
}
-
-
/**
* Compacts all DiskStores belonging to a member
- *
- * @param vm1 reference to VM
- * @throws Exception
*/
- @SuppressWarnings("serial")
- public void compactAllDiskStores(VM vm1) throws Exception {
-
- vm1.invoke(new SerializableCallable("Compact All Disk Stores") {
-
- public Object call() throws Exception {
- ManagementService service = getManagementService();
- MemberMXBean memberBean = service.getMemberMXBean();
- String[] compactedDiskStores = memberBean.compactAllDiskStores();
-
- assertTrue(compactedDiskStores.length > 0);
- for (int i = 0; i < compactedDiskStores.length; i++) {
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
- .info("<ExpectedString> Compacted Store " + i + " " + compactedDiskStores[i]
- + "</ExpectedString> ");
- }
-
- return null;
- }
+ private void compactAllDiskStores(final VM memberVM) throws Exception {
+ memberVM.invoke("compactAllDiskStores", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ MemberMXBean memberMXBean = service.getMemberMXBean();
+ String[] compactedDiskStores = memberMXBean.compactAllDiskStores();
+ assertThat(compactedDiskStores).hasSize(1);
});
-
}
/**
* Takes a back up of all the disk store in a given directory
*/
- @SuppressWarnings("serial")
- public void backupAllMembers(final VM managingVM) throws Exception {
+ private void backupAllMembers(final VM managerVM, final int memberCount) {
+ managerVM.invoke("backupAllMembers", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
+ File backupDir = this.temporaryFolder.newFolder("backupDir");
- managingVM.invoke(new SerializableCallable("Backup All Disk Stores") {
+ DiskBackupStatus status = bean.backupAllMembers(backupDir.getAbsolutePath(), null);
- public Object call() throws Exception {
- ManagementService service = getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- DiskBackupStatus status =
- bean.backupAllMembers(getBackupDir("test_backupAllMembers").getAbsolutePath(), null);
-
- return null;
- }
+ assertThat(status.getBackedUpDiskStores().keySet().size()).isEqualTo(memberCount);
+ assertThat(status.getOfflineDiskStores()).isEqualTo(null); // TODO: fix GEODE-1946
});
-
}
/**
- * Compact a disk store from Managing node
+ * Compact a disk store from managerVM VM
*/
- @SuppressWarnings("serial")
- public void compactDiskStoresRemote(VM managingVM) throws Exception {
- {
-
- managingVM.invoke(new SerializableCallable("Compact All Disk Stores Remote") {
-
- public Object call() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- Set<DistributedMember> otherMemberSet =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
-
- for (DistributedMember member : otherMemberSet) {
- MemberMXBean bean = MBeanUtil.getMemberMbeanProxy(member);
- String[] allDisks = bean.listDiskStores(true);
- assertNotNull(allDisks);
- List<String> listString = Arrays.asList(allDisks);
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
- .info("<ExpectedString> Remote All Disk Stores Are " + listString.toString()
- + "</ExpectedString> ");
- String[] compactedDiskStores = bean.compactAllDiskStores();
- assertTrue(compactedDiskStores.length > 0);
- for (int i = 0; i < compactedDiskStores.length; i++) {
- org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
- .info("<ExpectedString> Remote Compacted Store " + i + " "
- + compactedDiskStores[i] + "</ExpectedString> ");
- }
-
- }
- return null;
- }
- });
+ private void compactDiskStoresRemote(final VM managerVM, final int memberCount) {
+ managerVM.invoke("compactDiskStoresRemote", () -> {
+ Set<DistributedMember> otherMemberSet = this.managementTestRule.getOtherNormalMembers();// ((GemFireCacheImpl)cache).getDistributionManager().getOtherNormalDistributionManagerIds();
+ assertThat(otherMemberSet.size()).isEqualTo(memberCount);
- }
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
- }
-
- /**
- * Checks if a file with the given extension is present
- *
- * @param fileExtension file extension
- * @throws Exception
- */
- protected void checkIfContainsFileWithExt(String fileExtension) throws Exception {
- File[] files = diskDir.listFiles();
- for (int j = 0; j < files.length; j++) {
- if (files[j].getAbsolutePath().endsWith(fileExtension)) {
- fail("file \"" + files[j].getAbsolutePath() + "\" still exists");
- }
- }
+ for (DistributedMember member : otherMemberSet) {
+ MemberMXBean memberMXBean = awaitMemberMXBeanProxy(member);
- }
+ String[] allDisks = memberMXBean.listDiskStores(true);
+ assertThat(allDisks).isNotNull().hasSize(1);
- /**
- * Update Entry
- *
- * @param vm1 reference to VM
- */
- protected void updateTheEntry(VM vm1) {
- updateTheEntry(vm1, "C");
- }
-
- /**
- * Update an Entry
- *
- * @param vm1 reference to VM
- * @param value Value which is updated
- */
- @SuppressWarnings("serial")
- protected void updateTheEntry(VM vm1, final String value) {
- vm1.invoke(new SerializableRunnable("change the entry") {
-
- public void run() {
- Cache cache = getCache();
- Region region = cache.getRegion(REGION_NAME);
- region.put("A", value);
+ String[] compactedDiskStores = memberMXBean.compactAllDiskStores();
+ assertThat(compactedDiskStores).hasSize(1);
}
});
}
- /**
- * Put an entry to region
- *
- * @param vm0 reference to VM
- */
- @SuppressWarnings("serial")
- protected void putAnEntry(VM vm0) {
- vm0.invoke(new SerializableRunnable("Put an entry") {
-
- public void run() {
- Cache cache = getCache();
- Region region = cache.getRegion(REGION_NAME);
- region.put("A", "B");
- }
+ private void updateTheEntry(final VM memberVM, final String value) {
+ memberVM.invoke("updateTheEntry", () -> {
+ Cache cache = this.managementTestRule.getCache();
+ Region region = cache.getRegion(REGION_NAME);
+ region.put("A", value);
});
}
- /**
- * Close the given region REGION_NAME
- *
- * @param vm reference to VM
- */
- @SuppressWarnings("serial")
- protected void closeRegion(final VM vm) {
- SerializableRunnable closeRegion = new SerializableRunnable("Close persistent region") {
- public void run() {
- Cache cache = getCache();
- Region region = cache.getRegion(REGION_NAME);
- region.close();
- }
- };
- vm.invoke(closeRegion);
+ private void putAnEntry(final VM memberVM) {
+ memberVM.invoke("putAnEntry", () -> {
+ Cache cache = managementTestRule.getCache();
+ Region region = cache.getRegion(REGION_NAME);
+ region.put("A", "B");
+ });
}
- /**
- * Waiting to blocked waiting for another persistent member to come online
- *
- * @param vm reference to VM
- */
- @SuppressWarnings("serial")
- private void waitForBlockedInitialization(VM vm) {
- vm.invoke(new SerializableRunnable() {
-
- public void run() {
- Wait.waitForCriterion(new WaitCriterion() {
-
- public String description() {
- return "Waiting to blocked waiting for another persistent member to come online";
- }
-
- public boolean done() {
- Cache cache = getCache();
- GemFireCacheImpl cacheImpl = (GemFireCacheImpl) cache;
- PersistentMemberManager mm = cacheImpl.getPersistentMemberManager();
- Map<String, Set<PersistentMemberID>> regions = mm.getWaitingRegions();
- boolean done = !regions.isEmpty();
- return done;
- }
-
- }, MAX_WAIT, 100, true);
-
- }
-
+ private void closeRegion(final VM memberVM) {
+ memberVM.invoke("closeRegion", () -> {
+ Cache cache = this.managementTestRule.getCache();
+ Region region = cache.getRegion(REGION_NAME);
+ region.close();
});
}
- /**
- * Creates a persistent region
- *
- * @param vm reference to VM
- * @throws Throwable
- */
- protected void createPersistentRegion(VM vm) throws Throwable {
- AsyncInvocation future = createPersistentRegionAsync(vm);
- future.join(MAX_WAIT);
- if (future.isAlive()) {
- fail("Region not created within" + MAX_WAIT);
- }
- if (future.exceptionOccurred()) {
- throw new RuntimeException(future.getException());
- }
+ private void createPersistentRegion(final VM memberVM) throws InterruptedException, ExecutionException, TimeoutException {
+ await(createPersistentRegionAsync(memberVM));
}
- /**
- * Creates a persistent region in async manner
- *
- * @param vm reference to VM
- * @return reference to AsyncInvocation
- */
- @SuppressWarnings("serial")
- protected AsyncInvocation createPersistentRegionAsync(final VM vm) {
- SerializableRunnable createRegion = new SerializableRunnable("Create persistent region") {
- public void run() {
- Cache cache = getCache();
- DiskStoreFactory dsf = cache.createDiskStoreFactory();
- File dir = getDiskDirForVM(vm);
- dir.mkdirs();
- dsf.setDiskDirs(new File[] {dir});
- dsf.setMaxOplogSize(1);
- dsf.setAllowForceCompaction(true);
- dsf.setAutoCompact(false);
- DiskStore ds = dsf.create(REGION_NAME);
- RegionFactory rf = cache.createRegionFactory();
- rf.setDiskStoreName(ds.getName());
- rf.setDiskSynchronous(true);
- rf.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
- rf.setScope(Scope.DISTRIBUTED_ACK);
- rf.create(REGION_NAME);
- }
- };
- return vm.invokeAsync(createRegion);
+ private AsyncInvocation createPersistentRegionAsync(final VM memberVM) {
+ return memberVM.invokeAsync("createPersistentRegionAsync", () -> {
+ File dir = new File(diskDir, String.valueOf(ProcessUtils.identifyPid()));
+
+ Cache cache = this.managementTestRule.getCache();
+
+ DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
+ diskStoreFactory.setDiskDirs(new File[] { dir });
+ diskStoreFactory.setMaxOplogSize(1);
+ diskStoreFactory.setAllowForceCompaction(true);
+ diskStoreFactory.setAutoCompact(false);
+ DiskStore diskStore = diskStoreFactory.create(REGION_NAME);
+
+ RegionFactory regionFactory = cache.createRegionFactory();
+ regionFactory.setDiskStoreName(diskStore.getName());
+ regionFactory.setDiskSynchronous(true);
+ regionFactory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
+ regionFactory.setScope(Scope.DISTRIBUTED_ACK);
+ regionFactory.create(REGION_NAME);
+ });
}
- /**
- * Validates a persistent region
- *
- * @param vm reference to VM
- */
- @SuppressWarnings("serial")
- protected void validatePersistentRegion(final VM vm) {
- SerializableRunnable validateDisk = new SerializableRunnable("Validate persistent region") {
- public void run() {
- Cache cache = getCache();
- ManagementService service = getManagementService();
- DiskStoreMXBean bean = service.getLocalDiskStoreMBean(REGION_NAME);
- assertNotNull(bean);
+ private void verifyRecoveryStats(final VM memberVM, final boolean localRecovery) {
+ memberVM.invoke("verifyRecoveryStats", () -> {
+ Cache cache = this.managementTestRule.getCache();
+ Region region = cache.getRegion(REGION_NAME);
+ DistributedRegion distributedRegion = (DistributedRegion) region;
+ DiskRegionStats stats = distributedRegion.getDiskRegion().getStats();
+
+ if (localRecovery) {
+ assertThat(stats.getLocalInitializations()).isEqualTo(1);
+ assertThat(stats.getRemoteInitializations()).isEqualTo(0);
+ } else {
+ assertThat(stats.getLocalInitializations()).isEqualTo(0);
+ assertThat(stats.getRemoteInitializations()).isEqualTo(1);
}
- };
- vm.invoke(validateDisk);
+ });
}
- /**
- * Appends vm id to disk dir
- *
- * @param vm reference to VM
- * @return
- */
- protected File getDiskDirForVM(final VM vm) {
- File dir = new File(diskDir, String.valueOf(vm.getPid()));
- return dir;
+ private MemberMXBean awaitMemberMXBeanProxy(final DistributedMember member) {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ ObjectName objectName = service.getMemberMBeanName(member);
+ await().until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
+ return service.getMBeanProxy(objectName, MemberMXBean.class);
}
- /**
- * Checks recovery status
- *
- * @param vm reference to VM
- * @param localRecovery local recovery on or not
- */
- @SuppressWarnings("serial")
- private void checkForRecoveryStat(VM vm, final boolean localRecovery) {
- vm.invoke(new SerializableRunnable("check disk region stat") {
-
- public void run() {
- Cache cache = getCache();
- Region region = cache.getRegion(REGION_NAME);
- DistributedRegion distributedRegion = (DistributedRegion) region;
- DiskRegionStats stats = distributedRegion.getDiskRegion().getStats();
- if (localRecovery) {
- assertEquals(1, stats.getLocalInitializations());
- assertEquals(0, stats.getRemoteInitializations());
- } else {
- assertEquals(0, stats.getLocalInitializations());
- assertEquals(1, stats.getRemoteInitializations());
- }
-
- }
- });
+ private void await(final AsyncInvocation createPersistentRegionAsync) throws InterruptedException, ExecutionException, TimeoutException {
+ createPersistentRegionAsync.await(2, MINUTES);
}
- /**
- *
- * @return back up directory
- */
- protected static File getBackupDir(String name) throws Exception {
- File backUpDir = new File("BackupDir-" + name).getAbsoluteFile();
- org.apache.geode.internal.FileUtil.delete(backUpDir);
- backUpDir.mkdir();
- backUpDir.deleteOnExit();
- return backUpDir;
+ private ConditionFactory await() {
+ return Awaitility.await().atMost(2, MINUTES);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/DistributedSystemDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/DistributedSystemDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/DistributedSystemDUnitTest.java
index 4eaba67..cd05cde 100644
--- a/geode-core/src/test/java/org/apache/geode/management/DistributedSystemDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/DistributedSystemDUnitTest.java
@@ -14,23 +14,19 @@
*/
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.apache.geode.test.dunit.Host.*;
+import static org.apache.geode.test.dunit.Invoke.*;
+import static org.assertj.core.api.Assertions.*;
+import java.io.Serializable;
+import java.lang.management.ManagementFactory;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import javax.management.InstanceNotFoundException;
import javax.management.ListenerNotFoundException;
import javax.management.MBeanServer;
import javax.management.Notification;
@@ -39,11 +35,16 @@ import javax.management.NotificationFilter;
import javax.management.NotificationListener;
import javax.management.ObjectName;
+import com.jayway.awaitility.Awaitility;
+import com.jayway.awaitility.core.ConditionFactory;
import org.apache.logging.log4j.Logger;
+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.cache.Cache;
import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
import org.apache.geode.internal.admin.Alert;
import org.apache.geode.internal.cache.GemFireCacheImpl;
import org.apache.geode.internal.logging.LogService;
@@ -57,428 +58,269 @@ import org.apache.geode.management.internal.SystemManagementService;
import org.apache.geode.management.internal.beans.MemberMBean;
import org.apache.geode.management.internal.beans.SequenceNumber;
import org.apache.geode.test.dunit.IgnoredException;
-import org.apache.geode.test.dunit.LogWriterUtils;
-import org.apache.geode.test.dunit.Host;
-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;
/**
- * Distributed System tests
- *
+ * Distributed System management tests
+ * <p>
* a) For all the notifications
- *
* i) gemfire.distributedsystem.member.joined
- *
* ii) gemfire.distributedsystem.member.left
- *
* iii) gemfire.distributedsystem.member.suspect
- *
* iv ) All notifications emitted by member mbeans
- *
* vi) Alerts
- *
- * b) Concurrently modify proxy list by removing member and accessing the distributed system MBean
- *
+ * <p>
+ * b) Concurrently modify proxy list by removing member and accessing the
+ * distributed system MBean
+ * <p>
* c) Aggregate Operations like shutDownAll
- *
+ * <p>
* d) Member level operations like fetchJVMMetrics()
- *
+ * <p>
* e ) Statistics
- *
- *
- *
*/
@Category(DistributedTest.class)
-public class DistributedSystemDUnitTest extends ManagementTestBase {
+@SuppressWarnings({ "serial", "unused" })
+public class DistributedSystemDUnitTest implements Serializable {
private static final Logger logger = LogService.getLogger();
- private static final long serialVersionUID = 1L;
-
+ private static final String WARNING_LEVEL_MESSAGE = "Warning Level Alert Message";
+ private static final String SEVERE_LEVEL_MESSAGE = "Severe Level Alert Message";
- private static final int MAX_WAIT = 10 * 1000;
+ private static List<Notification> notifications;
+ private static Map<ObjectName, NotificationListener> notificationListenerMap;
- private static MBeanServer mbeanServer = MBeanJMXAdapter.mbeanServer;
+ @Manager
+ private VM managerVM;
- static List<Notification> notifList = new ArrayList<>();
+ @Member
+ private VM[] memberVMs;
- static Map<ObjectName, NotificationListener> notificationListenerMap =
- new HashMap<ObjectName, NotificationListener>();
+ @Rule
+ public ManagementTestRule managementTestRule = ManagementTestRule.builder().build();
- static final String WARNING_LEVEL_MESSAGE = "Warninglevel Alert Message";
-
- static final String SEVERE_LEVEL_MESSAGE = "Severelevel Alert Message";
+ @Before
+ public void before() throws Exception {
+ notifications = new ArrayList<>();
+ notificationListenerMap = new HashMap<>();
+ invokeInEveryVM(() -> notifications = new ArrayList<>());
+ invokeInEveryVM(() -> notificationListenerMap = new HashMap<>());
+ }
- public DistributedSystemDUnitTest() {
- super();
+ @After
+ public void after() throws Exception {
+ resetAlertCounts(this.managerVM);
}
/**
* Tests each and every operations that is defined on the MemberMXBean
- *
- * @throws Exception
*/
@Test
public void testDistributedSystemAggregate() throws Exception {
- VM managingNode = getManagingNode();
- createManagementCache(managingNode);
- startManagingNode(managingNode);
- addNotificationListener(managingNode);
+ this.managementTestRule.createManager(this.managerVM);
+ addNotificationListener(this.managerVM);
- for (VM vm : getManagedNodeList()) {
- createCache(vm);
+ for (VM memberVM : this.memberVMs) {
+ this.managementTestRule.createMember(memberVM);
}
- checkAggregate(managingNode);
- for (VM vm : getManagedNodeList()) {
- closeCache(vm);
- }
-
- closeCache(managingNode);
-
+ verifyDistributedSystemMXBean(this.managerVM);
}
/**
* Tests each and every operations that is defined on the MemberMXBean
- *
- * @throws Exception
*/
@Test
public void testAlertManagedNodeFirst() throws Exception {
-
- for (VM vm : getManagedNodeList()) {
- createCache(vm);
- warnLevelAlert(vm);
- severeLevelAlert(vm);
+ for (VM memberVM : this.memberVMs) {
+ this.managementTestRule.createMember(memberVM);
+ generateWarningAlert(memberVM);
+ generateSevereAlert(memberVM);
}
- VM managingNode = getManagingNode();
-
- createManagementCache(managingNode);
- startManagingNode(managingNode);
- addAlertListener(managingNode);
- checkAlertCount(managingNode, 0, 0);
+ this.managementTestRule.createManager(this.managerVM);
+ addAlertListener(this.managerVM);
+ verifyAlertCount(this.managerVM, 0, 0);
- final DistributedMember managingMember = getMember(managingNode);
+ DistributedMember managerDistributedMember = this.managementTestRule.getDistributedMember(this.managerVM);
- // Before we start we need to ensure that the initial (implicit) SEVERE alert has propagated
- // everywhere.
- for (VM vm : getManagedNodeList()) {
- ensureLoggerState(vm, managingMember, Alert.SEVERE);
+ // Before we start we need to ensure that the initial (implicit) SEVERE alert has propagated everywhere.
+ for (VM memberVM : this.memberVMs) {
+ verifyAlertAppender(memberVM, managerDistributedMember, Alert.SEVERE);
}
- setAlertLevel(managingNode, AlertDetails.getAlertLevelAsString(Alert.WARNING));
+ setAlertLevel(this.managerVM, AlertDetails.getAlertLevelAsString(Alert.WARNING));
- for (VM vm : getManagedNodeList()) {
- ensureLoggerState(vm, managingMember, Alert.WARNING);
- warnLevelAlert(vm);
- severeLevelAlert(vm);
+ for (VM memberVM : this.memberVMs) {
+ verifyAlertAppender(memberVM, managerDistributedMember, Alert.WARNING);
+ generateWarningAlert(memberVM);
+ generateSevereAlert(memberVM);
}
- checkAlertCount(managingNode, 3, 3);
- resetAlertCounts(managingNode);
+ verifyAlertCount(this.managerVM, 3, 3);
+ resetAlertCounts(this.managerVM);
- setAlertLevel(managingNode, AlertDetails.getAlertLevelAsString(Alert.SEVERE));
+ setAlertLevel(this.managerVM, AlertDetails.getAlertLevelAsString(Alert.SEVERE));
- for (VM vm : getManagedNodeList()) {
- ensureLoggerState(vm, managingMember, Alert.SEVERE);
- warnLevelAlert(vm);
- severeLevelAlert(vm);
+ for (VM memberVM : this.memberVMs) {
+ verifyAlertAppender(memberVM, managerDistributedMember, Alert.SEVERE);
+ generateWarningAlert(memberVM);
+ generateSevereAlert(memberVM);
}
- checkAlertCount(managingNode, 3, 0);
- resetAlertCounts(managingNode);
-
- for (VM vm : getManagedNodeList()) {
- closeCache(vm);
- }
-
- closeCache(managingNode);
- }
-
- @SuppressWarnings("serial")
- public void ensureLoggerState(VM vm1, final DistributedMember member, final int alertLevel)
- throws Exception {
- {
- vm1.invoke(new SerializableCallable("Ensure Logger State") {
-
- public Object call() throws Exception {
-
- Wait.waitForCriterion(new WaitCriterion() {
- public String description() {
- return "Waiting for all alert Listener to register with managed node";
- }
-
- public boolean done() {
-
- if (AlertAppender.getInstance().hasAlertListener(member, alertLevel)) {
- return true;
- }
- return false;
- }
-
- }, MAX_WAIT, 500, true);
-
- return null;
- }
- });
-
- }
+ verifyAlertCount(this.managerVM, 3, 0);
}
/**
* Tests each and every operations that is defined on the MemberMXBean
- *
- * @throws Exception
*/
@Test
public void testShutdownAll() throws Exception {
- final Host host = Host.getHost(0);
- VM managedNode1 = host.getVM(0);
- VM managedNode2 = host.getVM(1);
- VM managedNode3 = host.getVM(2);
-
- VM managingNode = host.getVM(3);
-
- // Managing Node is created first
- createManagementCache(managingNode);
- startManagingNode(managingNode);
-
- createCache(managedNode1);
- createCache(managedNode2);
- createCache(managedNode3);
- shutDownAll(managingNode);
- closeCache(managingNode);
+ VM memberVM1 = getHost(0).getVM(0);
+ VM memberVM2 = getHost(0).getVM(1);
+ VM memberVM3 = getHost(0).getVM(2);
+
+ VM managerVM = getHost(0).getVM(3);
+
+ // managerVM Node is created first
+ this.managementTestRule.createManager(managerVM);
+
+ this.managementTestRule.createMember(memberVM1);
+ this.managementTestRule.createMember(memberVM2);
+ this.managementTestRule.createMember(memberVM3);
+
+ shutDownAll(managerVM);
}
@Test
public void testNavigationAPIS() throws Exception {
+ this.managementTestRule.createManager(this.managerVM);
- final Host host = Host.getHost(0);
-
- createManagementCache(managingNode);
- startManagingNode(managingNode);
-
- for (VM vm : managedNodeList) {
- createCache(vm);
+ for (VM memberVM : this.memberVMs) {
+ this.managementTestRule.createMember(memberVM);
}
- checkNavigationAPIs(managingNode);
+ verifyFetchMemberObjectName(this.managerVM, this.memberVMs.length + 1);
}
@Test
public void testNotificationHub() throws Exception {
- this.initManagement(false);
+ this.managementTestRule.createMembers();
+ this.managementTestRule.createManagers();
class NotificationHubTestListener implements NotificationListener {
+
@Override
public synchronized void handleNotification(Notification notification, Object handback) {
logger.info("Notification received {}", notification);
- notifList.add(notification);
+ notifications.add(notification);
}
}
- managingNode.invoke(new SerializableRunnable("Add Listener to MemberMXBean") {
-
- public void run() {
- Cache cache = getCache();
- ManagementService service = getManagementService();
- final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
-
- Wait.waitForCriterion(new WaitCriterion() {
- public String description() {
- return "Waiting for all members to send their initial Data";
- }
-
- public boolean done() {
- if (bean.listMemberObjectNames().length == 5) {// including locator
- return true;
- } else {
- return false;
- }
- }
- }, MAX_WAIT, 500, true);
- for (ObjectName objectName : bean.listMemberObjectNames()) {
- NotificationHubTestListener listener = new NotificationHubTestListener();
- try {
- mbeanServer.addNotificationListener(objectName, listener, null, null);
- notificationListenerMap.put(objectName, listener);
- } catch (InstanceNotFoundException e) {
- LogWriterUtils.getLogWriter().error(e);
- }
- }
+ this.managerVM.invoke("addListenerToMemberMXBean", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ final DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
+
+ await().until(() -> assertThat(distributedSystemMXBean.listMemberObjectNames()).hasSize(5));
+
+ for (ObjectName objectName : distributedSystemMXBean.listMemberObjectNames()) {
+ NotificationHubTestListener listener = new NotificationHubTestListener();
+ ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener, null, null);
+ notificationListenerMap.put(objectName, listener);
}
});
// Check in all VMS
- for (VM vm : managedNodeList) {
- vm.invoke(new SerializableRunnable("Check Hub Listener num count") {
-
- public void run() {
- Cache cache = getCache();
- SystemManagementService service = (SystemManagementService) getManagementService();
- NotificationHub hub = service.getNotificationHub();
- Map<ObjectName, NotificationHubListener> listenerObjectMap = hub.getListenerObjectMap();
- assertEquals(1, listenerObjectMap.keySet().size());
- ObjectName memberMBeanName = MBeanJMXAdapter
- .getMemberMBeanName(cache.getDistributedSystem().getDistributedMember());
+ for (VM memberVM : this.memberVMs) {
+ memberVM.invoke("checkNotificationHubListenerCount", () -> {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ NotificationHub notificationHub = service.getNotificationHub();
+ Map<ObjectName, NotificationHubListener> listenerMap = notificationHub.getListenerObjectMap();
+ assertThat(listenerMap.keySet()).hasSize(1);
- NotificationHubListener listener = listenerObjectMap.get(memberMBeanName);
+ ObjectName memberMBeanName = MBeanJMXAdapter.getMemberMBeanName(this.managementTestRule.getDistributedMember());
+ NotificationHubListener listener = listenerMap.get(memberMBeanName);
- /*
- * Counter of listener should be 2 . One for default Listener which is added for each
- * member mbean by distributed system mbean One for the added listener in test
- */
- assertEquals(2, listener.getNumCounter());
+ /*
+ * Counter of listener should be 2 . One for default Listener which is
+ * added for each member mbean by distributed system mbean One for the
+ * added listener in test
+ */
+ assertThat(listener.getNumCounter()).isEqualTo(2);
- // Raise some notifications
+ // Raise some notifications
- NotificationBroadcasterSupport memberLevelNotifEmitter =
- (MemberMBean) service.getMemberMXBean();
+ NotificationBroadcasterSupport notifier = (MemberMBean) service.getMemberMXBean();
+ String memberSource = MBeanJMXAdapter.getMemberNameOrId(this.managementTestRule.getDistributedMember());
- String memberSource = MBeanJMXAdapter
- .getMemberNameOrId(cache.getDistributedSystem().getDistributedMember());
-
- // Only a dummy notification , no actual region is creates
- Notification notification = new Notification(JMXNotificationType.REGION_CREATED,
- memberSource, SequenceNumber.next(), System.currentTimeMillis(),
- ManagementConstants.REGION_CREATED_PREFIX + "/test");
- memberLevelNotifEmitter.sendNotification(notification);
-
- }
+ // Only a dummy notification , no actual region is created
+ Notification notification = new Notification(JMXNotificationType.REGION_CREATED, memberSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.REGION_CREATED_PREFIX + "/test");
+ notifier.sendNotification(notification);
});
}
- managingNode.invoke(new SerializableRunnable("Check notifications && Remove Listeners") {
-
- public void run() {
-
- Wait.waitForCriterion(new WaitCriterion() {
- public String description() {
- return "Waiting for all Notifications to reach the Managing Node";
- }
-
- public boolean done() {
- if (notifList.size() == 3) {
- return true;
- } else {
- return false;
- }
- }
- }, MAX_WAIT, 500, true);
+ this.managerVM.invoke("checkNotificationsAndRemoveListeners", () -> {
+ await().until(() -> assertThat(notifications).hasSize(3));
- notifList.clear();
-
- Iterator<ObjectName> it = notificationListenerMap.keySet().iterator();
- while (it.hasNext()) {
- ObjectName objectName = it.next();
- NotificationListener listener = notificationListenerMap.get(objectName);
- try {
- mbeanServer.removeNotificationListener(objectName, listener);
- } catch (ListenerNotFoundException e) {
- LogWriterUtils.getLogWriter().error(e);
- } catch (InstanceNotFoundException e) {
- LogWriterUtils.getLogWriter().error(e);
- }
- }
+ notifications.clear();
+ for (ObjectName objectName : notificationListenerMap.keySet()) {
+ NotificationListener listener = notificationListenerMap.get(objectName);
+ ManagementFactory.getPlatformMBeanServer().removeNotificationListener(objectName, listener);
}
});
// Check in all VMS again
- for (VM vm : managedNodeList) {
- vm.invoke(new SerializableRunnable("Check Hub Listener num count Again") {
-
- public void run() {
- Cache cache = getCache();
- SystemManagementService service = (SystemManagementService) getManagementService();
- NotificationHub hub = service.getNotificationHub();
- Map<ObjectName, NotificationHubListener> listenerObjectMap = hub.getListenerObjectMap();
-
- assertEquals(1, listenerObjectMap.keySet().size());
-
- ObjectName memberMBeanName = MBeanJMXAdapter
- .getMemberMBeanName(cache.getDistributedSystem().getDistributedMember());
-
- NotificationHubListener listener = listenerObjectMap.get(memberMBeanName);
-
- /*
- * Counter of listener should be 1 for the default Listener which is added for each member
- * mbean by distributed system mbean.
- */
- assertEquals(1, listener.getNumCounter());
-
- }
+ for (VM memberVM : this.memberVMs) {
+ memberVM.invoke("checkNotificationHubListenerCountAgain", () -> {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ NotificationHub hub = service.getNotificationHub();
+ Map<ObjectName, NotificationHubListener> listenerObjectMap = hub.getListenerObjectMap();
+ assertThat(listenerObjectMap.keySet().size()).isEqualTo(1);
+
+ ObjectName memberMBeanName = MBeanJMXAdapter.getMemberMBeanName(this.managementTestRule.getDistributedMember());
+ NotificationHubListener listener = listenerObjectMap.get(memberMBeanName);
+
+ /*
+ * Counter of listener should be 1 for the default Listener which is
+ * added for each member mbean by distributed system mbean.
+ */
+ assertThat(listener.getNumCounter()).isEqualTo(1);
});
}
- managingNode.invoke(new SerializableRunnable("Remove Listener from MemberMXBean") {
-
- public void run() {
- Cache cache = getCache();
- ManagementService service = getManagementService();
- final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
-
- Wait.waitForCriterion(new WaitCriterion() {
- public String description() {
- return "Waiting for all members to send their initial Data";
- }
-
- public boolean done() {
- if (bean.listMemberObjectNames().length == 5) {// including locator
- return true;
- } else {
- return false;
- }
-
- }
-
- }, MAX_WAIT, 500, true);
- for (ObjectName objectName : bean.listMemberObjectNames()) {
- NotificationHubTestListener listener = new NotificationHubTestListener();
- try {
- mbeanServer.removeNotificationListener(objectName, listener);
- } catch (InstanceNotFoundException e) {
- LogWriterUtils.getLogWriter().error(e);
- } catch (ListenerNotFoundException e) {
- // TODO: apparently there is never a notification listener on any these mbeans at this
- // point
- // fix this test so it doesn't hit these unexpected exceptions --
- // getLogWriter().error(e);
- }
+ this.managerVM.invoke("removeListenerFromMemberMXBean", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
+
+ await().until(() -> assertThat(distributedSystemMXBean.listMemberObjectNames()).hasSize(5));
+
+ for (ObjectName objectName : distributedSystemMXBean.listMemberObjectNames()) {
+ NotificationHubTestListener listener = new NotificationHubTestListener();
+ try {
+ ManagementFactory.getPlatformMBeanServer().removeNotificationListener(objectName, listener); // because new instance!!
+ } catch (ListenerNotFoundException e) {
+ // TODO: [old] apparently there is never a notification listener on any these mbeans at this point [fix this]
+ // fix this test so it doesn't hit these unexpected exceptions -- getLogWriter().error(e);
}
}
});
- for (VM vm : managedNodeList) {
- vm.invoke(new SerializableRunnable("Check Hub Listeners clean up") {
-
- public void run() {
- Cache cache = getCache();
- SystemManagementService service = (SystemManagementService) getManagementService();
- NotificationHub hub = service.getNotificationHub();
- hub.cleanUpListeners();
- assertEquals(0, hub.getListenerObjectMap().size());
-
- Iterator<ObjectName> it = notificationListenerMap.keySet().iterator();
- while (it.hasNext()) {
- ObjectName objectName = it.next();
- NotificationListener listener = notificationListenerMap.get(objectName);
- try {
- mbeanServer.removeNotificationListener(objectName, listener);
- fail("Found Listeners inspite of clearing them");
- } catch (ListenerNotFoundException e) {
- // Expected Exception Do nothing
- } catch (InstanceNotFoundException e) {
- LogWriterUtils.getLogWriter().error(e);
- }
- }
+ for (VM memberVM : this.memberVMs) {
+ memberVM.invoke("verifyNotificationHubListenersWereRemoved", () -> {
+ SystemManagementService service = this.managementTestRule.getSystemManagementService();
+ NotificationHub notificationHub = service.getNotificationHub();
+ notificationHub.cleanUpListeners();
+ assertThat(notificationHub.getListenerObjectMap()).isEmpty();
+
+ for (ObjectName objectName : notificationListenerMap.keySet()) {
+ NotificationListener listener = notificationListenerMap.get(objectName);
+ assertThatThrownBy(() -> ManagementFactory.getPlatformMBeanServer().removeNotificationListener(objectName, listener)).isExactlyInstanceOf(ListenerNotFoundException.class);
}
});
}
@@ -486,404 +328,212 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
/**
* Tests each and every operations that is defined on the MemberMXBean
- *
- * @throws Exception
*/
@Test
public void testAlert() throws Exception {
- VM managingNode = getManagingNode();
-
- createManagementCache(managingNode);
- startManagingNode(managingNode);
- addAlertListener(managingNode);
- resetAlertCounts(managingNode);
+ this.managementTestRule.createManager(this.managerVM);
+ addAlertListener(this.managerVM);
+ resetAlertCounts(this.managerVM);
- final DistributedMember managingMember = getMember(managingNode);
+ DistributedMember managerDistributedMember = this.managementTestRule.getDistributedMember(this.managerVM);
+ generateWarningAlert(this.managerVM);
+ generateSevereAlert(this.managerVM);
+ verifyAlertCount(this.managerVM, 1, 0);
+ resetAlertCounts(this.managerVM);
+ for (VM memberVM : this.memberVMs) {
+ this.managementTestRule.createMember(memberVM);
- warnLevelAlert(managingNode);
- severeLevelAlert(managingNode);
- checkAlertCount(managingNode, 1, 0);
- resetAlertCounts(managingNode);
-
- for (VM vm : getManagedNodeList()) {
-
- createCache(vm);
- // Default is severe ,So only Severe level alert is expected
-
- ensureLoggerState(vm, managingMember, Alert.SEVERE);
-
- warnLevelAlert(vm);
- severeLevelAlert(vm);
+ verifyAlertAppender(memberVM, managerDistributedMember, Alert.SEVERE);
+ generateWarningAlert(memberVM);
+ generateSevereAlert(memberVM);
}
- checkAlertCount(managingNode, 3, 0);
- resetAlertCounts(managingNode);
- setAlertLevel(managingNode, AlertDetails.getAlertLevelAsString(Alert.WARNING));
+ verifyAlertCount(this.managerVM, 3, 0);
+ resetAlertCounts(this.managerVM);
+ setAlertLevel(this.managerVM, AlertDetails.getAlertLevelAsString(Alert.WARNING));
- for (VM vm : getManagedNodeList()) {
- // warning and severe alerts both are to be checked
- ensureLoggerState(vm, managingMember, Alert.WARNING);
- warnLevelAlert(vm);
- severeLevelAlert(vm);
+ for (VM memberVM : this.memberVMs) {
+ verifyAlertAppender(memberVM, managerDistributedMember, Alert.WARNING);
+ generateWarningAlert(memberVM);
+ generateSevereAlert(memberVM);
}
- checkAlertCount(managingNode, 3, 3);
-
- resetAlertCounts(managingNode);
+ verifyAlertCount(this.managerVM, 3, 3);
- setAlertLevel(managingNode, AlertDetails.getAlertLevelAsString(Alert.OFF));
+ resetAlertCounts(this.managerVM);
- for (VM vm : getManagedNodeList()) {
- ensureLoggerState(vm, managingMember, Alert.OFF);
- warnLevelAlert(vm);
- severeLevelAlert(vm);
- }
- checkAlertCount(managingNode, 0, 0);
- resetAlertCounts(managingNode);
+ setAlertLevel(this.managerVM, AlertDetails.getAlertLevelAsString(Alert.OFF));
- for (VM vm : getManagedNodeList()) {
- closeCache(vm);
+ for (VM memberVM : this.memberVMs) {
+ verifyAlertAppender(memberVM, managerDistributedMember, Alert.OFF);
+ generateWarningAlert(memberVM);
+ generateSevereAlert(memberVM);
}
- closeCache(managingNode);
-
+ verifyAlertCount(this.managerVM, 0, 0);
}
- @SuppressWarnings("serial")
- public void checkAlertCount(VM vm1, final int expectedSevereAlertCount,
- final int expectedWarningAlertCount) throws Exception {
- {
- vm1.invoke(new SerializableCallable("Check Alert Count") {
-
- public Object call() throws Exception {
- final AlertNotifListener nt = AlertNotifListener.getInstance();
- Wait.waitForCriterion(new WaitCriterion() {
- public String description() {
- return "Waiting for all alerts to reach the Managing Node";
- }
-
- public boolean done() {
- if (expectedSevereAlertCount == nt.getseverAlertCount()
- && expectedWarningAlertCount == nt.getWarnigAlertCount()) {
- return true;
- } else {
- return false;
- }
-
- }
-
- }, MAX_WAIT, 500, true);
-
- return null;
- }
- });
-
- }
+ private void verifyAlertAppender(final VM memberVM, final DistributedMember member, final int alertLevel) {
+ memberVM.invoke("verifyAlertAppender", () -> await().until(() -> assertThat(AlertAppender.getInstance().hasAlertListener(member, alertLevel)).isTrue()));
}
+ private void verifyAlertCount(final VM managerVM, final int expectedSevereAlertCount, final int expectedWarningAlertCount) {
+ managerVM.invoke("verifyAlertCount", () -> {
+ AlertNotificationListener listener = AlertNotificationListener.getInstance();
-
- @SuppressWarnings("serial")
- public void setAlertLevel(VM vm1, final String alertLevel) throws Exception {
- {
- vm1.invoke(new SerializableCallable("Set Alert level") {
-
- public Object call() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- ManagementService service = getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- assertNotNull(bean);
- bean.changeAlertLevel(alertLevel);
-
- return null;
- }
- });
-
- }
+ await().until(() -> assertThat(listener.getSevereAlertCount()).isEqualTo(expectedSevereAlertCount));
+ await().until(() -> assertThat(listener.getWarningAlertCount()).isEqualTo(expectedWarningAlertCount));
+ });
}
- @SuppressWarnings("serial")
- public void warnLevelAlert(VM vm1) throws Exception {
- {
- vm1.invoke(new SerializableCallable("Warning level Alerts") {
-
- public Object call() throws Exception {
- final IgnoredException warnEx =
- IgnoredException.addIgnoredException(WARNING_LEVEL_MESSAGE);
- logger.warn(WARNING_LEVEL_MESSAGE);
- warnEx.remove();
- return null;
- }
- });
-
- }
+ private void setAlertLevel(final VM managerVM, final String alertLevel) {
+ managerVM.invoke("setAlertLevel", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
+ distributedSystemMXBean.changeAlertLevel(alertLevel);
+ });
}
-
- @SuppressWarnings("serial")
- public void resetAlertCounts(VM vm1) throws Exception {
- {
- vm1.invoke(new SerializableCallable("Reset Alert Count") {
-
- public Object call() throws Exception {
- AlertNotifListener nt = AlertNotifListener.getInstance();
- nt.resetCount();
- return null;
- }
- });
-
- }
+ private void generateWarningAlert(final VM anyVM) {
+ anyVM.invoke("generateWarningAlert", () -> {
+ IgnoredException ignoredException = IgnoredException.addIgnoredException(WARNING_LEVEL_MESSAGE);
+ logger.warn(WARNING_LEVEL_MESSAGE);
+ ignoredException.remove();
+ });
}
- @SuppressWarnings("serial")
- public void severeLevelAlert(VM vm1) throws Exception {
- {
- vm1.invoke(new SerializableCallable("Severe Level Alert") {
-
- public Object call() throws Exception {
- // add expected exception strings
-
- final IgnoredException severeEx =
- IgnoredException.addIgnoredException(SEVERE_LEVEL_MESSAGE);
- logger.fatal(SEVERE_LEVEL_MESSAGE);
- severeEx.remove();
- return null;
- }
- });
-
- }
+ private void resetAlertCounts(final VM managerVM) {
+ managerVM.invoke("resetAlertCounts", () -> {
+ AlertNotificationListener listener = AlertNotificationListener.getInstance();
+ listener.resetCount();
+ });
}
- @SuppressWarnings("serial")
- public void addAlertListener(VM vm1) throws Exception {
- {
- vm1.invoke(new SerializableCallable("Add Alert Listener") {
-
- public Object call() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- ManagementService service = getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- AlertNotifListener nt = AlertNotifListener.getInstance();
- nt.resetCount();
-
- NotificationFilter notificationFilter = new NotificationFilter() {
- @Override
- public boolean isNotificationEnabled(Notification notification) {
- return notification.getType().equals(JMXNotificationType.SYSTEM_ALERT);
- }
+ private void generateSevereAlert(final VM anyVM) {
+ anyVM.invoke("generateSevereAlert", () -> {
+ IgnoredException ignoredException = IgnoredException.addIgnoredException(SEVERE_LEVEL_MESSAGE);
+ logger.fatal(SEVERE_LEVEL_MESSAGE);
+ ignoredException.remove();
+ });
+ }
- };
+ private void addAlertListener(final VM managerVM) {
+ managerVM.invoke("addAlertListener", () -> {
+ AlertNotificationListener listener = AlertNotificationListener.getInstance();
+ listener.resetCount();
- mbeanServer.addNotificationListener(MBeanJMXAdapter.getDistributedSystemName(), nt,
- notificationFilter, null);
+ NotificationFilter notificationFilter = (Notification notification) -> notification.getType().equals(JMXNotificationType.SYSTEM_ALERT);
- return null;
- }
- });
-
- }
+ ManagementFactory.getPlatformMBeanServer().addNotificationListener(MBeanJMXAdapter.getDistributedSystemName(), listener, notificationFilter, null);
+ });
}
/**
* Check aggregate related functions and attributes
- *
- * @param vm1
- * @throws Exception
*/
- @SuppressWarnings("serial")
- public void checkAggregate(VM vm1) throws Exception {
- {
- vm1.invoke(new SerializableCallable("Chech Aggregate Attributes") {
-
- public Object call() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ private void verifyDistributedSystemMXBean(final VM managerVM) {
+ managerVM.invoke("verifyDistributedSystemMXBean", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
- ManagementService service = getManagementService();
+ await().until(() -> assertThat(distributedSystemMXBean.getMemberCount()).isEqualTo(5));
- final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- assertNotNull(service.getDistributedSystemMXBean());
-
- Wait.waitForCriterion(new WaitCriterion() {
- public String description() {
- return "Waiting All members to intitialize DistributedSystemMBean expect 5 but found "
- + bean.getMemberCount();
- }
-
- public boolean done() {
- // including locator
- if (bean.getMemberCount() == 5) {
- return true;
- } else {
- return false;
- }
-
- }
-
- }, MAX_WAIT, 500, true);
-
-
-
- final Set<DistributedMember> otherMemberSet =
- cache.getDistributionManager().getOtherNormalDistributionManagerIds();
- Iterator<DistributedMember> memberIt = otherMemberSet.iterator();
- while (memberIt.hasNext()) {
- DistributedMember member = memberIt.next();
- LogWriterUtils.getLogWriter().info("JVM Metrics For Member " + member.getId() + ":"
- + bean.showJVMMetrics(member.getId()));
- LogWriterUtils.getLogWriter().info("OS Metrics For Member " + member.getId() + ":"
- + bean.showOSMetrics(member.getId()));
- }
-
- return null;
- }
- });
-
- }
+ Set<DistributedMember> otherMemberSet = this.managementTestRule.getOtherNormalMembers();
+ for (DistributedMember member : otherMemberSet) {
+ // TODO: need assertions? JVMMetrics and OSMetrics
+ }
+ });
}
- @SuppressWarnings("serial")
- public void addNotificationListener(VM vm1) throws Exception {
- {
- vm1.invoke(new SerializableCallable("Add Notification Listener") {
-
- public Object call() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- ManagementService service = getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- assertNotNull(bean);
- TestDistributedSystemNotif nt = new TestDistributedSystemNotif();
- mbeanServer.addNotificationListener(MBeanJMXAdapter.getDistributedSystemName(), nt, null,
- null);
-
- return null;
- }
- });
+ private void addNotificationListener(final VM managerVM) {
+ managerVM.invoke("addNotificationListener", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
+ assertThat(distributedSystemMXBean).isNotNull();
- }
+ DistributedSystemNotificationListener listener = new DistributedSystemNotificationListener();
+ ManagementFactory.getPlatformMBeanServer().addNotificationListener(MBeanJMXAdapter.getDistributedSystemName(), listener, null, null);
+ });
}
+ private void shutDownAll(final VM managerVM) {
+ managerVM.invoke("shutDownAll", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
+ distributedSystemMXBean.shutDownAllMembers();
-
- @SuppressWarnings("serial")
- public void shutDownAll(VM vm1) throws Exception {
- {
- vm1.invoke(new SerializableCallable("Shut Down All") {
-
- public Object call() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- ManagementService service = getManagementService();
- DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- assertNotNull(service.getDistributedSystemMXBean());
- bean.shutDownAllMembers();
- Wait.pause(2000);
- assertEquals(cache.getDistributedSystem().getAllOtherMembers().size(), 1);
- return null;
- }
- });
-
- }
+ await().until(() -> assertThat(this.managementTestRule.getOtherNormalMembers()).hasSize(0));
+ });
}
+ private void verifyFetchMemberObjectName(final VM managerVM, final int memberCount) {
+ managerVM.invoke("verifyFetchMemberObjectName", () -> {
+ ManagementService service = this.managementTestRule.getManagementService();
+ DistributedSystemMXBean distributedSystemMXBean = service.getDistributedSystemMXBean();
+ await().until(() -> assertThat(distributedSystemMXBean.listMemberObjectNames()).hasSize(memberCount));
- @SuppressWarnings("serial")
- public void checkNavigationAPIs(VM vm1) throws Exception {
- {
- vm1.invoke(new SerializableCallable("Check Navigation APIS") {
-
- public Object call() throws Exception {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- ManagementService service = getManagementService();
- final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
-
- assertNotNull(service.getDistributedSystemMXBean());
-
- waitForAllMembers(4);
-
- for (int i = 0; i < bean.listMemberObjectNames().length; i++) {
- LogWriterUtils.getLogWriter()
- .info("ObjectNames Of the Mmeber" + bean.listMemberObjectNames()[i]);
- }
-
-
- ObjectName thisMemberName = MBeanJMXAdapter.getMemberMBeanName(
- InternalDistributedSystem.getConnectedInstance().getDistributedMember().getId());
-
- ObjectName memberName = bean.fetchMemberObjectName(
- InternalDistributedSystem.getConnectedInstance().getDistributedMember().getId());
- assertEquals(thisMemberName, memberName);
-
- return null;
- }
- });
-
- }
+ String memberId = this.managementTestRule.getDistributedMember().getId();
+ ObjectName thisMemberName = MBeanJMXAdapter.getMemberMBeanName(memberId);
+ ObjectName memberName = distributedSystemMXBean.fetchMemberObjectName(memberId);
+ assertThat(memberName).isEqualTo(thisMemberName);
+ });
}
+ private ConditionFactory await() {
+ return Awaitility.await().atMost(2, MINUTES);
+ }
- /**
- * Notification handler
- *
- *
- */
- private static class TestDistributedSystemNotif implements NotificationListener {
+ private static class DistributedSystemNotificationListener implements NotificationListener {
@Override
- public void handleNotification(Notification notification, Object handback) {
- assertNotNull(notification);
+ public void handleNotification(final Notification notification, final Object handback) {
+ assertThat(notification).isNotNull();
}
-
}
- /**
- * Notification handler
- *
- *
- */
- private static class AlertNotifListener implements NotificationListener {
+ private static class AlertNotificationListener implements NotificationListener {
+
+ private static AlertNotificationListener listener = new AlertNotificationListener();
+
+ private int warningAlertCount = 0;
- private static AlertNotifListener listener = new AlertNotifListener();
+ private int severeAlertCount = 0;
- public static AlertNotifListener getInstance() {
+ static AlertNotificationListener getInstance() { // TODO: get rid of singleton
return listener;
}
- private int warnigAlertCount = 0;
+ @Override
+ public synchronized void handleNotification(final Notification notification, final Object handback) {
+ assertThat(notification).isNotNull();
- private int severAlertCount = 0;
+ Map<String, String> notificationUserData = (Map<String, String>) notification.getUserData();
- @Override
- public synchronized void handleNotification(Notification notification, Object handback) {
- assertNotNull(notification);
- logger.info("Notification received {}", notification);
- Map<String, String> notifUserData = (Map<String, String>) notification.getUserData();
- if (notifUserData.get(JMXNotificationUserData.ALERT_LEVEL).equalsIgnoreCase("warning")) {
- assertEquals(WARNING_LEVEL_MESSAGE, notification.getMessage());
- ++warnigAlertCount;
+ if (notificationUserData.get(JMXNotificationUserData.ALERT_LEVEL).equalsIgnoreCase("warning")) {
+ assertThat(notification.getMessage()).isEqualTo(WARNING_LEVEL_MESSAGE);
+ warningAlertCount++;
}
- if (notifUserData.get(JMXNotificationUserData.ALERT_LEVEL).equalsIgnoreCase("severe")) {
- assertEquals(SEVERE_LEVEL_MESSAGE, notification.getMessage());
- ++severAlertCount;
+ if (notificationUserData.get(JMXNotificationUserData.ALERT_LEVEL).equalsIgnoreCase("severe")) {
+ assertThat(notification.getMessage()).isEqualTo(SEVERE_LEVEL_MESSAGE);
+ severeAlertCount++;
}
}
- public void resetCount() {
- warnigAlertCount = 0;
-
- severAlertCount = 0;
+ void resetCount() {
+ warningAlertCount = 0;
+ severeAlertCount = 0;
}
- public int getWarnigAlertCount() {
- return warnigAlertCount;
+ int getWarningAlertCount() {
+ return warningAlertCount;
}
- public int getseverAlertCount() {
- return severAlertCount;
+ int getSevereAlertCount() {
+ return severeAlertCount;
}
-
}
-
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/22f577eb/geode-core/src/test/java/org/apache/geode/management/JMXMBeanDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/JMXMBeanDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/JMXMBeanDUnitTest.java
index 0feb4c2..0096f0d 100644
--- a/geode-core/src/test/java/org/apache/geode/management/JMXMBeanDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/JMXMBeanDUnitTest.java
@@ -49,7 +49,7 @@ import org.apache.geode.test.junit.categories.FlakyTest;
import org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder;
import org.apache.geode.util.test.TestUtil;
-public class JMXMBeanDUnitTest extends DistributedTestCase {
+public class JMXMBeanDUnitTest extends DistributedTestCase { // TODO: rename and fix on Mac
private Host host;
private VM locator;
[33/50] [abbrv] incubator-geode git commit: GEODE-2110 Add gfsh start
server user and password options
Posted by kl...@apache.org.
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 Miller <km...@pivotal.io>
Authored: Mon Nov 14 17:41:55 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
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]
```
<a id="topic_3764EE2DB18B4AE4A625E0354471738A__table_at5_bwg_2w"></a>
@@ -763,6 +764,20 @@ See <a href="../../../configuring/cluster_config/gfsh_persist.html">Overview of
</td>
<td>all local addresses</td>
</tr>
+<tr class="even">
+<td><span class="keyword parmname">\-\-user</span></td>
+<td>The user name of the credential to use in authenticating to the cluster.
+When specified, if the <code>--password</code> option is not also specified,
+then <code>gfsh</code> will prompt for the password.
+</td>
+<td></td>
+</tr>
+<tr class="even">
+<td><span class="keyword parmname">\-\-password</span></td>
+<td>The password portion of the credential to use in authenticating to the cluster.
+</td>
+<td></td>
+</tr>
</tbody>
</table>