org.edg.data.reptor.optimization
Class OptimizationService

java.lang.Object
  extended byorg.edg.data.reptor.optimization.OptimizationService

public class OptimizationService
extends java.lang.Object

This optimiser finds the 'best' replica of the required file based on transfer latencies.

Version:
$Id: OptimizationService.java,v 1.3 2004/05/13 10:31:48 jamesc Exp $
Author:
Kurt Stockinger, Heinz Stockinger, Peter Kunszt
See Also:
Design of a Replica Optimisation Framework

Constructor Summary
OptimizationService(org.edg.data.ros.EdgReplicaOptimization ros, boolean isVerbose)
          Constructor.
 
Method Summary
static OptimizationService create(Configuration config)
          Create a new, correctly configured Optimization Service.
 org.edg.data.ros.AccessCost[] getAccessCost(org.edg.data.ros.ROSFile[] fileList, ComputingElementInfo[] ce, java.lang.String[] protocol)
          Calculates the expected cost of accessing all the files specified by logicalName from each Computing Element host specified by ceHosts.
 java.net.URI listBestFile(org.edg.data.ros.ROSFile replicaList, java.lang.String seHost)
          List best replica out of a set of files for a given SE host.
 java.lang.String ping()
          Send a contact message to the Optor server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptimizationService

public OptimizationService(org.edg.data.ros.EdgReplicaOptimization ros,
                           boolean isVerbose)
Constructor. Connects to the service and sets the verbosity flag.

Method Detail

create

public static OptimizationService create(Configuration config)
                                  throws InfoServiceException,
                                         CatalogCommunicationException
Create a new, correctly configured Optimization Service. This is dependant upon configuration in the Configuration object.

Parameters:
config - the Configuration
Returns:
the correctly configured OptimizationService
Throws:
InfoServiceException - if we can't locate a remote EdgReplicaOptimization Service in the Information System
CatalogCommunicationException - if we can't connect to the given EdgReplicaOptimization service

getAccessCost

public org.edg.data.ros.AccessCost[] getAccessCost(org.edg.data.ros.ROSFile[] fileList,
                                                   ComputingElementInfo[] ce,
                                                   java.lang.String[] protocol)
                                            throws OptorException
Calculates the expected cost of accessing all the files specified by logicalName from each Computing Element host specified by ceHosts.

Parameters:
fileList - the array of ROSFile objects, each a logical identifier with the full set of replicas and its size
ce - the array of ComputingElementInfo objects.
protocol - the array of transport protocols to be used.
Returns:
The AccessCost array in same order as ce array
Throws:
OptorException
See Also:
Design of a Replica Optimisation Framework

listBestFile

public java.net.URI listBestFile(org.edg.data.ros.ROSFile replicaList,
                                 java.lang.String seHost)
                          throws OptorException
List best replica out of a set of files for a given SE host.

Parameters:
replicaList - the ROSFile object that contains the list of replicas to the file.
seHost - the host of the StorageElement to consider to access any of the replicas from
Returns:
the URI of the best replica out of the list.
Throws:
OptorException
See Also:
Design of a Replica Optimisation Framework

ping

public java.lang.String ping()
                      throws OptorException
Send a contact message to the Optor server

Throws:
OptorException