ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject ignite git commit: IGNITE-1841 Added ConnectorConfiguration to cluster configuration.
Date Wed, 04 Nov 2015 06:24:30 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc1 cb1dea7c0 -> af965b4a6


IGNITE-1841 Added ConnectorConfiguration to cluster configuration.


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

Branch: refs/heads/ignite-843-rc1
Commit: af965b4a607006d8298588cbf28b7babec8c2a8a
Parents: cb1dea7
Author: Andrey <anovikov@gridgain.com>
Authored: Wed Nov 4 13:24:19 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Wed Nov 4 13:24:19 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/clusters-controller.js  |  15 ++
 .../main/js/controllers/models/clusters.json    | 234 +++++++++++++++++++
 modules/control-center-web/src/main/js/db.js    |  19 ++
 .../js/routes/generator/generator-common.js     |  24 ++
 .../main/js/routes/generator/generator-java.js  |  19 ++
 .../main/js/routes/generator/generator-xml.js   |  22 ++
 6 files changed, 333 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/af965b4a/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 f3c7c7e..3b8a38b 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
@@ -96,6 +96,7 @@ consoleModule.controller('clustersController', [
             general: {xml: '', java: '', allDefaults: true},
             atomics: {xml: '', java: '', allDefaults: true},
             communication: {xml: '', java: '', allDefaults: true},
+            connector: {xml: '', java: '', allDefaults: true},
             deployment: {xml: '', java: '', allDefaults: true},
             discovery: {xml: '', java: '', allDefaults: true},
             events: {xml: '', java: '', allDefaults: true},
@@ -255,6 +256,10 @@ consoleModule.controller('clustersController', [
                                 $scope.preview.communication.java = $generatorJava.clusterCommunication(val).asString();
                                 $scope.preview.communication.allDefaults = $common.isEmptyString($scope.preview.communication.xml);
 
+                                $scope.preview.connector.xml = $generatorXml.clusterConnector(val).asString();
+                                $scope.preview.connector.java = $generatorJava.clusterConnector(val).asString();
+                                $scope.preview.connector.allDefaults = $common.isEmptyString($scope.preview.connector.xml);
+
                                 $scope.preview.deployment.xml = $generatorXml.clusterDeployment(val).asString();
                                 $scope.preview.deployment.java = $generatorJava.clusterDeployment(val).asString();
                                 $scope.preview.deployment.allDefaults = $common.isEmptyString($scope.preview.deployment.xml);
@@ -399,6 +404,16 @@ consoleModule.controller('clustersController', [
                 }
             }
 
+            var r = item.connector;
+
+            if ($common.isDefined(r)) {
+                if (!$common.isEmptyString(r.messageInterceptor) && !$common.isValidJavaClass('Message
interceptor', r.messageInterceptor, false, 'connectorMessageInterceptor', false, $scope.panels,
'connector'))
+                    return false;
+
+                if (!$common.isEmptyString(r.sslFactory) && !$common.isValidJavaClass('SSL
factory', r.sslFactory, false, 'connectorSslFactory', false, $scope.panels, 'connector'))
+                    return false;
+            }
+
             var d = item.discovery;
 
             if (!$common.isEmptyString(d.addressResolver) && !$common.isValidJavaClass('Address
resolver', d.addressResolver, false, 'discoAddressResolver', false, $scope.panels, 'discovery'))

http://git-wip-us.apache.org/repos/asf/ignite/blob/af965b4a/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 222a719..b9c748b 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
@@ -685,6 +685,240 @@
       ]
     },
     {
+      "label": "Connector configuration",
+      "group": "connector",
+      "previewMinLines": 1,
+      "tip": [
+        "REST access configuration"
+      ],
+      "fields": [
+        {
+          "label": "Enabled",
+          "id": "restEnabled",
+          "type": "check",
+          "path": "connector",
+          "model": "enabled",
+          "tip": [
+            "Flag indicating whether to configure connector configuration"
+          ]
+        },
+        {
+          "label": "Jetty configuration path",
+          "id": "connectorJettyPath",
+          "type": "text",
+          "path": "connector",
+          "model": "jettyPath",
+          "hide": "!backupItem.connector.enabled",
+          "tip": [
+            "Path, either absolute or relative to IGNITE_HOME, to Jetty XML configuration
file",
+            "Jetty is used to support REST over HTTP protocol for accessing Ignite APIs remotely",
+            "If not provided, Jetty instance with default configuration will be started picking
IgniteSystemProperties.IGNITE_JETTY_HOST and IgniteSystemProperties.IGNITE_JETTY_PORT as host
and port respectively"
+          ]
+        },
+        {
+          "label": "TCP host",
+          "id": "connectorHost",
+          "type": "text",
+          "path": "connector",
+          "model": "host",
+          "hide": "!backupItem.connector.enabled",
+          "placeholder": "IgniteConfiguration#getLocalHost()",
+          "tip": [
+            "Host for TCP binary protocol server. This can be either an IP address or a domain
name",
+            "If not defined, system-wide local address will be used IgniteConfiguration#getLocalHost()",
+            "You can also use '0.0.0.0' value to bind to all locally-available IP addresses"
+          ]
+        },
+        {
+          "label": "TCP port",
+          "id": "connectorPort",
+          "type": "number",
+          "path": "connector",
+          "model": "port",
+          "hide": "!backupItem.connector.enabled",
+          "placeholder": 11211,
+          "min": 1024,
+          "max": 65535,
+          "tip": [
+            "Port for TCP binary protocol server"
+          ]
+        },
+        {
+          "label": "TCP port range",
+          "id": "connectorPortRange",
+          "type": "number",
+          "path": "connector",
+          "model": "portRange",
+          "hide": "!backupItem.connector.enabled",
+          "placeholder": 100,
+          "tip": [
+            "Number of ports for TCP binary protocol server to try if configured port is
already in use"
+          ]
+        },
+        {
+          "label": "Idle timeout",
+          "id": "connectorIdleTimeout",
+          "type": "number",
+          "path": "connector",
+          "model": "idleTimeout",
+          "hide": "!backupItem.connector.enabled",
+          "placeholder": 7000,
+          "tip": [
+            "Idle timeout for REST server",
+            "This setting is used to reject half-opened sockets",
+            "If no packets come within idle timeout, the connection is closed"
+          ]
+        },
+        {
+          "label": "Receive buffer size",
+          "id": "connectorReceiveBufferSize",
+          "type": "number",
+          "path": "connector",
+          "model": "receiveBufferSize",
+          "hide": "!backupItem.connector.enabled",
+          "placeholder": 32768,
+          "tip": [
+            "REST TCP server receive buffer size"
+          ]
+        },
+        {
+          "label": "Send buffer size",
+          "id": "connectorSendBufferSize",
+          "type": "number",
+          "path": "connector",
+          "model": "sendBufferSize",
+          "hide": "!backupItem.connector.enabled",
+          "placeholder": 32768,
+          "tip": [
+            "REST TCP server send buffer size"
+          ]
+        },
+        {
+          "label": "Send queue limit",
+          "id": "connectorSendQueueLimit",
+          "type": "number",
+          "path": "connector",
+          "model": "sendQueueLimit",
+          "hide": "!backupItem.connector.enabled",
+          "placeholder": "unlimited",
+          "tip": [
+            "REST TCP server send queue limit. If the limit exceeds, all successive writes
will block until the queue has enough capacity"
+          ]
+        },
+        {
+          "label": "Direct buffer",
+          "id": "connectorDirectBuffer",
+          "type": "check",
+          "path": "connector",
+          "model": "directBuffer",
+          "hide": "!backupItem.connector.enabled",
+          "tip": [
+            "Flag indicating whether REST TCP server should use direct buffers",
+            "A direct buffer is a buffer that is allocated and accessed using native system
calls, without using JVM heap",
+            "Enabling direct buffer may improve performance and avoid memory issues (long
GC pauses due to huge buffer size)"
+          ]
+        },
+        {
+          "label": "TCP_NODELAY option",
+          "id": "connectorNoDelay",
+          "type": "check",
+          "path": "connector",
+          "model": "noDelay",
+          "hide": "!backupItem.connector.enabled",
+          "tip": [
+            "Flag indicating whether TCP_NODELAY option should be set for accepted client
connections",
+            "Setting this option reduces network latency and should be enabled in majority
of cases",
+            "For more information, see Socket#setTcpNoDelay(boolean)"
+          ]
+        },
+        {
+          "label": "Selector count",
+          "id": "connectorSelectorCount",
+          "type": "number",
+          "path": "connector",
+          "model": "selectorCount",
+          "hide": "!backupItem.connector.enabled",
+          "placeholder": "min(4, availableProcessors)",
+          "tip": [
+            "Number of selector threads in REST TCP server",
+            "Higher value for this parameter may increase throughput, but also increases
context switching"
+          ]
+        },
+        {
+          "label": "Thread pool size",
+          "id": "connectorThreadPoolSize",
+          "type": "number",
+          "path": "connector",
+          "model": "threadPoolSize",
+          "hide": "!backupItem.connector.enabled",
+          "placeholder": "max(8, availableProcessors) * 2",
+          "tip": [
+            "Thread pool size to use for processing of client messages (REST requests)"
+          ]
+        },
+        {
+          "label": "Message interceptor",
+          "id": "connectorMessageInterceptor",
+          "type": "text",
+          "path": "connector",
+          "model": "messageInterceptor",
+          "hide": "!backupItem.connector.enabled",
+          "placeholder": "Enter fully qualified class name",
+          "tip": [
+            "Interceptor allows to transform all objects exchanged via REST protocol",
+            "For example if you use custom serialisation on client you can write interceptor
to transform binary representations received from client to Java objects and later access
them from java code directly"
+          ]
+        },
+        {
+          "label": "Secret key",
+          "id": "connectorSecretKey",
+          "type": "text",
+          "path": "connector",
+          "model": "secretKey",
+          "hide": "!backupItem.connector.enabled",
+          "placeholder": "Authentication is disabled",
+          "tip": [
+            "Secret key to authenticate REST requests"
+          ]
+        },
+        {
+          "label": "Enable SSL",
+          "id": "connectorSslEnabled",
+          "type": "check",
+          "path": "connector",
+          "model": "sslEnabled",
+          "hide": "!backupItem.connector.enabled",
+          "tip": [
+            "Enables/disables SSL for REST TCP binary protocol"
+          ]
+        },
+        {
+          "label": "Enable SSL client auth",
+          "id": "connectorSslClientAuth",
+          "type": "check",
+          "path": "connector",
+          "model": "sslClientAuth",
+          "hide": "!backupItem.connector.enabled || !backupItem.connector.sslEnabled",
+          "tip": [
+            "Flag indicating whether or not SSL client authentication is required"
+          ]
+        },
+        {
+          "label": "SSL factory",
+          "id": "connectorSslFactory",
+          "type": "text",
+          "path": "connector",
+          "model": "sslFactory",
+          "required": true,
+          "hide": "!backupItem.connector.enabled || !backupItem.connector.sslEnabled",
+          "placeholder": "Enter fully qualified class name",
+          "tip": [
+            "Instance of Factory that will be used to create an instance of SSLContext for
Secure Socket Layer on TCP binary protocol"
+          ]
+        }
+      ]
+    },
+    {
       "label": "Class deployment",
       "group": "deployment",
       "previewMinLines": 1,

http://git-wip-us.apache.org/repos/asf/ignite/blob/af965b4a/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 97c41c6..4c9ac0f 100644
--- a/modules/control-center-web/src/main/js/db.js
+++ b/modules/control-center-web/src/main/js/db.js
@@ -382,6 +382,25 @@ var ClusterSchema = new Schema({
         selectorsCount: Number,
         addressResolver: String
     },
+    connector: {
+        enabled: Boolean,
+        jettyPath: String,
+        host: String,
+        port: Number,
+        portRange: Number,
+        idleTimeout: Number,
+        receiveBufferSize: Number,
+        sendBufferSize: Number,
+        directBuffer: Boolean,
+        noDelay: Boolean,
+        selectorCount: Number,
+        threadPoolSize: Number,
+        messageInterceptor: String,
+        secretKey: String,
+        sslEnabled: Boolean,
+        sslClientAuth: Boolean,
+        sslFactory: String
+    },
     peerClassLoadingEnabled: Boolean,
     peerClassLoadingLocalClassPathExclude: [String],
     peerClassLoadingMissedResourcesCacheSize: Number,

http://git-wip-us.apache.org/repos/asf/ignite/blob/af965b4a/modules/control-center-web/src/main/js/routes/generator/generator-common.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-common.js b/modules/control-center-web/src/main/js/routes/generator/generator-common.js
index 295d0db..ade462b 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-common.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-common.js
@@ -367,6 +367,30 @@ $generatorCommon.SSL_CONFIGURATION_TRUST_MANAGER_FACTORY = {
 };
 
 // Communication configuration code generation descriptor.
+$generatorCommon.CONNECTOR_CONFIGURATION = {
+    className: 'org.apache.ignite.configuration.ConnectorConfiguration',
+    fields: {
+        jettyPath: null,
+        host: null,
+        port: {dflt: 11211},
+        portRange: {dflt: 100},
+        idleTimeout: {dflt: 7000},
+        receiveBufferSize: {dflt: 32768},
+        sendBufferSize: {dflt: 32768},
+        sendQueueLimit: {dflt: 0},
+        directBuffer: {dflt: false},
+        noDelay: {dflt: false},
+        selectorCount: null,
+        threadPoolSize: null,
+        messageInterceptor: null,
+        secretKey: null,
+        sslEnabled: {dflt: false},
+        sslClientAuth: {dflt: false},
+        sslFactory: null
+    }
+};
+
+// Communication configuration code generation descriptor.
 $generatorCommon.COMMUNICATION_CONFIGURATION = {
     className: 'org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi',
     fields: {

http://git-wip-us.apache.org/repos/asf/ignite/blob/af965b4a/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 2a5462d..5fc7adb 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
@@ -516,6 +516,23 @@ $generatorJava.clusterCommunication = function (cluster, res) {
     return res;
 };
 
+// Generate REST access group.
+$generatorJava.clusterConnector = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    var cfg = $generatorCommon.CONNECTOR_CONFIGURATION;
+
+    if ($commonUtils.isDefined($commonUtils.isDefined(cluster.connector) && cluster.connector.enabled))
{
+        $generatorJava.beanProperty(res, 'cfg', cluster.connector, 'connectorConfiguration',
'clientCfg',
+            $generatorCommon.CONNECTOR_CONFIGURATION.className, $generatorCommon.CONNECTOR_CONFIGURATION.fields,
true);
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
 // Generate deployment group.
 $generatorJava.clusterDeployment = function (cluster, res) {
     if (!res)
@@ -1797,6 +1814,8 @@ $generatorJava.cluster = function (cluster, javaClass, clientNearCfg)
{
 
         $generatorJava.clusterCommunication(cluster, res);
 
+        $generatorJava.clusterConnector(cluster, res);
+
         $generatorJava.clusterDeployment(cluster, res);
 
         $generatorJava.clusterEvents(cluster, res);

http://git-wip-us.apache.org/repos/asf/ignite/blob/af965b4a/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 c677288..2ba399c 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
@@ -406,6 +406,26 @@ $generatorXml.clusterCommunication = function (cluster, res) {
     return res;
 };
 
+/**
+ * XML generator for cluster's REST access configuration.
+ *
+ * @param cluster Cluster to get REST configuration.
+ * @param res Optional configuration presentation builder object.
+ * @returns Configuration presentation builder object
+ */
+$generatorXml.clusterConnector = function(cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if ($commonUtils.isDefined(cluster.connector) && cluster.connector.enabled) {
+        $generatorXml.beanProperty(res, cluster.connector, 'connectorConfiguration', $generatorCommon.CONNECTOR_CONFIGURATION,
true);
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
 // Generate deployment group.
 $generatorXml.clusterDeployment = function (cluster, res) {
     if (!res)
@@ -1324,6 +1344,8 @@ $generatorXml.cluster = function (cluster, clientNearCfg) {
 
         $generatorXml.clusterCommunication(cluster, res);
 
+        $generatorXml.clusterConnector(cluster, res);
+
         $generatorXml.clusterDeployment(cluster, res);
 
         $generatorXml.clusterEvents(cluster, res);


Mime
View raw message