ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [ignite] branch master updated: IGNITE-11333: SQL: Removed H2 console support.
Date Tue, 26 Feb 2019 11:24:56 GMT
This is an automated email from the ASF dual-hosted git repository.

vozerov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 5a7372e  IGNITE-11333: SQL: Removed H2 console support.
5a7372e is described below

commit 5a7372e0ff949a029fdc18519415409277bd4a6b
Author: devozerov <vozerov@gridgain.com>
AuthorDate: Tue Feb 26 14:24:14 2019 +0300

    IGNITE-11333: SQL: Removed H2 console support.
---
 .../org/apache/ignite/IgniteSystemProperties.java  |  6 +++
 .../processors/query/h2/ConnectionManager.java     | 43 +---------------------
 2 files changed, 7 insertions(+), 42 deletions(-)

diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index 6398e2d..5b9788f 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -386,7 +386,10 @@ public final class IgniteSystemProperties {
 
     /**
      * If this property set then debug console will be opened for H2 indexing SPI.
+     *
+     * @deprecated Since 2.8. H2 console is no longer supported.
      */
+    @Deprecated
     public static final String IGNITE_H2_DEBUG_CONSOLE = "IGNITE_H2_DEBUG_CONSOLE";
 
     /**
@@ -394,7 +397,10 @@ public final class IgniteSystemProperties {
      * to start H2 debug console on. If this property is not set or set to 0, H2 debug
      * console will use system-provided dynamic port.
      * This property is only relevant when {@link #IGNITE_H2_DEBUG_CONSOLE} property is set.
+     *
+     * @deprecated Since 2.8. H2 console is no longer supported.
      */
+    @Deprecated
     public static final String IGNITE_H2_DEBUG_CONSOLE_PORT = "IGNITE_H2_DEBUG_CONSOLE_PORT";
 
     /**
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ConnectionManager.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ConnectionManager.java
index db67edf..2b3776c 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ConnectionManager.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ConnectionManager.java
@@ -38,16 +38,10 @@ import org.apache.ignite.internal.processors.query.h2.sql.GridSqlQueryParser;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.h2.jdbc.JdbcStatement;
-import org.h2.server.web.WebServer;
-import org.h2.tools.Server;
 import org.jetbrains.annotations.Nullable;
 
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_H2_DEBUG_CONSOLE;
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_H2_DEBUG_CONSOLE_PORT;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_H2_INDEXING_CACHE_CLEANUP_PERIOD;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_H2_INDEXING_CACHE_THREAD_USAGE_TIMEOUT;
-import static org.apache.ignite.IgniteSystemProperties.getInteger;
-import static org.apache.ignite.IgniteSystemProperties.getString;
 
 /**
  * H2 connection manager.
@@ -147,9 +141,8 @@ public class ConnectionManager {
      * Constructor.
      *
      * @param ctx Context.
-     * @throws IgniteCheckedException On error.
      */
-    public ConnectionManager(GridKernalContext ctx) throws IgniteCheckedException {
+    public ConnectionManager(GridKernalContext ctx) {
         dbUrl = "jdbc:h2:mem:" + ctx.localNodeId() + DB_OPTIONS;
 
         log = ctx.log(ConnectionManager.class);
@@ -160,8 +153,6 @@ public class ConnectionManager {
 
         stmtCleanupTask = ctx.timeout().schedule(this::cleanupStatements, stmtCleanupPeriod,
stmtCleanupPeriod);
         connCleanupTask = ctx.timeout().schedule(this::cleanupConnections, CONN_CLEANUP_PERIOD,
CONN_CLEANUP_PERIOD);
-
-        startDebugConsole();
     }
 
     /**
@@ -444,38 +435,6 @@ public class ConnectionManager {
     }
 
     /**
-     * Start debug console if needed.
-     *
-     * @throws IgniteCheckedException If failed.
-     */
-    private void startDebugConsole() throws IgniteCheckedException {
-        try {
-            if (getString(IGNITE_H2_DEBUG_CONSOLE) != null) {
-                Connection c = DriverManager.getConnection(dbUrl);
-
-                int port = getInteger(IGNITE_H2_DEBUG_CONSOLE_PORT, 0);
-
-                WebServer webSrv = new WebServer();
-                Server web = new Server(webSrv, "-webPort", Integer.toString(port));
-                web.start();
-                String url = webSrv.addSession(c);
-
-                U.quietAndInfo(log, "H2 debug console URL: " + url);
-
-                try {
-                    Server.openBrowser(url);
-                }
-                catch (Exception e) {
-                    U.warn(log, "Failed to open browser: " + e.getMessage());
-                }
-            }
-        }
-        catch (SQLException e) {
-            throw new IgniteCheckedException(e);
-        }
-    }
-
-    /**
      * Create new connection wrapper.
      *
      * @return Connection wrapper.


Mime
View raw message