Skip to content
Snippets Groups Projects
Commit 145a5c2e authored by Nelson Tavares de Sousa's avatar Nelson Tavares de Sousa
Browse files

Merge branch 'error-codes' into 'master'

Error codes

fixes #163

See merge request !66
parents f1e419d0 f517d86d
No related branches found
No related tags found
No related merge requests found
Showing
with 64 additions and 30 deletions
...@@ -5,31 +5,43 @@ ...@@ -5,31 +5,43 @@
<title>Release Notes</title> <title>Release Notes</title>
</properties> </properties>
<body> <body>
<release version="2.1-SNAPSHOT" description="Nightly builds">
<action dev="ntd" type="add" issue="163">
Introduced error codes.
</action>
</release>
<release version="2.0" date="30.09.2015" description="Camellia Release"> <release version="2.0" date="30.09.2015" description="Camellia Release">
<action dev="ntd" type="add" issue="93"> <action dev="ntd" type="add" issue="93">
New concept: composite stages. New concept: composite
stages.
</action> </action>
<action dev="ntd" type="add" issue="33"> <action dev="ntd" type="add" issue="33">
New concept: TeeTime automatically New concept: TeeTime
automatically
chooses the correct type of pipe for all connections. chooses the correct type of pipe for all connections.
</action> </action>
<action dev="chw" type="add" issue="207"> <action dev="chw" type="add" issue="207">
Added capacity to IPipe. Added capacity to IPipe.
</action> </action>
<action dev="chw" type="add" issue="197"> <action dev="chw" type="add" issue="197">
Added the ability to add ports to a merger at runtime. Added the ability to add
ports to a merger at runtime.
</action> </action>
<action dev="chw" type="add" issue="172"> <action dev="chw" type="add" issue="172">
Added the ability to add ports to a distributor at runtime. Added the ability to add
ports to a distributor at runtime.
</action> </action>
<action dev="chw" type="add" issue="183"> <action dev="chw" type="add" issue="183">
Threads can be added at runtime. Threads can be added at
runtime.
</action> </action>
<action dev="ntd" type="add" issue="195"> <action dev="ntd" type="add" issue="195">
Configurations can only be executed once. Configurations can only be
executed once.
</action> </action>
<action dev="ntd" type="add" issue="165"> <action dev="ntd" type="add" issue="165">
Ports can be named for better debugging. Ports can be named for
better debugging.
</action> </action>
<action dev="ntd" type="add"> <action dev="ntd" type="add">
Stages without any input port are Stages without any input port are
...@@ -38,42 +50,51 @@ ...@@ -38,42 +50,51 @@
<action dev="ntd" type="add" issue="171"> <action dev="ntd" type="add" issue="171">
Configurations are now Configurations are now
built within the Configuration class. built within the Configuration class.
This removes any constraints on CompositeStages and This removes any constraints on
enables therefore multiple connections and multithreading in such stages. CompositeStages and
enables therefore multiple connections and
multithreading in such stages.
</action> </action>
<action dev="ntd" type="add" issue="154"> <action dev="ntd" type="add" issue="154">
All stages will be All stages will be
initialized before starting the analysis. initialized before starting the analysis.
</action> </action>
<action dev="ntd" type="add" issue="122"> <action dev="ntd" type="add" issue="122">
Threads can be named for better debugging. Threads can be named for
better debugging.
</action> </action>
<action dev="ntd" type="add" issue="170"> <action dev="ntd" type="add" issue="170">
Exceptions within the initialization will now terminate the execution. Exceptions within the
initialization will now terminate the execution.
</action> </action>
<action dev="ntd" type="add" issue="211"> <action dev="ntd" type="add" issue="211">
Added Services. Added Services.
Any Execution can now be aborted. Any
Execution can now be aborted.
</action> </action>
<action dev="ntd" type="update" issue="224"> <action dev="ntd" type="update" issue="224">
Merged Stage into AbstractStage. Merged Stage into
AbstractStage.
</action> </action>
<action dev="chw" type="update" issue="189"> <action dev="chw" type="update" issue="189">
Merger and Distributor strategies are moved to a separate package. Merger and Distributor
strategies are moved to a separate package.
</action> </action>
<action dev="ntd" type="update" issue="185"> <action dev="ntd" type="update" issue="185">
TerminatingExceptionListener is now the default listener. TerminatingExceptionListener is now the default listener.
</action> </action>
<action dev="ntd" type="update" issue="174"> <action dev="ntd" type="update" issue="174">
Removed addThreadableStage and replaced it by AbstractStage.declareActive(). Removed
addThreadableStage and replaced it by AbstractStage.declareActive().
</action> </action>
<action dev="ntd" type="update"> <action dev="ntd" type="update">
Renamed Analysis to Execution. Renamed Analysis to Execution.
</action> </action>
<action dev="ntd" type="remove" issue="217"> <action dev="ntd" type="remove" issue="217">
Removed InitializingSignal. Removed
InitializingSignal.
</action> </action>
<action dev="ntd" type="remove"> <action dev="ntd" type="remove">
Removed pair class. Removed pair class.
......
...@@ -82,7 +82,8 @@ public class A2InvalidThreadAssignmentCheck { ...@@ -82,7 +82,8 @@ public class A2InvalidThreadAssignmentCheck {
} else { } else {
if (colors.containsKey(targetStage)) { if (colors.containsKey(targetStage)) {
if (colors.get(targetStage) != color) { if (colors.get(targetStage) != color) {
throw new IllegalStateException("Crossing threads"); // One stage is connected to a stage of another thread (but not its "headstage") throw new IllegalStateException("1001 - Crossing threads in " + targetStage.getId()); // One stage is connected to a stage of another thread
// (but not its "headstage")
} }
} }
colors.put(targetStage, color); colors.put(targetStage, color);
......
...@@ -59,6 +59,13 @@ public abstract class AbstractCompositeStage { ...@@ -59,6 +59,13 @@ public abstract class AbstractCompositeStage {
* the type of elements to be sent * the type of elements to be sent
*/ */
protected <T> void connectPorts(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort, final int capacity) { protected <T> void connectPorts(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort, final int capacity) {
if (sourcePort == null) {
throw new IllegalArgumentException("1002 - sourcePort may not be null");
}
if (targetPort == null) {
throw new IllegalArgumentException("1003 - targetPort may not be null");
}
if (sourcePort.getOwningStage().getInputPorts().size() == 0) { if (sourcePort.getOwningStage().getInputPorts().size() == 0) {
if (sourcePort.getOwningStage().getOwningThread() == null) { if (sourcePort.getOwningStage().getOwningThread() == null) {
sourcePort.getOwningStage().declareActive(); sourcePort.getOwningStage().declareActive();
......
...@@ -68,7 +68,8 @@ public abstract class AbstractInterThreadPipe<T> extends AbstractPipe<T> { ...@@ -68,7 +68,8 @@ public abstract class AbstractInterThreadPipe<T> extends AbstractPipe<T> {
public final void waitForStartSignal() throws InterruptedException { public final void waitForStartSignal() throws InterruptedException {
final ISignal signal = signalQueue.take(); final ISignal signal = signalQueue.take();
if (!(signal instanceof StartingSignal)) { if (!(signal instanceof StartingSignal)) {
throw new IllegalStateException("Expected StartingSignal, but was " + signal.getClass().getSimpleName()); throw new IllegalStateException(
"2001 - Expected StartingSignal, but was " + signal.getClass().getSimpleName() + " in " + getTargetPort().getOwningStage().getId());
} }
cachedTargetStage.onSignal(signal, getTargetPort()); cachedTargetStage.onSignal(signal, getTargetPort());
} }
......
...@@ -67,7 +67,7 @@ public final class Execution<T extends Configuration> { ...@@ -67,7 +67,7 @@ public final class Execution<T extends Configuration> {
this.configuration = configuration; this.configuration = configuration;
this.configurationContext = configuration.getContext(); this.configurationContext = configuration.getContext();
if (configuration.isInitialized()) { if (configuration.isInitialized()) {
throw new IllegalStateException("Configuration was already executed"); throw new IllegalStateException("3001 - Configuration has already been used.");
} }
configuration.setInitialized(true); configuration.setInitialized(true);
if (validationEnabled) { if (validationEnabled) {
...@@ -151,7 +151,7 @@ public final class Execution<T extends Configuration> { ...@@ -151,7 +151,7 @@ public final class Execution<T extends Configuration> {
*/ */
public void executeNonBlocking() { public void executeNonBlocking() {
if (configuration.isExecuted()) { if (configuration.isExecuted()) {
throw new IllegalStateException("Any configuration instance may only be executed once."); throw new IllegalStateException("3002 - Any configuration instance may only be executed once.");
} }
configuration.setExecuted(true); configuration.setExecuted(true);
configurationContext.executeConfiguration(); configurationContext.executeConfiguration();
......
...@@ -31,7 +31,7 @@ public class ExecutionException extends RuntimeException { ...@@ -31,7 +31,7 @@ public class ExecutionException extends RuntimeException {
private final Map<Thread, List<Exception>> exceptions; private final Map<Thread, List<Exception>> exceptions;
public ExecutionException(final Map<Thread, List<Exception>> exceptions) { public ExecutionException(final Map<Thread, List<Exception>> exceptions) {
super((exceptions.size() == 1) ? exceptions.toString() : exceptions.size() + " error(s) while execution. Check thrown exception(s)."); super("3003 - " + ((exceptions.size() == 1) ? exceptions.toString() : exceptions.size()) + " error(s) occurred while execution. Check thrown exception(s).");
this.exceptions = exceptions; this.exceptions = exceptions;
} }
......
...@@ -95,7 +95,8 @@ class ExecutionInstantiation { ...@@ -95,7 +95,8 @@ class ExecutionInstantiation {
} else { } else {
if (colors.containsKey(targetStage)) { if (colors.containsKey(targetStage)) {
if (!colors.get(targetStage).equals(color)) { if (!colors.get(targetStage).equals(color)) {
throw new IllegalStateException("Crossing threads"); // One stage is connected to a stage of another thread (but not its "headstage") throw new IllegalStateException("1001 - Crossing threads in " + targetStage.getId()); // One stage is connected to a stage of another thread
// (but not its "headstage")
} }
} }
intraThreadPipeFactory.create(outputPort, pipe.getTargetPort()); intraThreadPipeFactory.create(outputPort, pipe.getTargetPort());
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
package teetime.framework; package teetime.framework;
public final class NotEnoughInputException extends RuntimeException { final class NotEnoughInputException extends RuntimeException {
private static final long serialVersionUID = -2517233596919204396L; private static final long serialVersionUID = -2517233596919204396L;
......
...@@ -85,7 +85,7 @@ class ThreadService extends AbstractService<ThreadService> { ...@@ -85,7 +85,7 @@ class ThreadService extends AbstractService<ThreadService> {
threadableStages.addAll(newThreadableStages); threadableStages.addAll(newThreadableStages);
if (threadableStages.isEmpty()) { if (threadableStages.isEmpty()) {
throw new IllegalStateException("No stage was added using the addThreadableStage(..) method. Add at least one stage."); throw new IllegalStateException("1004 - No threadable stages in this configuration.");
} }
A2InvalidThreadAssignmentCheck checker = new A2InvalidThreadAssignmentCheck(newThreadableStages); A2InvalidThreadAssignmentCheck checker = new A2InvalidThreadAssignmentCheck(newThreadableStages);
......
...@@ -29,7 +29,7 @@ public class InitialElementProducer<T> extends AbstractProducerStage<T> { ...@@ -29,7 +29,7 @@ public class InitialElementProducer<T> extends AbstractProducerStage<T> {
public InitialElementProducer(final Iterable<T> elements) { public InitialElementProducer(final Iterable<T> elements) {
if (elements == null) { if (elements == null) {
throw new IllegalArgumentException("The given iterable must not be null"); throw new IllegalArgumentException("4002 - The given iterable must not be null.");
} }
this.elements = elements; this.elements = elements;
} }
......
...@@ -37,7 +37,7 @@ public final class ObjectProducer<T> extends AbstractProducerStage<T> { ...@@ -37,7 +37,7 @@ public final class ObjectProducer<T> extends AbstractProducerStage<T> {
*/ */
public ObjectProducer(final long numInputObjects, final ConstructorClosure<T> inputObjectCreator) { public ObjectProducer(final long numInputObjects, final ConstructorClosure<T> inputObjectCreator) {
if (numInputObjects < 0) { if (numInputObjects < 0) {
throw new IllegalArgumentException("numInputObjects must be non-negative."); throw new IllegalArgumentException("4001 - numInputObjects must be non-negative.");
} }
this.numInputObjects = numInputObjects; this.numInputObjects = numInputObjects;
this.inputObjectCreator = inputObjectCreator; this.inputObjectCreator = inputObjectCreator;
......
...@@ -53,8 +53,7 @@ ...@@ -53,8 +53,7 @@
<item name="Wiki" href="wiki/home.html" /> <item name="Wiki" href="wiki/home.html" />
</links> </links>
<menu name="Documentation"> <menu name="Documentation">
<item name="JavaDoc" <item name="JavaDoc" href="stabledocs/index.html" />
href="stabledocs/index.html" />
<item name="Release Notes" href="changes-report.html" /> <item name="Release Notes" href="changes-report.html" />
<item name="Project Dependencies" href="dependencies.html" /> <item name="Project Dependencies" href="dependencies.html" />
<item name="License" href="license.html" /> <item name="License" href="license.html" />
...@@ -151,6 +150,10 @@ ...@@ -151,6 +150,10 @@
<tocTopMax>4</tocTopMax> <tocTopMax>4</tocTopMax>
<shortTitle>Wiki</shortTitle> <shortTitle>Wiki</shortTitle>
</wiki-home> </wiki-home>
<wiki-errors>
<toc>sidebar</toc>
<tocTopMax>4</tocTopMax>
</wiki-errors>
</pages> </pages>
</reflowSkin> </reflowSkin>
</custom> </custom>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment