ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [2/2] ignite git commit: IGNITE-1200 Fixed secondary file system configuration and code generation.
Date Thu, 05 Nov 2015 05:02:32 GMT
IGNITE-1200 Fixed secondary file system configuration and code generation.


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

Branch: refs/heads/ignite-843-rc1
Commit: c5ea672fb88718e56234571202eaf91951f9509a
Parents: 99c4207
Author: vsisko <vsisko@gridgain.com>
Authored: Thu Nov 5 12:02:33 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Thu Nov 5 12:02:33 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/igfs-controller.js  | 15 ++++
 .../src/main/js/controllers/models/caches.json  |  2 -
 .../main/js/controllers/models/clusters.json    |  2 -
 .../src/main/js/controllers/models/igfs.json    | 73 +++++++++++++++++---
 .../main/js/controllers/models/metadata.json    |  1 -
 modules/control-center-web/src/main/js/db.js    |  8 ++-
 .../main/js/routes/generator/generator-java.js  | 25 +++++++
 .../main/js/routes/generator/generator-xml.js   | 45 ++++++++++++
 8 files changed, 156 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c5ea672f/modules/control-center-web/src/main/js/controllers/igfs-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/igfs-controller.js b/modules/control-center-web/src/main/js/controllers/igfs-controller.js
index 9329559..0f92d09 100644
--- a/modules/control-center-web/src/main/js/controllers/igfs-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/igfs-controller.js
@@ -90,6 +90,7 @@ consoleModule.controller('igfsController', [
                 ipc: {xml: '', java: '', allDefaults: true},
                 fragmentizer: {xml: '', java: '', allDefaults: true},
                 dualMode: {xml: '', java: '', allDefaults: true},
+                secondaryFileSystem: {xml: '', java: '', allDefaults: true},
                 misc: {xml: '', java: '', allDefaults: true}
             };
 
@@ -182,6 +183,10 @@ consoleModule.controller('igfsController', [
                                     $scope.preview.dualMode.java = $generatorJava.igfsDualMode(val,
varName).asString();
                                     $scope.preview.dualMode.allDefaults = $common.isEmptyString($scope.preview.dualMode.xml);
 
+                                    $scope.preview.secondaryFileSystem.xml = $generatorXml.igfsSecondFS(val).asString();
+                                    $scope.preview.secondaryFileSystem.java = $generatorJava.igfsSecondFS(val,
varName).asString();
+                                    $scope.preview.secondaryFileSystem.allDefaults = $common.isEmptyString($scope.preview.secondaryFileSystem.xml);
+
                                     $scope.preview.misc.xml = $generatorXml.igfsMisc(val).asString();
                                     $scope.preview.misc.java = $generatorJava.igfsMisc(val,
varName).asString();
                                     $scope.preview.misc.allDefaults = $common.isEmptyString($scope.preview.misc.xml);
@@ -261,6 +266,16 @@ consoleModule.controller('igfsController', [
                     !$common.isValidJavaClass('Put executor service', item.dualModePutExecutorService,
false, 'dualModePutExecutorService', false, $scope.panels, 'dualMode'))
                     return false;
 
+                if (!item.secondaryFileSystemEnabled && (!item.defaultMode || item.defaultMode
!= 'PRIMARY'))
+                    return showPopoverMessage($scope.panels, 'misc', 'secondaryFileSystem-title',
'Secondary file system should be configured for not "PRIMARY" IGFS mode');
+
+                if (item.pathModes) {
+                    for (var pathIx = 0; pathIx < item.pathModes.length; pathIx ++) {
+                        if (!item.secondaryFileSystemEnabled && item.pathModes[pathIx].mode
!= 'PRIMARY')
+                            return showPopoverMessage($scope.panels, 'misc', 'secondaryFileSystem-title',
'Secondary file system should be configured for not "PRIMARY" path mode');
+                    }
+                }
+
                 return true;
             }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5ea672f/modules/control-center-web/src/main/js/controllers/models/caches.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/caches.json b/modules/control-center-web/src/main/js/controllers/models/caches.json
index 69a77bd..07c6cc3 100644
--- a/modules/control-center-web/src/main/js/controllers/models/caches.json
+++ b/modules/control-center-web/src/main/js/controllers/models/caches.json
@@ -45,7 +45,6 @@
             "Associate clusters with the current cache"
           ],
           "addLink": {
-            "label": "Add cluster(s)",
             "ref": "/configuration/clusters?new"
           }
         },
@@ -61,7 +60,6 @@
             "Select cache type metadata to describe types in cache"
           ],
           "addLink": {
-            "label": "Add metadata(s)",
             "ref": "/configuration/metadata?new"
           }
         },

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5ea672f/modules/control-center-web/src/main/js/controllers/models/clusters.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/clusters.json b/modules/control-center-web/src/main/js/controllers/models/clusters.json
index 0d56cfa..2e69fc6 100644
--- a/modules/control-center-web/src/main/js/controllers/models/clusters.json
+++ b/modules/control-center-web/src/main/js/controllers/models/clusters.json
@@ -42,7 +42,6 @@
             "Select caches to start in cluster or add a new cache"
           ],
           "addLink": {
-            "label": "Add cache(s)",
             "ref": "/configuration/caches?new"
           }
         },
@@ -1296,7 +1295,6 @@
             "Select IGFS to start in cluster or add a new IGFS"
           ],
           "addLink": {
-            "label": "Add cache(s)",
             "ref": "/configuration/igfs?new"
           }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5ea672f/modules/control-center-web/src/main/js/controllers/models/igfs.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/igfs.json b/modules/control-center-web/src/main/js/controllers/models/igfs.json
index 8efd1a9..88f31b5 100644
--- a/modules/control-center-web/src/main/js/controllers/models/igfs.json
+++ b/modules/control-center-web/src/main/js/controllers/models/igfs.json
@@ -47,7 +47,6 @@
             "Associate clusters with the current IGFS"
           ],
           "addLink": {
-            "label": "Add cluster(s)",
             "ref": "/configuration/clusters?new"
           }
         },
@@ -89,7 +88,7 @@
           "model": "type",
           "placeholder": "TCP",
           "items": "ipcTypes",
-          "hide": "!backupItem.ipcEndpointEnabled",
+          "disabled": "!backupItem.ipcEndpointEnabled",
           "tip": [
             "IPC endpoint configuration"
           ]
@@ -100,7 +99,7 @@
           "path": "ipcEndpointConfiguration",
           "model": "host",
           "placeholder": "127.0.0.1",
-          "hide": "!backupItem.ipcEndpointEnabled",
+          "disabled": "!backupItem.ipcEndpointEnabled",
           "tip": [
             "Host"
           ]
@@ -112,7 +111,7 @@
           "model": "port",
           "placeholder": 10500,
           "max": 65535,
-          "hide": "!backupItem.ipcEndpointEnabled",
+          "disabled": "!backupItem.ipcEndpointEnabled",
           "tip": [
             "Port"
           ]
@@ -123,7 +122,7 @@
           "path": "ipcEndpointConfiguration",
           "model": "memorySize",
           "placeholder": 262144,
-          "hide": "!backupItem.ipcEndpointEnabled",
+          "disabled": "!backupItem.ipcEndpointEnabled",
           "tip": [
             "Shared memory size in bytes allocated for endpoint communication"
           ]
@@ -134,7 +133,7 @@
           "path": "ipcEndpointConfiguration",
           "model": "tokenDirectoryPath",
           "placeholder": "ipc/shmem",
-          "hide": "!backupItem.ipcEndpointEnabled",
+          "disabled": "!backupItem.ipcEndpointEnabled",
           "tip": [
             "Directory where shared memory tokens are stored"
           ]
@@ -164,7 +163,7 @@
           "type": "number",
           "model": "fragmentizerConcurrentFiles",
           "placeholder": 0,
-          "hide": "!backupItem.fragmentizerEnabled",
+          "disabled": "!backupItem.fragmentizerEnabled",
           "tip": [
             "Number of files to process concurrently by fragmentizer"
           ]
@@ -175,7 +174,7 @@
           "type": "number",
           "model": "fragmentizerThrottlingBlockLength",
           "placeholder": 16777216,
-          "hide": "!backupItem.fragmentizerEnabled",
+          "disabled": "!backupItem.fragmentizerEnabled",
           "tip": [
             "Length of file chunk to transmit before throttling is delayed"
           ]
@@ -186,7 +185,7 @@
           "type": "number",
           "model": "fragmentizerThrottlingDelay",
           "placeholder": 200,
-          "hide": "!backupItem.fragmentizerEnabled",
+          "disabled": "!backupItem.fragmentizerEnabled",
           "tip": [
             "Delay in milliseconds for which fragmentizer is paused"
           ]
@@ -233,6 +232,62 @@
       ]
     },
     {
+      "label": "Secondary file system",
+      "group": "secondaryFileSystem",
+      "tip": [
+        "Secondary file system",
+        "Secondary file system is provided for pass-through, write-through, and read-through
purposes"
+      ],
+      "fields": [
+        {
+          "label": "Enabled",
+          "id": "secondaryFileSystemEnabled",
+          "type": "check",
+          "model": "secondaryFileSystemEnabled",
+          "placeholder": 0,
+          "tip": [
+            "Secondary file system enabled flag"
+          ]
+        },
+        {
+          "label": "URI",
+          "id": "hadoopURI",
+          "type": "text",
+          "model": "uri",
+          "disabled": "!backupItem.secondaryFileSystemEnabled",
+          "path": "secondaryFileSystem",
+          "placeholder": "hdfs://[namenodehost]:[port]/[path]",
+          "tip": [
+            "URI of file system"
+          ]
+        },
+        {
+          "label": "Config path",
+          "id": "cfgPath",
+          "type": "text",
+          "model": "cfgPath",
+          "disabled": "!backupItem.secondaryFileSystemEnabled",
+          "path": "secondaryFileSystem",
+          "placeholder": "Path to additional config",
+          "tip": [
+            "Additional path to Hadoop configuration"
+          ]
+        },
+        {
+          "label": "User name",
+          "id": "userName",
+          "type": "text",
+          "model": "userName",
+          "disabled": "!backupItem.secondaryFileSystemEnabled",
+          "path": "secondaryFileSystem",
+          "placeholder": "User name",
+          "tip": [
+            "User name"
+          ]
+        }
+      ]
+    },
+    {
       "label": "Miscellaneous",
       "group": "misc",
       "tip": [],

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5ea672f/modules/control-center-web/src/main/js/controllers/models/metadata.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/metadata.json b/modules/control-center-web/src/main/js/controllers/models/metadata.json
index e64e8b0..d6314aa 100644
--- a/modules/control-center-web/src/main/js/controllers/models/metadata.json
+++ b/modules/control-center-web/src/main/js/controllers/models/metadata.json
@@ -39,7 +39,6 @@
             "Select caches to associate metadata with cache"
           ],
           "addLink": {
-            "label": "Add cache(s)",
             "ref": "/configuration/caches?new"
           }
         },

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5ea672f/modules/control-center-web/src/main/js/db.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/db.js b/modules/control-center-web/src/main/js/db.js
index 4c9ac0f..b45cdce 100644
--- a/modules/control-center-web/src/main/js/db.js
+++ b/modules/control-center-web/src/main/js/db.js
@@ -253,7 +253,13 @@ var IgfsSchema = new Schema({
     perNodeParallelBatchCount: Number,
     prefetchBlocks: Number,
     sequentialReadsBeforePrefetch: Number,
-    trashPurgeTimeout: Number
+    trashPurgeTimeout: Number,
+    secondaryFileSystemEnabled: Boolean,
+    secondaryFileSystem: {
+        uri: String,
+        cfgPath: String,
+        userName: String
+    }
 });
 
 // Define IGFS model.

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5ea672f/modules/control-center-web/src/main/js/routes/generator/generator-java.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-java.js b/modules/control-center-web/src/main/js/routes/generator/generator-java.js
index 4588915..5df82b5 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-java.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-java.js
@@ -1637,6 +1637,7 @@ $generatorJava.igfss = function(igfss, varName, res) {
             $generatorJava.igfsIPC(igfs, igfsInst, res);
             $generatorJava.igfsFragmentizer(igfs, igfsInst, res);
             $generatorJava.igfsDualMode(igfs, igfsInst, res);
+            $generatorJava.igfsSecondFS(igfs, igfsInst, res);
             $generatorJava.igfsMisc(igfs, igfsInst, res);
 
             res.line(arrayName + '[' + ix + '] = ' + igfsInst + ';');
@@ -1701,6 +1702,30 @@ $generatorJava.igfsDualMode = function(igfs, varName, res) {
     return res;
 };
 
+$generatorJava.igfsSecondFS = function(igfs, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (igfs.secondaryFileSystemEnabled) {
+        var secondFs = igfs.secondaryFileSystem || {};
+
+        var uriDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.uri);
+        var nameDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.userName);
+        var cfgDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.cfgPath);
+
+        res.line(varName + '.setSecondaryFileSystem(new ' +
+            res.importClass('org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem')
+ '(' +
+                (uriDefined ? '"' + secondFs.uri + '"' : 'null') +
+                (cfgDefined || nameDefined ? (cfgDefined ? ', "' + secondFs.cfgPath + '"'
: ', null') : '') +
+                (nameDefined ? ', "' + secondFs.userName + '"' : '') +
+            '));');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
 $generatorJava.igfsGeneral = function(igfs, varName, res) {
     if (!res)
         res = $generatorCommon.builder();

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5ea672f/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-xml.js b/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
index 2ba399c..d2806c3 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
@@ -1189,6 +1189,7 @@ $generatorXml.igfss = function(igfss, res) {
             $generatorXml.igfsIPC(igfs, res);
             $generatorXml.igfsFragmentizer(igfs, res);
             $generatorXml.igfsDualMode(igfs, res);
+            $generatorXml.igfsSecondFS(igfs, res);
             $generatorXml.igfsMisc(igfs, res);
 
             res.endBlock('</bean>');
@@ -1254,6 +1255,50 @@ $generatorXml.igfsDualMode = function(igfs, res) {
     return res;
 };
 
+$generatorXml.igfsSecondFS = function(igfs, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (igfs.secondaryFileSystemEnabled) {
+        var secondFs = igfs.secondaryFileSystem || {};
+
+        res.startBlock('<property name="secondaryFileSystem">');
+
+        res.startBlock('<bean class="org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem">');
+
+        var nameDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.userName);
+        var cfgDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.cfgPath);
+
+        if ($commonUtils.isDefinedAndNotEmpty(secondFs.uri))
+            res.line('<constructor-arg index="0" value="' + secondFs.uri + '"/>');
+        else {
+            res.startBlock('<constructor-arg index="0">');
+            res.line('<null/>');
+            res.endBlock('</constructor-arg>');
+        }
+
+        if (cfgDefined || nameDefined) {
+            if (cfgDefined)
+                res.line('<constructor-arg index="1" value="' + secondFs.cfgPath + '"/>');
+            else {
+                res.startBlock('<constructor-arg index="1">');
+                res.line('<null/>');
+                res.endBlock('</constructor-arg>');
+            }
+        }
+
+        if ($commonUtils.isDefinedAndNotEmpty(secondFs.userName))
+            res.line('<constructor-arg index="2" value="' + secondFs.userName + '"/>');
+
+        res.endBlock('</bean>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
 $generatorXml.igfsGeneral = function(igfs, res) {
     if (!res)
         res = $generatorCommon.builder();


Mime
View raw message