> On Aug. 3, 2017, 8:45 a.m., Peter Vary wrote: > > common/src/java/org/apache/hadoop/hive/common/FileUtils.java > > Lines 98 (patched) > > <https://reviews.apache.org/r/61379/diff/1/?file=1788264#file1788264line98> > > > > There is no straightforward api to decide if a given path is > > snapshottable, or not, but I was able to come up with this: > > > > SnapshottableDirectoryStatus[] statuses = > > ((DistributedFileSystem)fs).getSnapshottableDirListing(); > > for (SnapshottableDirectoryStatus status: statuses) { > > if (status.getFullPath().equals(new Path(""))) { > > > > } > > } > > > > Maybe this is better than simply relying on the naming convention. We > > can use it like HdfsUtils.getFileId() > > > > What do you think?
The API is not for public consumption :( I think we should file a Hadoop ticket for requesting a public API, and until that it is ok, to use the string matching - Peter ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61379/#review182084 ----------------------------------------------------------- On Aug. 2, 2017, 2:03 p.m., Barna Zsombor Klara wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61379/ > ----------------------------------------------------------- > > (Updated Aug. 2, 2017, 2:03 p.m.) > > > Review request for hive, Marta Kuczora and Peter Vary. > > > Bugs: HIVE-16294 > https://issues.apache.org/jira/browse/HIVE-16294 > > > Repository: hive-git > > > Description > ------- > > HIVE-16294: Support snapshot for truncate table > > > Diffs > ----- > > common/src/java/org/apache/hadoop/hive/common/FileUtils.java > e8a3a7a49e31d02ba7ccb8774ea59c2cf0fea536 > metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java > 6a6fd439d72fd5e24c881554c86480b0b3e19574 > > > Diff: https://reviews.apache.org/r/61379/diff/1/ > > > Testing > ------- > > Manual testing as automated testing would entail the creation of snapshots > using hadoop which as far as I know is not supported with the current Hive > testing framework. > > > Thanks, > > Barna Zsombor Klara > >