Commit 68602594 authored by Jan Marchel's avatar Jan Marchel
Browse files

adding Node Candidate type Edge and all things related to it

parent 1d234989
Pipeline #21183 passed with stages
in 12 minutes and 15 seconds
...@@ -123,7 +123,7 @@ public class NodeCandidatesFetchingServiceImpl implements NodeCandidatesFetching ...@@ -123,7 +123,7 @@ public class NodeCandidatesFetchingServiceImpl implements NodeCandidatesFetching
if (nodeType.isPresent()) { if (nodeType.isPresent()) {
result.add(createNodeTypeRequirement(Collections.singletonList(NodeType.valueOf(getValueAsString(nodeType.get().getValue()))), resourceName)); result.add(createNodeTypeRequirement(Collections.singletonList(NodeType.valueOf(getValueAsString(nodeType.get().getValue()))), resourceName));
} else { } else {
result.add(createNodeTypeRequirement(Arrays.asList(NodeType.IAAS, NodeType.BYON), resourceName)); result.add(createNodeTypeRequirement(Arrays.asList(NodeType.IAAS, NodeType.BYON, NodeType.EDGE), resourceName));
} }
getAttribute(requirementsMap, "totalMemoryHasMin").ifPresent(attribute -> result.add(createRequirement(HARDWARE_CLASS, "ram", RequirementOperator.GEQ, getValueAsString(attribute.getValue())))); getAttribute(requirementsMap, "totalMemoryHasMin").ifPresent(attribute -> result.add(createRequirement(HARDWARE_CLASS, "ram", RequirementOperator.GEQ, getValueAsString(attribute.getValue()))));
......
...@@ -2,6 +2,6 @@ package eu.paasage.upperware.profiler.generator.communication.impl; ...@@ -2,6 +2,6 @@ package eu.paasage.upperware.profiler.generator.communication.impl;
public enum NodeType { public enum NodeType {
IAAS, PAAS, FAAS, BYON IAAS, PAAS, FAAS, BYON, EDGE
} }
package eu.passage.upperware.commons.model.edge; package eu.passage.upperware.commons.model.edge;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import eu.passage.upperware.commons.model.internal.IpAddress; import eu.passage.upperware.commons.model.internal.IpAddress;
import eu.passage.upperware.commons.model.internal.LoginCredential; import eu.passage.upperware.commons.model.internal.LoginCredential;
...@@ -11,14 +8,9 @@ import lombok.Data; ...@@ -11,14 +8,9 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.ToString; import lombok.ToString;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import org.activeeon.morphemic.model.NodeCandidate;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
...@@ -36,7 +28,7 @@ public class EdgeNode implements Serializable { ...@@ -36,7 +28,7 @@ public class EdgeNode implements Serializable {
@JsonProperty("loginCredential") @JsonProperty("loginCredential")
private LoginCredential loginCredential; private LoginCredential loginCredential;
@JsonProperty("ipAddresses") @JsonProperty("ipAddresses")
private List<IpAddress> ipAddresses; private List<IpAddress> ipAddresses = null;
@JsonProperty("nodeProperties") @JsonProperty("nodeProperties")
private NodeProperties nodeProperties; private NodeProperties nodeProperties;
@JsonProperty("reason") @JsonProperty("reason")
......
...@@ -102,7 +102,8 @@ public class NodeCandidatesConverter implements ArgumentConverter { ...@@ -102,7 +102,8 @@ public class NodeCandidatesConverter implements ArgumentConverter {
if (NodeCandidate.NodeCandidateTypeEnum.FAAS.equals(nodeCandidate.getNodeCandidateType())) { if (NodeCandidate.NodeCandidateTypeEnum.FAAS.equals(nodeCandidate.getNodeCandidateType())) {
return nodeCandidate.getPricePerInvocation(); return nodeCandidate.getPricePerInvocation();
} else if (NodeCandidate.NodeCandidateTypeEnum.IAAS.equals(nodeCandidate.getNodeCandidateType()) || } else if (NodeCandidate.NodeCandidateTypeEnum.IAAS.equals(nodeCandidate.getNodeCandidateType()) ||
NodeCandidate.NodeCandidateTypeEnum.BYON.equals(nodeCandidate.getNodeCandidateType())) { NodeCandidate.NodeCandidateTypeEnum.BYON.equals(nodeCandidate.getNodeCandidateType()) ||
NodeCandidate.NodeCandidateTypeEnum.EDGE.equals(nodeCandidate.getNodeCandidateType())) {
return nodeCandidate.getPrice(); return nodeCandidate.getPrice();
} else { } else {
throw new IllegalStateException("Type of Node Candidate: " + nodeCandidate.getNodeCandidateType() + "is not supported"); throw new IllegalStateException("Type of Node Candidate: " + nodeCandidate.getNodeCandidateType() + "is not supported");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment