Tsz Wo Nicholas Sze updated HDFS-13173:
    Component/s: snapshots

Hi Shashikant, thanks for working on this.  Let's have a 
DirectoryDiffListFactory in order to avoid adding the skipInteval and 
maxSkipLevels parameters to many methods.
/** For creating {@link DiffList} for {@link DirectoryDiff}. */
public abstract class DirectoryDiffListFactory {
  public static DiffList<DirectoryDiff> createDiffList(int capacity) {
    return CONSTRUCTOR.apply(capacity);

  public static void init(Configuration conf) {
    final int maxSkipLevels = conf.getInt(
    if (maxSkipLevels > 0) {
      final int skipInteval = conf.getInt(
      CONSTRUCTOR = c -> new DiffListBySkipList(c, skipInteval, maxSkipLevels);

  private static volatile IntFunction<DiffList<DirectoryDiff>> CONSTRUCTOR
      = c -> new DiffListByArrayList<>(c);

  private DirectoryDiffListFactory() {}

> Replace ArrayList with DirectoryDiffList(SnapshotSkipList) to store 
> DirectoryDiffs
> ----------------------------------------------------------------------------------
>                 Key: HDFS-13173
>                 URL: https://issues.apache.org/jira/browse/HDFS-13173
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: snapshots
>            Reporter: Shashikant Banerjee
>            Assignee: Shashikant Banerjee
>            Priority: Major
>         Attachments: HDFS-13173.001.patch
> This Jira will replace the existing ArrayList with DirectoryDiffList to store 
> directory diffs for snapshots based on the config value of maxSkipLevels. If 
> the config specified is set to greater than 0, SnapshotSkipList will be used 
> to store DirectoryDiffs  else ArrayList will be used. The config value is set 
> to 0 by default.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to