Skip to content

Commit

Permalink
Merge branch '3.8' of https://github.com/JumpMind/symmetric-ds into 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
klementinastojanovska committed Aug 25, 2017
2 parents 8fef64b + 2771fbe commit 9db3f80
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 3 deletions.
1 change: 1 addition & 0 deletions symmetric-assemble/src/asciidoc/appendix/databases.ad
Expand Up @@ -383,6 +383,7 @@ When locating a table, SymmetricDS uses the default catalog and schema unless th
|select current_schema()
|===

include::ignite.ad[]
include::db2.ad[]
include::derby.ad[]
include::firebird.ad[]
Expand Down
35 changes: 35 additions & 0 deletions symmetric-assemble/src/asciidoc/appendix/ignite.ad
@@ -0,0 +1,35 @@

=== Apache Ignite

Since SymmetricDS is trigger based and there are not triggers in Apache Ignite, data can only be loaded to an Apache Ignite instance. The runtime SymmetricDS tables will also need to be installed in a full relational database to support integration with Apache Ignite.

The following steps explain how to configure a SymmetricDS instance using Apache Ignite as a destination node:

* Configure and start an Apache Ignite cluster.
* Copy the Apache Ignite JDBC driver (ignite-core-VERSION.jar) to the "lib" directory of the SymmetricDS installation.
* Start SymmetricDS and configure a master node with the desired source database.
* Configure the desired node groups, group links, and routers.
* Create a target node and database that will contain the SymmetricDS runtime tables for the Apache Ignite instance.

TIP: The simplest solution to support Ignite is to add a new node (see <<Add Node>>) that is connected to an H2 database to store all the SYM_* runtime tables.

* Configure the channels that will send data to the target node and the corresponding reload channel. Set the Data Loader Type to "jdbc" on both of these channels.
* Stop your SymmetricDS instance and edit the .properties file for the target node in the engines directory of the SymmetricDS installation.
* Set the following properties in the engine file:

[source,properties]
----
jdbc.db.url=jdbc:ignite:thin://localhost
jdbc.db.driver=org.apache.ignite.IgniteJdbcThinDriver
jdbc.db.user=
jdbc.db.password=
jdbc.create.table.not.null.columns.supported=false
----

* Update the jdbc url, username, and password to the desired Apache Ignite instance.
* Restart SymmetricDS.
* Create Table Triggers and Table Routers for the desired source tables to sync.

TIP: Keep in mind that SymmetricDS currently only supports syncing to the "PUBLIC" schema of an Apache Ignite instance.

* (Optional) Perform an initial load from the source to the target node and/or send the table definitions to the Apache Ignite instance.
Expand Up @@ -446,6 +446,9 @@ public void incrementTriggersCreatedCount(long count) {
}
}

protected void saveAdditionalStats(Date endTime, ChannelStats stats) {
}

public void flush() {

boolean recordStatistics = parameterService.is(ParameterConstants.STATISTIC_RECORD_ENABLE,
Expand All @@ -463,6 +466,7 @@ public void flush() {
}
}
stats.setEndTime(endTime);
saveAdditionalStats(endTime, stats);
statisticService.save(stats);
}
}
Expand Down
Expand Up @@ -115,11 +115,14 @@ public Object readColumn(ResultSet resultSet) throws SQLException {
if (foundIdx > 0) {
switch (_jdbcType) {
case Types.BIT:
return new Boolean(resultSet.getBoolean(foundIdx));
String temp = resultSet.getString(foundIdx);
return temp != null ? Boolean.parseBoolean(temp) : Boolean.FALSE;
case Types.INTEGER:
return new Integer(resultSet.getInt(foundIdx));
String tempInt = resultSet.getString(foundIdx);
return tempInt != null ? Integer.parseInt(tempInt) : new Integer(0);
case Types.TINYINT:
return new Short(resultSet.getShort(foundIdx));
String tempTiny = resultSet.getString(foundIdx);
return tempTiny != null ? Short.parseShort(tempTiny) : new Short((short)0);
default:
return resultSet.getString(foundIdx);
}
Expand Down
Expand Up @@ -36,6 +36,9 @@ public boolean start(Table table) {
this.sourceTable = table;
try {
this.targetTable = lookupTableAtTarget(this.sourceTable);
if (targetTable == null) {
this.targetTable = sourceTable;
}
}
catch (Exception e) {
this.targetTable = this.sourceTable;
Expand Down

0 comments on commit 9db3f80

Please sign in to comment.