Skip to content

Commit

Permalink
0000779: Add a symmetric parameter that tells the data loader that it…
Browse files Browse the repository at this point in the history
… is NOT ok to ignore a table if it is missing in the database
  • Loading branch information
chenson42 committed Dec 1, 2012
1 parent 3bdf79c commit 55d51ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Expand Up @@ -57,11 +57,6 @@ public enum DataEventType {
*/
CREATE("C"),

/**
* An event that indicates that all SymmetricDS configuration table data should be streamed to the client.
*/
CONFIG("X"),

/**
* An event the indicates that the data payload is going to be a Java bean shell script that is to be run at the
* client.
Expand Down Expand Up @@ -111,8 +106,6 @@ public static DataEventType getEventType(String s) {
return SQL;
} else if (s.equals(CREATE.getCode())) {
return CREATE;
} else if (s.equals(CONFIG.getCode())) {
return CONFIG;
} else if (s.equals(RELOAD.getCode())) {
return RELOAD;
} else if (s.equals(BSH.getCode())) {
Expand Down
Expand Up @@ -146,7 +146,9 @@ public boolean start(Table table) {
}

public void write(CsvData data) {
if (targetTable != null) {
if (targetTable != null ||
data.getDataEventType() == DataEventType.CREATE ||
data.getDataEventType() == DataEventType.SQL) {
try {
statistics.get(batch).increment(DataWriterStatisticConstants.STATEMENTCOUNT);
statistics.get(batch).increment(DataWriterStatisticConstants.LINENUMBER);
Expand Down Expand Up @@ -206,8 +208,12 @@ public void write(CsvData data) {
}
}
} else {
throw new SqlException(String.format("Could not find the target table %s",
sourceTable.getFullyQualifiedTableName()));
if (sourceTable != null) {
throw new SqlException(String.format("Could not find the target table %s",
sourceTable.getFullyQualifiedTableName()));
} else {
throw new SqlException("The target table was not specified");
}
}
}

Expand Down

0 comments on commit 55d51ad

Please sign in to comment.