| Line | Hits | Source | 
|---|---|---|
| 1 | package umich.cac.data; | |
| 2 | ||
| 3 | import umich.cac.pbs.FieldFactory; | |
| 4 | ||
| 5 | /** | |
| 6 | * This class encapsulates the Resource_List.exec_host field in PBS. An entry | |
| 7 | * in the data file might look like | |
| 8 | * | |
| 9 | * <pre> | |
| 10 | * exec_host=node127m/0+node126m/2 | |
| 11 | * </pre> | |
| 12 | * | |
| 13 | * @author rmach@umich.edu | |
| 14 | * @version $Header: /cvsroot/pbsaccounting/pbsaccounting/src/umich/cac/data/ExecHostField.java,v 1.3 2003/10/21 19:08:00 rodmach Exp $ | |
| 15 | */ | |
| 16 | public class ExecHostField extends Field { | |
| 17 | ||
| 18 | /** The seperator PBS uses for the exec_host nodes */ | |
| 19 | 12 | private String NODE_SEPARATOR = "\\+"; | 
| 20 | ||
| 21 | /** | |
| 22 | * Constructor for NeedsNodes field | |
| 23 | * | |
| 24 | * @param fieldName | |
| 25 | * name of this field | |
| 26 | * @param rawValue | |
| 27 | * the value of this field from PBS accounting data | |
| 28 | */ | |
| 29 | public ExecHostField(FieldName fieldName, String rawValue) { | |
| 30 | 12 | super(fieldName, rawValue, FieldType.RESOURCE_USED); | 
| 31 | 12 | setupChildren(rawValue); | 
| 32 | 12 | } | 
| 33 | ||
| 34 | /** | |
| 35 | * Contains children of type node. These are encoded in PBS as | |
| 36 | * node1+node2+node3+ with + as the sepaator | |
| 37 | * | |
| 38 | * @param rawValue | |
| 39 | * raw data from PBS accounting file for exec_host | |
| 40 | */ | |
| 41 | private void setupChildren(String rawValue) { | |
| 42 | ||
| 43 | 12 | String[] innerNodes = rawValue.split(NODE_SEPARATOR); | 
| 44 | ||
| 45 | //Construct the list of NODE children | |
| 46 | 36 | for (int j = 0; j < innerNodes.length; j++) { | 
| 47 | 24 | Field nodeField = | 
| 48 | FieldFactory.getInstance().getField( | |
| 49 | FieldName.NODE, | |
| 50 | innerNodes[j]); | |
| 51 | 24 | addChild(nodeField); | 
| 52 | } | |
| 53 | ||
| 54 | 12 | } | 
| 55 | ||
| 56 | } | 
| 
 
this report was generated by version 1.0.5 of jcoverage.  | 
 
copyright © 2003, jcoverage ltd. all rights reserved.  |