@InterfaceAudience.Private public class Snapshot extends Object implements Comparable<byte[]>
Modifier and Type | Class and Description |
---|---|
static class |
Snapshot.Root
The root directory of the snapshot.
|
Modifier and Type | Field and Description |
---|---|
static Comparator<Snapshot> |
ID_COMPARATOR
Compare snapshot with IDs, where null indicates the current status thus
is greater than any non-null snapshot.
|
static Comparator<Integer> |
ID_INTEGER_COMPARATOR
Compare snapshot with IDs, where null indicates the current status thus
is greater than any non-null ID.
|
static int |
INVALID_ID |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(byte[] bytes) |
boolean |
equals(Object that) |
static Snapshot |
findLatestSnapshot(INode inode,
Snapshot anchor)
Find the latest snapshot that 1) covers the given inode (which means the
snapshot was either taken on the inode or taken on an ancestor of the
inode), and 2) was taken before the given snapshot (if the given snapshot
is not null).
|
static String |
generateDefaultSnapshotName() |
int |
getId() |
Snapshot.Root |
getRoot() |
static String |
getSnapshotPath(String snapshottableDir,
String snapshotRelativePath) |
int |
hashCode() |
String |
toString() |
public static final int INVALID_ID
public static final Comparator<Snapshot> ID_COMPARATOR
public static final Comparator<Integer> ID_INTEGER_COMPARATOR
public static String generateDefaultSnapshotName()
public static String getSnapshotPath(String snapshottableDir, String snapshotRelativePath)
public static Snapshot findLatestSnapshot(INode inode, Snapshot anchor)
inode
- the given inode that the returned snapshot needs to coveranchor
- the returned snapshot should be taken before this snapshot.public int getId()
public Snapshot.Root getRoot()
public int compareTo(byte[] bytes)
compareTo
in interface Comparable<byte[]>
Copyright © 2013 Apache Software Foundation. All rights reserved.