NIFI-4969 Fixing error when importing versioned flow with a processor that uses event driven scheduling. This closes #2539

This commit is contained in:
Bryan Bende 2018-03-13 12:42:33 -04:00 committed by Matt Gilman
parent d14229e440
commit f1d7518547
No known key found for this signature in database
GPG Key ID: DF61EC19432AEE37
2 changed files with 4 additions and 3 deletions

View File

@ -627,7 +627,8 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
throw new IllegalStateException("Cannot modify Processor configuration while the Processor is running");
}
if (taskCount < 1 && getSchedulingStrategy() != SchedulingStrategy.EVENT_DRIVEN) {
throw new IllegalArgumentException();
throw new IllegalArgumentException("Cannot set Concurrent Tasks to " + taskCount + " for component "
+ getIdentifier() + " because Scheduling Strategy is not Event Driven");
}
if (!isTriggeredSerially()) {
concurrentTaskCount.set(taskCount);

View File

@ -4072,8 +4072,6 @@ public final class StandardProcessGroup implements ProcessGroup {
processor.setAnnotationData(proposed.getAnnotationData());
processor.setBulletinLevel(LogLevel.valueOf(proposed.getBulletinLevel()));
processor.setComments(proposed.getComments());
processor.setMaxConcurrentTasks(proposed.getConcurrentlySchedulableTaskCount());
processor.setExecutionNode(ExecutionNode.valueOf(proposed.getExecutionNode()));
processor.setName(proposed.getName());
processor.setPenalizationPeriod(proposed.getPenaltyDuration());
@ -4082,6 +4080,8 @@ public final class StandardProcessGroup implements ProcessGroup {
processor.setRunDuration(proposed.getRunDurationMillis(), TimeUnit.MILLISECONDS);
processor.setSchedulingStrategy(SchedulingStrategy.valueOf(proposed.getSchedulingStrategy()));
processor.setScheduldingPeriod(proposed.getSchedulingPeriod());
processor.setMaxConcurrentTasks(proposed.getConcurrentlySchedulableTaskCount());
processor.setExecutionNode(ExecutionNode.valueOf(proposed.getExecutionNode()));
processor.setStyle(proposed.getStyle());
processor.setYieldPeriod(proposed.getYieldDuration());
processor.setPosition(new Position(proposed.getPosition().getX(), proposed.getPosition().getY()));