ZetaGrid v1.9

zeta
Class WorkUnitManager

java.lang.Object
  |
  +--zeta.WorkUnitManager

public class WorkUnitManager
extends java.lang.Object


Field Summary
private  java.util.Set activeWorkUnits
           
private  int completedLocalWorkUnits
           
private  int exitAfterWorkUnits
           
private  boolean exitAfterWorkUnitsActive
           
private  boolean offline
           
private  java.util.Set possibleWorkUnits
           
private  ZetaProperties properties
          Contains a persistent set of the ZetaGrid properties.
private  java.util.Set storeWorkUnits
           
private  Task task
           
private  int wait
           
 
Constructor Summary
WorkUnitManager(Task task)
           
 
Method Summary
private  boolean checkAvailDiskSpace(java.lang.String src, java.io.File dest)
           
private  void cleanWorkUnits(java.util.List workUnitFiles)
          Deletes local work unit files.
private  java.lang.String getKey()
          Returns a unique key of this computer.
private  int getNumberOfActiveWorkUnits()
           
 WorkUnit getWorkUnit()
           
private  int numberOfCompletedLocalWorkUnits()
           
private  int numberOfLocalWorkUnits(long notOlderThanMillis)
           
private  boolean requestNewWorkUnits()
           
private  void retrievePossibleWorkUnits()
           
private  int storeCompletedWorkUnits(boolean outputExceptions)
           
private  boolean storeData(WorkUnit workUnit, boolean outputExceptions)
           
private  void storePossibleWorkUnits(java.io.BufferedReader workUnits)
           
 void submit(WorkUnit workUnit, boolean exitAfterTransfer, boolean outputExceptions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

private ZetaProperties properties
Contains a persistent set of the ZetaGrid properties.


task

private Task task

possibleWorkUnits

private java.util.Set possibleWorkUnits

activeWorkUnits

private java.util.Set activeWorkUnits

storeWorkUnits

private java.util.Set storeWorkUnits

offline

private boolean offline

completedLocalWorkUnits

private int completedLocalWorkUnits

exitAfterWorkUnits

private int exitAfterWorkUnits

exitAfterWorkUnitsActive

private boolean exitAfterWorkUnitsActive

wait

private int wait
Constructor Detail

WorkUnitManager

public WorkUnitManager(Task task)
Method Detail

getWorkUnit

public WorkUnit getWorkUnit()

submit

public void submit(WorkUnit workUnit,
                   boolean exitAfterTransfer,
                   boolean outputExceptions)

storeData

private boolean storeData(WorkUnit workUnit,
                          boolean outputExceptions)

storeCompletedWorkUnits

private int storeCompletedWorkUnits(boolean outputExceptions)
Returns:
number of completed work units which are stored successfully at the server, -1 if an error occurs and no work unit is stored

requestNewWorkUnits

private boolean requestNewWorkUnits()

getNumberOfActiveWorkUnits

private int getNumberOfActiveWorkUnits()

numberOfLocalWorkUnits

private int numberOfLocalWorkUnits(long notOlderThanMillis)
Returns:
0 if all local work units are older than the specified time.

numberOfCompletedLocalWorkUnits

private int numberOfCompletedLocalWorkUnits()

cleanWorkUnits

private void cleanWorkUnits(java.util.List workUnitFiles)
Deletes local work unit files. A log file will only be deleted if it is inside the specified list and the last modified timestamp is older than one day or the result file for the same completed work unit as the log file does not exist. Deletes all result files which work unit has no log file.

Parameters:
workUnitFiles - list of work unit logfile names which can be deleted

checkAvailDiskSpace

private boolean checkAvailDiskSpace(java.lang.String src,
                                    java.io.File dest)
                             throws java.io.IOException
java.io.IOException

retrievePossibleWorkUnits

private void retrievePossibleWorkUnits()

storePossibleWorkUnits

private void storePossibleWorkUnits(java.io.BufferedReader workUnits)

getKey

private java.lang.String getKey()
Returns a unique key of this computer.

Returns:
a unique key of this computer.

ZetaGrid v1.9

For further technical papers, see ZetaGrid Technical Documentation.
 
Copyright © 2001,2002 Sebastian Wedeniwski. All Rights Reserved.