Commit 4994886a authored by Costin Grigoras's avatar Costin Grigoras
Browse files

Don't do guid2lfn for each pfn that misses one

parent 8fc36917
......@@ -850,7 +850,19 @@ public class GUID implements Comparable<GUID>, CatalogEntity {
* @return the <b>cached</b> LFNs associated to this GUID, from either the internal cache or the G*L_REF tables.
*/
public Set<LFN> getLFNs() {
if (lfnCache != null)
return getLFNs(false);
}
/**
* This method is _not_ authoritative, if you want to do the actual lookup to see which LFNs point to this GUID then use {@link LFNUtils#getLFN(GUID)}.
* Should only be called when the previous code has filled the cache with known LFN objects.
*
* @param cachedOnly if <code>true</code> even central services will not try to look up the LFN
*
* @return the <b>cached</b> LFNs associated to this GUID, from either the internal cache or the G*L_REF tables.
*/
public Set<LFN> getLFNs(final boolean cachedOnly) {
if (lfnCache != null || cachedOnly)
return lfnCache;
if (guidId == 0)
......
......@@ -429,7 +429,7 @@ public class XrootDEnvelope implements Serializable {
final GUID guid = pfn.getGuid();
final Set<LFN> lfns = guid.getLFNs();
final Set<LFN> lfns = guid.getLFNs(true);
final HashMap<String, String> e = new HashMap<>(8);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment