diff --git a/architecture/TMA-Framework.asta b/architecture/TMA-Framework.asta index 6bdbcc6..41f4510 100644 Binary files a/architecture/TMA-Framework.asta and b/architecture/TMA-Framework.asta differ diff --git a/architecture/diagrams/TMA-K_DataModel/TMAF-K_ConceptualDataModel_Actuators.jpg b/architecture/diagrams/TMA-K_DataModel/TMAF-K_ConceptualDataModel_Actuators.jpg index abbf357..1a02d95 100644 Binary files a/architecture/diagrams/TMA-K_DataModel/TMAF-K_ConceptualDataModel_Actuators.jpg and b/architecture/diagrams/TMA-K_DataModel/TMAF-K_ConceptualDataModel_Actuators.jpg differ diff --git a/architecture/diagrams/TMA-K_DataModel/TMAF-K_ConceptualDataModel_Planning.jpg b/architecture/diagrams/TMA-K_DataModel/TMAF-K_ConceptualDataModel_Planning.jpg index f9aca47..e0e5d3a 100644 Binary files a/architecture/diagrams/TMA-K_DataModel/TMAF-K_ConceptualDataModel_Planning.jpg and b/architecture/diagrams/TMA-K_DataModel/TMAF-K_ConceptualDataModel_Planning.jpg differ diff --git a/common/tma-utils/src/main/java/eubr/atmosphere/tma/data/MetricData.java b/common/tma-utils/src/main/java/eubr/atmosphere/tma/data/MetricData.java new file mode 100644 index 0000000..a5c73b4 --- /dev/null +++ b/common/tma-utils/src/main/java/eubr/atmosphere/tma/data/MetricData.java @@ -0,0 +1,22 @@ +package eubr.atmosphere.tma.data; + +public class MetricData { + + private int metricId; + private long valueTime; + + public int getMetricId() { + return metricId; + } + public void setMetricId(int metricId) { + this.metricId = metricId; + } + + public long getValueTime() { + return valueTime; + } + + public void setValueTime(long valueTime) { + this.valueTime = valueTime; + } +} diff --git a/common/tma-utils/src/main/java/eubr/atmosphere/tma/data/Plan.java b/common/tma-utils/src/main/java/eubr/atmosphere/tma/data/Plan.java index 320198a..be8666e 100644 --- a/common/tma-utils/src/main/java/eubr/atmosphere/tma/data/Plan.java +++ b/common/tma-utils/src/main/java/eubr/atmosphere/tma/data/Plan.java @@ -25,7 +25,6 @@ public static STATUS valueOf(int ordinal) { private Integer planId; private int metricId; - private int qualityModelId; private long valueTime; private STATUS status; // TODO: define the possible status in a enum private List actionList; @@ -51,14 +50,6 @@ public void setMetricId(int metricId) { this.metricId = metricId; } - public int getQualityModelId() { - return qualityModelId; - } - - public void setQualityModelId(int qualityModelId) { - this.qualityModelId = qualityModelId; - } - public STATUS getStatus() { return status; } diff --git a/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/DatabaseManager.java b/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/DatabaseManager.java index d93a4a2..c4d1ab3 100644 --- a/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/DatabaseManager.java +++ b/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/DatabaseManager.java @@ -78,6 +78,29 @@ public static ResultSet executeQuery(PreparedStatement ps) { return rs; } + public int execute(PreparedStatement ps) { + int key = -1; + try { + ps.execute(); + ResultSet generatedKeys = ps.getGeneratedKeys(); + if (generatedKeys.next()) { + key = generatedKeys.getInt(1); + } + } catch (SQLException e) { + LOGGER.error(e.getMessage()); + } + return key; + } + + public int[] executeBatch(PreparedStatement ps) { + try { + return ps.executeBatch(); + } catch (SQLException e) { + LOGGER.error(e.getMessage()); + } + return null; + } + public void close() { try { if (resultSet != null) { @@ -95,18 +118,4 @@ public void close() { LOGGER.error(e.getMessage()); } } - - public int execute(PreparedStatement ps) { - int key = -1; - try { - ps.execute(); - ResultSet generatedKeys = ps.getGeneratedKeys(); - if (generatedKeys.next()) { - key = generatedKeys.getInt(1); - } - } catch (SQLException e) { - LOGGER.error(e.getMessage()); - } - return key; - } } diff --git a/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/PerformanceScore.java b/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/PerformanceScore.java index 24fbfee..1d81a3c 100644 --- a/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/PerformanceScore.java +++ b/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/PerformanceScore.java @@ -16,6 +16,9 @@ public class PerformanceScore implements Score { private Double responseTime; private Double demand; private Double rateRequestUnderContracted; + private int metricId; + private int resourceId; + private long valueTime; public PerformanceScore() { super(); @@ -86,4 +89,31 @@ public Double getScore() { return this.score; } + + @Override + public long getValueTime() { + return this.valueTime; + } + + public void setValueTime(long valueTime) { + this.valueTime = valueTime; + } + + @Override + public int getResourceId() { + return this.resourceId; + } + + public void setResourceId(int resourceId) { + this.resourceId = resourceId; + } + + @Override + public int getMetricId() { + return this.metricId; + } + + public void setMetricId(int metricId) { + this.metricId = metricId; + } } diff --git a/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/ResourceConsumptionScore.java b/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/ResourceConsumptionScore.java index 2f40138..9f36651 100644 --- a/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/ResourceConsumptionScore.java +++ b/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/ResourceConsumptionScore.java @@ -15,6 +15,9 @@ public ResourceConsumptionScore() { private Double cpuNode; private Double memoryNode; private Double score; + private int metricId; + private int resourceId; + private long valueTime; public Double getCpuPod() { return cpuPod; @@ -79,4 +82,31 @@ public boolean isValid() { return this.getCpuNode()!= null && this.getCpuPod()!= null && this.getMemoryNode()!= null && this.getMemoryPod()!= null; } + + @Override + public long getValueTime() { + return this.valueTime; + } + + public void setValueTime(long valueTime) { + this.valueTime = valueTime; + } + + @Override + public int getResourceId() { + return this.resourceId; + } + + public void setResourceId(int resourceId) { + this.resourceId = resourceId; + } + + @Override + public int getMetricId() { + return this.metricId; + } + + public void setMetricId(int metricId) { + this.metricId = metricId; + } } diff --git a/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/Score.java b/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/Score.java index 76b287b..26f5fd5 100644 --- a/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/Score.java +++ b/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/Score.java @@ -3,4 +3,10 @@ public interface Score { public Double getScore(); + + public long getValueTime(); + + public int getResourceId(); + + public int getMetricId(); } diff --git a/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/TrustworthinessScore.java b/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/TrustworthinessScore.java index 659e696..a3b8b86 100644 --- a/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/TrustworthinessScore.java +++ b/common/tma-utils/src/main/java/eubr/atmosphere/tma/utils/TrustworthinessScore.java @@ -6,7 +6,9 @@ public class TrustworthinessScore implements Score { private ResourceConsumptionScore resourceConsumptionScore; private PerformanceScore performanceScore; private Integer podCount; - private long timestamp; + private int metricId; + private int resourceId; + private long valueTime; public TrustworthinessScore(ResourceConsumptionScore resourceConsumptionPodScore, PerformanceScore performanceScore) { @@ -23,7 +25,7 @@ public String toString() { + ", resourceConsumptionScore=" + resourceConsumptionScore + ", performanceScore=" + performanceScore + ", podCount=" + podCount - + ", timestamp=" + timestamp + + ", valueTime=" + valueTime + "]"; } @@ -51,14 +53,6 @@ public void setPodCount(Integer podCount) { this.podCount = podCount; } - public long getTimestamp() { - return timestamp; - } - - public void setTimestamp(long timestamp) { - this.timestamp = timestamp; - } - public ResourceConsumptionScore getResourceConsumptionScore() { return this.resourceConsumptionScore; } @@ -66,4 +60,31 @@ public ResourceConsumptionScore getResourceConsumptionScore() { public PerformanceScore getPerformanceScore() { return this.performanceScore; } + + @Override + public long getValueTime() { + return this.valueTime; + } + + public void setValueTime(long valueTime) { + this.valueTime = valueTime; + } + + @Override + public int getResourceId() { + return this.resourceId; + } + + public void setResourceId(int resourceId) { + this.resourceId = resourceId; + } + + @Override + public int getMetricId() { + return this.metricId; + } + + public void setMetricId(int metricId) { + this.metricId = metricId; + } } diff --git a/tma-framework-e b/tma-framework-e index ed1d5e2..e06a2cb 160000 --- a/tma-framework-e +++ b/tma-framework-e @@ -1 +1 @@ -Subproject commit ed1d5e24838bb1a9df2bb77dc45ec3a04119129e +Subproject commit e06a2cbbb006b4f74cfa7b429ad4a835caa3863f diff --git a/tma-framework-k b/tma-framework-k index ed4dbea..4303c92 160000 --- a/tma-framework-k +++ b/tma-framework-k @@ -1 +1 @@ -Subproject commit ed4dbea6f4a511a54795f90ddde980ce49441335 +Subproject commit 4303c9288f2dd08603ef7d173dfb296e56af8f93 diff --git a/tma-framework-m b/tma-framework-m index 246ca13..7610b30 160000 --- a/tma-framework-m +++ b/tma-framework-m @@ -1 +1 @@ -Subproject commit 246ca1355d509a174996c124c5d6130e7a3c2bbd +Subproject commit 7610b30cb5c2def15e047bd3cfc88e6d72941d77 diff --git a/tma-framework-p b/tma-framework-p index 0c9f307..4662682 160000 --- a/tma-framework-p +++ b/tma-framework-p @@ -1 +1 @@ -Subproject commit 0c9f30721ab613498a69fe79bf5c77cb0c6c9da8 +Subproject commit 466268222412d4c5809498c2e50c1f7271ba5753