|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.bnl.star.offline.scheduler.policy.FileAssignment
public class FileAssignment
Constructor Summary | |
---|---|
FileAssignment(int minFiles,
int maxFiles)
Create a new empty distribution, specifying the limits on how many files to assign to a single process |
Method Summary | |
---|---|
void |
add(Location location,
PhysicalFile file)
Assigns the file to the location. |
void |
add(PhysicalFile file)
Adds the file to the assignment, the host is used as location |
void |
addAll(FileAssignment assignment)
Adds an entire FileAssignment to the present. |
void |
addAllPhysical(java.util.Collection col)
Adds a list of files to the assignment. |
void |
addAllPhysical(Location location,
java.util.Collection col)
Adds a list of files to the specified location. |
int |
canAdd(Location location)
Returns how many files can be assigned to the location without changing the number of processes. |
int |
canRemove(Location location)
Returns how many files can be deassigned to the location without changing the number of processes. |
java.util.List |
getFiles(Location location)
Returns a list of URL of the files assigned to that location (a location can be a set of nodes). |
java.util.List |
getFiles(Location location,
int processIndex)
Returns the list of files assigned to a particular process of one location. |
java.util.List |
getInvalidLocations()
Returns the list of locations on which the files can't be divided in valid processes. |
java.util.Set |
getLocations()
Returns the locations to which something was assigned. |
java.lang.String |
getReport()
A full description of the current assignment, in a human readable form, contaning the number of files and processes for all the locations. |
java.lang.String |
getSummary()
Returns a printable summary of the current assignment, stating the total number of locations, and the number of invalid locations. |
boolean |
isValid()
True if the correct assignment can be divided into processes and dispatched correctly. |
boolean |
isValid(Location location)
True if the files assigned to the location can be divided in to a valid process. |
int |
minProcs(Location location)
Returns the minimum number of process to dispatch on the location to cover all the files. |
int |
needsLessFiles(Location location)
Returns how many files are to be deassigned from the location to make the assignment valid. |
int |
needsMoreFiles(Location location)
Returns how many are to be assigned to the location to make the assignment valid. |
void |
orderFiles(java.util.Comparator comp)
|
void |
remove(Location location,
PhysicalFile file)
Removes the file from the location. |
void |
removeAllPhysical(Location location,
java.util.Collection col)
Removes a set of file a location. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileAssignment(int minFiles, int maxFiles)
minFiles
- minimum number of files to assign to a processmaxFiles
- maximum number of files to assign to a processMethod Detail |
---|
public boolean isValid()
public boolean isValid(Location location)
location
- location to check
public java.util.List getInvalidLocations()
public java.lang.String getSummary()
public java.lang.String getReport()
public int minProcs(Location location)
location
- the location in the assignment
public int needsMoreFiles(Location location)
location
- the location to check
public int needsLessFiles(Location location)
location
- the location to check
public int canAdd(Location location)
location
- location to check
public int canRemove(Location location)
location
- location to check
public java.util.Set getLocations()
public java.util.List getFiles(Location location)
location
- the location to check
public java.util.List getFiles(Location location, int processIndex)
location
- the location to checkprocessIndex
- the process number
public void add(PhysicalFile file)
file
- the URL of the filepublic void add(Location location, PhysicalFile file)
location
- the location to which to assign the filefile
- the URL of the filepublic void addAll(FileAssignment assignment)
assignment
- the assignment to add to thispublic void addAllPhysical(java.util.Collection col)
col
- a Collection of PhysicalFile objectspublic void addAllPhysical(Location location, java.util.Collection col)
location
- the location to which to add tocol
- a Collection of PhysicalFile objectspublic void remove(Location location, PhysicalFile file)
location
- the location from which to remove the filefile
- the file to removepublic void removeAllPhysical(Location location, java.util.Collection col)
public void orderFiles(java.util.Comparator comp)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |