Changeset 1396 for DCWoRMS/branches/coolemall/src/schedframe/resources
- Timestamp:
- 06/26/14 14:18:01 (11 years ago)
- Location:
- DCWoRMS/branches/coolemall/src/schedframe/resources
- Files:
-
- 2 added
- 1 deleted
- 16 edited
- 16 moved
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/schedframe/resources/CustomResourceType.java
r477 r1396 2 2 3 3 4 public class UserResourceType implements ResourceType {4 public class CustomResourceType implements ResourceType { 5 5 6 6 protected String name; 7 7 8 public UserResourceType(String name) {8 public CustomResourceType(String name) { 9 9 this.name = name; 10 10 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceHistoryItem.java
r1207 r1396 2 2 3 3 4 public class ResourceHistory Changes{4 public class ResourceHistoryItem { 5 5 6 6 private long timestamp; 7 7 private String resourceName; 8 private String operation;8 private String action; 9 9 private String paramter; 10 10 11 public ResourceHistory Changes(long timestamp, String resourceName, String operation, String paramter) {11 public ResourceHistoryItem(long timestamp, String resourceName, String action, String paramter) { 12 12 super(); 13 13 this.timestamp = timestamp; 14 14 this.resourceName = resourceName; 15 this. operation = operation;15 this.action = action; 16 16 this.paramter = paramter; 17 17 } … … 25 25 } 26 26 27 public String get Operation() {28 return operation;27 public String getAction() { 28 return action; 29 29 } 30 30 -
DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceTypeFactory.java
r1207 r1396 60 60 return StandardResourceType.LS; 61 61 62 return new UserResourceType(typeName);62 return new CustomResourceType(typeName); 63 63 } 64 64 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java
r1392 r1396 57 57 initCharacteristics(resDesc); 58 58 accept(new LoadExtension(resDesc.getLoadProfile(), this)); 59 accept(new EnergyExtension.Builder().resource(this).powerProfile(resDesc.getPowerProfile()).air FlowProfile(resDesc.getAirThroughputProfile()).thermalProfile(resDesc.getThermalProfile()).build());59 accept(new EnergyExtension.Builder().resource(this).powerProfile(resDesc.getPowerProfile()).airflowProfile(resDesc.getAirflowProfile()).thermalProfile(resDesc.getThermalProfile()).build()); 60 60 } 61 61 -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java
r1389 r1396 10 10 import schedframe.resources.computing.extensions.ExtensionException; 11 11 import schedframe.resources.computing.extensions.ExtensionType; 12 import schedframe.resources.computing.profiles.energy.airthroughput.Air ThroughputInterfaceFactory;13 import schedframe.resources.computing.profiles.energy.airthroughput.Air ThroughputProfile;14 import schedframe.resources.computing.profiles.energy.airthroughput.ui.Air ThroughputInterface;12 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowInterfaceFactory; 13 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile; 14 import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirflowInterface; 15 15 import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory; 16 16 import schedframe.resources.computing.profiles.energy.power.PowerProfile; … … 30 30 protected PowerProfile powerProfile; 31 31 32 protected Air ThroughputInterface airFlowInterface;33 protected Air ThroughputProfile airFlowProfile;32 protected AirflowInterface airflowInterface; 33 protected AirflowProfile airflowProfile; 34 34 35 35 protected ThermalInterface thermalInterface; … … 74 74 protected PowerProfile powerProfile; 75 75 76 protected Air ThroughputInterface airFlowInterface;77 protected Air ThroughputProfile airFlowProfile;76 protected AirflowInterface airflowInterface; 77 protected AirflowProfile airflowProfile; 78 78 79 79 protected ThermalInterface thermalInterface; … … 84 84 public Builder powerProfile(PowerProfile pp){this.powerProfile = pp; this.powerInterface = PowerInterfaceFactory.createPowerInterface(resource, powerProfile); return this; } 85 85 86 public Builder air FlowProfile(AirThroughputProfile atp){this.airFlowProfile = atp; this.airFlowInterface = AirThroughputInterfaceFactory.createAirThroughputInterface(resource, airFlowProfile); return this; }86 public Builder airflowProfile(AirflowProfile atp){this.airflowProfile = atp; this.airflowInterface = AirflowInterfaceFactory.createAirflowInterface(resource, airflowProfile); return this; } 87 87 88 88 public Builder thermalProfile(ThermalProfile tp){this.thermalProfile = tp; this.thermalInterface = ThermalInterfaceFactory.createThermalInterface(resource, thermalProfile); return this; } … … 98 98 this.powerProfile = builder.powerProfile; 99 99 100 this.air FlowInterface = builder.airFlowInterface ;101 this.air FlowProfile = builder.airFlowProfile;100 this.airflowInterface = builder.airflowInterface ; 101 this.airflowProfile = builder.airflowProfile; 102 102 103 103 this.thermalInterface = builder.thermalInterface; … … 163 163 164 164 case AIRFLOW_STATE_CHANGED: 165 double air Flow = powerProfile.getEnergyEstimationPlugin().estimateAirThroughput(enEvent, new JobRegistryImpl(resource.getFullName()), resource);166 air FlowProfile.addToAirFlowHistory(airFlow);165 double airflow = powerProfile.getEnergyEstimationPlugin().estimateAirflow(enEvent, new JobRegistryImpl(resource.getFullName()), resource); 166 airflowProfile.addToAirFlowHistory(airflow); 167 167 break; 168 168 … … 204 204 } 205 205 206 public Air ThroughputInterface getAirThroughputInterface() {207 return air FlowInterface;208 } 209 210 public Air ThroughputProfile getAirFlowProfile() {211 return air FlowProfile;206 public AirflowInterface getAirflowInterface() { 207 return airflowInterface; 208 } 209 210 public AirflowProfile getAirFlowProfile() { 211 return airflowProfile; 212 212 } 213 213 -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirFlowValue.java
r495 r1396 3 3 import schedframe.resources.computing.profiles.energy.MeasurementHistory; 4 4 5 public class Air FlowValue extends MeasurementHistory{5 public class AirflowValue extends MeasurementHistory{ 6 6 7 public Air FlowValue(long timestamp, double value){7 public AirflowValue(long timestamp, double value){ 8 8 super(timestamp, value); 9 9 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowInterfaceFactory.java
r1318 r1396 3 3 import schedframe.resources.StandardResourceType; 4 4 import schedframe.resources.computing.ComputingResource; 5 import schedframe.resources.computing.profiles.energy.airthroughput.ui.Air ThroughputInterface;6 import schedframe.resources.computing.profiles.energy.airthroughput.ui.ComputingResourceAir ThroughputInterface;5 import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirflowInterface; 6 import schedframe.resources.computing.profiles.energy.airthroughput.ui.ComputingResourceAirflowInterface; 7 7 import schedframe.resources.devices.PhysicalResource; 8 import schedframe.resources.devices.DeviceAir ThroughputInterface;9 import schedframe.resources.devices.coolemall.FanAir ThroughputInterface;8 import schedframe.resources.devices.DeviceAirflowInterface; 9 import schedframe.resources.devices.coolemall.FanAirflowInterface; 10 10 11 public class Air ThroughputInterfaceFactory {11 public class AirflowInterfaceFactory { 12 12 13 public static Air ThroughputInterface createAirThroughputInterface(PhysicalResource resource, AirThroughputProfile atp){13 public static AirflowInterface createAirflowInterface(PhysicalResource resource, AirflowProfile atp){ 14 14 if(atp == null) 15 15 return null; 16 Air ThroughputInterface airThroughputInterface = null;16 AirflowInterface airflowInterface = null; 17 17 if(resource.getType().getName().equals(StandardResourceType.CRAH.getName())) 18 air ThroughputInterface = new DeviceAirThroughputInterface(resource, atp);18 airflowInterface = new DeviceAirflowInterface(resource, atp); 19 19 else if(resource.getType().getName().equals(StandardResourceType.Fan.getName())) 20 air ThroughputInterface = new FanAirThroughputInterface(resource, atp);20 airflowInterface = new FanAirflowInterface(resource, atp); 21 21 else if(resource.getType().getName().equals(StandardResourceType.Inlet.getName())) 22 air ThroughputInterface = new FanAirThroughputInterface(resource, atp);22 airflowInterface = new FanAirflowInterface(resource, atp); 23 23 else if(resource.getType().getName().equals(StandardResourceType.Outlet.getName())) 24 air ThroughputInterface = new FanAirThroughputInterface(resource, atp);24 airflowInterface = new FanAirflowInterface(resource, atp); 25 25 else if(resource.getType().getName().equals(StandardResourceType.CoolingDevice.getName())) 26 air ThroughputInterface = new DeviceAirThroughputInterface(resource, atp);26 airflowInterface = new DeviceAirflowInterface(resource, atp); 27 27 else 28 air ThroughputInterface = new ComputingResourceAirThroughputInterface((ComputingResource)resource, atp);29 return air ThroughputInterface;28 airflowInterface = new ComputingResourceAirflowInterface((ComputingResource)resource, atp); 29 return airflowInterface; 30 30 } 31 31 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowProfile.java
r1207 r1396 7 7 8 8 import schedframe.Parameters; 9 import schedframe.resources.computing.profiles.energy.airthroughput.plugin.Air ThroughputEstimationPlugin;9 import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirflowEstimationPlugin; 10 10 11 public class Air ThroughputProfile {11 public class AirflowProfile { 12 12 13 protected List<Air FlowValue> airFlowHistory;13 protected List<AirflowValue> airflowHistory; 14 14 15 protected Air ThroughputEstimationPlugin airThroughputEstimationPlugin;16 protected List <Air ThroughputState> airThroughputStates;15 protected AirflowEstimationPlugin airflowEstimationPlugin; 16 protected List <AirflowState> airflowStates; 17 17 protected Parameters parameters; 18 18 19 public Air ThroughputProfile(AirThroughputEstimationPlugin airThroughputEstimationPlugin, List<AirThroughputState> airThroughputStates) {19 public AirflowProfile(AirflowEstimationPlugin airflowEstimationPlugin, List<AirflowState> airflowStates) { 20 20 super(); 21 this.air ThroughputEstimationPlugin = airThroughputEstimationPlugin;22 this.air ThroughputStates = airThroughputStates;23 this.air FlowHistory = new ArrayList<AirFlowValue>();21 this.airflowEstimationPlugin = airflowEstimationPlugin; 22 this.airflowStates = airflowStates; 23 this.airflowHistory = new ArrayList<AirflowValue>(); 24 24 } 25 25 26 public List<Air ThroughputState> getAirThroughputStates() {27 return air ThroughputStates;26 public List<AirflowState> getAirflowStates() { 27 return airflowStates; 28 28 } 29 29 30 public void addToAirFlowHistory(double air Flow) {30 public void addToAirFlowHistory(double airflow) { 31 31 32 if (air FlowHistory.size() == 0) {33 Air FlowValue usage = new AirFlowValue(DateTimeUtils.currentTimeMillis(), airFlow);34 air FlowHistory.add(usage);32 if (airflowHistory.size() == 0) { 33 AirflowValue usage = new AirflowValue(DateTimeUtils.currentTimeMillis(), airflow); 34 airflowHistory.add(usage); 35 35 return; 36 36 } 37 37 38 int lastIdx = air FlowHistory.size() - 1;39 double lastAir Flow = airFlowHistory.get(lastIdx).getValue();40 if (lastAir Flow != airFlow) {41 Air FlowValue usage = airFlowHistory.get(lastIdx);38 int lastIdx = airflowHistory.size() - 1; 39 double lastAirflow = airflowHistory.get(lastIdx).getValue(); 40 if (lastAirflow != airflow) { 41 AirflowValue usage = airflowHistory.get(lastIdx); 42 42 long currentTime = DateTimeUtils.currentTimeMillis(); 43 43 if (usage.getTimestamp() == currentTime) { 44 usage.setValue(air Flow);45 if(lastIdx > 0 && air FlowHistory.get(lastIdx - 1).getValue() == airFlow)46 air FlowHistory.remove(usage);44 usage.setValue(airflow); 45 if(lastIdx > 0 && airflowHistory.get(lastIdx - 1).getValue() == airflow) 46 airflowHistory.remove(usage); 47 47 } else { 48 usage = new Air FlowValue(DateTimeUtils.currentTimeMillis(), airFlow);49 air FlowHistory.add(usage);48 usage = new AirflowValue(DateTimeUtils.currentTimeMillis(), airflow); 49 airflowHistory.add(usage); 50 50 } 51 51 } 52 52 } 53 53 54 public List<Air FlowValue> getAirThroughputHistory() {55 return air FlowHistory;54 public List<AirflowValue> getAirflowHistory() { 55 return airflowHistory; 56 56 } 57 57 -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowState.java
r477 r1396 3 3 import schedframe.Parameters; 4 4 5 public class Air ThroughputState {5 public class AirflowState { 6 6 7 protected Stringname;7 protected AirflowStateName name; 8 8 protected double value; 9 9 protected double powerUsage; 10 10 11 public Air ThroughputState(Stringname, double value, double powerUsage) {11 public AirflowState(AirflowStateName name, double value, double powerUsage) { 12 12 super(); 13 13 this.name = name; … … 16 16 } 17 17 18 public StringgetName() {18 public AirflowStateName getName() { 19 19 return name; 20 20 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowStateName.java
r753 r1396 1 1 package schedframe.resources.computing.profiles.energy.airthroughput; 2 2 3 public interface Air ThroughputStateName {3 public interface AirflowStateName { 4 4 5 public String get Name();5 public String getLabel(); 6 6 7 7 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/CustomAirflowStateName.java
r753 r1396 2 2 3 3 4 public class UserAirThroughputStateName implements AirThroughputStateName{4 public class CustomAirflowStateName implements AirflowStateName{ 5 5 6 6 protected String name; 7 7 8 public UserAirThroughputStateName(String name) {8 public CustomAirflowStateName(String name) { 9 9 this.name = name; 10 10 } 11 11 12 public String get Name() {12 public String getLabel() { 13 13 return name; 14 14 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/StandardAirflowStateName.java
r1207 r1396 1 1 package schedframe.resources.computing.profiles.energy.airthroughput; 2 2 3 public enum StandardAir ThroughputStateName implements AirThroughputStateName{3 public enum StandardAirflowStateName implements AirflowStateName{ 4 4 5 5 ON, 6 6 OFF; 7 7 8 public String get Name() {8 public String getLabel() { 9 9 return toString(); 10 10 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirflowEstimationPlugin.java
r748 r1396 6 6 import schedframe.scheduling.manager.tasks.JobRegistry; 7 7 8 public interface Air ThroughputEstimationPlugin extends Plugin {8 public interface AirflowEstimationPlugin extends Plugin { 9 9 10 public double estimateAir Throughput(Event event, JobRegistry jobRegistry, ComputingResource resource);10 public double estimateAirflow(Event event, JobRegistry jobRegistry, ComputingResource resource); 11 11 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/DefaultAirflowEstimationPlugin.java
r770 r1396 7 7 import schedframe.scheduling.manager.tasks.JobRegistry; 8 8 9 public class DefaultAir ThroughputEstimationPlugin implements AirThroughputEstimationPlugin {9 public class DefaultAirflowEstimationPlugin implements AirflowEstimationPlugin { 10 10 11 11 @Override … … 28 28 29 29 @Override 30 public double estimateAir Throughput(Event event, JobRegistry jobRegistry, ComputingResource resource) {30 public double estimateAirflow(Event event, JobRegistry jobRegistry, ComputingResource resource) { 31 31 throw new RuntimeException("This interface is depracated. For air throughput estimation please use the estimateAirThroughput method form EnergyEstimationPlugin interface."); 32 32 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirflowInterface.java
r1380 r1396 4 4 5 5 import schedframe.Parameters; 6 import schedframe.resources.computing.profiles.energy.airthroughput.Air FlowValue;7 import schedframe.resources.computing.profiles.energy.airthroughput.Air ThroughputState;8 import schedframe.resources.computing.profiles.energy.airthroughput.Air ThroughputStateName;6 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowValue; 7 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState; 8 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowStateName; 9 9 10 public interface Air ThroughputInterface {10 public interface AirflowInterface { 11 11 12 public Air ThroughputStateName getAirThroughputState();12 public AirflowStateName getAirflowState(); 13 13 14 public boolean setAir ThroughputState(AirThroughputStateName airThroughputState);14 public boolean setAirflowState(AirflowStateName airflowState); 15 15 16 public boolean supportAir ThroughputState(AirThroughputStateName powerState);16 public boolean supportAirflowState(AirflowStateName powerState); 17 17 18 public List<Air ThroughputState> getSupportedAirThroughputStates();18 public List<AirflowState> getSupportedAirflowStates(); 19 19 20 public double getAir Flow(AirThroughputStateName state) throws NoSuchFieldException;20 public double getAirflow(AirflowStateName state) throws NoSuchFieldException; 21 21 22 public double getPowerConsumption(Air ThroughputStateName state) throws NoSuchFieldException;22 public double getPowerConsumption(AirflowStateName state) throws NoSuchFieldException; 23 23 24 public Air FlowValue getRecentAirFlow();24 public AirflowValue getRecentAirflow(); 25 25 26 List<Air FlowValue> getAirFlowHistory();26 List<AirflowValue> getAirflowHistory(); 27 27 28 28 public Parameters getParameters(); -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirflowInterface.java
r1380 r1396 10 10 import schedframe.resources.computing.profiles.energy.EnergyEvent; 11 11 import schedframe.resources.computing.profiles.energy.EnergyEventType; 12 import schedframe.resources.computing.profiles.energy.airthroughput.Air FlowValue;13 import schedframe.resources.computing.profiles.energy.airthroughput.Air ThroughputProfile;14 import schedframe.resources.computing.profiles.energy.airthroughput.Air ThroughputState;15 import schedframe.resources.computing.profiles.energy.airthroughput.Air ThroughputStateName;16 import schedframe.resources.computing.profiles.energy.airthroughput.StandardAir ThroughputStateName;12 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowValue; 13 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile; 14 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState; 15 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowStateName; 16 import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirflowStateName; 17 17 18 public class ComputingResourceAir ThroughputInterface implements AirThroughputInterface{18 public class ComputingResourceAirflowInterface implements AirflowInterface{ 19 19 20 protected Air ThroughputStateName currentAirThroughputState;21 protected Air ThroughputProfile airThroughputProfile;20 protected AirflowStateName currentAirflowState; 21 protected AirflowProfile airflowProfile; 22 22 protected ComputingResource resource; 23 23 24 public ComputingResourceAir ThroughputInterface(ComputingResource resource, AirThroughputProfile airThroughputProfile){24 public ComputingResourceAirflowInterface(ComputingResource resource, AirflowProfile airflowProfile){ 25 25 this.resource = resource; 26 this.air ThroughputProfile = airThroughputProfile;27 this.currentAir ThroughputState = StandardAirThroughputStateName.ON;26 this.airflowProfile = airflowProfile; 27 this.currentAirflowState = StandardAirflowStateName.ON; 28 28 } 29 29 30 public Air ThroughputStateName getAirThroughputState() {31 return currentAir ThroughputState;30 public AirflowStateName getAirflowState() { 31 return currentAirflowState; 32 32 } 33 33 34 public boolean setAir ThroughputState(AirThroughputStateName state) {35 if(supportAir ThroughputState(state)){36 currentAir ThroughputState = state;34 public boolean setAirflowState(AirflowStateName state) { 35 if(supportAirflowState(state)){ 36 currentAirflowState = state; 37 37 38 38 //TO DO - notifications should be called for all resources starting form the lowest layer … … 44 44 } 45 45 46 public boolean supportAir ThroughputState(AirThroughputStateName state) {47 for(Air ThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){48 if(air FlowState.getName().equals(state.getName())){46 public boolean supportAirflowState(AirflowStateName state) { 47 for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 48 if(airflowState.getName().equals(state.getLabel())){ 49 49 return true; 50 50 } … … 53 53 } 54 54 55 public List<Air ThroughputState> getSupportedAirThroughputStates() {56 List<Air ThroughputState> airThroughputStates = new ArrayList<AirThroughputState>();57 for(Air ThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){58 air ThroughputStates.add(airFlowState);55 public List<AirflowState> getSupportedAirflowStates() { 56 List<AirflowState> airflowStates = new ArrayList<AirflowState>(); 57 for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 58 airflowStates.add(airflowState); 59 59 } 60 return air ThroughputStates;60 return airflowStates; 61 61 } 62 62 63 public double getAir Flow(AirThroughputStateName state) throws NoSuchFieldException {64 double air Throughput= 0;65 if(supportAir ThroughputState(state)){66 for(Air ThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){67 if(air FlowState.getName().equals(state.getName())){68 air Throughput = airFlowState.getValue();63 public double getAirflow(AirflowStateName state) throws NoSuchFieldException { 64 double airflow = 0; 65 if(supportAirflowState(state)){ 66 for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 67 if(airflowState.getName().equals(state.getLabel())){ 68 airflow = airflowState.getValue(); 69 69 break; 70 70 } 71 71 } 72 72 } 73 return air Throughput;73 return airflow; 74 74 } 75 75 76 public double getPowerConsumption(Air ThroughputStateName state) throws NoSuchFieldException {76 public double getPowerConsumption(AirflowStateName state) throws NoSuchFieldException { 77 77 double powerConsumption = 0; 78 if(supportAir ThroughputState(state)){79 for(Air ThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){80 if(air FlowState.getName().equals(state.getName())){81 powerConsumption = air FlowState.getPowerUsage();78 if(supportAirflowState(state)){ 79 for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 80 if(airflowState.getName().equals(state.getLabel())){ 81 powerConsumption = airflowState.getPowerUsage(); 82 82 break; 83 83 } … … 87 87 } 88 88 89 public Air FlowValue getRecentAirFlow() {90 Air FlowValue airFlow = null;91 int lastIdx = getAir FlowHistory().size() - 1;89 public AirflowValue getRecentAirflow() { 90 AirflowValue airflow = null; 91 int lastIdx = getAirflowHistory().size() - 1; 92 92 if(lastIdx >= 0) 93 air Flow = getAirFlowHistory().get(lastIdx);93 airflow = getAirflowHistory().get(lastIdx); 94 94 else { 95 95 try { 96 air Flow = new AirFlowValue(DateTimeUtils.currentTimeMillis(), getAirFlow(currentAirThroughputState));96 airflow = new AirflowValue(DateTimeUtils.currentTimeMillis(), getAirflow(currentAirflowState)); 97 97 } catch (NoSuchFieldException e) { 98 98 } 99 99 } 100 return air Flow;100 return airflow; 101 101 } 102 102 103 public List<Air FlowValue> getAirFlowHistory(){104 return air ThroughputProfile.getAirThroughputHistory();103 public List<AirflowValue> getAirflowHistory(){ 104 return airflowProfile.getAirflowHistory(); 105 105 } 106 106 107 107 108 108 public Parameters getParameters() { 109 return air ThroughputProfile.getParameters();109 return airflowProfile.getParameters(); 110 110 } 111 111 -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/CustomPowerStateName.java
r477 r1396 1 1 package schedframe.resources.computing.profiles.energy.power; 2 2 3 public class UserPowerStateName implements PowerStateName {3 public class CustomPowerStateName implements PowerStateName { 4 4 5 5 protected String name; 6 6 7 public UserPowerStateName(String name) {7 public CustomPowerStateName(String name) { 8 8 this.name = name; 9 9 } 10 10 11 public String get Name() {11 public String getLabel() { 12 12 return name; 13 13 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerStateName.java
r477 r1396 3 3 public interface PowerStateName { 4 4 5 public String get Name();5 public String getLabel(); 6 6 7 7 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerStateNameFactory.java
r477 r1396 6 6 public static PowerStateName createPowerStateName (String powerStateName){ 7 7 8 if(powerStateName.equals(StandardPowerStateName.ON.get Name()))8 if(powerStateName.equals(StandardPowerStateName.ON.getLabel())) 9 9 return StandardPowerStateName.ON; 10 10 11 else if(powerStateName.equals(StandardPowerStateName.OFF.get Name()))11 else if(powerStateName.equals(StandardPowerStateName.OFF.getLabel())) 12 12 return StandardPowerStateName.OFF; 13 13 14 else if(powerStateName.equals(StandardPowerStateName.HIBERNATE.get Name()))14 else if(powerStateName.equals(StandardPowerStateName.HIBERNATE.getLabel())) 15 15 return StandardPowerStateName.HIBERNATE; 16 16 17 else if(powerStateName.equals(StandardPowerStateName.SLEEP.get Name()))17 else if(powerStateName.equals(StandardPowerStateName.SLEEP.getLabel())) 18 18 return StandardPowerStateName.SLEEP; 19 19 20 else if(powerStateName.equals(StandardPowerStateName.SUSPEND.get Name()))20 else if(powerStateName.equals(StandardPowerStateName.SUSPEND.getLabel())) 21 21 return StandardPowerStateName.SUSPEND; 22 22 23 else return new UserPowerStateName(powerStateName);23 else return new CustomPowerStateName(powerStateName); 24 24 } 25 25 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/StandardPowerStateName.java
r477 r1396 10 10 HIBERNATE; 11 11 12 public String get Name() {12 public String getLabel() { 13 13 return toString(); 14 14 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java
r1207 r1396 10 10 public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource); 11 11 12 public double estimateAir Throughput(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource);12 public double estimateAirflow(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource); 13 13 14 14 public double estimateTemperature(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource); -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java
r1374 r1396 74 74 public boolean supportPowerState(PowerStateName state) { 75 75 for(PowerState powerState: powerProfile.getSupportedPowerStates()){ 76 if(powerState.getName().get Name().equals(state.getName())){76 if(powerState.getName().getLabel().equals(state.getLabel())){ 77 77 return true; 78 78 } … … 86 86 if(supportPowerState(state)){ 87 87 for(PowerState powerState: powerProfile.getSupportedPowerStates()){ 88 if(powerState.getName().get Name().equals(state.getName())){88 if(powerState.getName().getLabel().equals(state.getLabel())){ 89 89 powerConsumption = powerState.getPowerUsage(); 90 90 break; -
DCWoRMS/branches/coolemall/src/schedframe/resources/devices/Device.java
r1207 r1396 25 25 this.extensionList = new ExtensionListImpl(1); 26 26 initCharacteristics(devDesc); 27 accept(new EnergyExtension.Builder().resource(this).powerProfile(devDesc.getPowerProfile()).air FlowProfile(devDesc.getAirThroughputProfile()).thermalProfile(devDesc.getThermalProfile()).build());27 accept(new EnergyExtension.Builder().resource(this).powerProfile(devDesc.getPowerProfile()).airflowProfile(devDesc.getAirflowProfile()).thermalProfile(devDesc.getThermalProfile()).build()); 28 28 } 29 29 -
DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceAirflowInterface.java
r1380 r1396 9 9 import schedframe.resources.computing.profiles.energy.EnergyEvent; 10 10 import schedframe.resources.computing.profiles.energy.EnergyEventType; 11 import schedframe.resources.computing.profiles.energy.airthroughput.Air FlowValue;12 import schedframe.resources.computing.profiles.energy.airthroughput.Air ThroughputProfile;13 import schedframe.resources.computing.profiles.energy.airthroughput.Air ThroughputState;14 import schedframe.resources.computing.profiles.energy.airthroughput.Air ThroughputStateName;15 import schedframe.resources.computing.profiles.energy.airthroughput.StandardAir ThroughputStateName;16 import schedframe.resources.computing.profiles.energy.airthroughput.ui.Air ThroughputInterface;11 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowValue; 12 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile; 13 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState; 14 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowStateName; 15 import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirflowStateName; 16 import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirflowInterface; 17 17 18 public class DeviceAir ThroughputInterface implements AirThroughputInterface{18 public class DeviceAirflowInterface implements AirflowInterface{ 19 19 20 protected Air ThroughputStateName currentAirThroughputState;21 protected Air ThroughputProfile airThroughputProfile;20 protected AirflowStateName currentAirflowState; 21 protected AirflowProfile airflowProfile; 22 22 protected PhysicalResource resource; 23 23 24 public DeviceAir ThroughputInterface(PhysicalResource resource, AirThroughputProfile airThroughputProfile){24 public DeviceAirflowInterface(PhysicalResource resource, AirflowProfile airflowProfile){ 25 25 this.resource = resource; 26 this.air ThroughputProfile = airThroughputProfile;27 this.currentAir ThroughputState = StandardAirThroughputStateName.ON;26 this.airflowProfile = airflowProfile; 27 this.currentAirflowState = StandardAirflowStateName.ON; 28 28 } 29 29 30 public Air ThroughputStateName getAirThroughputState() {31 return currentAir ThroughputState;30 public AirflowStateName getAirflowState() { 31 return currentAirflowState; 32 32 } 33 33 34 public boolean setAir ThroughputState(AirThroughputStateName state) {35 if(supportAir ThroughputState(state)){36 currentAir ThroughputState = state;34 public boolean setAirflowState(AirflowStateName state) { 35 if(supportAirflowState(state)){ 36 currentAirflowState = state; 37 37 38 38 //TO DO - notifications should be called for all resources starting form the lowest layer … … 44 44 } 45 45 46 public boolean supportAir ThroughputState(AirThroughputStateName state) {47 for(Air ThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){48 if(air FlowState.getName().equals(state.getName())){46 public boolean supportAirflowState(AirflowStateName state) { 47 for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 48 if(airflowState.getName().getLabel().equals(state.getLabel())){ 49 49 return true; 50 50 } … … 53 53 } 54 54 55 public List<Air ThroughputState> getSupportedAirThroughputStates(){56 List<Air ThroughputState> airThroughputStates = new ArrayList<AirThroughputState>();57 for(Air ThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){58 air ThroughputStates.add(airFlowState);55 public List<AirflowState> getSupportedAirflowStates(){ 56 List<AirflowState> airflowStates = new ArrayList<AirflowState>(); 57 for(AirflowState airFlowState: airflowProfile.getAirflowStates()){ 58 airflowStates.add(airFlowState); 59 59 } 60 return air ThroughputStates;60 return airflowStates; 61 61 } 62 62 63 public double getAir Flow(AirThroughputStateName state) throws NoSuchFieldException {64 double air Throughput= 0;65 if(supportAir ThroughputState(state)){66 for(Air ThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){67 if(air FlowState.getName().equals(state.getName())){68 air Throughput = airFlowState.getValue();63 public double getAirflow(AirflowStateName state) throws NoSuchFieldException { 64 double airflow = 0; 65 if(supportAirflowState(state)){ 66 for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 67 if(airflowState.getName().getLabel().equals(state.getLabel())){ 68 airflow = airflowState.getValue(); 69 69 break; 70 70 } 71 71 } 72 72 } 73 return air Throughput;73 return airflow; 74 74 } 75 75 76 public double getPowerConsumption(Air ThroughputStateName state) throws NoSuchFieldException {76 public double getPowerConsumption(AirflowStateName state) throws NoSuchFieldException { 77 77 double powerConsumption = 0; 78 if(supportAir ThroughputState(state)){79 for(Air ThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){80 if(air FlowState.getName().equals(state.getName())){81 powerConsumption = air FlowState.getPowerUsage();78 if(supportAirflowState(state)){ 79 for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 80 if(airflowState.getName().getLabel().equals(state.getLabel())){ 81 powerConsumption = airflowState.getPowerUsage(); 82 82 break; 83 83 } … … 87 87 } 88 88 89 public Air FlowValue getRecentAirFlow() {90 Air FlowValue airFlow = null;91 int lastIdx = getAir FlowHistory().size() - 1;89 public AirflowValue getRecentAirflow() { 90 AirflowValue airflow = null; 91 int lastIdx = getAirflowHistory().size() - 1; 92 92 if(lastIdx >= 0) 93 air Flow = getAirFlowHistory().get(lastIdx);93 airflow = getAirflowHistory().get(lastIdx); 94 94 else { 95 95 try { 96 air Flow = new AirFlowValue(DateTimeUtils.currentTimeMillis(), getAirFlow(currentAirThroughputState));96 airflow = new AirflowValue(DateTimeUtils.currentTimeMillis(), getAirflow(currentAirflowState)); 97 97 } catch (NoSuchFieldException e) { 98 98 } 99 99 } 100 return air Flow;100 return airflow; 101 101 } 102 102 103 public List<Air FlowValue> getAirFlowHistory(){104 return air ThroughputProfile.getAirThroughputHistory();103 public List<AirflowValue> getAirflowHistory(){ 104 return airflowProfile.getAirflowHistory(); 105 105 } 106 106 107 107 public Parameters getParameters() { 108 return air ThroughputProfile.getParameters();108 return airflowProfile.getParameters(); 109 109 } 110 110 -
DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java
r1287 r1396 12 12 import schedframe.resources.computing.extensions.ExtensionType; 13 13 import schedframe.resources.computing.profiles.energy.EnergyExtension; 14 import schedframe.resources.computing.profiles.energy.airthroughput.ui.Air ThroughputInterface;14 import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirflowInterface; 15 15 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface; 16 16 import schedframe.resources.computing.profiles.energy.thermal.ui.ThermalInterface; … … 70 70 } 71 71 72 public Air ThroughputInterface getAirThroughputInterface(){72 public AirflowInterface getAirflowInterface(){ 73 73 Extension extension = getExtension(ExtensionType.ENERGY_EXTENSION); 74 74 if(extension != null){ 75 75 EnergyExtension ee = (EnergyExtension)extension; 76 return ee.getAir ThroughputInterface();76 return ee.getAirflowInterface(); 77 77 } 78 78 return null; -
DCWoRMS/branches/coolemall/src/schedframe/resources/devices/coolemall/FanAirflowInterface.java
r1317 r1396 1 1 package schedframe.resources.devices.coolemall; 2 2 3 import schedframe.resources.computing.profiles.energy.airthroughput.Air ThroughputProfile;4 import schedframe.resources.computing.profiles.energy.airthroughput. UserAirThroughputStateName;3 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile; 4 import schedframe.resources.computing.profiles.energy.airthroughput.CustomAirflowStateName; 5 5 import schedframe.resources.devices.PhysicalResource; 6 import schedframe.resources.devices.DeviceAir ThroughputInterface;6 import schedframe.resources.devices.DeviceAirflowInterface; 7 7 8 public class FanAir ThroughputInterface extends DeviceAirThroughputInterface {8 public class FanAirflowInterface extends DeviceAirflowInterface { 9 9 10 public FanAir ThroughputInterface(PhysicalResource resource, AirThroughputProfile airThroughputProfile) {11 super(resource, air ThroughputProfile);12 this.currentAir ThroughputState = new UserAirThroughputStateName("2");10 public FanAirflowInterface(PhysicalResource resource, AirflowProfile airflowProfile) { 11 super(resource, airflowProfile); 12 this.currentAirflowState = new CustomAirflowStateName("2"); 13 13 } 14 14 15 15 public boolean turnOn(){ 16 return setAir ThroughputState(new UserAirThroughputStateName("2"));16 return setAirflowState(new CustomAirflowStateName("2")); 17 17 } 18 18 19 19 public boolean turnOff(){ 20 return setAir ThroughputState(new UserAirThroughputStateName("1"));20 return setAirflowState(new CustomAirflowStateName("1")); 21 21 } 22 22 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java
r1317 r1396 10 10 import schedframe.resources.computing.description.ResourceDescription; 11 11 import schedframe.resources.computing.location.Location; 12 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile; 13 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState; 14 import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirThroughputEstimationPlugin; 15 import schedframe.resources.computing.profiles.energy.airthroughput.plugin.DefaultAirThroughputEstimationPlugin; 12 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowStateNameFactory; 13 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile; 14 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState; 15 import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirflowEstimationPlugin; 16 import schedframe.resources.computing.profiles.energy.airthroughput.plugin.DefaultAirflowEstimationPlugin; 16 17 import schedframe.resources.computing.profiles.energy.power.PState; 17 18 import schedframe.resources.computing.profiles.energy.power.PowerProfile; … … 36 37 37 38 protected PowerProfile powerProfile; 38 protected Air ThroughputProfile airThroughputProfile;39 protected AirflowProfile airflowProfile; 39 40 protected ThermalProfile thermalProfile; 40 41 protected LoadProfile loadProfile; … … 58 59 if (profile != null) { 59 60 initPowerProfile(profile.getPowerProfile()); 60 initAir ThroughputProfile(profile.getAirThroughputProfile());61 initAirflowProfile(profile.getAirThroughputProfile()); 61 62 initThermalProfile(profile.getThermalProfile()); 62 63 initLoadProfile(profile.getLoadProfile()); … … 151 152 } 152 153 153 protected void initAir ThroughputProfile(schemas.AirThroughputProfile airThroughputProfile) {154 if (air ThroughputProfile != null) {155 156 Air ThroughputEstimationPlugin airThroughputEstimationPlugin = null;157 List<Air ThroughputState> airThroughputStates = null;158 if(air ThroughputProfile.getAirThroughputEstimationPlugin() != null){159 String air ThroughputEstimationPluginName = airThroughputProfile.getAirThroughputEstimationPlugin().getName();160 if(air ThroughputEstimationPluginName != null) {161 air ThroughputEstimationPlugin = (AirThroughputEstimationPlugin) InstanceFactory.createInstance(162 air ThroughputEstimationPluginName, AirThroughputEstimationPlugin.class);154 protected void initAirflowProfile(schemas.AirThroughputProfile airflowProfile) { 155 if (airflowProfile != null) { 156 157 AirflowEstimationPlugin airflowEstimationPlugin = null; 158 List<AirflowState> airflowStates = null; 159 if(airflowProfile.getAirThroughputEstimationPlugin() != null){ 160 String airflowEstimationPluginName = airflowProfile.getAirThroughputEstimationPlugin().getName(); 161 if(airflowEstimationPluginName != null) { 162 airflowEstimationPlugin = (AirflowEstimationPlugin) InstanceFactory.createInstance( 163 airflowEstimationPluginName, AirflowEstimationPlugin.class); 163 164 } else { 164 air ThroughputEstimationPlugin = new DefaultAirThroughputEstimationPlugin();165 } 166 Parameters params = extractParameters(air ThroughputProfile.getAirThroughputEstimationPlugin().getParameter());167 air ThroughputEstimationPlugin.init(params);168 } 169 if(air ThroughputProfile.getAirThroughputStates() != null){170 air ThroughputStates = new ArrayList<AirThroughputState>();171 int air ThrouhputStateCount = airThroughputProfile.getAirThroughputStates().getAirThroughputStateCount();172 for (int i = 0; i < air ThrouhputStateCount; i++) {173 schemas.AirThroughputState ats = air ThroughputProfile.getAirThroughputStates().getAirThroughputState(i);174 Air ThroughputState airThroughputState = new AirThroughputState(ats.getName(), ats.getValue()165 airflowEstimationPlugin = new DefaultAirflowEstimationPlugin(); 166 } 167 Parameters params = extractParameters(airflowProfile.getAirThroughputEstimationPlugin().getParameter()); 168 airflowEstimationPlugin.init(params); 169 } 170 if(airflowProfile.getAirThroughputStates() != null){ 171 airflowStates = new ArrayList<AirflowState>(); 172 int airflowStateCount = airflowProfile.getAirThroughputStates().getAirThroughputStateCount(); 173 for (int i = 0; i < airflowStateCount; i++) { 174 schemas.AirThroughputState ats = airflowProfile.getAirThroughputStates().getAirThroughputState(i); 175 AirflowState airflowState = new AirflowState(AirflowStateNameFactory.createAirflowStateName(ats.getName()), ats.getValue() 175 176 .getContent(), ats.getPowerUsage().getContent()); 176 177 Parameters params = extractParameters(ats.getParameter()); 177 air ThroughputState.init(params);178 air ThroughputStates.add(airThroughputState);179 } 180 } 181 this.air ThroughputProfile = new AirThroughputProfile(airThroughputEstimationPlugin, airThroughputStates);182 Parameters params = extractParameters(air ThroughputProfile.getParameter());183 this.air ThroughputProfile.init(params);178 airflowState.init(params); 179 airflowStates.add(airflowState); 180 } 181 } 182 this.airflowProfile = new AirflowProfile(airflowEstimationPlugin, airflowStates); 183 Parameters params = extractParameters(airflowProfile.getParameter()); 184 this.airflowProfile.init(params); 184 185 } 185 186 } … … 281 282 } 282 283 283 public Air ThroughputProfile getAirThroughputProfile() {284 return air ThroughputProfile;284 public AirflowProfile getAirflowProfile() { 285 return airflowProfile; 285 286 } 286 287 -
DCWoRMS/branches/coolemall/src/schedframe/resources/units/CustomResourceUnitName.java
r477 r1396 1 1 package schedframe.resources.units; 2 2 3 public class UserResourceUnitName implements ResourceUnitName {3 public class CustomResourceUnitName implements ResourceUnitName { 4 4 5 5 protected String name; 6 6 7 public UserResourceUnitName(String name) {7 public CustomResourceUnitName(String name) { 8 8 this.name = name; 9 9 } 10 10 11 public String get Name() {11 public String getLabel() { 12 12 return name; 13 13 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitFactory.java
r1384 r1396 18 18 19 19 public static ResourceUnit createUnit(String unitName, String resId, int totalAmount, int usedAmount){ 20 if(unitName.equalsIgnoreCase(StandardResourceUnitName.CPU.get Name()))20 if(unitName.equalsIgnoreCase(StandardResourceUnitName.CPU.getLabel())) 21 21 return new PEUnit(resId, totalAmount, usedAmount); 22 if(unitName.equalsIgnoreCase(StandardResourceUnitName.PE.get Name()))22 if(unitName.equalsIgnoreCase(StandardResourceUnitName.PE.getLabel())) 23 23 return new PEUnit(resId, totalAmount, usedAmount); 24 else if(unitName.equalsIgnoreCase(StandardResourceUnitName.MEMORY.get Name()))24 else if(unitName.equalsIgnoreCase(StandardResourceUnitName.MEMORY.getLabel())) 25 25 return new Memory(resId, totalAmount, usedAmount); 26 else if(unitName.equalsIgnoreCase(StandardResourceUnitName.STORAGE.get Name()))26 else if(unitName.equalsIgnoreCase(StandardResourceUnitName.STORAGE.getLabel())) 27 27 return new Storage(resId, totalAmount, usedAmount); 28 else if(unitName.equalsIgnoreCase(StandardResourceUnitName.GPU.get Name()))28 else if(unitName.equalsIgnoreCase(StandardResourceUnitName.GPU.getLabel())) 29 29 return new GPU(resId, totalAmount, usedAmount); 30 else if (unitName.equalsIgnoreCase(StandardResourceUnitName.CPUSPEED.get Name()))30 else if (unitName.equalsIgnoreCase(StandardResourceUnitName.CPUSPEED.getLabel())) 31 31 return new CpuSpeed(resId, totalAmount, usedAmount); 32 else if (unitName.equalsIgnoreCase(StandardResourceUnitName.COST.get Name()))32 else if (unitName.equalsIgnoreCase(StandardResourceUnitName.COST.getLabel())) 33 33 return new Cost(resId, totalAmount); 34 else if (unitName.equalsIgnoreCase(StandardResourceUnitName.APPLICATION.get Name()))34 else if (unitName.equalsIgnoreCase(StandardResourceUnitName.APPLICATION.getLabel())) 35 35 return new Applications(resId); 36 36 else -
DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitName.java
r477 r1396 3 3 public interface ResourceUnitName { 4 4 5 public String get Name();5 public String getLabel(); 6 6 7 7 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitNameFactory.java
r477 r1396 6 6 public static ResourceUnitName createResourceUnitName(String unitName){ 7 7 8 if(unitName.equals(StandardResourceUnitName.MEMORY.get Name()))8 if(unitName.equals(StandardResourceUnitName.MEMORY.getLabel())) 9 9 return StandardResourceUnitName.MEMORY; 10 10 11 else if (unitName.equals(StandardResourceUnitName.STORAGE.get Name()))11 else if (unitName.equals(StandardResourceUnitName.STORAGE.getLabel())) 12 12 return StandardResourceUnitName.STORAGE; 13 13 14 else if (unitName.equals(StandardResourceUnitName.PE.get Name()))14 else if (unitName.equals(StandardResourceUnitName.PE.getLabel())) 15 15 return StandardResourceUnitName.PE; 16 16 17 else if (unitName.equals(StandardResourceUnitName.CPUSPEED.get Name()))17 else if (unitName.equals(StandardResourceUnitName.CPUSPEED.getLabel())) 18 18 return StandardResourceUnitName.CPUSPEED; 19 19 20 else if (unitName.equals(StandardResourceUnitName.GPU.get Name()))20 else if (unitName.equals(StandardResourceUnitName.GPU.getLabel())) 21 21 return StandardResourceUnitName.GPU; 22 22 23 else if (unitName.equals(StandardResourceUnitName.APPLICATION.get Name()))23 else if (unitName.equals(StandardResourceUnitName.APPLICATION.getLabel())) 24 24 return StandardResourceUnitName.APPLICATION; 25 25 26 else if (unitName.equals(StandardResourceUnitName.COST.get Name()))26 else if (unitName.equals(StandardResourceUnitName.COST.getLabel())) 27 27 return StandardResourceUnitName.COST; 28 28 29 else return new UserResourceUnitName(unitName);29 else return new CustomResourceUnitName(unitName); 30 30 } 31 31 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/units/StandardResourceUnitName.java
r477 r1396 46 46 } 47 47 48 public String get Name(){48 public String getLabel(){ 49 49 return this.name; 50 50 }
Note: See TracChangeset
for help on using the changeset viewer.