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 2015/08/14 13:30:05 UTC

[1/3] incubator-ignite git commit: IGNITE-843: Minor changes to documentation.

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-843 9642b59ab -> 3a1c1529d


IGNITE-843: Minor changes to documentation.


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

Branch: refs/heads/ignite-843
Commit: 98cadbfef664b86e1a170291e4015a198e4e0013
Parents: 9642b59
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri Aug 14 18:25:32 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri Aug 14 18:25:32 2015 +0700

----------------------------------------------------------------------
 modules/control-center-agent/README.txt              | 8 ++++----
 modules/control-center-agent/jdbc-drivers/README.txt | 7 ++++---
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98cadbfe/modules/control-center-agent/README.txt
----------------------------------------------------------------------
diff --git a/modules/control-center-agent/README.txt b/modules/control-center-agent/README.txt
index 410b366..3712cbd 100644
--- a/modules/control-center-agent/README.txt
+++ b/modules/control-center-agent/README.txt
@@ -1,9 +1,9 @@
 Ignite Control Center Agent
 ======================================
-Ignite Control Center Agent is a java standalone application that allow to connect grid to Ignite Web Control Center.
-Control Center Agent communicates with grid nodes via REST interface and connects to Web Control Center via web-socket.
+Ignite Control Center Agent is a java standalone application that allow to connect Ignite Grid to Ignite Web Control Center.
+Ignite Control Center Agent communicates with grid nodes via REST interface and connects to Ignite Web Control Center via web-socket.
 
-Two main functions of Control Center Agent:
+Two main functions of Ignite Control Center Agent:
  1. Proxy between Ignite Web Control Center and Ignite Grid to execute SQL statements and collect metrics for monitoring.
     You may need to specify URI for connect to Ignite REST server via "-n" option.
 
@@ -39,7 +39,7 @@ Options:
        Default: "./jdbc-drivers".
 
     -l, --login
-       User's login (email) on Web Control Center.
+       User's login (email) on Ignite Web Control Center.
 
     -n, --nodeUri
        URI for connect to Ignite REST server, for example: "http://localhost:8080".

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98cadbfe/modules/control-center-agent/jdbc-drivers/README.txt
----------------------------------------------------------------------
diff --git a/modules/control-center-agent/jdbc-drivers/README.txt b/modules/control-center-agent/jdbc-drivers/README.txt
index 5148c9d..fa2923d 100644
--- a/modules/control-center-agent/jdbc-drivers/README.txt
+++ b/modules/control-center-agent/jdbc-drivers/README.txt
@@ -1,9 +1,10 @@
 Ignite Control Center Agent
 ======================================
 
+If you are are planning to load cache type metadata from your existing databases
+you need to copy JDBC drivers in this folder.
+
 This is default folder for JDBC drivers.
-You could specify custom folder using option: -drv CUSTOM_PATH_TO_FOLDER_WITH_JDBC_DRIVERS
 
-Copy JDBC drivers for your databases in this folder.
+Also, you could specify custom folder using option: "-drv CUSTOM_PATH_TO_FOLDER_WITH_JDBC_DRIVERS".
 
-Note, you need to copy JDBC drivers if you are planning to load cache type metadata from your existing databases.


[3/3] incubator-ignite git commit: IGNITE-843: Validation with popover for cluster screen.

Posted by ak...@apache.org.
IGNITE-843: Validation with popover for cluster screen.


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

Branch: refs/heads/ignite-843
Commit: 3a1c1529d6fe7a8425cd53042e21a0f16fddd8e7
Parents: 14287f6
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri Aug 14 18:30:17 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri Aug 14 18:30:17 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/clusters-controller.js  | 68 +++++++++++++++-----
 .../src/main/js/controllers/common-module.js    | 16 +++--
 .../src/main/js/public/stylesheets/style.scss   |  1 +
 .../js/views/configuration/metadata-load.jade   |  2 +-
 .../src/main/js/views/includes/controls.jade    |  6 +-
 5 files changed, 68 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3a1c1529/modules/control-center-web/src/main/js/controllers/clusters-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/clusters-controller.js b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
index 6c2ead5..98f8c90 100644
--- a/modules/control-center-web/src/main/js/controllers/clusters-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-controlCenterModule.controller('clustersController', ['$scope', '$http', '$popover', '$common', '$focus', '$confirm', '$copy', '$table',
-    function ($scope, $http, $popover, $common, $focus, $confirm, $copy, $table) {
+controlCenterModule.controller('clustersController', ['$scope', '$http', '$popover', '$timeout', '$common', '$focus', '$confirm', '$copy', '$table',
+    function ($scope, $http, $popover, $timeout, $common, $focus, $confirm, $copy, $table) {
         $scope.joinTip = $common.joinTip;
         $scope.getModel = $common.getModel;
 
@@ -222,30 +222,64 @@ controlCenterModule.controller('clustersController', ['$scope', '$http', '$popov
             });
         };
 
-        $scope.popover = {
-            "title": "Title",
-            "content": "Hello Popover<br />This is a multiline message!"
-        };
+        var popover = null;
+
+        function showPopoverMessage(panelIndex, id, message) {
+            $common.ensureActivePanel($scope.panels, panelIndex);
+
+            var el = $('body').find('#' + id);
+
+            if (popover)
+                popover.hide();
+
+            var newPopover = $popover(el, {content: message});
+
+            $timeout(function () {
+                $focus(id);
+            }, 50);
+
+            $timeout(function () {
+                newPopover.show();
+
+                popover = newPopover;
+            }, 100);
+
+            $timeout(function () { newPopover.hide() }, 3000);
+
+            return false;
+        }
 
         // Check cluster logical consistency.
         function validate(item) {
-            if ($common.isEmptyString(item.name)) {
-                $common.ensureActivePanel($scope.panels, 0);
+            if ($common.isEmptyString(item.name))
+                return showPopoverMessage(0, 'clusterName', 'Name should not be empty');
 
-                var el = $('body').find('#clusterName');
+            if (item.discovery.kind == 'Vm' && item.discovery.Vm.addresses.length == 0)
+                return showPopoverMessage(0, 'addresses', 'Addresses are not specified');
 
-                var myPopover = $popover(el, {content: 'Name should not be empty'});
+            if (item.discovery.kind == 'S3' && $common.isEmptyString(item.discovery.S3.bucketName))
+                return showPopoverMessage(0, 'bucketName', 'Bucket name should not be empty');
 
-                myPopover.$promise.then(function () {
-                    myPopover.show();
+            if (item.discovery.kind == 'Cloud') {
+                if ($common.isEmptyString(item.discovery.Cloud.identity))
+                    return showPopoverMessage(0, 'identity', 'Identity should not be empty');
 
-                    $focus('clusterName');
-                });
+                if ($common.isEmptyString(item.discovery.Cloud.provider))
+                    return showPopoverMessage(0, 'provider', 'Provider should not be empty');
+            }
+
+            if (item.discovery.kind == 'GoogleStorage') {
+                if ($common.isEmptyString(item.discovery.GoogleStorage.projectName))
+                    return showPopoverMessage(0, 'projectName', 'Project name should not be empty');
+
+                if ($common.isEmptyString(item.discovery.GoogleStorage.bucketName))
+                    return showPopoverMessage(0, 'bucketName', 'Bucket name should not be empty');
 
-                //window.setInterval(function() { myPopover.hide() }, 3000)
+                if ($common.isEmptyString(item.discovery.GoogleStorage.serviceAccountP12FilePath))
+                    return showPopoverMessage(0, 'serviceAccountP12FilePath', 'Private key path should not be empty');
 
-                //return $common.showError('Name should not be empty!', 'zzz', '#div_to_show');
-                return false;
+                if ($common.isEmptyString(item.discovery.GoogleStorage.accountId))
+                    return showPopoverMessage(0, 'accountId', 'Account ID should not be empty');
             }
 
             if (!item.swapSpaceSpi || !item.swapSpaceSpi.kind && item.caches) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3a1c1529/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index 2ead841..7c15038 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -943,16 +943,24 @@ controlCenterModule.directive('retainSelection', function ($timeout) {
 });
 
 // Factory function to focus element.
-controlCenterModule.factory('$focus', function ($timeout, $window) {
+controlCenterModule.factory('$focus', function ($timeout) {
     return function (id) {
         // Timeout makes sure that is invoked after any other event has been triggered.
         // E.g. click events that need to run before the focus or inputs elements that are
         // in a disabled state but are enabled when those events are triggered.
         $timeout(function () {
-            var elem = $window.document.getElementById(id);
+            var elem = $('#' + id);
 
-            if (elem)
-                elem.focus();
+            if (elem.length > 0) {
+                var offset = elem.offset();
+
+                if(offset.top < window.pageYOffset)
+                    $('html, body').animate({
+                        scrollTop: offset.top - 20
+                    }, 10);
+
+                elem[0].focus();
+            }
         });
     };
 });

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3a1c1529/modules/control-center-web/src/main/js/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/stylesheets/style.scss b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
index 5debf53..28a3de7 100644
--- a/modules/control-center-web/src/main/js/public/stylesheets/style.scss
+++ b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
@@ -919,6 +919,7 @@ button .caret, .btn .caret {
 
 .popover {
     color: $ignite-red;
+    max-width: 400px;
 }
 
 .popover-content {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3a1c1529/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade b/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
index 5768a7d..05ae0e4 100644
--- a/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
@@ -24,7 +24,7 @@ include ../includes/controls
                 h4.modal-title Load metadata from database
             .metadata-download(ng-show='loadMeta.action == "download"')
                 |Connection to Web Agent is not established!<br/><br/>
-                |How to extract metadata from database:
+                |How to load metadata from database:
                 ul
                     li Download Web Agent.
                     li Unzip Web Agent to some folder.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3a1c1529/modules/control-center-web/src/main/js/views/includes/controls.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/includes/controls.jade b/modules/control-center-web/src/main/js/views/includes/controls.jade
index e57e085..74f11a0 100644
--- a/modules/control-center-web/src/main/js/views/includes/controls.jade
+++ b/modules/control-center-web/src/main/js/views/includes/controls.jade
@@ -128,7 +128,7 @@ mixin details-row
             .col-sm-8
                 +tipField('detail.tip')
                 .input-tip
-                    input.form-control(type='text' placeholder='{{::detail.placeholder}}')&attributes(detailCommon)
+                    input.form-control(id='{{::detail.model}}' type='text' placeholder='{{::detail.placeholder}}')&attributes(detailCommon)
         div(ng-switch-when='number')
             label(class=lblDetailClasses ng-class='{required: detail.required}') {{::detail.label}}:
             .col-sm-8
@@ -151,7 +151,7 @@ mixin details-row
                 .input-tip
                     button.form-control(bs-select data-multiple='1' data-placeholder='{{::detail.placeholder}}' bs-options='item.value as item.label for item in {{detail.items}}')&attributes(detailCommon)
         .section(ng-switch-when='table-simple')&attributes(detailCommon)
-            .col-sm-12.group
+            .col-sm-12.group(id='{{::detail.model}}')
                 .group-legend
                     label {{::detail.label}}:
                     +group-tip('detail.tableTip')
@@ -435,7 +435,7 @@ mixin group(title, fields, dataSource)
                     +form-row(dataSource)
 
 mixin groups(groups, dataSource)
-    .panel.panel-default(ng-repeat='group in #{groups}')
+    .panel.panel-default(ng-repeat='group in #{groups}' ng-click='triggerDigest=true')
         .panel-heading
             h3
                 a(bs-collapse-toggle) {{::group.label}}


[2/3] incubator-ignite git commit: IGNITE-843: Read JDBC driver class from driver jar file.

Posted by ak...@apache.org.
IGNITE-843: Read JDBC driver class from driver jar file.


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

Branch: refs/heads/ignite-843
Commit: 14287f6963d135afe314586f733217a3b69edd05
Parents: 98cadbf
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri Aug 14 18:26:28 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri Aug 14 18:26:28 2015 +0700

----------------------------------------------------------------------
 .../handlers/DatabaseMetadataExtractor.java     | 39 ++++++++++++++++++--
 1 file changed, 35 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/14287f69/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/DatabaseMetadataExtractor.java
----------------------------------------------------------------------
diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/DatabaseMetadataExtractor.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/DatabaseMetadataExtractor.java
index 8f6f5b2..57f6720 100644
--- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/DatabaseMetadataExtractor.java
+++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/DatabaseMetadataExtractor.java
@@ -22,6 +22,7 @@ import org.apache.ignite.agent.remote.*;
 import org.apache.ignite.schema.parser.*;
 
 import java.io.*;
+import java.net.*;
 import java.sql.*;
 import java.util.*;
 
@@ -68,11 +69,30 @@ public class DatabaseMetadataExtractor {
     }
 
     /**
+     * Wrapper class for later to be transformed to JSON and send to Web Control Center.
+     */
+    private static class JdbcDriver {
+        /** */
+        private final String jdbcDriverClass;
+        /** */
+        private final String jdbcDriverJar;
+
+        /**
+         * @param jdbcDriverClass Optional JDBC driver class.
+         * @param jdbcDriverJar File name of driver jar file.
+         */
+        public JdbcDriver(String jdbcDriverClass, String jdbcDriverJar) {
+            this.jdbcDriverClass = jdbcDriverClass;
+            this.jdbcDriverJar = jdbcDriverJar;
+        }
+    }
+
+    /**
      * @return Drivers in drivers folder
      * @see AgentConfiguration#driversFolder
      */
     @Remote
-    public List<String> availableDrivers() {
+    public List<JdbcDriver> availableDrivers() {
         if (driversFolder == null)
             return Collections.emptyList();
 
@@ -81,11 +101,22 @@ public class DatabaseMetadataExtractor {
         if (list == null)
             return Collections.emptyList();
 
-        List<String> res = new ArrayList<>();
+        List<JdbcDriver> res = new ArrayList<>();
 
         for (String fileName : list) {
-            if (fileName.endsWith(".jar"))
-                res.add(fileName);
+            if (fileName.endsWith(".jar")) {
+                try {
+                    String spec = "jar:file:/" + driversFolder + '/' + fileName + "!/META-INF/services/java.sql.Driver";
+
+                    URL url = new URL(spec.replace('\\', '/'));
+
+                    try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()))) {
+                        res.add(new JdbcDriver(reader.readLine(), fileName));
+                    }
+                } catch (IOException ignored) {
+                    res.add(new JdbcDriver(null, fileName));
+                }
+            }
         }
 
         return res;