| java.lang.Object org.griphyn.common.catalog.replica.MRC
MRC | public class MRC implements ReplicaCatalog(Code) | | A multiple replica catalog implementation that allows users to query
different multiple catalogs at the same time.
To use it set
pegasus.catalog.replica MRC
Each associated replica catalog can be configured via properties as follows.
The user associates a variable name referred to as [value]
for each of the catalogs, where [value] is any legal identifier
(concretely [A-Za-z][_A-Za-z0-9]*)
For each associated replica catalogs the user specifies the following
properties.
pegasus.catalog.replica.mrc.[value] to specify the type of replica catalog.
pegasus.catalog.replica.mrc.[value].key to specify a property name key for a
particular catalog
For example, if a user wants to query two lrc's at the same time he/she
can specify as follows
pegasus.catalog.replica.mrc.lrc1 LRC
pegasus.catalog.replica.mrc.lrc2.url rls://sukhna
pegasus.catalog.replica.mrc.lrc2 LRC
pegasus.catalog.replica.mrc.lrc2.url rls://smarty
In the above example, lrc1, lrc2 are any valid identifier names and url is
the property key that needed to be specified.
author: Karan Vahi version: $Revision: 429 $ |
Field Summary | |
final public static String | PROPERTY_PREFIX The prefix for the property subset for connecting to the individual
catalogs. | final public static String | TYPE_KEY The property key that designates the type of replica catalog to connect
to. | protected LogManager | mLogger The handle to the logging manager. | protected List | mRCList The list of replica catalogs that need to be queried for. |
Constructor Summary | |
public | MRC() The default constructor. |
Method Summary | |
public int | clear() Removes everything from the catalogs. | public void | close() Explicitely free resources before the garbage collection hits. | public boolean | connect(Properties props) Establishes a link between the implementation and the thing the
implementation is build upon.
Parameters: props - contains all necessary data to establish the link. | protected boolean | connect(String name, Properties properties) Connects to an individual replica catalog. | public int | delete(String lfn, String name, Object value) Deletes all PFN entries for a given LFN from the replica catalog where
the PFN attribute is found, and matches exactly the object value.
Parameters: lfn - is the logical filename to look for. Parameters: name - is the PFN attribute name to look for. Parameters: value - is an exact match of the attribute value to match. | public int | delete(String lfn, ReplicaCatalogEntry tuple) Deletes a very specific mapping from the replica catalog.
Parameters: lfn - is the logical filename in the tuple. Parameters: tuple - is a description of the PFN and its attributes. | public int | delete(Map x, boolean matchAttributes) Deletes multiple mappings into the replica catalog.
Parameters: x - is a map from logical filename string to list of replicacatalog entries. Parameters: matchAttributes - whether mapping should be deleted only if allattributes match. | public int | delete(String lfn, String pfn) Deletes a specific mapping from the replica catalog.
Parameters: lfn - is the logical filename in the tuple. Parameters: pfn - is the physical filename in the tuple. | public int | deleteByResource(String lfn, String handle) Deletes all PFN entries for a given LFN from the replica catalog where
the resource handle is found. | protected String | getKey(String key, String prefix) Returns the key with the prefix stripped off. | protected String | getName(String key) Returns the name from the key. | public int | insert(String lfn, String pfn, String handle) Inserts a new mapping into the replica catalog.
Parameters: lfn - is the logical filename under which to book the entry. Parameters: pfn - is the physical filename associated with it. Parameters: handle - is a resource handle where the PFN resides. | public int | insert(String lfn, ReplicaCatalogEntry tuple) Inserts a new mapping into the replica catalog.
Parameters: lfn - is the logical filename under which to book the entry. Parameters: tuple - is the physical filename and associated PFN attributes. | public int | insert(Map x) Inserts multiple mappings into the replica catalog.
Parameters: x - is a map from logical filename string to list of replicacatalog entries. | public boolean | isClosed() Predicate to check, if the connection with the catalog's
implementation is still active. | public Set | list(String constraint) Lists a subset of all logical filenames in the catalog.
Parameters: constraint - is a constraint for the logical filename only. | public Set | list() Lists all logical filenames in the catalog. | public String | lookup(String lfn, String handle) Retrieves the entry for a given filename and resource handle from the
replica catalog.
Parameters: lfn - is the logical filename to obtain information for. Parameters: handle - is the resource handle to obtain entries for. | public Collection | lookup(String lfn) Retrieves all entries for a given LFN from the replica catalog.
Parameters: lfn - is the logical filename to obtain information for. | public Map | lookup(Set lfns, String handle) Retrieves multiple entries for a given logical filename, up to the
complete catalog.
Parameters: lfns - is a set of logical filename strings to look up. Parameters: handle - is the resource handle, restricting the LFNs. | public Map | lookup(Map constraints) Retrieves multiple entries for a given logical filename, up to the
complete catalog.
Parameters: constraints - is mapping of keys 'lfn', 'pfn', or any attributename, e.g. | public Map | lookup(Set lfns) Retrieves multiple entries for a given logical filename, up to the
complete catalog.
Parameters: lfns - is a set of logical filename strings to look up. | public Set | lookupNoAttributes(String lfn) Retrieves all entries for a given LFN from the replica catalog.
Parameters: lfn - is the logical filename to obtain information for. | public Map | lookupNoAttributes(Set lfns) Retrieves multiple entries for a given logical filename, up to the
complete catalog.
Parameters: lfns - is a set of logical filename strings to look up. | public Map | lookupNoAttributes(Set lfns, String handle) Retrieves multiple entries for a given logical filename, up to the
complete catalog.
Parameters: lfns - is a set of logical filename strings to look up. Parameters: handle - is the resource handle, restricting the LFNs. | protected Iterator | rcIterator() Returns an iterator to iterate through the list of ReplicaCatalogs that
MRC is associated with. | public int | remove(String lfn) Removes all mappings for an LFN from the replica catalog.
Parameters: lfn - is the logical filename to remove all mappings for. | public int | remove(Set lfns) Removes all mappings for a set of LFNs.
Parameters: lfns - is a set of logical filename to remove all mappings for. | public int | removeByAttribute(String name, Object value) Removes all entries from the replica catalog where the PFN attribute
is found, and matches exactly the object value.
Parameters: name - is the PFN attribute name to look for. Parameters: value - is an exact match of the attribute value to match. | public int | removeByAttribute(String handle) Removes all entries associated with a particular resource handle.
Parameters: handle - is the site handle to remove all entries for. |
PROPERTY_PREFIX | final public static String PROPERTY_PREFIX(Code) | | The prefix for the property subset for connecting to the individual
catalogs.
|
TYPE_KEY | final public static String TYPE_KEY(Code) | | The property key that designates the type of replica catalog to connect
to.
|
mRCList | protected List mRCList(Code) | | The list of replica catalogs that need to be queried for.
|
MRC | public MRC()(Code) | | The default constructor.
|
clear | public int clear()(Code) | | Removes everything from the catalogs.
Use with care!!!
the number of removed entries. |
close | public void close()(Code) | | Explicitely free resources before the garbage collection hits.
|
connect | public boolean connect(Properties props)(Code) | | Establishes a link between the implementation and the thing the
implementation is build upon.
Parameters: props - contains all necessary data to establish the link. true if connected now, or false to indicate a failure. |
connect | protected boolean connect(String name, Properties properties)(Code) | | Connects to an individual replica catalog. Also adds the handle to the
connected replica catalog in the internal list.
Parameters: name - the name given by the user in the properties file. Parameters: properties - the properties to use for connecting. boolean |
delete | public int delete(String lfn, String name, Object value)(Code) | | Deletes all PFN entries for a given LFN from the replica catalog where
the PFN attribute is found, and matches exactly the object value.
Parameters: lfn - is the logical filename to look for. Parameters: name - is the PFN attribute name to look for. Parameters: value - is an exact match of the attribute value to match. the number of removed entries. |
delete | public int delete(String lfn, ReplicaCatalogEntry tuple)(Code) | | Deletes a very specific mapping from the replica catalog.
Parameters: lfn - is the logical filename in the tuple. Parameters: tuple - is a description of the PFN and its attributes. the number of removed entries, either 0 or 1. |
delete | public int delete(Map x, boolean matchAttributes)(Code) | | Deletes multiple mappings into the replica catalog.
Parameters: x - is a map from logical filename string to list of replicacatalog entries. Parameters: matchAttributes - whether mapping should be deleted only if allattributes match. the number of deletions. |
delete | public int delete(String lfn, String pfn)(Code) | | Deletes a specific mapping from the replica catalog.
Parameters: lfn - is the logical filename in the tuple. Parameters: pfn - is the physical filename in the tuple. the number of removed entries. |
deleteByResource | public int deleteByResource(String lfn, String handle)(Code) | | Deletes all PFN entries for a given LFN from the replica catalog where
the resource handle is found.
Parameters: lfn - is the logical filename to look for. Parameters: handle - is the resource handle the number of entries removed. |
getKey | protected String getKey(String key, String prefix)(Code) | | Returns the key with the prefix stripped off. In the case, where the key
is the prefix, STYLE_KEY is returned. If the key does not start with the
prefix, then null is returned.
Parameters: key - the key Parameters: prefix - String key stripped off of the prefix See Also: MRC.TYPE_KEY |
getName | protected String getName(String key)(Code) | | Returns the name from the key. The name is first component of the key before
the first dot (.).
Parameters: key - String String |
insert | public int insert(String lfn, String pfn, String handle)(Code) | | Inserts a new mapping into the replica catalog.
Parameters: lfn - is the logical filename under which to book the entry. Parameters: pfn - is the physical filename associated with it. Parameters: handle - is a resource handle where the PFN resides. number of insertions, should always be 1. On failure, throwan exception, don't use zero. throws: UnsupportedOperationException - |
insert | public int insert(String lfn, ReplicaCatalogEntry tuple)(Code) | | Inserts a new mapping into the replica catalog.
Parameters: lfn - is the logical filename under which to book the entry. Parameters: tuple - is the physical filename and associated PFN attributes. number of insertions, should always be 1. On failure, throw exception throws: UnsupportedOperationException - |
insert | public int insert(Map x)(Code) | | Inserts multiple mappings into the replica catalog.
Parameters: x - is a map from logical filename string to list of replicacatalog entries. the number of insertions. throws: UnsupportedOperationException - |
isClosed | public boolean isClosed()(Code) | | Predicate to check, if the connection with the catalog's
implementation is still active. Returns true only if the connections to
all the associated replica catalogs is closed.
true, if the implementation is disassociated, false otherwise. |
list | public Set list(String constraint)(Code) | | Lists a subset of all logical filenames in the catalog.
Parameters: constraint - is a constraint for the logical filename only. Itis a string that has some meaning to the implementing system. Thiscan be a SQL wildcard for queries, or a regular expression forJava-based memory collections. A set of logical filenames that match. The set may be empty |
list | public Set list()(Code) | | Lists all logical filenames in the catalog.
A set of all logical filenames known to the catalog. |
lookup | public String lookup(String lfn, String handle)(Code) | | Retrieves the entry for a given filename and resource handle from the
replica catalog.
Parameters: lfn - is the logical filename to obtain information for. Parameters: handle - is the resource handle to obtain entries for. the (first) matching physical filename, or null if no match was found. |
lookup | public Collection lookup(String lfn)(Code) | | Retrieves all entries for a given LFN from the replica catalog.
Parameters: lfn - is the logical filename to obtain information for. a collection of replica catalog entries |
lookup | public Map lookup(Set lfns, String handle)(Code) | | Retrieves multiple entries for a given logical filename, up to the
complete catalog.
Parameters: lfns - is a set of logical filename strings to look up. Parameters: handle - is the resource handle, restricting the LFNs. a map indexed by the LFN. Each value is a collection ofreplica catalog entries (all attributes). |
lookup | public Map lookup(Map constraints)(Code) | | Retrieves multiple entries for a given logical filename, up to the
complete catalog.
Parameters: constraints - is mapping of keys 'lfn', 'pfn', or any attributename, e.g. the resource handle 'site', to a string that has somemeaning to the implementing system. This can be a SQL wildcard forqueries, or a regular expression for Java-based memory collections.Unknown keys are ignored. Using an empty map requests the completecatalog. a map indexed by the LFN. Each value is a collection ofreplica catalog entries. |
lookup | public Map lookup(Set lfns)(Code) | | Retrieves multiple entries for a given logical filename, up to the
complete catalog.
Parameters: lfns - is a set of logical filename strings to look up. a map indexed by the LFN. Each value is a collection ofreplica catalog entries for the LFN. |
lookupNoAttributes | public Set lookupNoAttributes(String lfn)(Code) | | Retrieves all entries for a given LFN from the replica catalog.
Parameters: lfn - is the logical filename to obtain information for. a set of PFN strings |
lookupNoAttributes | public Map lookupNoAttributes(Set lfns)(Code) | | Retrieves multiple entries for a given logical filename, up to the
complete catalog.
Parameters: lfns - is a set of logical filename strings to look up. a map indexed by the LFN. Each value is a set of PFN strings. |
lookupNoAttributes | public Map lookupNoAttributes(Set lfns, String handle)(Code) | | Retrieves multiple entries for a given logical filename, up to the
complete catalog.
Parameters: lfns - is a set of logical filename strings to look up. Parameters: handle - is the resource handle, restricting the LFNs. a map indexed by the LFN. Each value is a set of physicalfilenames. |
rcIterator | protected Iterator rcIterator()(Code) | | Returns an iterator to iterate through the list of ReplicaCatalogs that
MRC is associated with.
Iterator |
remove | public int remove(String lfn)(Code) | | Removes all mappings for an LFN from the replica catalog.
Parameters: lfn - is the logical filename to remove all mappings for. the number of removed entries. |
remove | public int remove(Set lfns)(Code) | | Removes all mappings for a set of LFNs.
Parameters: lfns - is a set of logical filename to remove all mappings for. the number of removed entries. |
removeByAttribute | public int removeByAttribute(String name, Object value)(Code) | | Removes all entries from the replica catalog where the PFN attribute
is found, and matches exactly the object value.
Parameters: name - is the PFN attribute name to look for. Parameters: value - is an exact match of the attribute value to match. the number of removed entries. |
removeByAttribute | public int removeByAttribute(String handle)(Code) | | Removes all entries associated with a particular resource handle.
Parameters: handle - is the site handle to remove all entries for. the number of removed entries. |
|
|