synchronized Lease addLease(String holder, String src, long timestamp) {
    Lease lease = getLease(holder);
    if (lease == null) {
      lease = new Lease(holder);
      leases.put(holder, lease);
      sortedLeases.add(lease);
    } else {
      renewLease(lease);
    }
    sortedLeasesByPath.put(src, new LeaseOpenTime(lease, timestamp));
    lease.paths.add(src);

    return lease;
  }
synchronized Lease addLease ( String holder , String src , long timestamp ) { Lease lease = getLease ( holder ) ; if ( lease == null ) { lease = new Lease ( holder ) ; leases . put ( holder , lease ) ; sortedLeases . add ( lease ) ; } else { renewLease ( lease ) ; } sortedLeasesByPath . put ( src , new LeaseOpenTime ( lease , timestamp ) ) ; lease . paths . add ( src ) ; return lease ; }
Adds (or re-adds) the lease for the specified file.
@param client that will hold the lease
@param src file path to associated with the lease.
@param timestamp time that the file was opened. (could be in the
past if loaded from FsImage