Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TeeTime-Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nelson Tavares de Sousa
TeeTime-Framework
Commits
150c91e4
Commit
150c91e4
authored
10 years ago
by
Nelson Tavares de Sousa
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug, which didn't pass on signals if there is a 1:1 relation
parent
dd4038d3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/teetime/stage/basic/merger/Merger.java
+9
-6
9 additions, 6 deletions
src/main/java/teetime/stage/basic/merger/Merger.java
src/test/java/teetime/stage/WordCountingTest.java
+1
-1
1 addition, 1 deletion
src/test/java/teetime/stage/WordCountingTest.java
with
10 additions
and
7 deletions
src/main/java/teetime/stage/basic/merger/Merger.java
+
9
−
6
View file @
150c91e4
...
...
@@ -74,9 +74,10 @@ public final class Merger<T> extends AbstractStage {
* @param inputPort
* The port which the signal was sent to
*/
@SuppressWarnings
(
"unchecked"
)
@Override
public
void
onSignal
(
final
ISignal
signal
,
final
InputPort
<?>
inputPort
)
{
this
.
logger
.
trace
(
"Got signal: "
+
signal
+
" from input port: "
+
inputPort
);
this
.
logger
.
info
(
"Got signal: "
+
signal
+
" from input port: "
+
inputPort
);
if
(
signalMap
.
containsKey
(
signal
.
getClass
()))
{
Set
<
InputPort
<?>>
set
=
signalMap
.
get
(
signal
.
getClass
());
...
...
@@ -84,17 +85,19 @@ public final class Merger<T> extends AbstractStage {
this
.
logger
.
warn
(
"Received more than one signal - "
+
signal
+
" - from input port: "
+
inputPort
);
}
if
(
set
.
size
()
==
this
.
getInputPorts
().
length
)
{
signal
.
trigger
(
this
);
this
.
outputPort
.
sendSignal
(
signal
);
signalMap
.
remove
(
signal
.
getClass
());
}
}
else
{
Set
<
InputPort
<?>>
tempSet
=
new
HashSet
<
InputPort
<?>>();
tempSet
.
add
(
inputPort
);
signalMap
.
put
((
Class
<
ISignal
>)
signal
.
getClass
(),
tempSet
);
}
if
(
signalMap
.
get
(
signal
.
getClass
()).
size
()
==
this
.
getInputPorts
().
length
)
{
System
.
out
.
println
(
"SENT"
);
signal
.
trigger
(
this
);
this
.
outputPort
.
sendSignal
(
signal
);
signalMap
.
remove
(
signal
.
getClass
());
}
}
public
IMergerStrategy
getMergerStrategy
()
{
...
...
This diff is collapsed.
Click to expand it.
src/test/java/teetime/stage/WordCountingTest.java
+
1
−
1
View file @
150c91e4
...
...
@@ -38,7 +38,7 @@ public class WordCountingTest {
@Test
public
void
test1
()
throws
IOException
{
int
threads
=
2
;
int
threads
=
1
;
WordCountingConfiguration
wcc
=
new
WordCountingConfiguration
(
threads
,
testFile
,
testFile
);
Analysis
analysis
=
new
Analysis
(
wcc
);
analysis
.
start
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment