[
https://issues.apache.org/jira/browse/HBASE-11134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13993933#comment-13993933
]
Jonathan Hsieh commented on HBASE-11134:
----------------------------------------
Binding these vars to FSUtils so they can be picked up later seems strange --
can't this be made more explicit (e.g. when remote is specified we set some
vars, if not we load defaults, and then make the static that lists use those
vars)
{code}
+ } else if (cmd.equals("-remote-dir")) {
+ Path sourceDir = new Path(args[++i]);
+ URI defaultFs = sourceDir.getFileSystem(conf).getUri();
+ FSUtils.setFsDefault(conf, new Path(defaultFs));
+ FSUtils.setRootDir(conf, sourceDir);
{code}
{code}
+ * Returns the list of available snapshots in the specified location
+ * @param conf the {@link Configuration} to use
+ * @return the list of snapshots
+ */
+ public static List<SnapshotDescription> getSnapshotList(final Configuration
conf)
+ throws IOException {
+ Path rootDir = FSUtils.getRootDir(conf);
+ FileSystem fs = FileSystem.get(rootDir.toUri(), conf);
{code}
> Add a -list-snapshots option to SnapshotInfo
> --------------------------------------------
>
> Key: HBASE-11134
> URL: https://issues.apache.org/jira/browse/HBASE-11134
> Project: HBase
> Issue Type: Improvement
> Components: snapshots
> Affects Versions: 0.99.0
> Reporter: Matteo Bertozzi
> Assignee: Matteo Bertozzi
> Priority: Trivial
> Fix For: 0.99.0, 0.96.3, 0.94.20, 0.98.3
>
> Attachments: HBASE-11134-v0.patch, HBASE-11134-v1.patch
>
>
> Add a -list-snapshots option to SnapshotInfo to show all the snapshots
> available. Also add a -remote-dir option to simplify the usage of
> SnapshotInfo in case the snapshot dir is not the one of the current hbase
> cluster
> {code}
> $ hbase org.apache.hadoop.hbase.snapshot.SnapshotInfo -list-snapshots
> SNAPSHOT | CREATION TIME | TABLE NAME
> foo | 2014-05-07T22:40:13 | testtb
> bar | 2014-05-07T22:40:16 | testtb
> $ hbase org.apache.hadoop.hbase.snapshot.SnapshotInfo -remote-dir
> file:///backup/ -snapshot my_local_snapshot
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)