Skip to content

Commit

Permalink
Merge branch '3.9' of https://github.com/JumpMind/symmetric-ds.git in…
Browse files Browse the repository at this point in the history
…to 3.9
  • Loading branch information
erilong committed Feb 2, 2018
2 parents 10447e9 + 754b995 commit eef5152
Show file tree
Hide file tree
Showing 418 changed files with 13,086 additions and 683 deletions.
2 changes: 1 addition & 1 deletion symmetric-assemble/common.gradle
Expand Up @@ -162,7 +162,7 @@ subprojects { subproject ->
artifacts { testArtifacts testJar }

ext {
bshVersion = '2.0b5'
bshVersion = '2.0b6'
commonsBeanUtilsVersion = '1.9.3'
commonsCliVersion = '1.2'
commonsDbcpVersion = '1.3'
Expand Down
3 changes: 2 additions & 1 deletion symmetric-assemble/gradle.properties
Expand Up @@ -11,4 +11,5 @@ publishPort=?
publishServer=symmetricds.org
sourceforgeUser=?
sourceforgePassword=?
jetty.version=9.4.7.v20170914
jetty.version=9.4.7.v20170914
vaadinVersion=8.1.6
6 changes: 3 additions & 3 deletions symmetric-assemble/settings.gradle
@@ -1,3 +1,3 @@
includeFlat 'symmetric-util','symmetric-db',
'symmetric-csv','symmetric-jdbc','symmetric-io', 'symmetric-core',
'symmetric-client','symmetric-server','symmetric-wrapper','symmetric-android'
includeFlat 'symmetric-util','symmetric-db','symmetric-csv','symmetric-jdbc',
'symmetric-io', 'symmetric-core','symmetric-client','symmetric-server',
'symmetric-wrapper','symmetric-android','symmetric-sqlexplorer'
6 changes: 4 additions & 2 deletions symmetric-assemble/src/asciidoc/examples/kafka.ad
Expand Up @@ -15,6 +15,8 @@ If your using the quick start you can run through steps 1-5 and finish with sett

==== SymmetricDS Setup

* Add the kafka-clients-{version}.jar to your SymmetricDS installation /lib folder and restart SymmetricDS.

* Create a new extension point for the <<IDatabaseWriterFilter>> implementation. For this example we will setup a java based implementation that will write either CSV or JSON data to the Kafka queue for the "client" target node group.

NOTE: Java based extension points require a full JDK (not just the JRE).
Expand Down Expand Up @@ -45,7 +47,7 @@ import org.slf4j.LoggerFactory;
public class KafkaWriterFilter implements IDatabaseWriterFilter {
protected final String KAKFA_TEXT_CACHE = "KAKFA_TEXT_CACHE" + this.hashCode();

private final Logger log = LoggerFactory.getLogger(getClass());
private final Logger log = LoggerFactory.getLogger(IDatabaseWriterFilter.class);

public boolean beforeWrite(DataContext context, Table table, CsvData data) {
if (table.getName().toUpperCase().startsWith("SYM_")) {
Expand Down Expand Up @@ -194,7 +196,7 @@ import org.slf4j.LoggerFactory;
public class KafkaWriterFilter implements IDatabaseWriterFilter {
protected final String KAKFA_TEXT_CACHE = "KAKFA_TEXT_CACHE" + this.hashCode();

private final Logger log = LoggerFactory.getLogger(getClass());
private final Logger log = LoggerFactory.getLogger(IDatabaseWriterFilter.class);

public boolean beforeWrite(DataContext context, Table table, CsvData data) {
if (table.getName().toUpperCase().startsWith("SYM_")) {
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion symmetric-client/build.gradle
Expand Up @@ -8,7 +8,7 @@ apply from: symAssembleDir + '/common.gradle'
compile "org.springframework:spring-context:$springVersion"
compile "commons-cli:commons-cli:$commonsCliVersion"
compile "commons-vfs:commons-vfs:1.0"
compile "com.jcraft:jsch:0.1.48"
// compile "com.jcraft:jsch:0.1.48"

provided "org.mongodb:mongo-java-driver:2.12.3"
provided "org.codehaus.mojo:animal-sniffer-annotations:$animalSnifferVersion"
Expand Down
Expand Up @@ -119,6 +119,15 @@ protected boolean executeWithOptions(CommandLine line) throws Exception {
throw new ParseException("Failed to parse arg [" + numericScaleArg + "] " + ex);
}
}

String dateTimeFormatArg = getOptionValue(OPTION_DATE_TIME_FORMAT, "dateTimeFormat", line, config);
if (!StringUtils.isEmpty(dateTimeFormatArg)) {
try {
config.setDateTimeFormat(dateTimeFormatArg);
} catch (Exception ex) {
throw new ParseException("Failed to parse arg [" + dateTimeFormatArg + "]" + ex);
}
}

ISymmetricEngine sourceEngine = new ClientSymmetricEngine(sourceProperies);
ISymmetricEngine targetEngine = new ClientSymmetricEngine(targetProperties);
Expand All @@ -133,10 +142,10 @@ protected String getOptionValue(String optionName, String internalName, CommandL
String optionValue = line.hasOption(optionName) ? line.getOptionValue(optionName) : null;
if (optionValue == null) {
Properties props = getConfigProperties(line);
optionValue = props.getProperty(optionName);
optionValue = props != null ? props.getProperty(optionName) : null;
if (optionValue == null) {
String optionNameUnderScore = optionName.replace('-', '_');
optionValue = props.getProperty(optionNameUnderScore);
optionValue = props != null ? props.getProperty(optionNameUnderScore) : null;
if (optionValue != null) {
config.setConfigSource(internalName, line.getOptionValue(OPTION_CONFIG_PROPERTIES));
}
Expand Down Expand Up @@ -171,6 +180,8 @@ protected static void initFromServerProperties() {
private static final String OPTION_OUTPUT_SQL = "output-sql";

private static final String OPTION_NUMERIC_SCALE = "numeric-scale";

private static final String OPTION_DATE_TIME_FORMAT = "date-time-format";

private static final String OPTION_CONFIG_PROPERTIES = "config";

Expand All @@ -191,6 +202,7 @@ protected void buildOptions(Options options) {
addOption(options, null, OPTION_USE_SYM_CONFIG, true);
addOption(options, null, OPTION_OUTPUT_SQL, true);
addOption(options, null, OPTION_NUMERIC_SCALE, true);
addOption(options, null, OPTION_DATE_TIME_FORMAT, true);
addOption(options, null, OPTION_CONFIG_PROPERTIES, true);
}

Expand Down

0 comments on commit eef5152

Please sign in to comment.