Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
ba6730d6
Commit
ba6730d6
authored
Dec 11, 2015
by
Björn Richerzhagen
Browse files
Include hostGroup in DAO
to enable easy filtering for postprocessing without relying on host IDs
parent
1d84fab6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/util/db/dao/metric/HostMetricDAO.java
View file @
ba6730d6
...
...
@@ -54,12 +54,12 @@ public class HostMetricDAO extends DAO {
if
(
hostId
!=
-
1
)
{
List
<
SimHost
>
allPeers
=
GlobalOracle
.
getHosts
();
for
(
SimHost
h
:
allPeers
)
{
HostMetric
hostMetric
=
new
HostMetric
(
metric
,
h
.
getHostId
());
HostMetric
hostMetric
=
new
HostMetric
(
metric
,
h
.
getHostId
()
,
h
.
getProperties
().
getGroupID
()
);
metricMap
.
put
(
h
.
getHostId
(),
hostMetric
);
addToPersistQueue
(
hostMetric
);
}
}
else
{
HostMetric
hostMetric
=
new
HostMetric
(
metric
,
hostId
);
HostMetric
hostMetric
=
new
HostMetric
(
metric
,
hostId
,
"__GLOBAL__"
);
metricMap
.
put
(
hostId
,
hostMetric
);
addToPersistQueue
(
hostMetric
);
}
...
...
src/de/tud/kom/p2psim/impl/util/db/metric/HostMetric.java
View file @
ba6730d6
package
de.tud.kom.p2psim.impl.util.db.metric
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
...
...
@@ -28,6 +29,12 @@ public class HostMetric {
private
int
id
;
private
long
hostId
;
/**
* GroupName of the host
*/
@Column
(
length
=
1023
)
private
String
groupName
;
@ManyToOne
@JoinColumn
(
name
=
"metricId"
)
...
...
@@ -37,9 +44,10 @@ public class HostMetric {
}
public
HostMetric
(
Metric
metric
,
long
hostId
)
{
public
HostMetric
(
Metric
metric
,
long
hostId
,
String
groupName
)
{
this
.
metric
=
metric
;
this
.
hostId
=
hostId
;
this
.
groupName
=
groupName
;
}
public
long
getHostId
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment