Skip to content

Commit

Permalink
Add reloadChannels option to the API for saving channels
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Sep 9, 2009
1 parent 8223578 commit 7235bce
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Expand Up @@ -40,7 +40,7 @@ public interface IConfigurationService {

public void saveChannel(Channel channel, boolean reloadChannels);

public void saveChannel(NodeChannel channel);
public void saveChannel(NodeChannel channel, boolean reloadChannels);

public void saveNodeChannel(NodeChannel channel, boolean reloadChannels);

Expand Down
Expand Up @@ -75,8 +75,8 @@ public void saveChannel(Channel channel, boolean reloadChannels) {
}
}

public void saveChannel(NodeChannel nodeChannel) {
saveChannel(nodeChannel.getChannel(), true);
public void saveChannel(NodeChannel nodeChannel, boolean reloadChannels) {
saveChannel(nodeChannel.getChannel(), reloadChannels);
}

public void saveNodeChannel(NodeChannel nodeChannel, boolean reloadChannels) {
Expand Down
Expand Up @@ -90,7 +90,7 @@ public void testDisabledChannel() {
assertEquals(list.size(), 0);

nodeChannel.setEnabled(true);
getConfigurationService().saveChannel(nodeChannel);
getConfigurationService().saveChannel(nodeChannel, true);
}

protected void createDataEvent(String tableName, int triggerHistoryId, String channelId, DataEventType type,
Expand Down
Expand Up @@ -102,7 +102,7 @@ public void testColumnMatchTransactionalOnlyRoutingToNode1() {
NodeChannel testChannel = getConfigurationService().getNodeChannel(TestConstants.TEST_CHANNEL_ID);
testChannel.setMaxBatchToSend(100);
testChannel.setBatchAlgorithm("transactional");
getConfigurationService().saveChannel(testChannel);
getConfigurationService().saveChannel(testChannel, true);

// should be 51 batches for table 1
insert(TEST_TABLE_1, 500, true);
Expand Down Expand Up @@ -142,7 +142,7 @@ public void testSubSelectNonTransactionalRoutingToNode1() {
testChannel.setMaxBatchToSend(1000);
testChannel.setMaxBatchSize(5);
testChannel.setBatchAlgorithm("nontransactional");
getConfigurationService().saveChannel(testChannel);
getConfigurationService().saveChannel(testChannel, true);

// should be 100 batches for table 1, even though we committed the
// changes as part of a transaction
Expand Down Expand Up @@ -183,7 +183,7 @@ public void testSyncIncomingBatch() throws Exception {
testChannel.setMaxBatchToSend(1000);
testChannel.setMaxBatchSize(50);
testChannel.setBatchAlgorithm("default");
getConfigurationService().saveChannel(testChannel);
getConfigurationService().saveChannel(testChannel, true);

getTriggerRouterService().syncTriggers();

Expand Down Expand Up @@ -221,7 +221,7 @@ public void testLargeNumberOfEventsToManyNodes() {
testChannel.setMaxBatchToSend(100);
testChannel.setMaxBatchSize(10000);
testChannel.setBatchAlgorithm("default");
getConfigurationService().saveChannel(testChannel);
getConfigurationService().saveChannel(testChannel, true);
final int ROWS_TO_INSERT = 100000;
final int NODES_TO_INSERT = 1000;
logger.info(String.format("About to insert %s nodes", NODES_TO_INSERT));
Expand Down Expand Up @@ -259,7 +259,7 @@ public void testBshTransactionalRoutingOnUpdate() {
testChannel.setMaxBatchToSend(1000);
testChannel.setMaxBatchSize(5);
testChannel.setBatchAlgorithm("transactional");
getConfigurationService().saveChannel(testChannel);
getConfigurationService().saveChannel(testChannel, true);

long ts = System.currentTimeMillis();
TransactionCallback callback = new TransactionCallback() {
Expand Down Expand Up @@ -310,7 +310,7 @@ public void testBshRoutingDeletesToNode3() {
final int MAX_BATCH_SIZE = 100;
testChannel.setMaxBatchSize(MAX_BATCH_SIZE);
testChannel.setBatchAlgorithm("nontransactional");
getConfigurationService().saveChannel(testChannel);
getConfigurationService().saveChannel(testChannel, true);

TransactionCallback callback = new TransactionCallback() {
public Object doInTransaction(TransactionStatus status) {
Expand Down

0 comments on commit 7235bce

Please sign in to comment.