Skip to content

Commit

Permalink
0001581: Add support for multiple channels for file sync
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Mar 21, 2014
1 parent d97a5c0 commit c7d6061
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
Expand Up @@ -326,6 +326,12 @@ public void end(Batch batch, boolean inError) {
zos.putNextEntry(entry);
IOUtils.write(script.toString(), zos);
zos.closeEntry();

entry = new ZipEntry(batch.getBatchId() + "/batch-info.txt");
zos.putNextEntry(entry);
IOUtils.write(batch.getChannelId(), zos);
zos.closeEntry();


}
} catch (IOException e) {
Expand Down
Expand Up @@ -207,8 +207,16 @@ public void setReloadFlag(boolean value) {
this.channel.setReloadFlag(value);
}

public boolean isReloadFlag() {
return this.channel.isReloadFlag();
}

public void setFileSyncFlag(boolean value) {
this.channel.setFileSyncFlag(value);
}

public boolean isFileSyncFlag() {
return this.channel.isFileSyncFlag();
}

}
Expand Up @@ -219,10 +219,12 @@ public void saveFileTrigger(FileTrigger fileTrigger) {
fileTrigger.getAfterCopyScript(), fileTrigger.getLastUpdateBy(),
fileTrigger.getLastUpdateTime(), fileTrigger.getChannelId(),
fileTrigger.getReloadChannelId(), fileTrigger.getTriggerId() }, new int[] {
Types.VARCHAR, Types.SMALLINT, Types.VARCHAR, Types.VARCHAR,
Types.SMALLINT, Types.SMALLINT, Types.SMALLINT, Types.VARCHAR,
Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
Types.TIMESTAMP, Types.VARCHAR })) {
Types.VARCHAR, Types.SMALLINT,
Types.VARCHAR, Types.VARCHAR,
Types.SMALLINT, Types.SMALLINT, Types.SMALLINT, Types.SMALLINT,
Types.SMALLINT, Types.VARCHAR,
Types.VARCHAR, Types.VARCHAR,
Types.TIMESTAMP, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR })) {
fileTrigger.setCreateTime(fileTrigger.getLastUpdateTime());
sqlTemplate.update(
getSql("insertFileTriggerSql"),
Expand All @@ -238,7 +240,7 @@ public void saveFileTrigger(FileTrigger fileTrigger) {
fileTrigger.getTriggerId(), fileTrigger.getCreateTime(),
fileTrigger.getChannelId(), fileTrigger.getReloadChannelId() },
new int[] { Types.VARCHAR, Types.SMALLINT, Types.VARCHAR, Types.VARCHAR,
Types.SMALLINT, Types.SMALLINT, Types.SMALLINT, Types.VARCHAR,
Types.SMALLINT, Types.SMALLINT, Types.SMALLINT, Types.SMALLINT, Types.SMALLINT, Types.VARCHAR,
Types.VARCHAR, Types.VARCHAR, Types.TIMESTAMP, Types.VARCHAR,
Types.TIMESTAMP, Types.VARCHAR, Types.VARCHAR });
}
Expand Down

0 comments on commit c7d6061

Please sign in to comment.