summaryrefslogtreecommitdiff
path: root/module/ri-engine
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2021-01-24 21:43:30 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2021-01-24 21:43:30 +0100
commit0037e24177fe9fc28809b8afd67a881af94037c0 (patch)
tree57de3f5c3ed2e06272d2a80086375176df4d5f3d /module/ri-engine
parent35942469a41df149fe35b113d6f228b654616757 (diff)
downloadrules-sandbox-0037e24177fe9fc28809b8afd67a881af94037c0.tar.gz
rules-sandbox-0037e24177fe9fc28809b8afd67a881af94037c0.tar.bz2
rules-sandbox-0037e24177fe9fc28809b8afd67a881af94037c0.tar.xz
rules-sandbox-0037e24177fe9fc28809b8afd67a881af94037c0.zip
WIP: Optaplanner.
Diffstat (limited to 'module/ri-engine')
-rw-r--r--module/ri-engine/pom.xml2
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/dba/Container.java6
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/machine/MachineSpecification.java19
3 files changed, 26 insertions, 1 deletions
diff --git a/module/ri-engine/pom.xml b/module/ri-engine/pom.xml
index fd9ba7c..80ef901 100644
--- a/module/ri-engine/pom.xml
+++ b/module/ri-engine/pom.xml
@@ -41,10 +41,12 @@
<groupId>org.drools</groupId>
<artifactId>drools-templates</artifactId>
</dependency>
+ <!--
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-internal</artifactId>
</dependency>
+ -->
<dependency>
<groupId>org.mvel</groupId>
diff --git a/module/ri-engine/src/main/java/io/trygvis/rules/dba/Container.java b/module/ri-engine/src/main/java/io/trygvis/rules/dba/Container.java
index f6d2ba4..3888661 100644
--- a/module/ri-engine/src/main/java/io/trygvis/rules/dba/Container.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/dba/Container.java
@@ -2,6 +2,7 @@ package io.trygvis.rules.dba;
import com.fasterxml.jackson.annotation.JsonIdentityReference;
import io.trygvis.rules.machine.Machine;
+import io.trygvis.rules.machine.MachineSpecification;
//@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class Container {
@@ -15,14 +16,17 @@ public class Container {
public final String tag;
private Machine machine;
+ public final MachineSpecification machineSpecification;
- public Container(Cluster cluster, String name, String machineRole, String image, String tag) {
+ public Container(Cluster cluster, String name, String machineRole, String image, String tag,
+ MachineSpecification machineSpecification) {
this.id = cluster.name + "-" + name;
this.cluster = cluster;
this.name = name;
this.machineRole = machineRole;
this.image = image;
this.tag = tag;
+ this.machineSpecification = machineSpecification;
}
public Cluster getCluster() {
diff --git a/module/ri-engine/src/main/java/io/trygvis/rules/machine/MachineSpecification.java b/module/ri-engine/src/main/java/io/trygvis/rules/machine/MachineSpecification.java
new file mode 100644
index 0000000..2e17ae5
--- /dev/null
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/machine/MachineSpecification.java
@@ -0,0 +1,19 @@
+package io.trygvis.rules.machine;
+
+public class MachineSpecification {
+ public final int cpu;
+ public final int memory;
+
+ public MachineSpecification(int cpu, int memory) {
+ this.cpu = cpu;
+ this.memory = memory;
+ }
+
+ public int getCpu() {
+ return cpu;
+ }
+
+ public int getMemory() {
+ return memory;
+ }
+}