You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2018/11/20 14:55:20 UTC
[37/50] [abbrv] ignite git commit: IGNITE-9554 Web Agent: Exclude
caches created via SQL from random data population in "Demo" mode.
IGNITE-9554 Web Agent: Exclude caches created via SQL from random data population in "Demo" mode.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4fb1fc37
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4fb1fc37
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4fb1fc37
Branch: refs/heads/ignite-10044
Commit: 4fb1fc37a5016fb0386cb654cc527b685cb78349
Parents: ae7a1d0
Author: Vasiliy Sisko <vs...@gridgain.com>
Authored: Tue Nov 20 16:30:35 2018 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Nov 20 16:30:35 2018 +0700
----------------------------------------------------------------------
.../service/DemoRandomCacheLoadService.java | 22 +++++++++++---------
1 file changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4fb1fc37/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoRandomCacheLoadService.java
----------------------------------------------------------------------
diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoRandomCacheLoadService.java b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoRandomCacheLoadService.java
index e6242fc..5b73e96 100644
--- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoRandomCacheLoadService.java
+++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoRandomCacheLoadService.java
@@ -29,6 +29,8 @@ import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.services.Service;
import org.apache.ignite.services.ServiceContext;
+import static org.apache.ignite.internal.processors.query.QueryUtils.DFLT_SCHEMA;
+
/**
* Demo service. Create cache and populate it by random int pairs.
*/
@@ -78,19 +80,19 @@ public class DemoRandomCacheLoadService implements Service {
@Override public void run() {
try {
for (String cacheName : ignite.cacheNames()) {
- if (!DemoCachesLoadService.DEMO_CACHES.contains(cacheName)) {
- IgniteCache<Integer, Integer> cache = ignite.cache(cacheName);
+ IgniteCache<Integer, Integer> cache = ignite.cache(cacheName);
- if (cache != null) {
- for (int i = 0, n = 1; i < cnt; i++, n++) {
- Integer key = rnd.nextInt(RND_CNT);
- Integer val = rnd.nextInt(RND_CNT);
+ if (cache != null &&
+ !DemoCachesLoadService.DEMO_CACHES.contains(cacheName) &&
+ !DFLT_SCHEMA.equalsIgnoreCase(cache.getConfiguration(CacheConfiguration.class).getSqlSchema())) {
+ for (int i = 0, n = 1; i < cnt; i++, n++) {
+ Integer key = rnd.nextInt(RND_CNT);
+ Integer val = rnd.nextInt(RND_CNT);
- cache.put(key, val);
+ cache.put(key, val);
- if (rnd.nextInt(100) < 30)
- cache.remove(key);
- }
+ if (rnd.nextInt(100) < 30)
+ cache.remove(key);
}
}
}