예제 #1
0
static double memoryResource (const mesos::Resource& resource) {
  if (resource.name() == "mem" && resource.type() == mesos::Value::SCALAR) {
    return resource.scalar().value();
  }

  return 0;
}
예제 #2
0
static double diskspaceResource (const mesos::Resource& resource) {
  if (resource.name() == "disk" && resource.type() == mesos::Value::SCALAR) {
    return resource.scalar().value();
  }

  return 0;
}
예제 #3
0
bool arangodb::notIsDisk (const mesos::Resource& resource) {
  return resource.name() != "disk";
}
예제 #4
0
bool arangodb::isPorts (const mesos::Resource& resource) {
  return resource.name() == "ports";
}
예제 #5
0
bool arangodb::isDefaultRole (mesos::Resource const& resource) {
  return ! resource.has_role() || resource.role() == "*";
}
예제 #6
0
bool arangodb::isNoRoundingError (const mesos::Resource& resource) {
  return resource.type() != mesos::Value::SCALAR ||
         fabs(resource.scalar().value()) > 1e-6;
}