- Timestamp:
- 12/19/12 19:10:54 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/trunk/src/test/article/recs/plugins/scheduling/RecsSP.java
r680 r705 1 1 package test.article.recs.plugins.scheduling; 2 2 3 import java.io.FileInputStream; 4 import java.io.FileNotFoundException; 5 import java.io.IOException; 6 import java.util.PropertyResourceBundle; 7 import java.util.ResourceBundle; 8 9 import schedframe.resources.computing.ComputingNode; 3 10 import schedframe.scheduling.tasks.TaskInterface; 11 import test.article.recs.utils.AppType; 4 12 import test.article.recs.utils.TaskToApp; 13 import dcworms.schedframe.scheduling.ExecTask; 14 import dcworms.schedframe.scheduling.Executable; 5 15 import example.localplugin.BaseLocalSchedulingPlugin; 6 16 7 17 public abstract class RecsSP extends BaseLocalSchedulingPlugin { 8 18 19 private static String EXEC_DATA_FILE_NAME = "src/test/article/recs/data/executiveness_data.properties"; 20 21 private ResourceBundle execBundle; 22 9 23 protected TaskToApp taskToApp = new TaskToApp(); 10 24 … … 12 26 taskToApp.getAppType(task); 13 27 } 28 29 protected String createQuery(TaskInterface<?> task, ComputingNode node) { 30 Executable exec = (Executable)task; 31 String query = getApplicationType(exec) + "." + getNodeCategory(node); 32 return query; 33 } 34 35 private String getApplicationType(ExecTask task){ 36 AppType appType = taskToApp.getAppType(task); 37 return appType.toString(); 38 } 39 40 private String getNodeCategory(ComputingNode node){ 41 return node.getCategory(); 42 } 43 44 protected boolean getExecutiveness(String query) throws FileNotFoundException, IOException{ 45 ResourceBundle execBundle = getExecBundle(); 46 return Boolean.valueOf(execBundle.getString(query)).booleanValue(); 47 } 48 49 private ResourceBundle getExecBundle() throws FileNotFoundException, IOException{ 50 if(execBundle == null){ 51 execBundle = new PropertyResourceBundle(new FileInputStream(EXEC_DATA_FILE_NAME)); 52 } 53 return execBundle; 54 } 14 55 }
Note: See TracChangeset
for help on using the changeset viewer.