~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/libs/jgdi/src/com/sun/grid/jgdi/monitoring/JobSummaryImpl.java

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*___INFO__MARK_BEGIN__*/
 
2
/*************************************************************************
 
3
 *
 
4
 *  The Contents of this file are made available subject to the terms of
 
5
 *  the Sun Industry Standards Source License Version 1.2
 
6
 *
 
7
 *  Sun Microsystems Inc., March, 2001
 
8
 *
 
9
 *
 
10
 *  Sun Industry Standards Source License Version 1.2
 
11
 *  =================================================
 
12
 *  The contents of this file are subject to the Sun Industry Standards
 
13
 *  Source License Version 1.2 (the "License"); You may not use this file
 
14
 *  except in compliance with the License. You may obtain a copy of the
 
15
 *  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
 
16
 *
 
17
 *  Software provided under this License is provided on an "AS IS" basis,
 
18
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 
19
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 
20
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 
21
 *  See the License for the specific provisions governing your rights and
 
22
 *  obligations concerning the Software.
 
23
 *
 
24
 *   The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 
25
 *
 
26
 *   Copyright: 2001 by Sun Microsystems, Inc.
 
27
 *
 
28
 *   All Rights Reserved.
 
29
 *
 
30
 ************************************************************************/
 
31
/*___INFO__MARK_END__*/
 
32
package com.sun.grid.jgdi.monitoring;
 
33
 
 
34
import java.io.Serializable;
 
35
import java.util.ArrayList;
 
36
import java.util.Collections;
 
37
import java.util.Date;
 
38
import java.util.HashMap;
 
39
import java.util.List;
 
40
import java.util.Map;
 
41
import java.util.Set;
 
42
 
 
43
/**
 
44
 * The class JobSummary extends the class JobInfo and adds addtional
 
45
 * information about the job.
 
46
 *
 
47
 */
 
48
public class JobSummaryImpl extends JobInfoImpl implements JobSummary, Serializable {
 
49
    
 
50
    private double nurg;
 
51
    private double urg;
 
52
    private double nppri;
 
53
    private double nprior;
 
54
    private double ntckts;
 
55
    private double rrcontr;
 
56
    private double wtcontr;
 
57
    private double dlcontr;
 
58
    private String project;
 
59
    private String department;
 
60
    private Date deadline;
 
61
    
 
62
    private boolean hasCpuUsage;
 
63
    private int cpuUsage;
 
64
    private boolean hasMemUsage;
 
65
    private double memUsage;
 
66
    private boolean hasIoUsage;
 
67
    private double ioUsage;
 
68
    
 
69
    private boolean isZombie;
 
70
    private long overrideTickets;
 
71
    private boolean isQueueAssigned;
 
72
    private long tickets;
 
73
    private long otickets;
 
74
    private long ftickets;
 
75
    private long stickets;
 
76
    
 
77
    private double share;
 
78
    private String queue;
 
79
    private String master;
 
80
    private int slots;
 
81
    private boolean isArray;
 
82
    private boolean isRunning;
 
83
    
 
84
    private String parallelEnvironmentName;
 
85
    private String parallelEnvironmentRange;
 
86
    
 
87
    private String grantedPEName;
 
88
    private int grantedPESlots;
 
89
    
 
90
    private String checkpointEnv;
 
91
    private String masterQueue;
 
92
    
 
93
    private List<TaskSummary> taskList;
 
94
    
 
95
    /* Name value pairs for requested resources */
 
96
    private Map<String, String> requestMap;
 
97
    
 
98
    private Map<String, HardRequestValue> hardRequestMap;
 
99
    
 
100
    private Map<String, String> softRequestMap;
 
101
    
 
102
    private List<String> hardRequestedQueueList;
 
103
    
 
104
    private List<String> softRequestedQueueList;
 
105
    
 
106
    private List<String> hardRequestedMasterQueueList;
 
107
    
 
108
    private List<String> softRequestedMasterQueueList;
 
109
    
 
110
    private List<String> requestedPredecessorList;
 
111
 
 
112
    private List<String> requestedArrayPredecessorList;
 
113
    
 
114
    private List<Integer> predecessorList;
 
115
    
 
116
   private List<Integer> arrayPredecessorList;
 
117
 
 
118
    /** Creates a new instance of JobSummary */
 
119
    public JobSummaryImpl() {
 
120
    }
 
121
    
 
122
    /**
 
123
     *  Get the list of tasks of this job
 
124
     *  @return the list of tasks
 
125
     */
 
126
    public List<TaskSummary> getTaskList() {
 
127
        if (taskList == null) {
 
128
            return Collections.EMPTY_LIST;
 
129
        }
 
130
        return taskList;
 
131
    }
 
132
    
 
133
    /**
 
134
     *  Get the number of tasks of this job
 
135
     *  @return the number of tasks
 
136
     */
 
137
    public int getTaskCount() {
 
138
        if (taskList == null) {
 
139
            return 0;
 
140
        } else {
 
141
            return taskList.size();
 
142
        }
 
143
    }
 
144
    
 
145
    /**
 
146
     *  Add a new task to the job
 
147
     *  @param taskSummary the new task
 
148
     */
 
149
    public void addTask(TaskSummary taskSummary) {
 
150
        
 
151
        if (taskList == null) {
 
152
            taskList = new ArrayList<TaskSummary>();
 
153
        }
 
154
        taskList.add(taskSummary);
 
155
    }
 
156
    
 
157
    /**
 
158
     *  Add a resource request to the job
 
159
     *  @param  name of the resource
 
160
     *  @param  value requested value of the resource
 
161
     */
 
162
    public void addRequest(String name, String value) {
 
163
        if (requestMap == null) {
 
164
            requestMap = new HashMap<String, String>();
 
165
        }
 
166
        requestMap.put(name, value);
 
167
    }
 
168
    
 
169
    /**
 
170
     *   <p>Get all resources which have been requested by this job.</p>
 
171
     *
 
172
     *   <p>recource requsts are specified by qsub with the -l option (see man qsub).</p>
 
173
     *
 
174
     *   @return set of resources names
 
175
     */
 
176
    public Set<String> getRequestNames() {
 
177
        if (requestMap == null) {
 
178
            return Collections.EMPTY_SET;
 
179
        } else {
 
180
            return requestMap.keySet();
 
181
        }
 
182
    }
 
183
    
 
184
    /**
 
185
     *  Get value of a requested resource
 
186
     *
 
187
     *  @param  name  name of the requested resource
 
188
     *  @return value of the requested resource
 
189
     */
 
190
    public String getRequestValue(String name) {
 
191
        if (requestMap == null) {
 
192
            return null;
 
193
        } else {
 
194
            return requestMap.get(name);
 
195
        }
 
196
    }
 
197
    
 
198
    /**
 
199
     *  Add a hard resource request to the job summary.
 
200
     *  @param name  name of the resource
 
201
     *  @param value requested value
 
202
     *  @param uc    jobs urgency contribution for this resource
 
203
     */
 
204
    public void addHardRequest(String name, String value, double uc) {
 
205
        if (hardRequestMap == null) {
 
206
            hardRequestMap = new HashMap<String, HardRequestValue>();
 
207
        }
 
208
        hardRequestMap.put(name, new HardRequestValue(name, value, uc));
 
209
    }
 
210
    
 
211
    /**
 
212
     *  Get a set of all hard requested resources.
 
213
     *  @return set of resource names
 
214
     */
 
215
    public Set<String> getHardRequestNames() {
 
216
        if (hardRequestMap == null) {
 
217
            return Collections.EMPTY_SET;
 
218
        } else {
 
219
            return hardRequestMap.keySet();
 
220
        }
 
221
    }
 
222
    
 
223
    /**
 
224
     *  Get a value of a hard requested resource
 
225
     *  @param name  name of the hard requested resource
 
226
     *  @return  the hard requested resource value (includes the
 
227
     *           requested value and the urgency contribution)
 
228
     */
 
229
    public HardRequestValue getHardRequestValue(String name) {
 
230
        if (hardRequestMap == null) {
 
231
            return null;
 
232
        } else {
 
233
            return hardRequestMap.get(name);
 
234
        }
 
235
    }
 
236
    
 
237
    /**
 
238
     *  Add a soft request to the job
 
239
     *  @param name  name of the requested resource
 
240
     *  @param value requested value
 
241
     */
 
242
    public void addSoftRequest(String name, String value) {
 
243
        if (softRequestMap == null) {
 
244
            softRequestMap = new HashMap<String, String>();
 
245
        }
 
246
        softRequestMap.put(name, value);
 
247
    }
 
248
    
 
249
    /**
 
250
     *  Get a set of all soft requested resources
 
251
     *  @return set of all soft requested resources
 
252
     */
 
253
    public Set<String> getSoftRequestNames() {
 
254
        if (softRequestMap == null) {
 
255
            return Collections.EMPTY_SET;
 
256
        } else {
 
257
            return softRequestMap.keySet();
 
258
        }
 
259
    }
 
260
    
 
261
    /**
 
262
     *  Get the value of a soft requested resource
 
263
     *  @param name name of the resource
 
264
     *  @return requested value
 
265
     */
 
266
    public String getSoftRequestValue(String name) {
 
267
        if (softRequestMap == null) {
 
268
            return null;
 
269
        } else {
 
270
            return softRequestMap.get(name);
 
271
        }
 
272
    }
 
273
    
 
274
    /**
 
275
     *   Add a hard requested queue
 
276
     *
 
277
     *   @param qname of the hard requested queue
 
278
     */
 
279
    public void addHardRequestedQueue(String qname) {
 
280
        if (hardRequestedQueueList == null) {
 
281
            hardRequestedQueueList = new ArrayList<String>();
 
282
        }
 
283
        hardRequestedQueueList.add(qname);
 
284
    }
 
285
    
 
286
    /**
 
287
     *  Get a list of all hard requested queues
 
288
     *  @return list of hard requested queues
 
289
     */
 
290
    public List<String> getHardRequestedQueues() {
 
291
        if (hardRequestedQueueList == null) {
 
292
            return Collections.EMPTY_LIST;
 
293
        } else {
 
294
            return Collections.unmodifiableList(hardRequestedQueueList);
 
295
        }
 
296
    }
 
297
    
 
298
    /**
 
299
     *  Add a soft requested queue
 
300
     *
 
301
     *  @param  qname name of the soft requested queue
 
302
     */
 
303
    public void addSoftRequestedQueue(String qname) {
 
304
        if (softRequestedQueueList == null) {
 
305
            softRequestedQueueList = new ArrayList<String>();
 
306
        }
 
307
        softRequestedQueueList.add(qname);
 
308
    }
 
309
    
 
310
    /**
 
311
     *  Get a list of all soft requested queues
 
312
     *  @return list of all soft requested queues
 
313
     */
 
314
    public List<String> getSoftRequestedQueues() {
 
315
        if (softRequestedQueueList == null) {
 
316
            return Collections.EMPTY_LIST;
 
317
        } else {
 
318
            return Collections.unmodifiableList(softRequestedQueueList);
 
319
        }
 
320
    }
 
321
    
 
322
    /**
 
323
     *  Adds a hard requested master queue to the job
 
324
     *  (see qsub -masterq).
 
325
     *
 
326
     *  @param qname  name of the hard requested master queue
 
327
     */
 
328
    public void addHardRequestedMasterQueue(String qname) {
 
329
        if (hardRequestedMasterQueueList == null) {
 
330
            hardRequestedMasterQueueList = new ArrayList<String>();
 
331
        }
 
332
        hardRequestedMasterQueueList.add(qname);
 
333
    }
 
334
    
 
335
    /**
 
336
     *  Get a list of all hard requested master queues
 
337
     *  @return list of all hard requested master queues
 
338
     */
 
339
    public List<String> getHardRequestedMasterQueues() {
 
340
        if (hardRequestedMasterQueueList == null) {
 
341
            return Collections.EMPTY_LIST;
 
342
        } else {
 
343
            return Collections.unmodifiableList(hardRequestedMasterQueueList);
 
344
        }
 
345
    }
 
346
    
 
347
    /**
 
348
     *  Add a soft requested master queue
 
349
     *  (see qsub -masterq)
 
350
     *  @param qname of the soft requested master queue
 
351
     */
 
352
    public void addSoftRequestedMasterQueue(String qname) {
 
353
        if (softRequestedMasterQueueList == null) {
 
354
            softRequestedMasterQueueList = new ArrayList<String>();
 
355
        }
 
356
        softRequestedMasterQueueList.add(qname);
 
357
    }
 
358
    
 
359
    /**
 
360
     *  Get a list of all soft requested master queues
 
361
     *  @return list of all soft requested master queues
 
362
     */
 
363
    public List getSoftRequestedMasterQueues() {
 
364
        if (softRequestedMasterQueueList == null) {
 
365
            return Collections.EMPTY_LIST;
 
366
        } else {
 
367
            return Collections.unmodifiableList(softRequestedMasterQueueList);
 
368
        }
 
369
    }
 
370
    
 
371
    /**
 
372
     *  add a requested predecessor to the job
 
373
     *  (predecessor of a job can be requested with
 
374
     *   qsub -hold_jid)
 
375
     *
 
376
     *  @param  name of the predecessor
 
377
     */
 
378
    public void addRequestedPredecessor(String name) {
 
379
        if (requestedPredecessorList == null) {
 
380
            requestedPredecessorList = new ArrayList<String>();
 
381
        }
 
382
        requestedPredecessorList.add(name);
 
383
    }
 
384
 
 
385
   /**
 
386
    *  add a requested array predecessor to the job
 
387
    *  (array predecessor of a job can be requested with
 
388
    *   qsub -hold_jid_ad)
 
389
    *
 
390
    *  @param  name of the array predecessor
 
391
    */
 
392
   public void addRequestedArrayPredecessor(String name) {
 
393
      if (requestedArrayPredecessorList == null) {
 
394
         requestedArrayPredecessorList = new ArrayList<String>();
 
395
      }
 
396
      requestedArrayPredecessorList.add(name);
 
397
   }
 
398
 
 
399
    
 
400
    /**
 
401
     * Get a list of all requested predecessors
 
402
     * @return list of requested predecessors job names
 
403
     */
 
404
    public List<String> getRequestedPredecessors() {
 
405
        if (requestedPredecessorList == null) {
 
406
            return Collections.EMPTY_LIST;
 
407
        } else {
 
408
            return Collections.unmodifiableList(requestedPredecessorList);
 
409
        }
 
410
    }
 
411
    
 
412
   /**
 
413
    * Get a list of all requested array predecessors
 
414
    * @return list of requested array predecessors job names
 
415
    */
 
416
   public List<String> getRequestedArrayPredecessors() {
 
417
      if(requestedArrayPredecessorList == null) {
 
418
         return Collections.EMPTY_LIST;
 
419
      } else {
 
420
         return Collections.unmodifiableList(requestedArrayPredecessorList);
 
421
      }
 
422
   }
 
423
 
 
424
    /**
 
425
     *  Add the job id of a predecessor
 
426
     *  @param job_id job id of the predecessor
 
427
     */
 
428
    public void addPredecessor(int job_id) {
 
429
        if (predecessorList == null) {
 
430
            predecessorList = new ArrayList<Integer>();
 
431
        }
 
432
        predecessorList.add(new Integer(job_id));
 
433
    }
 
434
    
 
435
   /**
 
436
    *  Add the job id of an array predecessor
 
437
    *  @param job_id job id of the array predecessor
 
438
    */
 
439
   public void addArrayPredecessor(int job_id) {
 
440
      if (arrayPredecessorList == null) {
 
441
         arrayPredecessorList = new ArrayList<Integer>();
 
442
      }
 
443
      arrayPredecessorList.add(new Integer(job_id));
 
444
   }
 
445
 
 
446
    /**
 
447
     *  Get a list of all predecessor job id
 
448
     *  @return list of job ids (java.lang.Integer)
 
449
     */
 
450
    public List<Integer> getPredecessors() {
 
451
        if (predecessorList == null) {
 
452
            return Collections.EMPTY_LIST;
 
453
        } else {
 
454
            return Collections.unmodifiableList(predecessorList);
 
455
        }
 
456
    }
 
457
    
 
458
    /**
 
459
     *  Get a list of all array predecessor job id
 
460
     *  @return list of job ids (java.lang.Integer)
 
461
     */
 
462
    public List<Integer> getArrayPredecessors() {
 
463
       if(arrayPredecessorList == null) {
 
464
          return Collections.EMPTY_LIST;
 
465
       } else {
 
466
          return Collections.unmodifiableList(arrayPredecessorList);
 
467
       }
 
468
    }
 
469
 
 
470
   /**
 
471
     *  Get the jobs total urgency value in normalized fashion.
 
472
     *  @return the jobs total urgency value in normalized fashion
 
473
     */
 
474
    public double getNormalizedUrgency() {
 
475
        return nurg;
 
476
    }
 
477
    
 
478
    /**
 
479
     * Set the jobs total urgency value in normalized fashion.
 
480
     * @param nurg the normalized total urgency
 
481
     */
 
482
    public void setNormalizedUrgency(double nurg) {
 
483
        this.nurg = nurg;
 
484
    }
 
485
    
 
486
    /**
 
487
     *  Get the total urgency of the job
 
488
     *  @return total urgency of the job
 
489
     */
 
490
    public double getUrgency() {
 
491
        return urg;
 
492
    }
 
493
    
 
494
    /**
 
495
     *  Set the total urgency of the job
 
496
     *  @param urg the total urgency
 
497
     */
 
498
    public void setUrgency(double urg) {
 
499
        this.urg = urg;
 
500
    }
 
501
    
 
502
    /**
 
503
     *  Get the priority of the job which has been
 
504
     *  requested by the user in normalized form
 
505
     *
 
506
     *  @return the normalized job priority
 
507
     */
 
508
    public double getNormalizedRequestedPriority() {
 
509
        return nppri;
 
510
    }
 
511
    
 
512
    /**
 
513
     *  Set the priority of the job which has been requested
 
514
     *  by the user in normalized form
 
515
     *  @param nppri requested priority in normalized
 
516
     */
 
517
    public void setNormalizedRequestedPriority(double nppri) {
 
518
        this.nppri = nppri;
 
519
    }
 
520
    
 
521
    /**
 
522
     *  Get the normalized priority of the job
 
523
     *  @return the normalized priority of the job
 
524
     */
 
525
    public double getNormalizedPriority() {
 
526
        return nprior;
 
527
    }
 
528
    
 
529
    /**
 
530
     *  Get the normalized priority of the job
 
531
     *  param nprior  the normalized priority
 
532
     */
 
533
    public void setNormalizedPriority(double nprior) {
 
534
        this.nprior = nprior;
 
535
    }
 
536
    
 
537
    /**
 
538
     *  Get the normalized total number of tickets
 
539
     *  @return the normalized total number of tickets
 
540
     */
 
541
    public double getNormalizedTickets() {
 
542
        return ntckts;
 
543
    }
 
544
    
 
545
    /**
 
546
     *  Set the normalized total number of tickets
 
547
     *  @param ntckts the normalized total number of tickets
 
548
     */
 
549
    public void setNormalizedTickets(double ntckts) {
 
550
        this.ntckts = ntckts;
 
551
    }
 
552
    
 
553
    /**
 
554
     * Get the urgency value contribution that  reflects the urgency
 
555
     * that is related to the jobs overall resource requirement.
 
556
     *
 
557
     * @return the urgency value contribution
 
558
     */
 
559
    public double getRrcontr() {
 
560
        return rrcontr;
 
561
    }
 
562
    
 
563
    /**
 
564
     * Set the urgency value contribution that  reflects the urgency
 
565
     * that is related to the jobs overall resource requirement.
 
566
     */
 
567
    public void setRrcontr(double rrcontr) {
 
568
        this.rrcontr = rrcontr;
 
569
    }
 
570
    
 
571
    /**
 
572
     * Get the urgency value contribution that reflects the
 
573
     * urgency related to the jobs waiting time.
 
574
     * @return the urgency value contribution
 
575
     */
 
576
    public double getWtcontr() {
 
577
        return wtcontr;
 
578
    }
 
579
    
 
580
    /**
 
581
     * Set the urgency value contribution that reflects the
 
582
     * urgency related to the jobs waiting time.
 
583
     * @param wtcontr the urgency value contribution
 
584
     */
 
585
    public void setWtcontr(double wtcontr) {
 
586
        this.wtcontr = wtcontr;
 
587
    }
 
588
    
 
589
    /**
 
590
     *  Get the urgency value contribution that reflects the
 
591
     *  urgency related to the jobs deadline initiation time.
 
592
     *  @return the urgency value contribution
 
593
     */
 
594
    public double getDlcontr() {
 
595
        return dlcontr;
 
596
    }
 
597
    
 
598
    /**
 
599
     *  Set the urgency value contribution that reflects the
 
600
     *  urgency related to the jobs deadline initiation time.
 
601
     *  @param dlcontr the urgency value contribution
 
602
     */
 
603
    public void setDlcontr(double dlcontr) {
 
604
        this.dlcontr = dlcontr;
 
605
    }
 
606
    
 
607
    /**
 
608
     *  Get the project of the job
 
609
     *  @return the project of the job
 
610
     */
 
611
    public String getProject() {
 
612
        return project;
 
613
    }
 
614
    
 
615
    /**
 
616
     *  Set the project of the job
 
617
     *  @param  project project of the job
 
618
     */
 
619
    public void setProject(String project) {
 
620
        this.project = project;
 
621
    }
 
622
    
 
623
    /**
 
624
     *  Get the department of the job
 
625
     *  @return the department of the job
 
626
     */
 
627
    public String getDepartment() {
 
628
        return department;
 
629
    }
 
630
    
 
631
    /**
 
632
     *  Set the department of the job
 
633
     *  @param department the department of the job
 
634
     */
 
635
    public void setDepartment(String department) {
 
636
        this.department = department;
 
637
    }
 
638
    
 
639
    /**
 
640
     *  Get the deadline of the job
 
641
     *  @return the deadline
 
642
     */
 
643
    public Date getDeadline() {
 
644
        return deadline;
 
645
    }
 
646
    
 
647
    /**
 
648
     *  Set the deadline of the job
 
649
     *  @param deadline the deadline of the job
 
650
     */
 
651
    public void setDeadline(Date deadline) {
 
652
        this.deadline = deadline;
 
653
    }
 
654
    
 
655
    /**
 
656
     *  Set the deadline of the job
 
657
     *  @param deadline the deadline of the job in millis
 
658
     */
 
659
    public void setDeadline(long deadline) {
 
660
        this.deadline = new Date(deadline);
 
661
    }
 
662
    
 
663
    /**
 
664
     *  Determine if the job has a cpu usage
 
665
     *  @return true of the job has a cpu usage
 
666
     */
 
667
    public boolean hasCpuUsage() {
 
668
        return hasCpuUsage;
 
669
    }
 
670
    
 
671
    /**
 
672
     *  Get the cpu usage of the job. If the jobs has no
 
673
     *  cpu usage, <code>0</code> is returned
 
674
     *  @return  the cpu usage of the job
 
675
     *  @see #hasCpuUsage
 
676
     */
 
677
    public int getCpuUsage() {
 
678
        return cpuUsage;
 
679
    }
 
680
    
 
681
    /**
 
682
     *  Set the cpu usage of the job
 
683
     *  @param cpuUsage the cpu usage
 
684
     */
 
685
    public void setCpuUsage(int cpuUsage) {
 
686
        this.cpuUsage = cpuUsage;
 
687
        hasCpuUsage = true;
 
688
    }
 
689
    
 
690
    /**
 
691
     *  Determine if the job has a memory usage
 
692
     *  @return <code>true</code> if the job has a memory usage
 
693
     */
 
694
    public boolean hasMemUsage() {
 
695
        return hasMemUsage;
 
696
    }
 
697
    
 
698
    /**
 
699
     *  Get the memory usage of the job. If the job has no memory
 
700
     *  usage <code>0</code> is returned.
 
701
     *
 
702
     *  @return the memory usage of the job
 
703
     *  @see #hasMemUsage
 
704
     */
 
705
    public double getMemUsage() {
 
706
        return memUsage;
 
707
    }
 
708
    
 
709
    /**
 
710
     *  Set the memory usage of the job
 
711
     *  @param memUsage the memory usage
 
712
     */
 
713
    public void setMemUsage(double memUsage) {
 
714
        this.memUsage = memUsage;
 
715
        hasMemUsage = true;
 
716
    }
 
717
    
 
718
    /**
 
719
     *  Determine if the job has a io usage
 
720
     *  @return true of the job has a io usage
 
721
     */
 
722
    public boolean hasIoUsage() {
 
723
        return hasIoUsage;
 
724
    }
 
725
    
 
726
    /**
 
727
     *  Get the io usage of the job. If the job has no io
 
728
     *  usage <code>0</code> is returned.
 
729
     *
 
730
     *  @return the io usage of the job
 
731
     *  @see #hasIoUsage
 
732
     */
 
733
    public double getIoUsage() {
 
734
        return ioUsage;
 
735
    }
 
736
    
 
737
    /**
 
738
     *  Set the io usage of the job.
 
739
     *  @param ioUsage the io usage of the job
 
740
     */
 
741
    public void setIoUsage(double ioUsage) {
 
742
        this.ioUsage = ioUsage;
 
743
        hasIoUsage = true;
 
744
    }
 
745
    
 
746
    /**
 
747
     *  Determine if the job is a zombie
 
748
     *  @return <code>false</code> if the job a zombie
 
749
     */
 
750
    public boolean isZombie() {
 
751
        return isZombie;
 
752
    }
 
753
    
 
754
    /**
 
755
     *  Set the zombie flag
 
756
     *  @param  isZombie the zombie flag
 
757
     */
 
758
    public void setZombie(boolean isZombie) {
 
759
        this.isZombie = isZombie;
 
760
    }
 
761
    
 
762
    /**
 
763
     *  Get the override tickets of the job
 
764
     *  @return the override tickets of the job
 
765
     */
 
766
    public long getOverrideTickets() {
 
767
        return overrideTickets;
 
768
    }
 
769
    
 
770
    /**
 
771
     *  Set the override tickets of the job
 
772
     *  @param overrideTickets the override tickets of the job
 
773
     */
 
774
    public void setOverrideTickets(long overrideTickets) {
 
775
        this.overrideTickets = overrideTickets;
 
776
    }
 
777
    
 
778
    /**
 
779
     *  Determine if the job is assigned to a queue
 
780
     *  @return <code>true</code> if the job is assigned to a queue
 
781
     */
 
782
    public boolean isQueueAssigned() {
 
783
        return isQueueAssigned;
 
784
    }
 
785
    
 
786
    /**
 
787
     *  Set the queue assigned falg
 
788
     *  @param isQueueAssigned the queue assigned flag
 
789
     */
 
790
    public void setQueueAssigned(boolean isQueueAssigned) {
 
791
        this.isQueueAssigned = isQueueAssigned;
 
792
    }
 
793
    
 
794
    /**
 
795
     *  Get the currently number of tickets of the job
 
796
     *  @return currently number of tickets
 
797
     */
 
798
    public long getTickets() {
 
799
        return tickets;
 
800
    }
 
801
    
 
802
    /**
 
803
     *  Set the currently number of tickets of the job
 
804
     *  @param tickets currently number of tickets
 
805
     */
 
806
    public void setTickets(long tickets) {
 
807
        this.tickets = tickets;
 
808
    }
 
809
    
 
810
    /**
 
811
     * Get the override portion of the total number of tickets
 
812
     * assigned to the job currently
 
813
     * @return override portion of the total number of tickets
 
814
     */
 
815
    public long getOtickets() {
 
816
        return otickets;
 
817
    }
 
818
    
 
819
    /**
 
820
     *  Set the override portion of the total number of tickets
 
821
     *  assigned to the job currently
 
822
     *  @param otickets the override portion of the total number of tickets
 
823
     */
 
824
    public void setOtickets(long otickets) {
 
825
        this.otickets = otickets;
 
826
    }
 
827
    
 
828
    /**
 
829
     *  Get the functional portion of the total number of tickets
 
830
     *  assigned to the job currently.
 
831
     *
 
832
     *  @return the functional portion of the total number of tickets
 
833
     */
 
834
    public long getFtickets() {
 
835
        return ftickets;
 
836
    }
 
837
    
 
838
    /**
 
839
     *  Set the functional portion of the total number of tickets
 
840
     *  assigned to the job currently.
 
841
     *
 
842
     *  @param ftickets the functional portion of the total number of tickets
 
843
     */
 
844
    public void setFtickets(long ftickets) {
 
845
        this.ftickets = ftickets;
 
846
    }
 
847
    
 
848
    /**
 
849
     * Get the share portion of the total number of tickets
 
850
     * assigned to the job currently.
 
851
     *
 
852
     * @return the share portion of the total number of tickets
 
853
     */
 
854
    public long getStickets() {
 
855
        return stickets;
 
856
    }
 
857
    
 
858
    /**
 
859
     * Set the share portion of the total number of tickets
 
860
     * assigned to the job currently.
 
861
     *
 
862
     * @param stickets the share portion of the total number of tickets
 
863
     */
 
864
    public void setStickets(long stickets) {
 
865
        this.stickets = stickets;
 
866
    }
 
867
    
 
868
    /**
 
869
     * Get the share of the total system to which the job is entitled currently.
 
870
     * @return the share of the job
 
871
     */
 
872
    public double getShare() {
 
873
        return share;
 
874
    }
 
875
    
 
876
    /**
 
877
     * Set the share of the total system to which the job is entitled currently.
 
878
     * @param share the share of the job
 
879
     */
 
880
    public void setShare(double share) {
 
881
        this.share = share;
 
882
    }
 
883
    
 
884
    /**
 
885
     *  Get the number of used slots
 
886
     *  @return the number of used slots
 
887
     */
 
888
    public int getSlots() {
 
889
        return slots;
 
890
    }
 
891
    
 
892
    /**
 
893
     *  Set the number of used slots
 
894
     *  @param slots the number of used slots
 
895
     */
 
896
    public void setSlots(int slots) {
 
897
        this.slots = slots;
 
898
    }
 
899
    
 
900
    /**
 
901
     *  Determine if the job is an array job
 
902
     *  @return <code>true</code> if the job is an array job
 
903
     */
 
904
    public boolean isArray() {
 
905
        return isArray;
 
906
    }
 
907
    
 
908
    /**
 
909
     *  Set the array job flag
 
910
     *  @param isArray the array job flag
 
911
     */
 
912
    public void setArray(boolean isArray) {
 
913
        this.isArray = isArray;
 
914
    }
 
915
    
 
916
    /**
 
917
     *  Determine if the job is running
 
918
     *  @return <code>true</code> of the job is running
 
919
     */
 
920
    public boolean isRunning() {
 
921
        return isRunning;
 
922
    }
 
923
    
 
924
    /**
 
925
     *  Set the is running flag
 
926
     *  @param isRunning the is running flag
 
927
     */
 
928
    public void setRunning(boolean isRunning) {
 
929
        this.isRunning = isRunning;
 
930
    }
 
931
    
 
932
    /**
 
933
     *  Get the name of the parallel environment of the job
 
934
     *  @return name of the parallel environment
 
935
     */
 
936
    public String getParallelEnvironmentName() {
 
937
        return parallelEnvironmentName;
 
938
    }
 
939
    
 
940
    /**
 
941
     *  Set the name of the parallel environment of the job
 
942
     *  @param parallelEnvironmentName name of the parallel environment
 
943
     */
 
944
    public void setParallelEnvironmentName(String parallelEnvironmentName) {
 
945
        this.parallelEnvironmentName = parallelEnvironmentName;
 
946
    }
 
947
    
 
948
    /**
 
949
     * Get the requested PE slot range.
 
950
     * @return the requested PE slot range
 
951
     */
 
952
    public String getParallelEnvironmentRange() {
 
953
        return parallelEnvironmentRange;
 
954
    }
 
955
    
 
956
    /**
 
957
     * Set the requested PE slot range.
 
958
     * @param parallelEnvironmentRange the requested PE slot range
 
959
     */
 
960
    public void setParallelEnvironmentRange(String parallelEnvironmentRange) {
 
961
        this.parallelEnvironmentRange = parallelEnvironmentRange;
 
962
    }
 
963
    
 
964
    /**
 
965
     *   Get the name of the granted PE
 
966
     *   @return name of the granted PE
 
967
     */
 
968
    public String getGrantedPEName() {
 
969
        return grantedPEName;
 
970
    }
 
971
    
 
972
    /**
 
973
     *   Set the name of the granted PE
 
974
     *   @param grantedPEName name of the granted PE
 
975
     */
 
976
    public void setGrantedPEName(String grantedPEName) {
 
977
        this.grantedPEName = grantedPEName;
 
978
    }
 
979
    
 
980
    /**
 
981
     *  Get the number of granted PE slots
 
982
     *  @return number of granted PE slots
 
983
     */
 
984
    public int getGrantedPESlots() {
 
985
        return grantedPESlots;
 
986
    }
 
987
    
 
988
    /**
 
989
     *  Set the number of granted PE slots
 
990
     *  @param grantedPESlots number of granted PE slots
 
991
     */
 
992
    public void setGrantedPESlots(int grantedPESlots) {
 
993
        this.grantedPESlots = grantedPESlots;
 
994
    }
 
995
    
 
996
    /**
 
997
     *  Get the checkpoint environment of the job
 
998
     *  @return the checkpoint environment of the job
 
999
     */
 
1000
    public String getCheckpointEnv() {
 
1001
        return checkpointEnv;
 
1002
    }
 
1003
    
 
1004
    /**
 
1005
     *  Set the checkpoint environment of the job
 
1006
     *  @param checkpointEnv the checkpoint environment of the job
 
1007
     */
 
1008
    public void setCheckpointEnv(String checkpointEnv) {
 
1009
        this.checkpointEnv = checkpointEnv;
 
1010
    }
 
1011
}