public class ReplicaStore extends Data implements java.lang.Cloneable
org.griphyn.common.catalog.ReplicaCatalogEntry
Modifier and Type | Field and Description |
---|---|
private java.util.Map |
mStore
The replica store.
|
Constructor and Description |
---|
ReplicaStore()
Default constructor.
|
ReplicaStore(java.util.Map rces)
Overloaded constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.util.Map rces)
Adds ReplicaCatalogEntries into the store.
|
void |
add(ReplicaLocation rl)
Adds replica catalog entries into the store.
|
void |
add(java.lang.String lfn,
java.util.Collection tuples)
Adds replica catalog entries into the store.
|
java.lang.Object |
clone()
Returns the clone of the object.
|
boolean |
containsLFN(java.lang.String lfn)
Returns a boolean indicating whether the store has a mapping for a
particular LFN or not.
|
protected ReplicaLocation |
get(java.lang.String key)
Returns an entry corresponding to the LFN
|
int |
getLFNCount()
Returns the number of LFN's for which the mappings are stored in the
store.
|
java.util.Set |
getLFNs()
Returns the set of LFN's for which the mappings are stored in the store.
|
java.util.Set |
getLFNs(java.util.Set lfns)
Returns a
Set of lfns for which the mappings are stored in
the store, amongst the Set passed as input. |
ReplicaLocation |
getReplicaLocation(java.lang.String lfn)
Returns a
ReplicaLocation corresponding to the LFN. |
boolean |
isEmpty()
Returns a boolean indicating whether a store is empty or not.
|
protected java.lang.Object |
put(java.lang.String key,
ReplicaLocation value)
Inserts entry in the store overwriting any existing entry.
|
java.util.Iterator |
replicaLocationIterator()
Returns an iterator to the list of
ReplicaLocation
objects stored in the store. |
void |
store(java.util.Map rces)
Stores replica catalog entries into the store.
|
java.lang.String |
toString()
Returns the textual description of the data class.
|
setToString, vectorToString
public ReplicaStore()
public ReplicaStore(java.util.Map rces)
rces
- map indexed by LFN's and each value is a collection
of replica catalog entries for the LFN.public void store(java.util.Map rces)
ReplicaCatlogEntry
ends up being stored as a ReplicaLocation
object.rces
- map indexed by LFN's and each value is a collection
of replica catalog entries for the LFN.public void add(java.util.Map rces)
ReplicaCatlogEntry
ends up being stored as a ReplicaLocation
object.rces
- map indexed by LFN's and each value is a collection
of replica catalog entries for the LFN.public void add(java.lang.String lfn, java.util.Collection tuples)
lfn
- the lfn.tuples
- list of ReplicaCatalogEntry containing the PFN and the
attributes.
public void add(ReplicaLocation rl)
rl
- the ReplicaLocation
containing a pfn and all
the attributes.public ReplicaLocation getReplicaLocation(java.lang.String lfn)
ReplicaLocation
corresponding to the LFN.lfn
- the lfn for which the ReplicaLocation is required.ReplicaLocation
if entry exists else null.public java.util.Iterator replicaLocationIterator()
ReplicaLocation
objects stored in the store.public java.util.Set getLFNs()
public java.util.Set getLFNs(java.util.Set lfns)
Set
of lfns for which the mappings are stored in
the store, amongst the Set
passed as input.lfns
- the collections of lfnspublic boolean isEmpty()
public int getLFNCount()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
public boolean containsLFN(java.lang.String lfn)
lfn
- the logical file name of the file.protected java.lang.Object put(java.lang.String key, ReplicaLocation value)
key
- the keyvalue
- ReplicaLocation
object.protected ReplicaLocation get(java.lang.String key)
key
- the LFNReplicaLocation
object if exists, else null.