ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [19/23] ignite git commit: IGNITE-6670 Web Agent: Improved demo startup.
Date Mon, 30 Oct 2017 12:27:13 GMT
IGNITE-6670 Web Agent: Improved demo startup.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b4bd20e1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b4bd20e1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b4bd20e1

Branch: refs/heads/ignite-6748
Commit: b4bd20e10cf564c9852be58e620f1d3b79af9067
Parents: 67859f4
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Mon Oct 30 14:56:22 2017 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Mon Oct 30 14:56:22 2017 +0700

----------------------------------------------------------------------
 .../ignite/console/demo/AgentClusterDemo.java   | 32 +++++++++++---------
 .../demo/service/DemoCachesLoadService.java     |  3 +-
 2 files changed, 19 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b4bd20e1/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/AgentClusterDemo.java
----------------------------------------------------------------------
diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/AgentClusterDemo.java
b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/AgentClusterDemo.java
index 886888b..7157df7 100644
--- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/AgentClusterDemo.java
+++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/AgentClusterDemo.java
@@ -27,9 +27,9 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteServices;
 import org.apache.ignite.Ignition;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.console.demo.service.DemoCachesLoadService;
 import org.apache.ignite.console.demo.service.DemoComputeLoadService;
 import org.apache.ignite.console.demo.service.DemoRandomCacheLoadService;
@@ -53,6 +53,7 @@ import static org.apache.ignite.IgniteSystemProperties.IGNITE_NO_ASCII;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_PERFORMANCE_SUGGESTIONS_DISABLED;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_QUIET;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_UPDATE_NOTIFIER;
+import static org.apache.ignite.configuration.DataStorageConfiguration.DFLT_DATA_REGION_INITIAL_SIZE;
 import static org.apache.ignite.console.demo.AgentDemoUtils.newScheduledThreadPool;
 import static org.apache.ignite.events.EventType.EVTS_DISCOVERY;
 import static org.apache.ignite.internal.visor.util.VisorTaskUtils.VISOR_TASK_EVTS;
@@ -132,15 +133,16 @@ public class AgentClusterDemo {
         cfg.setGridLogger(new Slf4jLogger(log));
         cfg.setMetricsLogFrequency(0);
 
-        MemoryConfiguration memCfg = new MemoryConfiguration();
+        DataRegionConfiguration dataRegCfg = new DataRegionConfiguration();
+        dataRegCfg.setName("demo");
+        dataRegCfg.setMetricsEnabled(true);
+        dataRegCfg.setMaxSize(DFLT_DATA_REGION_INITIAL_SIZE);
 
-        MemoryPolicyConfiguration memPlc = new MemoryPolicyConfiguration();
-        memPlc.setName("demo");
-        memPlc.setMetricsEnabled(true);
+        DataStorageConfiguration dataStorageCfg = new DataStorageConfiguration();
+        dataStorageCfg.setDefaultDataRegionConfiguration(dataRegCfg);
+        dataStorageCfg.setSystemRegionMaxSize(DFLT_DATA_REGION_INITIAL_SIZE);
 
-        memCfg.setMemoryPolicies(memPlc);
-
-        cfg.setMemoryConfiguration(memCfg);
+        cfg.setDataStorageConfiguration(dataStorageCfg);
 
         if (client)
             cfg.setClientMode(true);
@@ -157,10 +159,10 @@ public class AgentClusterDemo {
         services.deployMultiple("Demo service: Multiple instances", new DemoServiceMultipleInstances(),
7, 3);
         services.deployNodeSingleton("Demo service: Node singleton", new DemoServiceNodeSingleton());
         services.deployClusterSingleton("Demo service: Cluster singleton", new DemoServiceClusterSingleton());
+        services.deployClusterSingleton("Demo caches load service", new DemoCachesLoadService(20));
         services.deployKeyAffinitySingleton("Demo service: Key affinity singleton",
             new DemoServiceKeyAffinity(), DemoCachesLoadService.CAR_CACHE_NAME, "id");
 
-        services.deployClusterSingleton("Demo caches load service", new DemoCachesLoadService(20));
         services.deployNodeSingleton("RandomCache load service", new DemoRandomCacheLoadService(20));
 
         services.deployMultiple("Demo service: Compute load", new DemoComputeLoadService(),
2, 1);
@@ -195,8 +197,10 @@ public class AgentClusterDemo {
                     int idx = cnt.incrementAndGet();
                     int port = basePort.get();
 
+                    IgniteEx ignite = null;
+
                     try {
-                        IgniteEx ignite = (IgniteEx)Ignition.start(igniteConfiguration(port,
idx, false));
+                        ignite = (IgniteEx)Ignition.start(igniteConfiguration(port, idx,
false));
 
                         if (idx == 0) {
                             Collection<String> jettyAddrs = ignite.localNode().attribute(ATTR_REST_JETTY_ADDRS);
@@ -219,8 +223,6 @@ public class AgentClusterDemo {
                             demoUrl = String.format("http://%s:%d", jettyHost, jettyPort);
 
                             initLatch.countDown();
-
-                            deployServices(ignite.services(ignite.cluster().forServers()));
                         }
                     }
                     catch (Throwable e) {
@@ -234,13 +236,15 @@ public class AgentClusterDemo {
                     }
                     finally {
                         if (idx == NODE_CNT) {
+                            deployServices(ignite.services(ignite.cluster().forServers()));
+
                             log.info("DEMO: All embedded nodes for demo successfully started");
 
                             execSrv.shutdown();
                         }
                     }
                 }
-            }, 1, 10, TimeUnit.SECONDS);
+            }, 1, 5, TimeUnit.SECONDS);
         }
 
         return initLatch;

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4bd20e1/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java
----------------------------------------------------------------------
diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java
b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java
index 40fd4ac..6691d1d 100644
--- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java
+++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java
@@ -194,7 +194,6 @@ public class DemoCachesLoadService implements Service {
         }, 10, 3, TimeUnit.SECONDS);
     }
 
-
     /**
      * Create base cache configuration.
      *
@@ -208,7 +207,7 @@ public class DemoCachesLoadService implements Service {
         ccfg.setQueryDetailMetricsSize(10);
         ccfg.setStatisticsEnabled(true);
         ccfg.setSqlFunctionClasses(SQLFunctions.class);
-        ccfg.setMemoryPolicyName("demo");
+        ccfg.setDataRegionName("demo");
 
         return ccfg;
     }


Mime
View raw message