Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andreas Tsagkaropoulos
morphemic-preprocessor
Commits
e607f33d
Commit
e607f33d
authored
Feb 05, 2021
by
Mohamed Khalil Labidi
Browse files
Filtering t3a hardware types
parent
d4002364
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/activeeon/morphemic/PAGateway.java
View file @
e607f33d
...
...
@@ -221,7 +221,9 @@ public class PAGateway {
List
<
NodeCandidate
>
allNodeCandidates
=
EntityManagerHelper
.
createQuery
(
"SELECT nc FROM NodeCandidate nc"
,
NodeCandidate
.
class
).
getResultList
();
allNodeCandidates
.
forEach
(
nodeCandidate
->
{
if
(
NodeCandidateUtils
.
verifyAllFilters
(
requirements
,
nodeCandidate
))
{
// Hardware types t3a are not YET, handled by jclouds.
if
(
NodeCandidateUtils
.
verifyAllFilters
(
requirements
,
nodeCandidate
)
&&
!
nodeCandidate
.
getHardware
().
getName
().
startsWith
(
"t3a"
))
{
filteredNodeCandidates
.
add
(
nodeCandidate
);
}
});
...
...
src/main/java/org/activeeon/morphemic/service/NodeCandidateUtils.java
View file @
e607f33d
...
...
@@ -240,7 +240,10 @@ public class NodeCandidateUtils {
LOGGER
.
info
(
"Getting images from Proactive ..."
);
JSONArray
images
=
connectorIaasGateway
.
getImages
(
paCloud
.
getDummyInfrastructureName
());
LOGGER
.
info
(
"Returned images: "
+
images
.
toString
());
List
<
JSONObject
>
consolidatedImages
=
images
.
toList
().
parallelStream
().
map
(
NodeCandidateUtils:
:
convertObjectToJson
).
filter
(
record
->
!
blacklistedRegions
.
contains
(
record
.
get
(
"location"
))).
collect
(
Collectors
.
toList
());
List
<
JSONObject
>
consolidatedImages
=
images
.
toList
().
parallelStream
()
.
map
(
NodeCandidateUtils:
:
convertObjectToJson
)
.
filter
(
record
->
!
blacklistedRegions
.
contains
(
record
.
get
(
"location"
)))
.
collect
(
Collectors
.
toList
());
LOGGER
.
info
(
"Consolidated images: "
+
consolidatedImages
.
toString
());
//TODO: (Optimization) An images per region map structure <region,[image1,image2]> could be the best here.
...
...
Write
Preview
Supports
Markdown
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