You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dm...@apache.org on 2016/06/13 11:33:28 UTC
[1/3] ignite git commit: IGNITE-3304: Fix parameter error in class
GridServiceProcessor. Reviewed and merged by Denis Magda.
Repository: ignite
Updated Branches:
refs/heads/master 7d12c851d -> 8adeef374
IGNITE-3304: Fix parameter error in class GridServiceProcessor.
Reviewed and merged by Denis Magda.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/320c1aaf
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/320c1aaf
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/320c1aaf
Branch: refs/heads/master
Commit: 320c1aafdaaa0b5325f32566cb48fcbef455f69d
Parents: 2040c3d
Author: MaBiao <ma...@gmail.com>
Authored: Mon Jun 13 13:39:37 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jun 13 13:39:37 2016 +0300
----------------------------------------------------------------------
.../main/java/org/apache/ignite/internal/IgniteServicesImpl.java | 2 +-
.../ignite/internal/processors/service/GridServiceProcessor.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/320c1aaf/modules/core/src/main/java/org/apache/ignite/internal/IgniteServicesImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteServicesImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteServicesImpl.java
index 8f4e0bb..b8042c3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteServicesImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteServicesImpl.java
@@ -229,7 +229,7 @@ public class IgniteServicesImpl extends AsyncSupportAdapter implements IgniteSer
guard();
try {
- return ctx.service().serviceProxy(prj, name, svcItf, sticky);
+ return (T)ctx.service().serviceProxy(prj, name, svcItf, sticky);
}
finally {
unguard();
http://git-wip-us.apache.org/repos/asf/ignite/blob/320c1aaf/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
index 132dac4..b507e5f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
@@ -786,7 +786,7 @@ public class GridServiceProcessor extends GridProcessorAdapter {
}
}
- return new GridServiceProxy<>(prj, name, svcItf, sticky, ctx).proxy();
+ return new GridServiceProxy<T>(prj, name, svcItf, sticky, ctx).proxy();
}
/**
[2/3] ignite git commit: Mysql support broken in 1.6,
externalize sql syntax to make it configurable Reviewed and merged by
Denis Magda.
Posted by dm...@apache.org.
Mysql support broken in 1.6, externalize sql syntax to make it configurable
Reviewed and merged by Denis Magda.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4f8ba17b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4f8ba17b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4f8ba17b
Branch: refs/heads/master
Commit: 4f8ba17b412af8d32812ffba39e7dc2a2326ecf8
Parents: 320c1aa
Author: Kristian Rosenvold <kr...@gmail.com>
Authored: Mon Jun 13 14:32:20 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jun 13 14:32:20 2016 +0300
----------------------------------------------------------------------
.../ipfinder/jdbc/BasicJdbcIpFinderDialect.java | 28 ++++++++
.../tcp/ipfinder/jdbc/JdbcIpFinderDialect.java | 28 ++++++++
.../jdbc/OracleJdbcIpFinderDialect.java | 28 ++++++++
.../ipfinder/jdbc/TcpDiscoveryJdbcIpFinder.java | 72 +++++++++++---------
4 files changed, 122 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f8ba17b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/BasicJdbcIpFinderDialect.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/BasicJdbcIpFinderDialect.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/BasicJdbcIpFinderDialect.java
new file mode 100644
index 0000000..9a626c2
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/BasicJdbcIpFinderDialect.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spi.discovery.tcp.ipfinder.jdbc;
+
+/**
+ * Basic JDBC dialect to use along with {@link TcpDiscoveryJdbcIpFinder}.
+ */
+public class BasicJdbcIpFinderDialect implements JdbcIpFinderDialect {
+ /** {@inheritDoc} */
+ @Override public String tableName() {
+ return "tbl_addrs";
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f8ba17b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/JdbcIpFinderDialect.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/JdbcIpFinderDialect.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/JdbcIpFinderDialect.java
new file mode 100644
index 0000000..099d172
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/JdbcIpFinderDialect.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.spi.discovery.tcp.ipfinder.jdbc;
+
+/**
+ * SQL dialect to use with {@link TcpDiscoveryJdbcIpFinder}.
+ */
+public interface JdbcIpFinderDialect {
+ /**
+ * Gets table name in a valid form to use as IP addresses
+ * @return Table name.
+ */
+ public String tableName();
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f8ba17b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/OracleJdbcIpFinderDialect.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/OracleJdbcIpFinderDialect.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/OracleJdbcIpFinderDialect.java
new file mode 100644
index 0000000..dce506c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/OracleJdbcIpFinderDialect.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spi.discovery.tcp.ipfinder.jdbc;
+
+/**
+ * Oracle JDBC dialect to use along with {@link TcpDiscoveryJdbcIpFinder}.
+ */
+public class OracleJdbcIpFinderDialect implements JdbcIpFinderDialect {
+ /** {@inheritDoc} */
+ @Override public String tableName() {
+ return "\"TBL_ADDRS\"";
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f8ba17b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/TcpDiscoveryJdbcIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/TcpDiscoveryJdbcIpFinder.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/TcpDiscoveryJdbcIpFinder.java
index 24802f5..a16f238 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/TcpDiscoveryJdbcIpFinder.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/jdbc/TcpDiscoveryJdbcIpFinder.java
@@ -59,31 +59,6 @@ import static java.sql.Connection.TRANSACTION_READ_COMMITTED;
* The database will contain 1 table which will hold IP addresses.
*/
public class TcpDiscoveryJdbcIpFinder extends TcpDiscoveryIpFinderAdapter {
- /** Name of the address table, in upper case. Mostly table names are not case-sensitive
- * but databases such as Oracle require table names in upper-case when looking them up in the metadata. */
- public static final String ADDRS_TABLE_NAME = "TBL_ADDRS";
-
- /** Query to get addresses. */
- public static final String GET_ADDRS_QRY = "select hostname, port from \"" + ADDRS_TABLE_NAME
- + "\"";
-
- /** Query to register address. */
- public static final String REG_ADDR_QRY = "insert into \"" + ADDRS_TABLE_NAME
- + "\" values (?, ?)";
-
- /** Query to unregister address. */
- public static final String UNREG_ADDR_QRY = "delete from \"" + ADDRS_TABLE_NAME
- + "\" where hostname = ? and port = ?";
-
- /** Query to create addresses table. */
- public static final String CREATE_ADDRS_TABLE_QRY =
- "create table \"" + ADDRS_TABLE_NAME + "\" (" +
- "hostname VARCHAR(1024), " +
- "port INT)";
-
- /** Query to check database validity. */
- public static final String CHK_QRY = "select count(*) from \"" + ADDRS_TABLE_NAME + "\"";
-
/** Grid logger. */
@LoggerResource
private IgniteLogger log;
@@ -102,13 +77,42 @@ public class TcpDiscoveryJdbcIpFinder extends TcpDiscoveryIpFinderAdapter {
@GridToStringExclude
private final CountDownLatch initLatch = new CountDownLatch(1);
+ /** Table name. */
+ private final String addrTableName;
+
+ /** Query to get addresses. */
+ private final String getAddrsQry;
+
+ /** Query to register address. */
+ private final String regAddrQry;
+
+ /** Query to unregister address. */
+ private final String unregAddrQry;
+
+ /** Query to create addresses table. */
+ private final String createAddrsTableQry;
+
+ /** Query to check database validity. */
+ private final String chkQry;
+
/**
* Constructor.
*/
public TcpDiscoveryJdbcIpFinder() {
- setShared(true);
+ this(new BasicJdbcIpFinderDialect());
}
+ public TcpDiscoveryJdbcIpFinder(JdbcIpFinderDialect jdbcDialect) {
+ setShared(true);
+
+ this.addrTableName = jdbcDialect.tableName();
+ this.getAddrsQry = "select hostname, port from " + addrTableName;
+ this.regAddrQry = "insert into " + addrTableName + " values (?, ?)";
+ this.unregAddrQry = "delete from " + addrTableName + " where hostname = ? and port = ?";
+ this.createAddrsTableQry = "create table " + addrTableName + " (hostname VARCHAR(1024), port INT)";
+ this.chkQry = "select count(*) from " + addrTableName;
+ }
+
/** {@inheritDoc} */
@Override public Collection<InetSocketAddress> getRegisteredAddresses() throws IgniteSpiException {
init();
@@ -124,7 +128,7 @@ public class TcpDiscoveryJdbcIpFinder extends TcpDiscoveryIpFinderAdapter {
conn.setTransactionIsolation(TRANSACTION_READ_COMMITTED);
- stmt = conn.prepareStatement(GET_ADDRS_QRY);
+ stmt = conn.prepareStatement(getAddrsQry);
rs = stmt.executeQuery();
@@ -166,8 +170,8 @@ public class TcpDiscoveryJdbcIpFinder extends TcpDiscoveryIpFinderAdapter {
conn.setTransactionIsolation(TRANSACTION_READ_COMMITTED);
- stmtUnreg = conn.prepareStatement(UNREG_ADDR_QRY);
- stmtReg = conn.prepareStatement(REG_ADDR_QRY);
+ stmtUnreg = conn.prepareStatement(unregAddrQry);
+ stmtReg = conn.prepareStatement(regAddrQry);
for (InetSocketAddress addr : addrs) {
stmtUnreg.setString(1, addr.getAddress().getHostAddress());
@@ -225,7 +229,7 @@ public class TcpDiscoveryJdbcIpFinder extends TcpDiscoveryIpFinderAdapter {
conn.setTransactionIsolation(TRANSACTION_READ_COMMITTED);
- stmt = conn.prepareStatement(UNREG_ADDR_QRY);
+ stmt = conn.prepareStatement(unregAddrQry);
for (InetSocketAddress addr : addrs) {
stmt.setString(1, addr.getAddress().getHostAddress());
@@ -313,12 +317,12 @@ public class TcpDiscoveryJdbcIpFinder extends TcpDiscoveryIpFinderAdapter {
// in the create statement which will check and create atomically.
// However not all databases support it, for example Oracle,
// so we do not use it.
- try (ResultSet tables = dbm.getTables(null, null, ADDRS_TABLE_NAME, null)) {
+ try (ResultSet tables = dbm.getTables(null, null, addrTableName, null)) {
if (!tables.next()) {
// Table does not exist
// Create tbl_addrs.
try (Statement stmt = conn.createStatement()) {
- stmt.executeUpdate(CREATE_ADDRS_TABLE_QRY);
+ stmt.executeUpdate(createAddrsTableQry);
conn.commit();
}
@@ -332,7 +336,7 @@ public class TcpDiscoveryJdbcIpFinder extends TcpDiscoveryIpFinderAdapter {
// exception, so the safest way to determine if this
// exception is to be ignored is to test again to
// see if the table has been created.
- try (ResultSet tablesAgain = dbm.getTables(null, null, ADDRS_TABLE_NAME, null)) {
+ try (ResultSet tablesAgain = dbm.getTables(null, null, addrTableName, null)) {
if (!tablesAgain.next())
throw e;
}
@@ -388,7 +392,7 @@ public class TcpDiscoveryJdbcIpFinder extends TcpDiscoveryIpFinderAdapter {
// Check if tbl_addrs exists and database initialized properly.
stmt = conn.createStatement();
- stmt.execute(CHK_QRY);
+ stmt.execute(chkQry);
}
catch (SQLException e) {
throw new IgniteSpiException("IP finder has not been properly initialized.", e);
[3/3] ignite git commit: Merge remote-tracking branch
'remotes/community/gridgain-7.6.1'
Posted by dm...@apache.org.
Merge remote-tracking branch 'remotes/community/gridgain-7.6.1'
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8adeef37
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8adeef37
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8adeef37
Branch: refs/heads/master
Commit: 8adeef37463fcc3e0f647596f1b97f0826aa946d
Parents: 7d12c85 4f8ba17
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Jun 13 14:32:59 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jun 13 14:32:59 2016 +0300
----------------------------------------------------------------------
.../ignite/internal/IgniteServicesImpl.java | 2 +-
.../service/GridServiceProcessor.java | 2 +-
.../ipfinder/jdbc/BasicJdbcIpFinderDialect.java | 28 ++++++++
.../tcp/ipfinder/jdbc/JdbcIpFinderDialect.java | 28 ++++++++
.../jdbc/OracleJdbcIpFinderDialect.java | 28 ++++++++
.../ipfinder/jdbc/TcpDiscoveryJdbcIpFinder.java | 72 +++++++++++---------
6 files changed, 124 insertions(+), 36 deletions(-)
----------------------------------------------------------------------