fe/src/main/java/com/cloudera/impala/catalog/CatalogObjectCache.java
/**
   * Adds a new catalogObject to the cache. If a catalogObject with the same name already
   * exists in the cache, the new item will only be added if it has a larger catalog
   * version.
   * Synchronized because add() may require two cache accesses that must be performed
   * atomically.
   * Returns true if this item was added or false if the existing value was preserved.
   */
Adds a new catalogObject to the cache. If a catalogObject with the same name already
exists in the cache, the new item will only be added if it has a larger catalog
version.
Synchronized because add() may require two cache accesses that must be performed
atomically.
Returns true if this item was added or false if the existing value was preserved.
Adds a new catalogObject to the cache . If a catalogObject with the same name already exists in the cache the new item will only be added if it has a larger catalog version . Synchronized because add () may require two cache accesses that must be performed atomically . Returns true if this item was added or false if the existing value was preserved .
public synchronized boolean add(T catalogObject) {
    Preconditions.checkNotNull(catalogObject);
    T existingItem = metadataCache_.putIfAbsent(
        catalogObject.getName().toLowerCase(), catalogObject);
    if (existingItem == null) return true;
    if (existingItem.getCatalogVersion() < catalogObject.getCatalogVersion()) {
      metadataCache_.put(catalogObject.getName().toLowerCase(), catalogObject);
      return true;
    }
    return false;
  }
public synchronized boolean add ( T catalogObject ) { Preconditions . checkNotNull ( catalogObject ) ; T existingItem = metadataCache_ . putIfAbsent ( catalogObject . getName ( ) . toLowerCase ( ) , catalogObject ) ; if ( existingItem == null ) return true ; if ( existingItem . getCatalogVersion ( ) < catalogObject . getCatalogVersion ( ) ) { metadataCache_ . put ( catalogObject . getName ( ) . toLowerCase ( ) , catalogObject ) ; return true ; } return false ; }
Adds a new catalogObject to the cache.
Adds a new catalogObject to the cache .
// When existingItem != null it indicates there was already an existing entry // associated with the key. Add the updated object iff it has a catalog // version greater than the existing entry.