IGNITE-7927 Web Console: Fixed demo for non-collocated joins.
authorVasiliy Sisko <vsisko@gridgain.com>
Tue, 10 Apr 2018 10:48:52 +0000 (17:48 +0700)
committerAlexey Kuznetsov <akuznetsov@apache.org>
Tue, 10 Apr 2018 10:48:52 +0000 (17:48 +0700)
modules/web-console/backend/routes/demo.js
modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java

index a18fa7a..b081d0c 100644 (file)
@@ -95,10 +95,12 @@ module.exports.factory = (errors, settings, mongo, spacesService) => {
 
                                             domain.space = cacheDoc.space;
                                             domain.caches.push(cacheDoc._id);
+                                            domain.clusters.push(cluster._id);
 
                                             return domain.save()
                                                 .then((domainDoc) => {
                                                     cacheDoc.domains.push(domainDoc._id);
+                                                    cluster.models.push(domainDoc._id);
 
                                                     return cacheDoc.save();
                                                 });
index 6691d1d..2aace06 100644 (file)
@@ -269,6 +269,14 @@ public class DemoCachesLoadService implements Service {
 
         type.setFields(qryFlds);
 
+        // Indexes for DEPARTMENT.
+
+        ArrayList<QueryIndex> indexes = new ArrayList<>();
+
+        indexes.add(new QueryIndex("countryId", QueryIndexType.SORTED, false, "DEP_COUNTRY"));
+
+        type.setIndexes(indexes);
+
         ccfg.setQueryEntities(qryEntities);
 
         return ccfg;
@@ -312,6 +320,11 @@ public class DemoCachesLoadService implements Service {
 
         // Indexes for EMPLOYEE.
 
+        Collection<QueryIndex> indexes = new ArrayList<>();
+
+        indexes.add(new QueryIndex("departmentId", QueryIndexType.SORTED, false, "EMP_DEPARTMENT"));
+        indexes.add(new QueryIndex("managerId", QueryIndexType.SORTED, false, "EMP_MANAGER"));
+
         QueryIndex idx = new QueryIndex();
 
         idx.setName("EMP_NAMES");
@@ -323,8 +336,6 @@ public class DemoCachesLoadService implements Service {
 
         idx.setFields(indFlds);
 
-        Collection<QueryIndex> indexes = new ArrayList<>();
-
         indexes.add(idx);
         indexes.add(new QueryIndex("salary", QueryIndexType.SORTED, false, "EMP_SALARY"));
 
@@ -392,6 +403,13 @@ public class DemoCachesLoadService implements Service {
 
         type.setFields(qryFlds);
 
+        // Indexes for CAR.
+
+        ArrayList<QueryIndex> indexes = new ArrayList<>();
+
+        indexes.add(new QueryIndex("parkingId", QueryIndexType.SORTED, false, "CAR_PARKING"));
+        type.setIndexes(indexes);
+
         ccfg.setQueryEntities(qryEntities);
 
         return ccfg;