You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2016/02/16 16:15:06 UTC

[49/50] ignite git commit: IGNITE-843 Minor fixes.

IGNITE-843 Minor fixes.


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

Branch: refs/heads/ignite-843-rc3
Commit: f06c1953e42d76ad4be2cdc53ec094f02e7b0d5f
Parents: 09d6538
Author: AKuznetsov <ak...@gridgain.com>
Authored: Tue Feb 16 20:39:53 2016 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Tue Feb 16 20:39:53 2016 +0700

----------------------------------------------------------------------
 .../control-center-web/src/main/js/package.json |  1 +
 .../src/main/js/serve/mongo.js                  | 10 ++++-----
 .../src/main/js/serve/routes/caches.js          | 19 ++++++++--------
 .../src/main/js/serve/routes/clusters.js        | 23 ++++++++++----------
 .../src/main/js/serve/routes/domains.js         | 17 +++++++--------
 .../src/main/js/serve/routes/igfs.js            | 19 ++++++++--------
 6 files changed, 43 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f06c1953/modules/control-center-web/src/main/js/package.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/package.json b/modules/control-center-web/src/main/js/package.json
index 9eef666..a4f820e 100644
--- a/modules/control-center-web/src/main/js/package.json
+++ b/modules/control-center-web/src/main/js/package.json
@@ -21,6 +21,7 @@
     "node": ">=0.12.4"
   },
   "dependencies": {
+    "async": "1.5.2",
     "babel-eslint": "^4.1.6",
     "body-parser": "~1.14.1",
     "bootstrap-sass": "^3.3.6",

http://git-wip-us.apache.org/repos/asf/ignite/blob/f06c1953/modules/control-center-web/src/main/js/serve/mongo.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/mongo.js b/modules/control-center-web/src/main/js/serve/mongo.js
index 9021016..0ea72d9 100644
--- a/modules/control-center-web/src/main/js/serve/mongo.js
+++ b/modules/control-center-web/src/main/js/serve/mongo.js
@@ -90,7 +90,7 @@ module.exports.factory = function(deepPopulatePlugin, passportMongo, settings, p
 
     // Define Domain model schema.
     const DomainModelSchema = new Schema({
-        space: {type: ObjectId, ref: 'Space'},
+        space: {type: ObjectId, ref: 'Space', index: true},
         caches: [{type: ObjectId, ref: 'Cache'}],
         queryMetadata: {type: String, enum: ['Annotations', 'Configuration']},
         kind: {type: String, enum: ['query', 'store', 'both']},
@@ -125,7 +125,7 @@ module.exports.factory = function(deepPopulatePlugin, passportMongo, settings, p
 
     // Define Cache schema.
     const CacheSchema = new Schema({
-        space: {type: ObjectId, ref: 'Space'},
+        space: {type: ObjectId, ref: 'Space', index: true},
         name: String,
         clusters: [{type: ObjectId, ref: 'Cluster'}],
         domains: [{type: ObjectId, ref: 'DomainModel'}],
@@ -258,7 +258,7 @@ module.exports.factory = function(deepPopulatePlugin, passportMongo, settings, p
     result.Cache = mongoose.model('Cache', CacheSchema);
 
     const IgfsSchema = new Schema({
-        space: {type: ObjectId, ref: 'Space'},
+        space: {type: ObjectId, ref: 'Space', index: true},
         name: String,
         clusters: [{type: ObjectId, ref: 'Cluster'}],
         affinnityGroupSize: Number,
@@ -304,7 +304,7 @@ module.exports.factory = function(deepPopulatePlugin, passportMongo, settings, p
 
     // Define Cluster schema.
     const ClusterSchema = new Schema({
-        space: {type: ObjectId, ref: 'Space'},
+        space: {type: ObjectId, ref: 'Space', index: true},
         name: String,
         localHost: String,
         discovery: {
@@ -506,7 +506,7 @@ module.exports.factory = function(deepPopulatePlugin, passportMongo, settings, p
 
     // Define Notebook schema.
     const NotebookSchema = new Schema({
-        space: {type: ObjectId, ref: 'Space'},
+        space: {type: ObjectId, ref: 'Space', index: true},
         name: String,
         expandedParagraphs: [Number],
         paragraphs: [{

http://git-wip-us.apache.org/repos/asf/ignite/blob/f06c1953/modules/control-center-web/src/main/js/serve/routes/caches.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/caches.js b/modules/control-center-web/src/main/js/serve/routes/caches.js
index 17fef2d..0122864 100644
--- a/modules/control-center-web/src/main/js/serve/routes/caches.js
+++ b/modules/control-center-web/src/main/js/serve/routes/caches.js
@@ -87,17 +87,16 @@ module.exports.factory = function(_, express, mongo) {
                             .then(() => res.send(cacheId))
                             .catch((err) => mongo.handleError(res, err));
                     }
-                    else {
-                        return (new mongo.Cache(params)).save()
-                            .then((cache) => {
-                                cacheId = cache._id;
 
-                                return mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}).exec();
-                            })
-                            .then(() => mongo.DomainModel.update({_id: {$in: domains}}, {$addToSet: {caches: cacheId}}, {multi: true}).exec())
-                            .then(() => res.send(cacheId))
-                            .catch((err) => mongo.handleError(res, err));
-                    }
+                    return (new mongo.Cache(params)).save()
+                        .then((cache) => {
+                            cacheId = cache._id;
+
+                            return mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}).exec();
+                        })
+                        .then(() => mongo.DomainModel.update({_id: {$in: domains}}, {$addToSet: {caches: cacheId}}, {multi: true}).exec())
+                        .then(() => res.send(cacheId))
+                        .catch((err) => mongo.handleError(res, err));
                 });
         });
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f06c1953/modules/control-center-web/src/main/js/serve/routes/clusters.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/clusters.js b/modules/control-center-web/src/main/js/serve/routes/clusters.js
index 6bbf4c0..bca0735 100644
--- a/modules/control-center-web/src/main/js/serve/routes/clusters.js
+++ b/modules/control-center-web/src/main/js/serve/routes/clusters.js
@@ -97,19 +97,18 @@ module.exports.factory = function(_, express, mongo) {
                             .then(() => res.send(clusterId))
                             .catch((err) => mongo.handleError(res, err));
                     }
-                    else {
-                        return (new mongo.Cluster(params)).save()
-                            .then((cluster) => {
-                                clusterId = cluster._id;
 
-                                return mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {clusters: clusterId}}, {multi: true}).exec();
-                            })
-                            .then(() => mongo.Cache.update({_id: {$nin: caches}}, {$pull: {clusters: clusterId}}, {multi: true}).exec())
-                            .then(() => mongo.Igfs.update({_id: {$in: igfss}}, {$addToSet: {clusters: clusterId}}, {multi: true}).exec())
-                            .then(() => mongo.Igfs.update({_id: {$nin: igfss}}, {$pull: {clusters: clusterId}}, {multi: true}).exec())
-                            .then(() => res.send(clusterId))
-                            .catch((err) => mongo.handleError(res, err));
-                    }
+                    return (new mongo.Cluster(params)).save()
+                        .then((cluster) => {
+                            clusterId = cluster._id;
+
+                            return mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {clusters: clusterId}}, {multi: true}).exec();
+                        })
+                        .then(() => mongo.Cache.update({_id: {$nin: caches}}, {$pull: {clusters: clusterId}}, {multi: true}).exec())
+                        .then(() => mongo.Igfs.update({_id: {$in: igfss}}, {$addToSet: {clusters: clusterId}}, {multi: true}).exec())
+                        .then(() => mongo.Igfs.update({_id: {$nin: igfss}}, {$pull: {clusters: clusterId}}, {multi: true}).exec())
+                        .then(() => res.send(clusterId))
+                        .catch((err) => mongo.handleError(res, err));
                 });
         });
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f06c1953/modules/control-center-web/src/main/js/serve/routes/domains.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/domains.js b/modules/control-center-web/src/main/js/serve/routes/domains.js
index 6fe64b3..d98398b 100644
--- a/modules/control-center-web/src/main/js/serve/routes/domains.js
+++ b/modules/control-center-web/src/main/js/serve/routes/domains.js
@@ -93,15 +93,14 @@ module.exports.factory = (_, express, mongo) => {
                                 return _updateCacheStore(cacheStoreChanges);
                             });
                     }
-                    else {
-                        return (new mongo.DomainModel(domain)).save()
-                            .then((savedDomain) => {
-                                savedDomains.push(savedDomain);
-
-                                return mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: savedDomain._id}}, {multi: true}).exec();
-                            })
-                            .then(() => _updateCacheStore(cacheStoreChanges));
-                    }
+
+                    return (new mongo.DomainModel(domain)).save()
+                        .then((savedDomain) => {
+                            savedDomains.push(savedDomain);
+
+                            return mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: savedDomain._id}}, {multi: true}).exec();
+                        })
+                        .then(() => _updateCacheStore(cacheStoreChanges));
                 });
         };
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f06c1953/modules/control-center-web/src/main/js/serve/routes/igfs.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/igfs.js b/modules/control-center-web/src/main/js/serve/routes/igfs.js
index baadfe6..255220a 100644
--- a/modules/control-center-web/src/main/js/serve/routes/igfs.js
+++ b/modules/control-center-web/src/main/js/serve/routes/igfs.js
@@ -79,17 +79,16 @@ module.exports.factory = function(_, express, mongo) {
                             .then(() => res.send(igfsId))
                             .catch((err) => mongo.handleError(res, err));
                     }
-                    else {
-                        return (new mongo.Igfs(params)).save()
-                            .then((igfs) => {
-                                igfsId = igfs._id;
 
-                                return mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}).exec();
-                            })
-                            .then(() => res.send(igfsId))
-                            .catch((err) => mongo.handleError(res, err));
-                    }
-                })
+                    return (new mongo.Igfs(params)).save()
+                        .then((igfs) => {
+                            igfsId = igfs._id;
+
+                            return mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}).exec();
+                        })
+                        .then(() => res.send(igfsId))
+                        .catch((err) => mongo.handleError(res, err));
+                });
         });
 
         /**