public <T> T doAs(PrivilegedAction<T> action) throws IOException {
    UserGroupInformation ugi = getUGI();
    if (ugi != null) {
      return ugi.doAs(action);
    }
    return null;
  }
The class handles authentication when cluster is security enabled
app/com/linkedin/drelephant/security/HadoopSecurity.java