
com.powsybl.computation.slurm.SlurmComputationResourcesStatus Maven / Gradle / Ivy
/**
* Copyright (c) 2019, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package com.powsybl.computation.slurm;
import com.powsybl.computation.ComputationResourcesStatus;
import org.joda.time.DateTime;
import java.util.Collections;
import java.util.Map;
import java.util.Objects;
/**
* @author Yichen Tang
*/
class SlurmComputationResourcesStatus implements ComputationResourcesStatus {
private final DateTime dateTime;
private final int availableCores;
private final int busyCores;
private final Map busyCoresPerApp;
SlurmComputationResourcesStatus(DateTime dateTime, int availableCores, int busyCores, Map busyCoresPerApp) {
this.dateTime = Objects.requireNonNull(dateTime);
this.availableCores = availableCores;
this.busyCores = busyCores;
this.busyCoresPerApp = Collections.unmodifiableMap(Objects.requireNonNull(busyCoresPerApp));
}
@Override
public DateTime getDate() {
return dateTime;
}
@Override
public int getAvailableCores() {
return availableCores;
}
@Override
public int getBusyCores() {
return busyCores;
}
@Override
public Map getBusyCoresPerApp() {
return busyCoresPerApp;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy