|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The ReplicaManager interface defines all methods that can be called by a client using the edg-replica-manager Reptor. This is the primary API that should be used by all client applications.
Method Summary | |
void |
addAlias(java.net.URI guid,
java.net.URI lfn)
Add an alias LFN to a known GUID. |
java.net.URI |
copyAndRegisterFile(java.net.URI source,
java.net.URI dest,
java.net.URI logicalName,
java.lang.String protocol,
int nstreams)
This method performs the task of copying a file into grid-aware storage and registering the copy in the Replica Catalog as an atomic operation. |
void |
copyFile(java.net.URI source,
java.net.URI dest,
java.lang.String protocol,
int nstreams,
boolean force)
Copies a physical file from source to
destination using the specified transport
mechanism. |
void |
deleteFile(java.net.URI file,
java.lang.String seHost,
boolean all_available)
Delete a file from storage and unregister it. |
org.edg.data.ros.AccessCost[] |
getAccessCost(java.net.URI[] logicalName,
java.lang.String[] ces,
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 |
getBestFile(java.net.URI logicalName,
java.lang.String seHost,
java.lang.String protocol,
java.lang.String turlProtocol,
int nstreams)
Return the storage file name (SURL) of the best file in terms of network latencies. |
java.net.URI |
getTurl(java.net.URI surl,
java.lang.String protocol)
Retrieve the Transfer URL (TURL) for a given Storage URL (SURL), using the given protocol. |
java.net.URI |
listBestFile(java.net.URI logicalName,
java.lang.String seHost)
Return the 'best' replica for a given logical file identifier. |
java.net.URI |
listGUID(java.net.URI file)
Returns the GUID of the given LFN or SURL. |
java.util.Set |
listLocalReplicas(java.net.URI file)
Returns the set of all local replicas of the file name that may be an LFN, GUID or SURL. |
java.util.Set |
listReplicas(java.net.URI file)
Returns the Set of all known replicas of the file name that may be an LFN, GUID or SURL. |
java.net.URI |
registerEntry(java.net.URI file,
java.net.URI logicalName)
Deprecated. |
java.net.URI |
registerFile(java.net.URI file,
java.net.URI logicalName)
Register a file in the Replica Catalog that is already stored on a Storage Element. |
java.net.URI |
registerGUID(java.net.URI surl,
java.net.URI guid)
Register a file in the Replica Catalog with a known GUID. |
void |
removeAlias(java.net.URI guid,
java.net.URI lfn)
Remove an alias LFN from a known GUID. |
java.net.URI |
replicateFile(java.net.URI source,
java.net.URI dest,
java.lang.String protocol,
int nstreams)
This method performs the task of replicating a file between grid-aware stores and registering the replica in the Replica Catalog as an atomic operation. |
void |
unregisterEntry(java.net.URI file,
java.net.URI logicalName)
Deprecated. |
void |
unregisterFile(java.net.URI surl,
java.net.URI guid)
Unregister a file from the Replica Catalog. |
Method Detail |
public java.net.URI registerEntry(java.net.URI file, java.net.URI logicalName) throws CatalogCommunicationException, InvalidInfoException, java.io.FileNotFoundException, AlreadyRegisteredException, InvalidFileNameException, SurlExistsException, LfnExistsException, InfoServiceException, StorageResourceException, org.edg.data.util.InvalidFileTypeException
CatalogCommunicationException
InvalidInfoException
java.io.FileNotFoundException
AlreadyRegisteredException
InvalidFileNameException
SurlExistsException
LfnExistsException
InfoServiceException
StorageResourceException
org.edg.data.util.InvalidFileTypeException
public java.net.URI registerFile(java.net.URI file, java.net.URI logicalName) throws InvalidFileNameException, java.io.FileNotFoundException, InfoServiceException, CatalogCommunicationException, AlreadyRegisteredException, LfnExistsException, InvalidInfoException, SurlExistsException, StorageResourceException, org.edg.data.util.InvalidFileTypeException
srm://storage.element.host/vopath/file.name
The logical
name is optional, it may declare a logical identifier that can
be used later to look up any instance of the file. The method
returns the GUID, the Grid Unique IDentifier of the file. The
detailed semantics are:
This method does not include any data movement (i.e. the storage file is not copied) and assumes that the storage file is already located at a known Storage Element.
file
- the file. It must be a valid
Storage File Name, i.e. the host part of the given URI needs
to be a recognized Storage Element.logicalName
- the logical name to be used in the catalog
to find the file again. If this parameter is null
,
an automatic name is generated and used.
InvalidFileNameException
- if file is not valid or the SE is not found
java.io.FileNotFoundException
- if file does not exist
InfoServiceException
CatalogCommunicationException
AlreadyRegisteredException
LfnExistsException
InvalidInfoException
SurlExistsException
StorageResourceException
org.edg.data.util.InvalidFileTypeException
public java.net.URI registerGUID(java.net.URI surl, java.net.URI guid) throws InvalidFileNameException, java.io.FileNotFoundException, InfoServiceException, CatalogCommunicationException, SurlExistsException, InvalidInfoException, StorageResourceException, org.edg.data.util.InvalidFileTypeException
srm://storage.element.host/vopath/file.name
The GUID is the GUID that this file should be registered with
for the case if the file was copied by other means. (TruckFTP
use case). While there is only one centralized catalog, there
is no need for this method, but if the catalogs are not
centralized, this method can be used to register a file with a
known GUID. Be careful, if the GUID corresponds to a wrong file
in the remote (probably unattainable) catalogs then once the
connection is established, the distributed catalog will
inconsistent data.
This method can also be used to register a second replica in
the same LRC, usually this does not happen.
surl
- the file. It must be a valid
Storage File Name, i.e. the host part of the given URI needs
to be a recognized Storage Element.guid
- the GUID to be used in the catalog
to find the file again.
InvalidFileNameException
- if file is not valid or the SE is not found
java.io.FileNotFoundException
- if file does not exist
InfoServiceException
CatalogCommunicationException
SurlExistsException
InvalidInfoException
StorageResourceException
org.edg.data.util.InvalidFileTypeException
public java.net.URI getTurl(java.net.URI surl, java.lang.String protocol) throws InvalidFileNameException, java.io.FileNotFoundException, InfoServiceException, InvalidInfoException, StorageResourceException, FileHandleException, org.edg.data.util.InvalidFileTypeException
surl
- the file. It must be a valid
Storage File Name, i.e. the host part of the given URI needs
to be a recognized Storage Element.protocol
- The protocol for the TURL (either 'file', 'gsiftp'/'gridftp' or 'rfio'.
InvalidFileNameException
- if file is not valid or the SE is not found
java.io.FileNotFoundException
- if the file does not exist.
InfoServiceException
InvalidInfoException
StorageResourceException
FileHandleException
org.edg.data.util.InvalidFileTypeException
public void addAlias(java.net.URI guid, java.net.URI lfn) throws CatalogCommunicationException, org.edg.data.util.InvalidFileTypeException, GUIDDoesNotExistException, LfnExistsException
guid
- GUID to add new alias forlfn
- the new LFN
CatalogCommunicationException
org.edg.data.util.InvalidFileTypeException
GUIDDoesNotExistException
LfnExistsException
public void unregisterEntry(java.net.URI file, java.net.URI logicalName) throws CatalogCommunicationException, java.io.FileNotFoundException, InvalidFileNameException, GUIDDoesNotExistException, org.edg.data.util.InvalidFileTypeException
CatalogCommunicationException
java.io.FileNotFoundException
InvalidFileNameException
GUIDDoesNotExistException
org.edg.data.util.InvalidFileTypeException
public void unregisterFile(java.net.URI surl, java.net.URI guid) throws InvalidFileNameException, CatalogCommunicationException, GUIDDoesNotExistException, java.io.FileNotFoundException, org.edg.data.util.InvalidFileTypeException
This method does not include any data deletion (i.e. the storage file is not removed).
surl
- the storage file to unregister. It must be a valid
Storage File Name, i.e. the host part of the given URI needs
to be a recognized Storage Element.guid
- the GUID
InvalidFileNameException
- if file is not valid or the SE is not found
CatalogCommunicationException
- if there was an error in contacting the LRC
GUIDDoesNotExistException
- if the GUID was not found in the catalog
java.io.FileNotFoundException
- if file does not exist
org.edg.data.util.InvalidFileTypeException
public void removeAlias(java.net.URI guid, java.net.URI lfn) throws CatalogCommunicationException, org.edg.data.util.InvalidFileTypeException, GUIDDoesNotExistException
guid
- GUID to remove the alias fromlfn
- the LFN
CatalogCommunicationException
org.edg.data.util.InvalidFileTypeException
GUIDDoesNotExistException
public void copyFile(java.net.URI source, java.net.URI dest, java.lang.String protocol, int nstreams, boolean force) throws CatalogCommunicationException, FileHandleException, InvalidFileNameException, java.io.FileNotFoundException, InfoServiceException, ConfigurationException, FileCopierException, LfnDoesNotExistException, org.edg.data.util.InvalidFileTypeException
source
to
destination
using the specified transport
mechanism. This action does not involve any updates to the
replica catalogs as the destination cannot be a grid-aware
store, in order to avoid catalog
corruption. copyAndRegisterFile needs to be used for that
purpose, i.e. to bring a file into the grid. The destination
does not accept GUIDs, LFNs or SURLs. As said, for those cases
copyAndRegisterFile or replicateFile needs to be used.
It provides all the capability of globus-url-copy and more,
accepting also GUIDs, LFNs and SURLs as the source file. Since
the destination is not on grid-storage, the destination file
will not be registered in the catalog.
Example: To get a local copy of a grid file, the source
file can be specified as a GUID or LFN and the destination file
as a local file. The result will be that the file will be
copied 'out of the grid' to the local file. Local file URIs need
to have the 'file' scheme.
source
- the source file. source
may be one
of the following:
dest
- the physical destination file. Must be one
of the following:
protocol
- the protocol to be used. This parameter is only
considered if the source is specified using an SURL, LFN or
GUID. If it's not set (i.e. null
), the default
protocol is used as specified in the configuration file.nstreams
- the number of streams to be used (if the
protocol supports multiple streams, otherwise this parameter
has no effect). If it's set <= 0 the default number of streams
is used as specified in the configuration file.force
- is the flag that specifies whether the destination
should be overwritten or not. If false, the destination will not
be overwritten if it exists, but an error will be thrown.
InvalidFileNameException
- if the source or destination file are invalid
java.io.FileNotFoundException
- if the source cannot be found
CatalogCommunicationException
- if the RLS or RMC could not be contacted
ConfigurationException
- if there is a configuration problem
InfoServiceException
- if the info service cannot be contacted or has an error
FileHandleException
- if there is a problem with source
or destination
FileCopierException
- if the copy operation fails
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
ReplicaManagerImpl.copyAndRegisterFile(java.net.URI, java.net.URI, java.net.URI, java.lang.String, int)
public java.net.URI copyAndRegisterFile(java.net.URI source, java.net.URI dest, java.net.URI logicalName, java.lang.String protocol, int nstreams) throws InvalidFileNameException, InfoServiceException, ConfigurationException, FileHandleException, FileCopierException, CatalogCommunicationException, DestinationExistsException, LfnExistsException, java.io.FileNotFoundException, StorageResourceException, org.edg.data.util.InvalidFileTypeException
destination
must refer to a Storage Element just
like for replicateFile. The difference to replicateFile is that
the latter requires the source
to be a valid grid
file descriptor, i.e. either an LFN, GUID or other SURL, while
copyAndRegisterFile does explicitly forbid such sources and
accepts only non-grid files. For files already in the grid,
replicateFile should be used.
The method returns the GUID of the new entry.
source
- the file to be registered. It must
be accessible through this name using the specified protocol in
the URI. The source
may be:
dest
- (optional) The physical destination
file. dest
may be specified in three
different ways:
null
, the 'closest' SE is located and the file is
stored as in the previous case.
logicalName
- (optional) The logical name to be used in the catalog
to find the file again. If this parameter is null
,
only the GUID is used.protocol
- (optional) The protocol to be used (can be null in which
case the default protocol for the given SE is used)nstreams
- (optional) The number of parallel streams to be used for
the copy. If zero or less than zero, the default is used.
java.io.FileNotFoundException
- if source does not exist
DestinationExistsException
- if destination already exists
FileCopierException
- if the copy operation fails
InvalidFileNameException
- if source or destination name is not valid
CatalogCommunicationException
- if the catalogs to register the file cannot be contacted
LfnExistsException
- if the LFN that the file should be registered with already exists
FileHandleException
- if there is some problem with source or destination
ConfigurationException
- if there is a configuration problem
InfoServiceException
- if there is problem with the information services.
StorageResourceException
org.edg.data.util.InvalidFileTypeException
ReplicaManagerImpl.replicateFile(java.net.URI, java.net.URI, java.lang.String, int)
,
ReplicaManagerImpl.copyFile(java.net.URI, java.net.URI, java.lang.String, int, boolean)
,
ReplicaManagerImpl.registerFile(java.net.URI, java.net.URI)
public java.net.URI replicateFile(java.net.URI source, java.net.URI dest, java.lang.String protocol, int nstreams) throws java.io.FileNotFoundException, InvalidFileNameException, FileHandleException, FileCopierException, InfoServiceException, ConfigurationException, CatalogCommunicationException, GUIDDoesNotExistException, InvalidInfoException, StorageResourceException, IllegalArgumentException, SurlDoesNotExistException, LfnDoesNotExistException, org.edg.data.util.InvalidFileTypeException
source
and destination
must
refer to a Storage Element.
The method returns the GUID of the entry upon success or throws
an appropriate exception upon failure.
source
- the file to be replicated. The source
may be:
dest
- The physical destination. dest
may be
specified in three different ways: null
, the 'closest' SE is located
and the file is replicated to it as in the previous case (if it's not
already available there). protocol
- (optional) The protocol to be used (can be null in
which case the default protocol for the given destination SE is used)nstreams
- (optional) The number of parallel streams to be used
for the copy. If zero or less than zero, the default is used.
java.io.FileNotFoundException
- if source does not exist
GUIDDoesNotExistException
- if source is in the catalog but has no GUID -
this means the catalog is corrupted
InvalidFileNameException
- if source or destination is not
valid
FileHandleException
- if there is a problem with source or
destination
FileCopierException
- if the copy operation fails.
InfoServiceException
ConfigurationException
CatalogCommunicationException
InvalidInfoException
StorageResourceException
IllegalArgumentException
SurlDoesNotExistException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
ReplicaManagerImpl.copyAndRegisterFile(java.net.URI, java.net.URI, java.net.URI, java.lang.String, int)
public void deleteFile(java.net.URI file, java.lang.String seHost, boolean all_available) throws IllegalArgumentException, InfoServiceException, ConfigurationException, InvalidFileNameException, CatalogCommunicationException, GUIDDoesNotExistException, FileHandleException, SurlDoesNotExistException, LfnDoesNotExistException, org.edg.data.util.InvalidFileTypeException
file
- GUID or SURL of the file to be deleted.seHost
- if GUID is given, this indicates from
which SE the replica should be removed. It needn't be given for an SURL.all_available
- boolean flag indicating whether all available instances should
be removed (only if file is a GUID). This is best efffort.
GUIDDoesNotExistException
- if the given file is not a valid GUID or has no GUID
InvalidFileNameException
- if file is not a valid SURL or GUID
FileHandleException
- if there is a problem with contacting the SE
ConfigurationException
- if there is a problem with the configuration
CatalogCommunicationException
- if there is a problem with the communication with LRC or RMC
IllegalArgumentException
InfoServiceException
SurlDoesNotExistException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
public java.util.Set listReplicas(java.net.URI file) throws CatalogCommunicationException, java.io.FileNotFoundException, InvalidFileNameException, IllegalArgumentException, GUIDDoesNotExistException, SurlDoesNotExistException, LfnDoesNotExistException, org.edg.data.util.InvalidFileTypeException
file
- LFN, GUID or SURL of the file to get
CatalogCommunicationException
java.io.FileNotFoundException
InvalidFileNameException
IllegalArgumentException
GUIDDoesNotExistException
SurlDoesNotExistException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
public java.util.Set listLocalReplicas(java.net.URI file) throws CatalogCommunicationException, java.io.FileNotFoundException, InvalidFileNameException, IllegalArgumentException, GUIDDoesNotExistException, SurlDoesNotExistException, LfnDoesNotExistException, org.edg.data.util.InvalidFileTypeException
file
- LFN, GUID or SURL of the file to get
CatalogCommunicationException
java.io.FileNotFoundException
InvalidFileNameException
IllegalArgumentException
GUIDDoesNotExistException
SurlDoesNotExistException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
public java.net.URI listGUID(java.net.URI file) throws InvalidFileNameException, CatalogCommunicationException, java.io.FileNotFoundException, GUIDDoesNotExistException, IllegalArgumentException, SurlDoesNotExistException, LfnDoesNotExistException, org.edg.data.util.InvalidFileTypeException
file
- LFN or SURL of the file to get the GUID of.
InvalidFileNameException
CatalogCommunicationException
java.io.FileNotFoundException
GUIDDoesNotExistException
IllegalArgumentException
SurlDoesNotExistException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
public java.net.URI listBestFile(java.net.URI logicalName, java.lang.String seHost) throws InfoServiceException, ConfigurationException, CatalogCommunicationException, InvalidFileNameException, IllegalArgumentException, LfnDoesNotExistException, org.edg.data.util.InvalidFileTypeException
logicalName
- logical file name or GUID of the file to get
the cheapest replica of.seHost
- the reference Storage Element. If this is null,
the default SE will be taken.
InfoServiceException
ConfigurationException
CatalogCommunicationException
InvalidFileNameException
IllegalArgumentException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
public org.edg.data.ros.AccessCost[] getAccessCost(java.net.URI[] logicalName, java.lang.String[] ces, java.lang.String[] protocol) throws InvalidFileNameException, InfoServiceException, CatalogCommunicationException, OptorException, IllegalArgumentException, LfnDoesNotExistException, org.edg.data.util.InvalidFileTypeException
logicalName
- the array of LFNs or GUIDs.ces
- the array of ComputingElement hosts.protocol
- the array of transport protocols to be used.
AccessCost
array in same order as
ce
array
InvalidFileNameException
- if one of the logicalNames is not an lfn.
InfoServiceException
- if there has been a communication problem with an info service
CatalogCommunicationException
- if the LRC, RMC or ROS could not be contacted
OptorException
- if there has been a problem with the ROS call
IllegalArgumentException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
public java.net.URI getBestFile(java.net.URI logicalName, java.lang.String seHost, java.lang.String protocol, java.lang.String turlProtocol, int nstreams) throws InvalidFileNameException, InfoServiceException, ConfigurationException, IllegalArgumentException, CatalogCommunicationException, GUIDDoesNotExistException, InvalidInfoException, java.io.FileNotFoundException, FileHandleException, FileCopierException, StorageResourceException, LfnDoesNotExistException, org.edg.data.util.InvalidFileTypeException
logicalName
- the LFN or GUID of the file to find the best replica of.seHost
- destination StorageElement.protocol
- The protocol that will be used to replicate the fileturlProtocol
- The protocol that the TURL will be returned as.
InvalidFileNameException
InfoServiceException
ConfigurationException
IllegalArgumentException
CatalogCommunicationException
GUIDDoesNotExistException
InvalidInfoException
java.io.FileNotFoundException
FileHandleException
FileCopierException
StorageResourceException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |