src/main/java/org/apache/hadoop/hdfs/server/namenode/analytics/HsqlDriver.java
public void logHistoryPerUser(
      Map<String, Long> cachedValues, Map<String, Map<String, Long>> cachedMaps, Set<String> users)
      throws SQLException {
    writeHistory(cachedValues, "");
    for (String user : users) {
      // For each user make an entry in database
      Map<String, Long> userData = new HashMap<>();
      userData.put(
          "emptyFiles",
          cachedMaps
              .getOrDefault("emptyFilesUsers", Collections.emptyMap())
              .getOrDefault(user, 0L));
      userData.put(
          "emptyDirs",
          cachedMaps.getOrDefault("emptyDirsUsers", Collections.emptyMap()).getOrDefault(user, 0L));
      userData.put(
          "tinyFiles",
          cachedMaps.getOrDefault("tinyFilesUsers", Collections.emptyMap()).getOrDefault(user, 0L));
      userData.put(
          "smallFiles",
          cachedMaps
              .getOrDefault("smallFilesUsers", Collections.emptyMap())
              .getOrDefault(user, 0L));
      userData.put(
          "diskspace",
          cachedMaps.getOrDefault("diskspaceUsers", Collections.emptyMap()).getOrDefault(user, 0L));
      userData.put(
          "mediumFiles",
          cachedMaps
              .getOrDefault("mediumFilesUsers", Collections.emptyMap())
              .getOrDefault(user, 0L));
      userData.put(
          "numFiles",
          cachedMaps.getOrDefault("numFilesUsers", Collections.emptyMap()).getOrDefault(user, 0L));
      userData.put(
          "numDirs",
          cachedMaps.getOrDefault("numDirsUsers", Collections.emptyMap()).getOrDefault(user, 0L));
      writeHistory(userData, user);
    }
  }
/**
   * Log user values discovered by {@link SuggestionsEngine}.
   *
   * @param cachedValues set of all cached values
   * @param cachedMaps mapping of values to username
   * @param users set of usernames
   * @throws SQLException error in logging user data
   */
Log user values discovered by  SuggestionsEngine.
@param cachedValues set of all cached values
@param cachedMaps mapping of values to username
@param users set of usernames
@throws SQLException error in logging user data
Log user values discovered by SuggestionsEngine . @param cachedValues set of all cached values @param cachedMaps mapping of values to username @param users set of usernames @throws SQLException error in logging user data
public void logHistoryPerUser(
      Map<String, Long> cachedValues, Map<String, Map<String, Long>> cachedMaps, Set<String> users)
      throws SQLException {
    writeHistory(cachedValues, "");
    for (String user : users) {
      Map<String, Long> userData = new HashMap<>();
      userData.put(
          "emptyFiles",
          cachedMaps
              .getOrDefault("emptyFilesUsers", Collections.emptyMap())
              .getOrDefault(user, 0L));
      userData.put(
          "emptyDirs",
          cachedMaps.getOrDefault("emptyDirsUsers", Collections.emptyMap()).getOrDefault(user, 0L));
      userData.put(
          "tinyFiles",
          cachedMaps.getOrDefault("tinyFilesUsers", Collections.emptyMap()).getOrDefault(user, 0L));
      userData.put(
          "smallFiles",
          cachedMaps
              .getOrDefault("smallFilesUsers", Collections.emptyMap())
              .getOrDefault(user, 0L));
      userData.put(
          "diskspace",
          cachedMaps.getOrDefault("diskspaceUsers", Collections.emptyMap()).getOrDefault(user, 0L));
      userData.put(
          "mediumFiles",
          cachedMaps
              .getOrDefault("mediumFilesUsers", Collections.emptyMap())
              .getOrDefault(user, 0L));
      userData.put(
          "numFiles",
          cachedMaps.getOrDefault("numFilesUsers", Collections.emptyMap()).getOrDefault(user, 0L));
      userData.put(
          "numDirs",
          cachedMaps.getOrDefault("numDirsUsers", Collections.emptyMap()).getOrDefault(user, 0L));
      writeHistory(userData, user);
    }
  }
public void logHistoryPerUser ( Map < String , Long > cachedValues , Map < String , Map < String , Long > > cachedMaps , Set < String > users ) throws SQLException { writeHistory ( cachedValues , "" ) ; for ( String user : users ) { Map < String , Long > userData = new HashMap < > ( ) ; userData . put ( "emptyFiles" , cachedMaps . getOrDefault ( "emptyFilesUsers" , Collections . emptyMap ( ) ) . getOrDefault ( user , 0L ) ) ; userData . put ( "emptyDirs" , cachedMaps . getOrDefault ( "emptyDirsUsers" , Collections . emptyMap ( ) ) . getOrDefault ( user , 0L ) ) ; userData . put ( "tinyFiles" , cachedMaps . getOrDefault ( "tinyFilesUsers" , Collections . emptyMap ( ) ) . getOrDefault ( user , 0L ) ) ; userData . put ( "smallFiles" , cachedMaps . getOrDefault ( "smallFilesUsers" , Collections . emptyMap ( ) ) . getOrDefault ( user , 0L ) ) ; userData . put ( "diskspace" , cachedMaps . getOrDefault ( "diskspaceUsers" , Collections . emptyMap ( ) ) . getOrDefault ( user , 0L ) ) ; userData . put ( "mediumFiles" , cachedMaps . getOrDefault ( "mediumFilesUsers" , Collections . emptyMap ( ) ) . getOrDefault ( user , 0L ) ) ; userData . put ( "numFiles" , cachedMaps . getOrDefault ( "numFilesUsers" , Collections . emptyMap ( ) ) . getOrDefault ( user , 0L ) ) ; userData . put ( "numDirs" , cachedMaps . getOrDefault ( "numDirsUsers" , Collections . emptyMap ( ) ) . getOrDefault ( user , 0L ) ) ; writeHistory ( userData , user ) ; } }
Log user values discovered by {@link SuggestionsEngine}.
Log user values discovered by { @link SuggestionsEngine } .
// For each user make an entry in database