Skip to content
Snippets Groups Projects
Commit 65cf609c authored by Christian Wulf's avatar Christian Wulf
Browse files

removed execute2() method from StageWithPort

parent 05e15f26
No related branches found
No related tags found
No related merge requests found
...@@ -37,32 +37,6 @@ public abstract class AbstractStage<I, O> implements StageWithPort<I, O> { ...@@ -37,32 +37,6 @@ public abstract class AbstractStage<I, O> implements StageWithPort<I, O> {
return this.outputPort; return this.outputPort;
} }
@Override
public CommittableQueue<O> execute2(final CommittableQueue<I> elements) {
// pass through the end signal
// InputPort<I> port = this.getInputPort();
// if (elements != null) {
// // I element = port.read();
// // I element = elements.getTail();
// // if (element == END_SIGNAL) {
// // this.send((O) END_SIGNAL);
// // } else {
// // // elements = this.getInputPort().pipe.getElements();
// // }
//
// this.execute4(elements);
// } else {
// throw new IllegalStateException();
// }
this.execute4(elements);
// this.outputElements.commit();
// return this.outputElements;
return null;
}
protected void execute4(final CommittableQueue<I> elements) { protected void execute4(final CommittableQueue<I> elements) {
throw new IllegalStateException(); // default implementation throw new IllegalStateException(); // default implementation
} }
......
package teetime.variant.methodcallWithPorts.framework.core; package teetime.variant.methodcallWithPorts.framework.core;
import teetime.util.list.CommittableQueue;
public abstract class ConsumerStage<I, O> extends AbstractStage<I, O> { public abstract class ConsumerStage<I, O> extends AbstractStage<I, O> {
@Override
public CommittableQueue<O> execute2(final CommittableQueue<I> elements) {
// the following code block does not harm the performance
// boolean inputIsEmpty = elements.isEmpty();
// if (inputIsEmpty) {
// this.disable();
// return this.outputElements;
// }
CommittableQueue<O> output = super.execute2(elements);
this.setReschedulable(!elements.isEmpty()); // costs ~1200 ns on chw-work (not reproducible)
return output;
}
@Override @Override
public void executeWithPorts() { public void executeWithPorts() {
// if (this.logger.isDebugEnabled()) { // if (this.logger.isDebugEnabled()) {
......
...@@ -5,8 +5,6 @@ import java.util.LinkedList; ...@@ -5,8 +5,6 @@ import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import teetime.util.list.CommittableQueue;
import kieker.common.logging.Log; import kieker.common.logging.Log;
import kieker.common.logging.LogFactory; import kieker.common.logging.LogFactory;
...@@ -58,27 +56,6 @@ public class Pipeline<I, O> implements StageWithPort<I, O> { ...@@ -58,27 +56,6 @@ public class Pipeline<I, O> implements StageWithPort<I, O> {
this.lastStage = stage; this.lastStage = stage;
} }
@Override
public CommittableQueue<O> execute2(final CommittableQueue<I> elements) {
// CommittableQueue queue = this.firstStage.execute2(elements);
// for (Stage<?, ?> stage : this.intermediateStages) {
// queue = stage.execute2(queue);
// }
// return this.lastStage.execute2(queue);
// below is faster than above (probably because of the instantiation of a list iterator in each (!) execution)
CommittableQueue queue = elements;
// for (int i = this.startIndex; i < this.stages.length; i++) {
// Stage<?, ?> stage = this.stages[i];
// queue = stage.execute2(queue);
// }
this.firstStage.execute2(elements);
this.setReschedulable(this.firstStage.isReschedulable());
return queue;
}
@Override @Override
public void executeWithPorts() { public void executeWithPorts() {
// StageWithPort<?, ?> headStage = this.currentHeads.next(); // StageWithPort<?, ?> headStage = this.currentHeads.next();
......
package teetime.variant.methodcallWithPorts.framework.core; package teetime.variant.methodcallWithPorts.framework.core;
import teetime.util.list.CommittableQueue;
public abstract class ProducerStage<I, O> extends AbstractStage<I, O> { public abstract class ProducerStage<I, O> extends AbstractStage<I, O> {
...@@ -8,18 +7,6 @@ public abstract class ProducerStage<I, O> extends AbstractStage<I, O> { ...@@ -8,18 +7,6 @@ public abstract class ProducerStage<I, O> extends AbstractStage<I, O> {
this.setReschedulable(true); this.setReschedulable(true);
} }
@Override
public CommittableQueue<O> execute2(final CommittableQueue<I> elements) {
CommittableQueue<O> outputElements = super.execute2(elements);
boolean outputIsEmpty = outputElements.isEmpty();
if (outputIsEmpty) {
this.getOutputPort().getPipe().close();
}
return outputElements;
}
@Override @Override
public void executeWithPorts() { public void executeWithPorts() {
this.execute5(null); this.execute5(null);
......
package teetime.variant.methodcallWithPorts.framework.core; package teetime.variant.methodcallWithPorts.framework.core;
import teetime.util.list.CommittableQueue;
public interface StageWithPort<I, O> { public interface StageWithPort<I, O> {
...@@ -10,8 +9,6 @@ public interface StageWithPort<I, O> { ...@@ -10,8 +9,6 @@ public interface StageWithPort<I, O> {
void executeWithPorts(); void executeWithPorts();
CommittableQueue<O> execute2(CommittableQueue<I> elements);
StageWithPort<?, ?> getParentStage(); StageWithPort<?, ?> getParentStage();
void setParentStage(StageWithPort<?, ?> parentStage, int index); void setParentStage(StageWithPort<?, ?> parentStage, int index);
......
...@@ -4,7 +4,6 @@ import java.util.LinkedList; ...@@ -4,7 +4,6 @@ import java.util.LinkedList;
import java.util.List; import java.util.List;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.list.CommittableQueue;
import teetime.variant.methodcallWithPorts.framework.core.InputPort; import teetime.variant.methodcallWithPorts.framework.core.InputPort;
import teetime.variant.methodcallWithPorts.framework.core.OutputPort; import teetime.variant.methodcallWithPorts.framework.core.OutputPort;
import teetime.variant.methodcallWithPorts.framework.core.StageWithPort; import teetime.variant.methodcallWithPorts.framework.core.StageWithPort;
...@@ -22,12 +21,6 @@ public class EndStage<T> implements StageWithPort<T, T> { ...@@ -22,12 +21,6 @@ public class EndStage<T> implements StageWithPort<T, T> {
// do nothing // do nothing
} }
@Override
public CommittableQueue<T> execute2(final CommittableQueue<T> elements) {
// TODO Auto-generated method stub
return null;
}
@Override @Override
public StageWithPort<?, ?> getParentStage() { public StageWithPort<?, ?> getParentStage() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
......
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