org.apache.hadoop.hdfs.server.namenode.snapshot
Class INodeDirectoryWithSnapshot.DirectoryDiffList

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.namenode.snapshot.INodeDirectoryWithSnapshot.DirectoryDiffList
All Implemented Interfaces:
Iterable<INodeDirectoryWithSnapshot.DirectoryDiff>
Enclosing class:
INodeDirectoryWithSnapshot

public static class INodeDirectoryWithSnapshot.DirectoryDiffList
extends Object

A list of directory diffs.


Constructor Summary
INodeDirectoryWithSnapshot.DirectoryDiffList()
           
 
Method Summary
 List<D> asList()
           
 void clear()
          Get the size of the list and then clear it.
 Quota.Counts deleteSnapshotDiff(org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot snapshot, org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot prior, N currentINode, INode.BlocksMapUpdateInfo collectedBlocks, List<org.apache.hadoop.hdfs.server.namenode.INode> removedINodes, boolean countDiffChange)
          Delete a snapshot.
 D getDiff(org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot snapshot)
           
 D getLast()
           
 org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot getLastSnapshot()
           
 org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot getPrior(int snapshotId)
           
 org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot getSnapshotById(int snapshotId)
          Search for the snapshot whose id is 1) no less than the given id, and 2) most close to the given id.
 Iterator<D> iterator()
           
 void saveSelf2Snapshot(org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot latest, N currentINode, A snapshotCopy)
          Save the snapshot copy to the latest snapshot.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

INodeDirectoryWithSnapshot.DirectoryDiffList

public INodeDirectoryWithSnapshot.DirectoryDiffList()
Method Detail

asList

public final List<D> asList()
Returns:
this list as a unmodifiable List.

clear

public void clear()
Get the size of the list and then clear it.


deleteSnapshotDiff

public final Quota.Counts deleteSnapshotDiff(org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot snapshot,
                                             org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot prior,
                                             N currentINode,
                                             INode.BlocksMapUpdateInfo collectedBlocks,
                                             List<org.apache.hadoop.hdfs.server.namenode.INode> removedINodes,
                                             boolean countDiffChange)
                                      throws org.apache.hadoop.hdfs.protocol.QuotaExceededException
Delete a snapshot. The synchronization of the diff list will be done outside. If the diff to remove is not the first one in the diff list, we need to combine the diff with its previous one.

Parameters:
snapshot - The snapshot to be deleted
prior - The snapshot taken before the to-be-deleted snapshot
collectedBlocks - Used to collect information for blocksMap update
Returns:
delta in namespace.
Throws:
org.apache.hadoop.hdfs.protocol.QuotaExceededException

getLast

public final D getLast()
Returns:
the last diff.

getLastSnapshot

public final org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot getLastSnapshot()
Returns:
the last snapshot.

getPrior

public final org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot getPrior(int snapshotId)

getDiff

public final D getDiff(org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot snapshot)
Returns:
the diff corresponding to the given snapshot. When the diff is null, it means that the current state and the corresponding snapshot state are the same.

getSnapshotById

public final org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot getSnapshotById(int snapshotId)
Search for the snapshot whose id is 1) no less than the given id, and 2) most close to the given id.


saveSelf2Snapshot

public void saveSelf2Snapshot(org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot latest,
                              N currentINode,
                              A snapshotCopy)
                       throws org.apache.hadoop.hdfs.protocol.QuotaExceededException
Save the snapshot copy to the latest snapshot.

Throws:
org.apache.hadoop.hdfs.protocol.QuotaExceededException

iterator

public Iterator<D> iterator()
Specified by:
iterator in interface Iterable<D extends org.apache.hadoop.hdfs.server.namenode.snapshot.AbstractINodeDiff<N,A,D>>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Apache Software Foundation. All Rights Reserved.