package org.apache.mesos.logstash.config;


public class LogstashSettings {

    private final static double DEFAULT_CPUS = 0.2;
    private final static double DEFAULT_MEM = 256;

    private final Double cpus;
    private final Double mem;

    public LogstashSettings(Double cpus, Double mem) {

        this.cpus = cpus;
        this.mem = mem;
    }

    public double getMemForTask() {
        return cpus != null ? cpus : DEFAULT_CPUS;
    }

    public double getCpuForTask() {
        return mem != null ? mem : DEFAULT_MEM;
    }
}

@@ -400,20 +400,19 @@
  return 
-cpus
+mem
  != null
@@ -414,20 +414,19 @@
  null ? 
-cpus
+mem
  : DEFAU
@@ -428,20 +428,19 @@
 DEFAULT_
-CPUS
+MEM
 ;%0A    %7D%0A
@@ -483,35 +483,36 @@
 %0A        return 
-mem
+cpus
  != null ? mem :
@@ -498,35 +498,36 @@
  cpus != null ? 
-mem
+cpus
  : DEFAULT_MEM;%0A
@@ -513,29 +513,30 @@
  cpus : DEFAULT_
-MEM
+CPUS
 ;%0A    %7D%0A%7D%0A

Make sure settings use the right resource options.