Code example for LoadingCache

Methods: getUnchecked

0
  public static TezDAGID getInstance(ApplicationId applicationId, int id) {
    // The newly created TezDAGIds are primarily for their hashCode method, and 
    // will be short-lived. 
    // Alternately the cache can be keyed by the hash of the incoming paramters. 
    Preconditions.checkArgument(applicationId != null, "ApplicationID cannot be null");
    return dagIdCache.getUnchecked(new TezDAGID(applicationId, id));
  } 
   
  /** 
   * Get a DAGID object from given parts. 
   * @param yarnRMIdentifier YARN RM identifier 
   * @param appId application number 
   * @param id the dag number 
   */ 
  public static TezDAGID getInstance(String yarnRMIdentifier, int appId, int id) {
    // The newly created TezDAGIds are primarily for their hashCode method, and 
    // will be short-lived. 
    // Alternately the cache can be keyed by the hash of the incoming paramters. 
    Preconditions.checkArgument(yarnRMIdentifier != null, "yarnRMIdentifier cannot be null");
    return dagIdCache.getUnchecked(new TezDAGID(yarnRMIdentifier, appId, id));