Skip to content

Commit

Permalink
0003371: Raima Dialect
Browse files Browse the repository at this point in the history
  • Loading branch information
jumpmind-josh committed Jan 15, 2018
1 parent e9cdbb6 commit d9975ee
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 18 deletions.
Expand Up @@ -385,7 +385,30 @@ public List<NodeChannel> getNodeChannels(final String nodeId, boolean refreshExt
}

if (nodeId != null) {
nodeChannels = sqlTemplate.query(getSql("selectNodeChannelsSql"), new NodeChannelMapper(nodeId), nodeId);
nodeChannels = sqlTemplate.query(getSql("selectNodeChannelsSql"), new NodeChannelMapper(nodeId));

List<NodeChannel> nodeChannelControls = sqlTemplate.query(getSql("selectNodeChannelControlSql"),
new ISqlRowMapper<NodeChannel>() {
public NodeChannel mapRow(Row row) {
NodeChannel nodeChannel = new NodeChannel();
nodeChannel.setChannelId(row.getString("channel_id"));
nodeChannel.setLastExtractTime(row.getDateTime("last_extract_time"));
nodeChannel.setIgnoreEnabled(row.getBoolean("ignore_enabled"));
nodeChannel.setSuspendEnabled(row.getBoolean("suspend_enabled"));

return nodeChannel;
};
}, nodeId);

for (NodeChannel nodeChannelControl : nodeChannelControls) {
for (NodeChannel nodeChannel : nodeChannels) {
if (nodeChannel.getChannelId().equals(nodeChannelControl.getChannelId())) {
nodeChannel.setIgnoreEnabled(nodeChannelControl.isIgnoreEnabled());
nodeChannel.setSuspendEnabled(nodeChannelControl.isSuspendEnabled());
nodeChannel.setLastExtractTime(nodeChannelControl.getLastExtractTime());
}
}
}
nodeChannelCache.put(nodeId, nodeChannels);
loaded = true;
} else {
Expand Down Expand Up @@ -661,8 +684,6 @@ public NodeChannel mapRow(Row row) {
NodeChannel nodeChannel = new NodeChannel();
nodeChannel.setChannelId(row.getString("channel_id"));
nodeChannel.setNodeId(nodeId);
nodeChannel.setIgnoreEnabled(row.getBoolean("ignore_enabled"));
nodeChannel.setSuspendEnabled(row.getBoolean("suspend_enabled"));
nodeChannel.setProcessingOrder(row.getInt("processing_order"));
nodeChannel.setMaxBatchSize(row.getInt("max_batch_size"));
nodeChannel.setEnabled(row.getBoolean("enabled"));
Expand All @@ -673,7 +694,6 @@ public NodeChannel mapRow(Row row) {
nodeChannel.setUsePkDataToRoute(row.getBoolean("use_pk_data_to_route"));
nodeChannel.setContainsBigLob(row.getBoolean("contains_big_lob"));
nodeChannel.setBatchAlgorithm(row.getString("batch_algorithm"));
nodeChannel.setLastExtractTime(row.getDateTime("last_extract_time"));
nodeChannel.setExtractPeriodMillis(row.getLong("extract_period_millis"));
nodeChannel.setDataLoaderType(row.getString("data_loader_type"));
nodeChannel.setCreateTime(row.getDateTime("create_time"));
Expand Down
Expand Up @@ -79,20 +79,19 @@ public ConfigurationServiceSqlMap(IDatabasePlatform platform,
" from $(channel) c order by c.processing_order asc, c.channel_id ");

putSql("selectNodeChannelsSql",
"select c.channel_id, nc.node_id, nc.ignore_enabled, nc.suspend_enabled, c.processing_order, "
+ " c.max_batch_size, c.enabled, c.max_batch_to_send, c.max_data_to_route, c.use_old_data_to_route, "
+ " c.use_row_data_to_route, c.use_pk_data_to_route, c.contains_big_lob, c.batch_algorithm, "
+ " nc.last_extract_time, c.extract_period_millis, c.data_loader_type, "
+ " last_update_time, last_update_by, create_time, c.reload_flag, c.file_sync_flag, c.queue, "
+ " c.max_network_kbps, c.data_event_action "
+ " from $(channel) c left outer join "
+ " $(node_channel_ctl) nc on c.channel_id = nc.channel_id and nc.node_id = ? "
+ " order by c.processing_order asc, c.channel_id ");

putSql("selectNodeChannelControlLastExtractTimeSql", ""
+ "select channel_id, last_extract_time "
+ " from $(node_channel_ctl) where node_id = ? "
+ " order by channel_id ");
"select c.channel_id, c.processing_order, "
+ " c.max_batch_size, c.enabled, c.max_batch_to_send, c.max_data_to_route, c.use_old_data_to_route, "
+ " c.use_row_data_to_route, c.use_pk_data_to_route, c.contains_big_lob, c.batch_algorithm, "
+ " c.extract_period_millis, c.data_loader_type, "
+ " last_update_time, last_update_by, create_time, c.reload_flag, c.file_sync_flag, c.queue, "
+ " c.max_network_kbps, c.data_event_action "
+ " from $(channel) c "
+ " order by c.processing_order asc, c.channel_id ");

putSql("selectNodeChannelControlSql",
" select channel_id, last_extract_time, suspend_enabled, ignore_enabled "
+ " from $(node_channel_ctl) where node_id = ? "
+ " order by channel_id ");

putSql("insertChannelSql",
"insert into $(channel) (channel_id, processing_order, max_batch_size, "
Expand Down

0 comments on commit d9975ee

Please sign in to comment.