Skip to content

Commit

Permalink
0004205: Disable initial load in background if max batch size is 1
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Dec 13, 2019
1 parent b272654 commit 64ccf3b
Showing 1 changed file with 19 additions and 1 deletion.
Expand Up @@ -30,6 +30,7 @@
import org.jumpmind.symmetric.SymmetricException;
import org.jumpmind.symmetric.common.ParameterConstants;
import org.jumpmind.symmetric.load.IReloadGenerator;
import org.jumpmind.symmetric.model.Channel;
import org.jumpmind.symmetric.model.ExtractRequest;
import org.jumpmind.symmetric.model.Node;
import org.jumpmind.symmetric.model.NodeGroupLink;
Expand Down Expand Up @@ -196,9 +197,26 @@ protected void processTableRequestLoads(Node source, ProcessInfo processInfo) {
return;
}

boolean useExtractJob = parameterService.is(ParameterConstants.INITIAL_LOAD_USE_EXTRACT_JOB, true);

if (useExtractJob) {
Map<String, Channel> channels = engine.getConfigurationService().getChannels(false);
boolean isError = false;
for (Channel channel : channels.values()) {
if (channel.isReloadFlag() && channel.getMaxBatchSize() == 1) {
log.error("Max batch size must be greater than 1 for '{}' channel", channel.getChannelId());
isError = true;
}
}
if (isError) {
log.error("Initial loads are disabled until max batch size is corrected or {} is set to false",
ParameterConstants.INITIAL_LOAD_USE_EXTRACT_JOB);
return;
}
}

log.info("Found " + loadsToProcess.size() + " table reload requests to process.");

boolean useExtractJob = parameterService.is(ParameterConstants.INITIAL_LOAD_USE_EXTRACT_JOB, true);
boolean streamToFile = parameterService.is(ParameterConstants.STREAM_TO_FILE_ENABLED, false);
Map<String, List<TableReloadRequest>> requestsSplitByLoad = new HashMap<String, List<TableReloadRequest>>();
Map<String, List<TriggerRouter>> triggerRoutersByNodeGroup = new HashMap<String, List<TriggerRouter>>();
Expand Down

0 comments on commit 64ccf3b

Please sign in to comment.