ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [39/50] ignite git commit: IGNITE-5530 Fixed import indexes from RDBMS. Added systemSchemas to MySQLMetadataDialect. Fixed POJO hashCode generation for double.
Date Tue, 20 Jun 2017 06:00:41 GMT
IGNITE-5530 Fixed import indexes from RDBMS. Added systemSchemas to MySQLMetadataDialect. Fixed
POJO hashCode generation for double.


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

Branch: refs/heads/ignite-2.1.2-exchange
Commit: 2cc0b7315d7d6b16e5795faf5b1874f05eff43b2
Parents: 599d1a8
Author: Alexey Kuznetsov <akuznetsov@gridgain.com>
Authored: Sun Jun 18 11:44:53 2017 +0700
Committer: Alexey Kuznetsov <akuznetsov@gridgain.com>
Committed: Sun Jun 18 11:44:53 2017 +0700

----------------------------------------------------------------------
 .../generator/JavaTransformer.service.js             |  2 +-
 .../agent/db/dialect/JdbcMetadataDialect.java        | 15 ++++++++++++++-
 .../agent/db/dialect/MySQLMetadataDialect.java       |  6 ++++++
 3 files changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2cc0b731/modules/web-console/frontend/app/modules/configuration/generator/JavaTransformer.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/JavaTransformer.service.js
b/modules/web-console/frontend/app/modules/configuration/generator/JavaTransformer.service.js
index fad61d6..01f118d 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/JavaTransformer.service.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/JavaTransformer.service.js
@@ -1239,7 +1239,7 @@ export default class IgniteJavaTransformer extends AbstractTransformer
{
 
                     tempVar = true;
 
-                    fldHashCode = `${javaName} != +0.0f ? Float.floatToIntBits(${javaName})
: 0`;
+                    fldHashCode = '(int) (ig_hash_temp ^ (ig_hash_temp >>> 32))';
 
                     break;
                 default:

http://git-wip-us.apache.org/repos/asf/ignite/blob/2cc0b731/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/db/dialect/JdbcMetadataDialect.java
----------------------------------------------------------------------
diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/db/dialect/JdbcMetadataDialect.java
b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/db/dialect/JdbcMetadataDialect.java
index 031e3a7..a5da7c1 100644
--- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/db/dialect/JdbcMetadataDialect.java
+++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/db/dialect/JdbcMetadataDialect.java
@@ -140,7 +140,7 @@ public class JdbcMetadataDialect extends DatabaseMetadataDialect {
                     if (sys.contains(schema))
                         continue;
 
-                    Collection<String> pkCols = new LinkedHashSet<>();
+                    Set<String> pkCols = new LinkedHashSet<>();
 
                     try (ResultSet pkRs = dbMeta.getPrimaryKeys(tblCatalog, tblSchema, tblName))
{
                         while (pkRs.next())
@@ -223,6 +223,19 @@ public class JdbcMetadataDialect extends DatabaseMetadataDialect {
                         }
                     }
 
+                    // Remove index that is equals to primary key.
+                    if (!pkCols.isEmpty()) {
+                        for (Map.Entry<String, QueryIndex> entry : idxs.entrySet())
{
+                            QueryIndex idx = entry.getValue();
+
+                            if (pkCols.equals(idx.getFields().keySet())) {
+                                idxs.remove(entry.getKey());
+
+                                break;
+                            }
+                        }
+                    }
+
                     tbls.add(table(schema, tblName, cols, idxs.values()));
                 }
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/2cc0b731/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/db/dialect/MySQLMetadataDialect.java
----------------------------------------------------------------------
diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/db/dialect/MySQLMetadataDialect.java
b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/db/dialect/MySQLMetadataDialect.java
index 4adeeb3..f94c447 100644
--- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/db/dialect/MySQLMetadataDialect.java
+++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/db/dialect/MySQLMetadataDialect.java
@@ -22,6 +22,7 @@ import java.sql.DatabaseMetaData;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
@@ -34,6 +35,11 @@ public class MySQLMetadataDialect extends JdbcMetadataDialect {
     private static final int TYPE_NAME_IDX = 1;
 
     /** {@inheritDoc} */
+    @Override public Set<String> systemSchemas() {
+        return new HashSet<>(Arrays.asList("information_schema", "mysql", "performance_schema",
"sys"));
+    }
+
+    /** {@inheritDoc} */
     @Override public Collection<String> schemas(Connection conn) throws SQLException
{
         Collection<String> schemas = new ArrayList<>();
 


Mime
View raw message