List of usage examples for org.apache.hadoop.fs FileSystem createSnapshot
public Path createSnapshot(Path path, String snapshotName) throws IOException
From source file:org.apache.falcon.snapshots.replication.HdfsSnapshotReplicator.java
License:Apache License
private static void createSnapshotInFileSystem(String dirName, String snapshotName, FileSystem fs) throws FalconException { try {// w ww . ja v a 2s.com LOG.info("Creating snapshot {} in directory {}", snapshotName, dirName); fs.createSnapshot(new Path(dirName), snapshotName); } catch (IOException e) { LOG.warn("Unable to create snapshot {} in filesystem {}. Exception is {}", snapshotName, fs.getConf().get(HadoopClientFactory.FS_DEFAULT_NAME_KEY), e.getMessage()); throw new FalconException("Unable to create snapshot " + snapshotName, e); } }