Skip to content

Commit

Permalink
0003092: Remove sym_trigger_router.initial_load_batch_count. It is no
Browse files Browse the repository at this point in the history
longer used.
  • Loading branch information
chenson42 committed May 4, 2017
1 parent 9c2a7cf commit 103aa7b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
Expand Up @@ -47,9 +47,7 @@ public class TriggerRouter implements Serializable {

private String initialLoadSelect;

private String initialLoadDeleteStmt;

private int initialLoadBatchCount = 0;
private String initialLoadDeleteStmt;

private Trigger trigger;

Expand Down Expand Up @@ -144,15 +142,7 @@ public String getInitialLoadDeleteStmt() {

public void setInitialLoadDeleteStmt(String initialLoadDeleteStmt) {
this.initialLoadDeleteStmt = initialLoadDeleteStmt;
}

public void setInitialLoadBatchCount(int initialLoadBatchCount) {
this.initialLoadBatchCount = initialLoadBatchCount;
}

public int getInitialLoadBatchCount() {
return initialLoadBatchCount;
}
}

public boolean isRouted(DataEventType event) {
switch (event) {
Expand Down
Expand Up @@ -1003,29 +1003,27 @@ public void saveTriggerRouter(TriggerRouter triggerRouter, boolean updateTrigger
new Object[] { triggerRouter.getInitialLoadOrder(),
triggerRouter.getInitialLoadSelect(),
triggerRouter.getInitialLoadDeleteStmt(),
triggerRouter.getInitialLoadBatchCount(),
triggerRouter.isPingBackEnabled() ? 1 : 0,
triggerRouter.getLastUpdateBy(),
triggerRouter.getLastUpdateTime(),
triggerRouter.isEnabled() ? 1 : 0,
triggerRouter.getTrigger().getTriggerId(),
triggerRouter.getRouter().getRouterId() }, new int[] { Types.NUMERIC,
Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.SMALLINT, Types.VARCHAR,
Types.VARCHAR, Types.VARCHAR, Types.SMALLINT, Types.VARCHAR,
Types.TIMESTAMP, Types.SMALLINT, Types.VARCHAR, Types.VARCHAR })) {
triggerRouter.setCreateTime(triggerRouter.getLastUpdateTime());
sqlTemplate.update(
getSql("insertTriggerRouterSql"),
new Object[] { triggerRouter.getInitialLoadOrder(),
triggerRouter.getInitialLoadSelect(),
triggerRouter.getInitialLoadDeleteStmt(),
triggerRouter.getInitialLoadBatchCount(),
triggerRouter.isPingBackEnabled() ? 1 : 0,
triggerRouter.getCreateTime(), triggerRouter.getLastUpdateBy(),
triggerRouter.getLastUpdateTime(),
triggerRouter.isEnabled() ? 1 : 0,
triggerRouter.getTrigger().getTriggerId(),
triggerRouter.getRouter().getRouterId() }, new int[] { Types.NUMERIC,
Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.SMALLINT, Types.TIMESTAMP,
Types.VARCHAR, Types.VARCHAR, Types.SMALLINT, Types.TIMESTAMP,
Types.VARCHAR, Types.TIMESTAMP, Types.SMALLINT, Types.VARCHAR, Types.VARCHAR });
}

Expand Down Expand Up @@ -2052,7 +2050,6 @@ public TriggerRouter mapRow(Row rs) {
triggerRouter.setLastUpdateBy(rs.getString("last_update_by"));
triggerRouter.setInitialLoadOrder(rs.getInt("initial_load_order"));
triggerRouter.setInitialLoadSelect(rs.getString("initial_load_select"));
triggerRouter.setInitialLoadBatchCount(rs.getInt("initial_load_batch_count"));
triggerRouter.setEnabled(rs.getBoolean("enabled"));
triggerRouter.setInitialLoadDeleteStmt(rs.getString("initial_load_delete_stmt"));

Expand Down
Expand Up @@ -61,7 +61,7 @@ public TriggerRouterServiceSqlMap(IDatabasePlatform platform,
+ " inner join $(router) r on tr.router_id=r.router_id ");

putSql("selectTriggerRoutersColumnList",
" tr.trigger_id, tr.router_id, tr.create_time, tr.last_update_time, tr.last_update_by, tr.initial_load_order, tr.initial_load_select, tr.initial_load_delete_stmt, tr.initial_load_batch_count, tr.ping_back_enabled, tr.enabled ");
" tr.trigger_id, tr.router_id, tr.create_time, tr.last_update_time, tr.last_update_by, tr.initial_load_order, tr.initial_load_select, tr.initial_load_delete_stmt, tr.ping_back_enabled, tr.enabled ");

putSql("selectRoutersColumnList",
""
Expand Down Expand Up @@ -177,13 +177,13 @@ public TriggerRouterServiceSqlMap(IDatabasePlatform platform,
putSql("insertTriggerRouterSql",
""
+ "insert into $(trigger_router) "
+ " (initial_load_order,initial_load_select,initial_load_delete_stmt,initial_load_batch_count,ping_back_enabled,create_time,last_update_by,last_update_time,enabled,trigger_id,router_id) "
+ " (initial_load_order,initial_load_select,initial_load_delete_stmt,ping_back_enabled,create_time,last_update_by,last_update_time,enabled,trigger_id,router_id) "
+ " values(?,?,?,?,?,?,?,?,?,?,?) ");

putSql("updateTriggerRouterSql",
""
+ "update $(trigger_router) "
+ " set initial_load_order=?,initial_load_select=?,initial_load_delete_stmt=?,initial_load_batch_count=?,ping_back_enabled=?,last_update_by=?,last_update_time=?,enabled=? "
+ " set initial_load_order=?,initial_load_select=?,initial_load_delete_stmt=?,ping_back_enabled=?,last_update_by=?,last_update_time=?,enabled=? "
+ " where trigger_id=? and router_id=? ");

putSql("selectTriggerTargetSql",
Expand Down
1 change: 0 additions & 1 deletion symmetric-core/src/main/resources/symmetric-schema.xml
Expand Up @@ -843,7 +843,6 @@
<column name="initial_load_order" type="INTEGER" required="true" default="1" description="Order sequence of this table when an initial load is sent to a node. If this value is the same for multiple tables, then SymmetricDS will attempt to order the tables according to FK constraints. If this value is set to a negative number, then the table will be excluded from an initial load." />
<column name="initial_load_select" type="LONGVARCHAR" description="Optional expression that can be used to pare down the data selected from a table during the initial load process." />
<column name="initial_load_delete_stmt" type="LONGVARCHAR" description="The expression that is used to delete data when an initial load occurs. If this field is empty, no delete will occur before the initial load. If this field is not empty, the text will be used as a sql statement and executed for the initial load delete." />
<column name="initial_load_batch_count" type="INTEGER" default="1" description="Only applicable if the initial load extract job is enabled. The number of batches to split an initial load of a table across. If 0 then a select count(*) will be used to dynamically determine the number of batches based on the max_batch_size of the reload channel." />
<column name="ping_back_enabled" type="BOOLEANINT" size="1" required="true" default="0" description="When enabled, the node will route data that originated from a node back to that node. This attribute is only effective if sync_on_incoming_batch is set to 1."/>
<column name="create_time" type="TIMESTAMP" required="true" description="Timestamp when this entry was created." />
<column name="last_update_by" type="VARCHAR" size="50" description="The user who last updated this entry." />
Expand Down

0 comments on commit 103aa7b

Please sign in to comment.